From 1b427fb801690970fbbe745bea39243bb7efbdb8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leonardo=20Fl=C3=B3rez-Valencia?= Date: Tue, 7 Nov 2017 16:12:30 -0500 Subject: [PATCH] ... --- config/CTArteries.nsi | 17 - config/EnvVarUpdate.nsh | 327 ------------------ config/install_ivq.sh | 201 +++++------ config/{install_mxe.sh => install_ivq_mxe.sh} | 4 +- config/ivq.nsi | 57 --- config/mxe.patch | 126 ------- config/vtk.patch | 20 -- 7 files changed, 102 insertions(+), 650 deletions(-) delete mode 100644 config/CTArteries.nsi delete mode 100644 config/EnvVarUpdate.nsh rename config/{install_mxe.sh => install_ivq_mxe.sh} (93%) delete mode 100644 config/ivq.nsi delete mode 100644 config/mxe.patch delete mode 100644 config/vtk.patch diff --git a/config/CTArteries.nsi b/config/CTArteries.nsi deleted file mode 100644 index d1dbe14..0000000 --- a/config/CTArteries.nsi +++ /dev/null @@ -1,17 +0,0 @@ -OutFile "install_CTArteries.exe" -InstallDir "$PROGRAMFILES\CTArteries" - -Section -SetOutPath "$INSTDIR" -File "CTArteries\*" -WriteUninstaller $INSTDIR\uninstaller.exe -SectionEnd - -Section "Uninstall" - -Delete $INSTDIR\uninstaller.exe -RMDir /r $INSTDIR - -SectionEnd - -## eof diff --git a/config/EnvVarUpdate.nsh b/config/EnvVarUpdate.nsh deleted file mode 100644 index f435531..0000000 --- a/config/EnvVarUpdate.nsh +++ /dev/null @@ -1,327 +0,0 @@ -/** - * EnvVarUpdate.nsh - * : Environmental Variables: append, prepend, and remove entries - * - * WARNING: If you use StrFunc.nsh header then include it before this file - * with all required definitions. This is to avoid conflicts - * - * Usage: - * ${EnvVarUpdate} "ResultVar" "EnvVarName" "Action" "RegLoc" "PathString" - * - * Credits: - * Version 1.0 - * * Cal Turney (turnec2) - * * Amir Szekely (KiCHiK) and e-circ for developing the forerunners of this - * function: AddToPath, un.RemoveFromPath, AddToEnvVar, un.RemoveFromEnvVar, - * WriteEnvStr, and un.DeleteEnvStr - * * Diego Pedroso (deguix) for StrTok - * * Kevin English (kenglish_hi) for StrContains - * * Hendri Adriaens (Smile2Me), Diego Pedroso (deguix), and Dan Fuhry - * (dandaman32) for StrReplace - * - * Version 1.1 (compatibility with StrFunc.nsh) - * * techtonik - * - * http://nsis.sourceforge.net/Environmental_Variables:_append%2C_prepend%2C_and_remove_entries - * - */ - - -!ifndef ENVVARUPDATE_FUNCTION -!define ENVVARUPDATE_FUNCTION -!verbose push -!verbose 3 -!include "LogicLib.nsh" -!include "WinMessages.NSH" -!include "StrFunc.nsh" - -; ---- Fix for conflict if StrFunc.nsh is already includes in main file ----------------------- -!macro _IncludeStrFunction StrFuncName - !ifndef ${StrFuncName}_INCLUDED - ${${StrFuncName}} - !endif - !ifndef Un${StrFuncName}_INCLUDED - ${Un${StrFuncName}} - !endif - !define un.${StrFuncName} "${Un${StrFuncName}}" -!macroend - -!insertmacro _IncludeStrFunction StrTok -!insertmacro _IncludeStrFunction StrStr -!insertmacro _IncludeStrFunction StrRep - -; ---------------------------------- Macro Definitions ---------------------------------------- -!macro _EnvVarUpdateConstructor ResultVar EnvVarName Action Regloc PathString - Push "${EnvVarName}" - Push "${Action}" - Push "${RegLoc}" - Push "${PathString}" - Call EnvVarUpdate - Pop "${ResultVar}" -!macroend -!define EnvVarUpdate '!insertmacro "_EnvVarUpdateConstructor"' - -!macro _unEnvVarUpdateConstructor ResultVar EnvVarName Action Regloc PathString - Push "${EnvVarName}" - Push "${Action}" - Push "${RegLoc}" - Push "${PathString}" - Call un.EnvVarUpdate - Pop "${ResultVar}" -!macroend -!define un.EnvVarUpdate '!insertmacro "_unEnvVarUpdateConstructor"' -; ---------------------------------- Macro Definitions end------------------------------------- - -;----------------------------------- EnvVarUpdate start---------------------------------------- -!define hklm_all_users 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"' -!define hkcu_current_user 'HKCU "Environment"' - -!macro EnvVarUpdate UN - -Function ${UN}EnvVarUpdate - - Push $0 - Exch 4 - Exch $1 - Exch 3 - Exch $2 - Exch 2 - Exch $3 - Exch - Exch $4 - Push $5 - Push $6 - Push $7 - Push $8 - Push $9 - Push $R0 - - /* After this point: - ------------------------- - $0 = ResultVar (returned) - $1 = EnvVarName (input) - $2 = Action (input) - $3 = RegLoc (input) - $4 = PathString (input) - $5 = Orig EnvVar (read from registry) - $6 = Len of $0 (temp) - $7 = tempstr1 (temp) - $8 = Entry counter (temp) - $9 = tempstr2 (temp) - $R0 = tempChar (temp) */ - - ; Step 1: Read contents of EnvVarName from RegLoc - ; - ; Check for empty EnvVarName - ${If} $1 == "" - SetErrors - DetailPrint "ERROR: EnvVarName is blank" - Goto EnvVarUpdate_Restore_Vars - ${EndIf} - - ; Check for valid Action - ${If} $2 != "A" - ${AndIf} $2 != "P" - ${AndIf} $2 != "R" - SetErrors - DetailPrint "ERROR: Invalid Action - must be A, P, or R" - Goto EnvVarUpdate_Restore_Vars - ${EndIf} - - ${If} $3 == HKLM - ReadRegStr $5 ${hklm_all_users} $1 ; Get EnvVarName from all users into $5 - ${ElseIf} $3 == HKCU - ReadRegStr $5 ${hkcu_current_user} $1 ; Read EnvVarName from current user into $5 - ${Else} - SetErrors - DetailPrint 'ERROR: Action is [$3] but must be "HKLM" or HKCU"' - Goto EnvVarUpdate_Restore_Vars - ${EndIf} - - ; Check for empty PathString - ${If} $4 == "" - SetErrors - DetailPrint "ERROR: PathString is blank" - Goto EnvVarUpdate_Restore_Vars - ${EndIf} - - ; Make sure we've got some work to do - ${If} $5 == "" - ${AndIf} $2 == "R" - SetErrors - DetailPrint "$1 is empty - Nothing to remove" - Goto EnvVarUpdate_Restore_Vars - ${EndIf} - - ; Step 2: Scrub EnvVar - ; - StrCpy $0 $5 ; Copy the contents to $0 - ; Remove spaces around semicolons (NOTE: spaces before the 1st entry or - ; after the last one are not removed here but instead in Step 3) - ${If} $0 != "" ; If EnvVar is not empty ... - ${Do} - ${${UN}StrStr} $7 $0 " ;" - ${If} $7 == "" - ${ExitDo} - ${EndIf} - ${${UN}StrRep} $0 $0 " ;" ";" ; Remove ';' - ${Loop} - ${Do} - ${${UN}StrStr} $7 $0 "; " - ${If} $7 == "" - ${ExitDo} - ${EndIf} - ${${UN}StrRep} $0 $0 "; " ";" ; Remove ';' - ${Loop} - ${Do} - ${${UN}StrStr} $7 $0 ";;" - ${If} $7 == "" - ${ExitDo} - ${EndIf} - ${${UN}StrRep} $0 $0 ";;" ";" - ${Loop} - - ; Remove a leading or trailing semicolon from EnvVar - StrCpy $7 $0 1 0 - ${If} $7 == ";" - StrCpy $0 $0 "" 1 ; Change ';' to '' - ${EndIf} - StrLen $6 $0 - IntOp $6 $6 - 1 - StrCpy $7 $0 1 $6 - ${If} $7 == ";" - StrCpy $0 $0 $6 ; Change ';' to '' - ${EndIf} - ; DetailPrint "Scrubbed $1: [$0]" ; Uncomment to debug - ${EndIf} - - /* Step 3. Remove all instances of the target path/string (even if "A" or "P") - $6 = bool flag (1 = found and removed PathString) - $7 = a string (e.g. path) delimited by semicolon(s) - $8 = entry counter starting at 0 - $9 = copy of $0 - $R0 = tempChar */ - - ${If} $5 != "" ; If EnvVar is not empty ... - StrCpy $9 $0 - StrCpy $0 "" - StrCpy $8 0 - StrCpy $6 0 - - ${Do} - ${${UN}StrTok} $7 $9 ";" $8 "0" ; $7 = next entry, $8 = entry counter - - ${If} $7 == "" ; If we've run out of entries, - ${ExitDo} ; were done - ${EndIf} ; - - ; Remove leading and trailing spaces from this entry (critical step for Action=Remove) - ${Do} - StrCpy $R0 $7 1 - ${If} $R0 != " " - ${ExitDo} - ${EndIf} - StrCpy $7 $7 "" 1 ; Remove leading space - ${Loop} - ${Do} - StrCpy $R0 $7 1 -1 - ${If} $R0 != " " - ${ExitDo} - ${EndIf} - StrCpy $7 $7 -1 ; Remove trailing space - ${Loop} - ${If} $7 == $4 ; If string matches, remove it by not appending it - StrCpy $6 1 ; Set 'found' flag - ${ElseIf} $7 != $4 ; If string does NOT match - ${AndIf} $0 == "" ; and the 1st string being added to $0, - StrCpy $0 $7 ; copy it to $0 without a prepended semicolon - ${ElseIf} $7 != $4 ; If string does NOT match - ${AndIf} $0 != "" ; and this is NOT the 1st string to be added to $0, - StrCpy $0 $0;$7 ; append path to $0 with a prepended semicolon - ${EndIf} ; - - IntOp $8 $8 + 1 ; Bump counter - ${Loop} ; Check for duplicates until we run out of paths - ${EndIf} - - ; Step 4: Perform the requested Action - ; - ${If} $2 != "R" ; If Append or Prepend - ${If} $6 == 1 ; And if we found the target - DetailPrint "Target is already present in $1. It will be removed and" - ${EndIf} - ${If} $0 == "" ; If EnvVar is (now) empty - StrCpy $0 $4 ; just copy PathString to EnvVar - ${If} $6 == 0 ; If found flag is either 0 - ${OrIf} $6 == "" ; or blank (if EnvVarName is empty) - DetailPrint "$1 was empty and has been updated with the target" - ${EndIf} - ${ElseIf} $2 == "A" ; If Append (and EnvVar is not empty), - StrCpy $0 $0;$4 ; append PathString - ${If} $6 == 1 - DetailPrint "appended to $1" - ${Else} - DetailPrint "Target was appended to $1" - ${EndIf} - ${Else} ; If Prepend (and EnvVar is not empty), - StrCpy $0 $4;$0 ; prepend PathString - ${If} $6 == 1 - DetailPrint "prepended to $1" - ${Else} - DetailPrint "Target was prepended to $1" - ${EndIf} - ${EndIf} - ${Else} ; If Action = Remove - ${If} $6 == 1 ; and we found the target - DetailPrint "Target was found and removed from $1" - ${Else} - DetailPrint "Target was NOT found in $1 (nothing to remove)" - ${EndIf} - ${If} $0 == "" - DetailPrint "$1 is now empty" - ${EndIf} - ${EndIf} - - ; Step 5: Update the registry at RegLoc with the updated EnvVar and announce the change - ; - ClearErrors - ${If} $3 == HKLM - WriteRegExpandStr ${hklm_all_users} $1 $0 ; Write it in all users section - ${ElseIf} $3 == HKCU - WriteRegExpandStr ${hkcu_current_user} $1 $0 ; Write it to current user section - ${EndIf} - - IfErrors 0 +4 - MessageBox MB_OK|MB_ICONEXCLAMATION "Could not write updated $1 to $3" - DetailPrint "Could not write updated $1 to $3" - Goto EnvVarUpdate_Restore_Vars - - ; "Export" our change - SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 - - EnvVarUpdate_Restore_Vars: - ; - ; Restore the user's variables and return ResultVar - Pop $R0 - Pop $9 - Pop $8 - Pop $7 - Pop $6 - Pop $5 - Pop $4 - Pop $3 - Pop $2 - Pop $1 - Push $0 ; Push my $0 (ResultVar) - Exch - Pop $0 ; Restore his $0 - -FunctionEnd - -!macroend ; EnvVarUpdate UN -!insertmacro EnvVarUpdate "" -!insertmacro EnvVarUpdate "un." -;----------------------------------- EnvVarUpdate end---------------------------------------- - -!verbose pop -!endif diff --git a/config/install_ivq.sh b/config/install_ivq.sh index 5c6609e..3139f31 100755 --- a/config/install_ivq.sh +++ b/config/install_ivq.sh @@ -1,33 +1,27 @@ #!/bin/bash +qt5_version="5.9.2" +cmake_version="3.9.5" +vtk_version="8.0.1" +itk_version="4.12.2" + +cmake_short_version=`echo $cmake_version | sed 's/\.[^.]*$//'` +cmake_url="https://www.cmake.org/files/v$cmake_short_version/cmake-$cmake_version.tar.gz" +qt5_short_version=`echo $qt5_version | sed 's/\.[^.]*$//'` +qt5_url="https://download.qt.io/official_releases/qt/$qt5_short_version/$qt5_version/submodules/qtbase-opensource-src-$qt5_version.tar.xz" +vtk_short_version=`echo $vtk_version | sed 's/\.[^.]*$//'` +vtk_url="https://www.vtk.org/files/release/$vtk_short_version/VTK-$vtk_version.tar.gz" +itk_short_version=`echo $itk_version | sed 's/\.[^.]*$//'` +itk_url="https://downloads.sourceforge.net/project/itk/itk/$itk_short_version/InsightToolkit-$itk_version.tar.xz" + ## -- Command line options while [[ "$#" -gt 1 ]]; do key="$1" case $key in - -qt) - qt="$2" - shift - ;; - -cmake) - cmake="$2" - shift - ;; - -vtk) - vtk="$2" - shift - ;; - -itk) - itk="$2" - shift - ;; -prefix) prefix="$2" shift ;; - -suffix) - suffix="$2" - shift - ;; -build_dir) build_dir="$2" shift @@ -45,12 +39,8 @@ done ## -- Check command line options if \ - [ -z "$prefix" ] || \ - [ -z "$qt" ] || \ - [ -z "$cmake" ] || \ - [ -z "$vtk" ] || \ - [ -z "$itk" ] ; then - (>&2 echo "Usage: $0 -prefix [dir] -qt [dir] -cmake [dir] -vtk [dir] -itk [dir] [-build_dir [dir]] [-suffix [string]] [-cores [n]]") + [ -z "$prefix" ] ; then + (>&2 echo "Usage: $0 -prefix [dir] [-build_dir [dir]] [-cores [n]]") exit 1 fi @@ -61,85 +51,96 @@ fi if [ -z "$build_dir" ] ; then build_dir="$HOME/.tmp" fi -if [ ! -z "$suffix" ] ; then - qt_suffix="-qtlibinfix $suffix" -fi curr_dir=`pwd` -## -- Configure, build and install Qt5 -mkdir -p $build_dir/qt -cd $build_dir/qt -$qt/configure \ - -prefix $prefix -shared -confirm-license -opensource -release \ - -c++std c++11 -opengl desktop \ - -nomake examples -nomake tests -no-harfbuzz \ - -qt-xcb -qt-xkbcommon -qt-pcre \ - -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity \ - -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad \ - -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation \ - -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing \ - -skip qtquickcontrols -skip qtquickcontrols2 -skip qtscript \ - -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport \ - -skip qtspeech -skip qtsvg -skip qttranslations -skip qtvirtualkeyboard \ - -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets \ - -skip qtwebview -skip qtxmlpatterns $qt_suffix -make -s -j$cores -k -make -s -j -k install - -## -- Configure, build and install CMake +## -- Create build directory +mkdir -p $build_dir/qt5 mkdir -p $build_dir/cmake -cd $build_dir/cmake -$cmake/bootstrap --parallel=$cores --prefix=$prefix --no-qt-gui -make -s -j$cores -k -make -s -j -k install - -## -- Configure, build and install VTK -cd $vtk -patch -s -p1 < $curr_dir/vtk.patch mkdir -p $build_dir/vtk -cd $build_dir/vtk -$prefix/bin/cmake \ - -DCMAKE_CXX_FLAGS:STRING=-std=c++11 \ - -DBUILD_SHARED_LIBS:BOOL=ON \ - -DCMAKE_BUILD_TYPE:STRING=Release \ - -DCMAKE_INSTALL_PREFIX:PATH=$prefix \ - -DBUILD_DOCUMENTATION:BOOL=OFF \ - -DBUILD_EXAMPLES:BOOL=OFF \ - -DBUILD_TESTING:BOOL=OFF \ - -DVTK_Group_Qt:BOOL=ON \ - -DVTK_QT_VERSION:STRING=5 \ - -DQt5_DIR:PATH=$prefix/lib/cmake/Qt5 \ - -DQT_QMAKE_EXECUTABLE:PATH=$prefix/bin/qmake \ - -DModule_vtkGUISupportQtOpenGL:BOOL=ON \ - -DCMAKE_DEBUG_POSTFIX:STRING=$suffix \ - -DCMAKE_RELEASE_POSTFIX:STRING=$suffix \ - -DCMAKE_MACOSX_RPATH:BOOL=ON \ - $vtk -make -s -j$cores -k -use_vtk=`make -j -k -s install | grep UseVTK | sed 's/.*: //'` - -## -- Configure, build and install VTK mkdir -p $build_dir/itk -cd $build_dir/itk -$prefix/bin/cmake \ - -DCMAKE_CXX_FLAGS:STRING=-std=c++11 \ - -DBUILD_SHARED_LIBS:BOOL=ON \ - -DCMAKE_BUILD_TYPE:STRING=Release \ - -DCMAKE_INSTALL_PREFIX:PATH=$prefix \ - -DBUILD_DOCUMENTATION:BOOL=OFF \ - -DBUILD_EXAMPLES:BOOL=OFF \ - -DBUILD_TESTING:BOOL=OFF \ - -DVTK_DIR:PATH=`dirname $use_vtk` \ - -DModule_ITKReview:BOOL=ON \ - -DModule_ITKVtkGlue:BOOL=ON \ - -DCMAKE_DEBUG_POSTFIX:STRING=$suffix \ - -DCMAKE_RELEASE_POSTFIX:STRING=$suffix \ - -DCMAKE_MACOSX_RPATH:BOOL=ON \ - $itk -make -s -j$cores -k -make -s -j -k install +platform=`uname` +if [[ "$platform" == 'Linux' ]]; then + wget -O $build_dir/qt5/qt5.tar.xz $qt5_url + wget -O $build_dir/cmake/cmake.tar.xz $cmake_url + wget -O $build_dir/vtk/vtk.tar.xz $vtk_url + wget -O $build_dir/itk/itk.tar.xz $itk_url +elif [[ "$platform" == 'Darwin' ]]; then + curl -o $build_dir/qt5/qt5.tar.xz $qt5_url + curl -o $build_dir/cmake/cmake.tar.xz $cmake_url + curl -o $build_dir/vtk/vtk.tar.xz $vtk_url + curl -o $build_dir/itk/itk.tar.xz $itk_url +fi + +# ## -- Configure, build and install Qt5 +# mkdir -p $build_dir/qt +# cd $build_dir/qt +# $qt/configure \ +# -prefix $prefix -shared -confirm-license -opensource -release \ +# -c++std c++11 -opengl desktop \ +# -nomake examples -nomake tests -no-harfbuzz \ +# -qt-xcb -qt-xkbcommon -qt-pcre \ +# -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity \ +# -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad \ +# -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation \ +# -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing \ +# -skip qtquickcontrols -skip qtquickcontrols2 -skip qtscript \ +# -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport \ +# -skip qtspeech -skip qtsvg -skip qttranslations -skip qtvirtualkeyboard \ +# -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets \ +# -skip qtwebview -skip qtxmlpatterns +# make -s -j$cores -k +# make -s -j -k install + +# ## -- Configure, build and install CMake +# mkdir -p $build_dir/cmake +# cd $build_dir/cmake +# $cmake/bootstrap --parallel=$cores --prefix=$prefix --no-qt-gui +# make -s -j$cores -k +# make -s -j -k install + +# ## -- Configure, build and install VTK +# cd $vtk +# patch -s -p1 < $curr_dir/vtk.patch +# mkdir -p $build_dir/vtk +# cd $build_dir/vtk +# $prefix/bin/cmake \ +# -DCMAKE_CXX_FLAGS:STRING=-std=c++11 \ +# -DBUILD_SHARED_LIBS:BOOL=ON \ +# -DCMAKE_BUILD_TYPE:STRING=Release \ +# -DCMAKE_INSTALL_PREFIX:PATH=$prefix \ +# -DBUILD_DOCUMENTATION:BOOL=OFF \ +# -DBUILD_EXAMPLES:BOOL=OFF \ +# -DBUILD_TESTING:BOOL=OFF \ +# -DVTK_Group_Qt:BOOL=ON \ +# -DVTK_QT_VERSION:STRING=5 \ +# -DQt5_DIR:PATH=$prefix/lib/cmake/Qt5 \ +# -DQT_QMAKE_EXECUTABLE:PATH=$prefix/bin/qmake \ +# -DModule_vtkGUISupportQtOpenGL:BOOL=ON \ +# -DCMAKE_MACOSX_RPATH:BOOL=ON \ +# $vtk +# make -s -j$cores -k +# use_vtk=`make -j -k -s install | grep UseVTK | sed 's/.*: //'` + +# ## -- Configure, build and install VTK +# mkdir -p $build_dir/itk +# cd $build_dir/itk +# $prefix/bin/cmake \ +# -DCMAKE_CXX_FLAGS:STRING=-std=c++11 \ +# -DBUILD_SHARED_LIBS:BOOL=ON \ +# -DCMAKE_BUILD_TYPE:STRING=Release \ +# -DCMAKE_INSTALL_PREFIX:PATH=$prefix \ +# -DBUILD_DOCUMENTATION:BOOL=OFF \ +# -DBUILD_EXAMPLES:BOOL=OFF \ +# -DBUILD_TESTING:BOOL=OFF \ +# -DVTK_DIR:PATH=`dirname $use_vtk` \ +# -DModule_ITKReview:BOOL=ON \ +# -DModule_ITKVtkGlue:BOOL=ON \ +# -DCMAKE_MACOSX_RPATH:BOOL=ON \ +# $itk +# make -s -j$cores -k +# make -s -j -k install -## -- End -cd $curr_dir +# ## -- End +# cd $curr_dir ## eof - $RCSfile$ diff --git a/config/install_mxe.sh b/config/install_ivq_mxe.sh similarity index 93% rename from config/install_mxe.sh rename to config/install_ivq_mxe.sh index e23f5ac..656cce1 100755 --- a/config/install_mxe.sh +++ b/config/install_ivq_mxe.sh @@ -32,6 +32,7 @@ fi curr_dir=`pwd` ## -- Get mxe +mkdir -p $prefix cd $prefix git clone https://github.com/mxe/mxe.git @@ -39,9 +40,6 @@ git clone https://github.com/mxe/mxe.git cd $prefix/mxe echo "MXE_TARGETS := x86_64-w64-mingw32.shared" > settings.mk -## -- Patch mxe -patch -s -p1 < $curr_dir/mxe.patch - ## -- Compile all make -j$cores -k qtbase vtk itk nsis diff --git a/config/ivq.nsi b/config/ivq.nsi deleted file mode 100644 index 368daef..0000000 --- a/config/ivq.nsi +++ /dev/null @@ -1,57 +0,0 @@ -OutFile "install_ivq.exe" -InstallDir "$PROGRAMFILES\ivq" - -Section -SetOutPath "$INSTDIR\bin" -File "ivq\bin\*.dll" -SetOutPath "$INSTDIR\plugins\bearer" -File "ivq\plugins\bearer\*.dll" -SetOutPath "$INSTDIR\plugins\designer" -File "ivq\plugins\designer\*.dll" -SetOutPath "$INSTDIR\plugins\generic" -File "ivq\plugins\generic\*.dll" -SetOutPath "$INSTDIR\plugins\iconengines" -File "ivq\plugins\iconengines\*.dll" -SetOutPath "$INSTDIR\plugins\imageformats" -File "ivq\plugins\imageformats\*.dll" -SetOutPath "$INSTDIR\plugins\platforms" -File "ivq\plugins\platforms\*.dll" -SetOutPath "$INSTDIR\plugins\printsupport" -File "ivq\plugins\printsupport\*.dll" -SetOutPath "$INSTDIR\plugins\qmltooling" -File "ivq\plugins\qmltooling\*.dll" -SetOutPath "$INSTDIR\plugins\sqldrivers" -File "ivq\plugins\sqldrivers\*.dll" -WriteUninstaller $INSTDIR\uninstaller.exe -SectionEnd - -Section "Uninstall" - -Delete $INSTDIR\uninstaller.exe -RMDir /r $INSTDIR - -SectionEnd - -!include EnvVarUpdate.nsh -Section -${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR\bin" -${EnvVarUpdate} $0 "QT_QPA_PLATFORM_PLUGIN_PATH" "A" "HKLM" "$INSTDIR\plugins\platforms" -SectionEnd - -#QT_QPA_PLATFORM_PLUGIN_PATH -#!include WriteEnvStr.nsh - -#Section "Add Env Var" -# !ifdef ALL_USERS -# !define ReadEnvStr_RegKey \ -# 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"' -# !else -# !define ReadEnvStr_RegKey 'HKCU "Environment"' -# !endif - -#ReadEnvStr $R0 "PATH" -#StrCpy $R0 "$R0;$INSTDIR\bin" -#System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("PATH", R0).r2' -#SectionEnd - -## eof diff --git a/config/mxe.patch b/config/mxe.patch deleted file mode 100644 index cdf60f1..0000000 --- a/config/mxe.patch +++ /dev/null @@ -1,126 +0,0 @@ -diff --git a/src/itk.mk b/src/itk.mk -index a8194fa..5c48425 100644 ---- a/src/itk.mk -+++ b/src/itk.mk -@@ -9,7 +9,7 @@ $(PKG)_CHECKSUM := 334312cc31925fd6c2622c9cd4ed33fecbbbd5b97e03b93f34b259d08352e - $(PKG)_SUBDIR := InsightToolkit-$($(PKG)_VERSION) - $(PKG)_FILE := $($(PKG)_SUBDIR).tar.xz - $(PKG)_URL := https://$(SOURCEFORGE_MIRROR)/project/$(PKG)/$(PKG)/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE) --$(PKG)_DEPS := gcc expat hdf5 jpeg libpng tiff zlib -+$(PKG)_DEPS := gcc expat hdf5 jpeg libpng tiff zlib vtk - - define $(PKG)_UPDATE - $(WGET) -q -O- 'https://itk.org/ITK/resources/software.html' | \ -@@ -31,6 +31,10 @@ define $(PKG)_BUILD - -DITK_USE_SYSTEM_PNG=TRUE \ - -DITK_USE_SYSTEM_TIFF=TRUE \ - -DITK_USE_SYSTEM_ZLIB=TRUE \ -+ -DModule_ITKReview=TRUE \ -+ -DModule_ITKVtkGlue=TRUE \ -+ -DCMAKE_DEBUG_POSTFIX=_cpPlugins \ -+ -DCMAKE_RELEASE_POSTFIX=_cpPlugins \ - '$(1)' - $(MAKE) -C '$(1).build' -j '$(JOBS)' install VERBOSE=1 - endef -diff --git a/src/qtbase.mk b/src/qtbase.mk -index c02650c4..c46867a6 100644 ---- a/src/qtbase.mk -+++ b/src/qtbase.mk -@@ -64,51 +64,22 @@ define $(PKG)_BUILD - -dbus-linked \ - -no-pch \ - -v \ -- $($(PKG)_CONFIGURE_OPTS) -+ $($(PKG)_CONFIGURE_OPTS) \ -+ -qtlibinfix _cpPlugins - - $(MAKE) -C '$(1)' -j '$(JOBS)' - rm -rf '$(PREFIX)/$(TARGET)/qt5' - $(MAKE) -C '$(1)' -j 1 install - ln -sf '$(PREFIX)/$(TARGET)/qt5/bin/qmake' '$(PREFIX)/bin/$(TARGET)'-qmake-qt5 - -- mkdir '$(1)/test-qt' -- cd '$(1)/test-qt' && '$(PREFIX)/$(TARGET)/qt5/bin/qmake' '$(PWD)/src/qt-test.pro' -- $(MAKE) -C '$(1)/test-qt' -j '$(JOBS)' $(BUILD_TYPE) -- $(INSTALL) -m755 '$(1)/test-qt/$(BUILD_TYPE)/test-qt5.exe' '$(PREFIX)/$(TARGET)/bin/' -- -- # build test the manual way -- mkdir '$(1)/test-$(PKG)-pkgconfig' -- '$(PREFIX)/$(TARGET)/qt5/bin/uic' -o '$(1)/test-$(PKG)-pkgconfig/ui_qt-test.h' '$(TOP_DIR)/src/qt-test.ui' -- '$(PREFIX)/$(TARGET)/qt5/bin/moc' \ -- -o '$(1)/test-$(PKG)-pkgconfig/moc_qt-test.cpp' \ -- -I'$(1)/test-$(PKG)-pkgconfig' \ -- '$(TOP_DIR)/src/qt-test.hpp' -- '$(PREFIX)/$(TARGET)/qt5/bin/rcc' -name qt-test -o '$(1)/test-$(PKG)-pkgconfig/qrc_qt-test.cpp' '$(TOP_DIR)/src/qt-test.qrc' -- '$(TARGET)-g++' \ -- -W -Wall -Werror -std=c++0x -pedantic \ -- '$(TOP_DIR)/src/qt-test.cpp' \ -- '$(1)/test-$(PKG)-pkgconfig/moc_qt-test.cpp' \ -- '$(1)/test-$(PKG)-pkgconfig/qrc_qt-test.cpp' \ -- -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG)-pkgconfig.exe' \ -- -I'$(1)/test-$(PKG)-pkgconfig' \ -- `'$(TARGET)-pkg-config' Qt5Widgets$(BUILD_TYPE_SUFFIX) --cflags --libs` -- - # setup cmake toolchain - echo 'set(CMAKE_SYSTEM_PREFIX_PATH "$(PREFIX)/$(TARGET)/qt5" ${CMAKE_SYSTEM_PREFIX_PATH})' > '$(CMAKE_TOOLCHAIN_DIR)/$(PKG).cmake' - -- # batch file to run test programs -- (printf 'set PATH=..\\lib;..\\qt5\\bin;..\\qt5\\lib;%%PATH%%\r\n'; \ -- printf 'set QT_QPA_PLATFORM_PLUGIN_PATH=..\\qt5\\plugins\r\n'; \ -- printf 'test-qt5.exe\r\n'; \ -- printf 'test-qtbase-pkgconfig.exe\r\n';) \ -- > '$(PREFIX)/$(TARGET)/bin/test-qt5.bat' -- - # add libs to CMake config of Qt5Core to fix static linking - $(SED) -i 's,set(_Qt5Core_LIB_DEPENDENCIES \"\"),set(_Qt5Core_LIB_DEPENDENCIES \"ole32;uuid;ws2_32;advapi32;shell32;user32;kernel32;mpr;version;winmm;z;pcre2-16\"),g' '$(PREFIX)/$(TARGET)/qt5/lib/cmake/Qt5Core/Qt5CoreConfig.cmake' - $(SED) -i 's,set(_Qt5Gui_LIB_DEPENDENCIES \"Qt5::Core\"),set(_Qt5Gui_LIB_DEPENDENCIES \"Qt5::Core;ole32;uuid;ws2_32;advapi32;shell32;user32;kernel32;mpr;version;winmm;z;pcre2-16;png16;harfbuzz;z\"),g' '$(PREFIX)/$(TARGET)/qt5/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake' - $(SED) -i 's,set(_Qt5Widgets_LIB_DEPENDENCIES \"Qt5::Gui;Qt5::Core\"),set(_Qt5Widgets_LIB_DEPENDENCIES \"Qt5::Gui;Qt5::Core;gdi32;comdlg32;oleaut32;imm32;opengl32;png16;harfbuzz;ole32;uuid;ws2_32;advapi32;shell32;user32;kernel32;mpr;version;winmm;z;pcre2-16;shell32;uxtheme;dwmapi\"),g' '$(PREFIX)/$(TARGET)/qt5/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake' - endef - -- - $(PKG)_BUILD_SHARED = $(subst -static ,-shared ,\ - $($(PKG)_BUILD)) -diff --git a/src/vtk-1-fixes.patch b/src/vtk-1-fixes.patch -index 1e13226f..23957a3f 100644 ---- a/src/vtk-1-fixes.patch -+++ b/src/vtk-1-fixes.patch -@@ -68,3 +68,23 @@ Subject: [PATCH] fix libharu shared linking - endif() - # Maintain backward compatibility with user setting COMPILE_TOOLS_IMPORTED - if(DEFINED COMPILE_TOOLS_IMPORTED AND NOT DEFINED VTK_COMPILE_TOOLS_IMPORTED) -+ -+--- a/GUISupport/Qt/PluginInstall.cmake.in 2017-08-30 15:55:05.000000000 -0500 -++++ b/GUISupport/Qt/PluginInstall.cmake.in 2017-10-06 18:20:24.746721343 -0500 -+@@ -3,12 +3,10 @@ -+ set(VTK_INSTALL_QT_DIR "@VTK_INSTALL_QT_DIR@") -+ set(VTK_INSTALL_QT_PLUGIN_DIR "@VTK_INSTALL_QT_PLUGIN_DIR@") -+ set(BUILDTYPE_SUFFIX) -+-if (WIN32) -+- if (BUILD_TYPE STREQUAL "Debug") -+- set(BUILDTYPE_SUFFIX @CMAKE_DEBUG_POSTFIX@) -+- else () -+- set(BUILDTYPE_SUFFIX @CMAKE_RELEASE_POSTFIX@) -+- endif () -++if (BUILD_TYPE STREQUAL "Debug") -++ set(BUILDTYPE_SUFFIX @CMAKE_DEBUG_POSTFIX@) -++else () -++ set(BUILDTYPE_SUFFIX @CMAKE_RELEASE_POSTFIX@) -+ endif () -+ set(VTK_INSTALL_QT_PLUGIN_FILE "@CMAKE_SHARED_LIBRARY_PREFIX@QVTKWidgetPlugin${BUILDTYPE_SUFFIX}@CMAKE_SHARED_LIBRARY_SUFFIX@") -+ set(VTK_CONFIGURATIONS "@CMAKE_CONFIGURATION_TYPES@") -diff --git a/src/vtk.mk b/src/vtk.mk -index 47d5419c..d7d397ad 100644 ---- a/src/vtk.mk -+++ b/src/vtk.mk -@@ -49,7 +49,10 @@ define $(PKG)_BUILD - -DVTK_FORBID_DOWNLOADS=ON \ - -DVTK_USE_SYSTEM_LIBHARU=ON \ - -DBUILD_EXAMPLES=OFF \ -- -DBUILD_TESTING=OFF -+ -DBUILD_TESTING=OFF \ -+ -DCMAKE_DEBUG_POSTFIX=_cpPlugins \ -+ -DCMAKE_RELEASE_POSTFIX=_cpPlugins -+ - $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' VERBOSE=1 - $(MAKE) -C '$(BUILD_DIR)' -j 1 install VERBOSE=1 - diff --git a/config/vtk.patch b/config/vtk.patch deleted file mode 100644 index 1e12e7b..0000000 --- a/config/vtk.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -ruN VTK-8.0.1/GUISupport/Qt/PluginInstall.cmake.in VTK-8.0.1-patched/GUISupport/Qt/PluginInstall.cmake.in ---- VTK-8.0.1/GUISupport/Qt/PluginInstall.cmake.in 2017-08-30 15:55:05.000000000 -0500 -+++ VTK-8.0.1-patched/GUISupport/Qt/PluginInstall.cmake.in 2017-10-06 18:20:24.746721343 -0500 -@@ -3,12 +3,10 @@ - set(VTK_INSTALL_QT_DIR "@VTK_INSTALL_QT_DIR@") - set(VTK_INSTALL_QT_PLUGIN_DIR "@VTK_INSTALL_QT_PLUGIN_DIR@") - set(BUILDTYPE_SUFFIX) --if (WIN32) -- if (BUILD_TYPE STREQUAL "Debug") -- set(BUILDTYPE_SUFFIX @CMAKE_DEBUG_POSTFIX@) -- else () -- set(BUILDTYPE_SUFFIX @CMAKE_RELEASE_POSTFIX@) -- endif () -+if (BUILD_TYPE STREQUAL "Debug") -+ set(BUILDTYPE_SUFFIX @CMAKE_DEBUG_POSTFIX@) -+else () -+ set(BUILDTYPE_SUFFIX @CMAKE_RELEASE_POSTFIX@) - endif () - set(VTK_INSTALL_QT_PLUGIN_FILE "@CMAKE_SHARED_LIBRARY_PREFIX@QVTKWidgetPlugin${BUILDTYPE_SUFFIX}@CMAKE_SHARED_LIBRARY_SUFFIX@") - set(VTK_CONFIGURATIONS "@CMAKE_CONFIGURATION_TYPES@") -- 2.47.1