diff tools/makeinst-script.sh.in @ 4793:202fa20cf559

add msys2 environment/tools option, use seprate post-install script to finalize install * src/msys2-bash.mk: new file * src/msys2-coreutils.mk: new file * src/msys2-diffutils.mk: new file * src/msys2-dos2unix.mk: new file * src/msys2-filesystem.mk: new file * src/msys2-findutils.mk: new file * src/msys2-gawk.mk: new file * src/msys2-gcc-libs.mk: new file * src/msys2-gmp.mk: new file * src/msys2-gnupg.mk: new file * src/msys2-grep.mk: new file * src/msys2-gzip.mk: new file * src/msys2-icu.mk: new file * src/msys2-info.mk: new file * src/msys2-less.mk: new file * src/msys2-libassuan.mk: new file * src/msys2-libbz2.mk: new file * src/msys2-libexpat.mk: new file * src/msys2-libgpg-error.mk: new file * src/msys2-libgpgme.mk: new file * src/msys2-libiconv.mk: new file * src/msys2-libidn2.mk: new file * src/msys2-libintl.mk: new file * src/msys2-liblzma.mk: new file * src/msys2-libmetalink.mk: new file * src/msys2-libopenssl.mk: new file * src/msys2-libpcre.mk: new file * src/msys2-libpsl.mk: new file * src/msys2-libreadline.mk: new file * src/msys2-libunistring.mk: new file * src/msys2-libutil-linux.mk: new file * src/msys2-libxml2.mk: new file * src/msys2-make.mk: new file * src/msys2-mintty.mk: new file * src/msys2-ncurses.mk: new file * src/msys2-pacman-mirrors.mk: new file * src/msys2-pacman.mk: new file * src/msys2-patch.mk: new file * src/msys2-runtime.mk: new file * src/msys2-sed.mk: new file * src/msys2-tar.mk: new file * src/msys2-unzip.mk: new file * src/msys2-wget.mk: new file * src/msys2-zip.mk: new file * src/msys2-zlib.mk: new file * src/msys2-mpfr.mk: new file * src/msys2-libsqlite.mk: new file * src/msys2-keyring.mk: new file * src/msys2-libffi.mk: new file * src/msys2-libgnutls.mk: new file * src/msys2-libhogweed.mk: new file * src/msys2-libksba.mk: new file * src/msys2-libnettle.mk: new file * src/msys2-libnpth.mk: new file * src/msys2-libp11-kit.mk: new file * src/msys2-libtasn1.mk: new file * src/src-msys2-bash.mk: new file * src/src-msys2-coreutils.mk: new file * src/src-msys2-diffutils.mk: new file * src/src-msys2-dos2unix.mk: new file * src/src-msys2-filesystem.mk: new file * src/src-msys2-findutils.mk: new file * src/src-msys2-gawk.mk: new file * src/src-msys2-gcc-libs.mk: new file * src/src-msys2-gmp.mk: new file * src/src-msys2-gnupg.mk: new file * src/src-msys2-grep.mk: new file * src/src-msys2-gzip.mk: new file * src/src-msys2-icu.mk: new file * src/src-msys2-info.mk: new file * src/src-msys2-keyring.mk: new file * src/src-msys2-less.mk: new file * src/src-msys2-libassuan.mk: new file * src/src-msys2-libbz2.mk: new file * src/src-msys2-libexpat.mk: new file * src/src-msys2-libffi.mk: new file * src/src-msys2-libgcrypt.mk: new file * src/src-msys2-libgnutls.mk: new file * src/src-msys2-libgpg-error.mk: new file * src/src-msys2-libgpgme.mk: new file * src/src-msys2-libhogweed.mk: new file * src/src-msys2-libiconv.mk: new file * src/src-msys2-libidn2.mk: new file * src/src-msys2-libintl.mk: new file * src/src-msys2-libksba.mk: new file * src/src-msys2-liblzma.mk: new file * src/src-msys2-libmetalink.mk: new file * src/src-msys2-libnettle.mk: new file * src/src-msys2-libnpth.mk: new file * src/src-msys2-libopenssl.mk: new file * src/src-msys2-libp11-kit.mk: new file * src/src-msys2-libpcre.mk: new file * src/src-msys2-libpsl.mk: new file * src/src-msys2-libreadline.mk: new file * src/src-msys2-libsqlite.mk: new file * src/src-msys2-libtasn1.mk: new file * src/src-msys2-libunistring.mk: new file * src/src-msys2-libutil-linux.mk: new file * src/src-msys2-libxml2.mk: new file * src/src-msys2-make.mk: new file * src/src-msys2-mintty.mk: new file * src/src-msys2-mpfr.mk: new file * src/src-msys2-ncurses.mk: new file * src/src-msys2-pacman-mirrors.mk: new file * src/src-msys2-pacman.mk: new file * src/src-msys2-patch.mk: new file * src/src-msys2-runtime.mk: new file * src/src-msys2-sed.mk: new file * src/src-msys2-tar.mk: new file * src/src-msys2-unzip.mk: new file * src/src-msys2-wget.mk: new file * src/src-msys2-zip.mk: new file * src/src-msys2-zlib.mk: new file * Makefile.in: add msys2 vars and base rules * index.html: ref new msys2 targets * dist-files.mk: added refs to new msys2 mk files * binary-dist-rules.mk: added conditional msys/msys2 dist files, post-install.bat * configure.ac: added --with-msys2 option * installer-files/post-install.bat: new file * tools/makeinst-script.sh.in: call post-install.bat instead of fc_update and octave, and use nsExec to hide comd windows while executing it * tools/msys2-install.py; new file * installer-files/cmdshell.bat, installer-files/fc_update.bat, installer-files/octave-firsttime.vbs, installer-files/octave.vbs: update paths when running msys2
author John Donoghue
date Wed, 15 Aug 2018 08:05:01 -0400
parents 68deb4d4d928
children adc0217b36c0
line wrap: on
line diff
--- a/tools/makeinst-script.sh.in	Mon Aug 13 14:27:16 2018 -0400
+++ b/tools/makeinst-script.sh.in	Wed Aug 15 08:05:01 2018 -0400
@@ -16,13 +16,23 @@
 cd `dirname $1`
 MXEDIR=`cd ..; pwd`
 
-if [ -e $OCTAVE_SOURCE/bin/libopenblas.dll ]; then
+if [ "@USE_MSYS2@" == "yes" ]; then
+  if [ "@ENABLE_WINDOWS_64@" == "yes" ]; then
+    OCTAVE_SUBDIR=mingw64
+  else
+    OCTAVE_SUBDIR=mingw32
+  fi
+else
+  OCTAVE_SUBDIR=
+fi
+
+
+if [ -e $OCTAVE_SOURCE/$OCTAVE_SUBDIR/bin/libopenblas.dll ]; then
   DEFAULT_BLAS="OpenBLAS"
 else
   DEFAULT_BLAS="Reference BLAS"
 fi
 
-
 # find octave shortcut icon
 ICON=`find $OCTAVE_SOURCE -name octave-logo.ico -printf "%P\n" | head -1 | sed 's,/,\\\\,g'`
 
@@ -180,7 +190,7 @@
   Pop \$InstallBlasLibCtrl
 EOF
    # add option to install libopenblas if we have the dll present
-   if [ -e $OCTAVE_SOURCE/bin/libopenblas.dll ]; then
+   if [ -e $OCTAVE_SOURCE/$OCTAVE_SUBDIR/bin/libopenblas.dll ]; then
      cat >> $OUTFILE << EOF
   \${NSD_CB_AddString} \$InstallBlasLibCtrl "OpenBLAS"
 EOF
@@ -239,6 +249,7 @@
   File "$OCTAVE_SOURCE/octave.vbs"
   File "$OCTAVE_SOURCE/octave-firsttime.vbs"
   File "$OCTAVE_SOURCE/fc_update.bat"
+  File "$OCTAVE_SOURCE/post-install.bat"
 
   File "$OCTAVE_SOURCE/HG-ID"
 
@@ -263,14 +274,17 @@
  ; add qt.conf
  Push \$0
  \${StrRep} '\$0' '\$INSTDIR' '\\' '/'
- WriteINIStr "\$INSTDIR\\bin\\qt.conf" "Paths" "Prefix" "\$0"
- WriteINIStr "\$INSTDIR\\bin\\qt.conf" "Paths" "Translations" "translations"
+ WriteINIStr "\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\qt.conf" "Paths" "Prefix" "\$0"
+ WriteINIStr "\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\qt.conf" "Paths" "Translations" "translations"
  Pop \$0
 
- ; run fc-cache updater
+ ; run post-install script
  GetFullPathName /SHORT \$1 \$INSTDIR
- DetailPrint "Building font cache (may take a while)"
- ExecWait "\$1\\fc_update.bat"
+ DetailPrint "Running post install script (May take a while) ..."
+ ;ExecWait "\$1\\post-install.bat"
+ ; run in hidden console window
+ nsExec::Exec /TIMEOUT=30000 '"\$1\\post-install.bat"'
+ Pop \$0
 SectionEnd
 
 Section make_uninstaller
@@ -301,7 +315,9 @@
  SetOutPath "\$INSTDIR"
 
  ; fix the shortcuts for appid
- ExecWait '"\$INSTDIR\\bin\\win7appid.exe" "\$SMPROGRAMS\\GNU Octave $VERSION\\Octave-$VERSION (GUI).lnk" "gnu.octave.$VERSION"'
+ ; run in hidden console window
+ nsExec::Exec /TIMEOUT=30000 '"\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\win7appid.exe" "\$SMPROGRAMS\\GNU Octave $VERSION\\Octave-$VERSION (GUI).lnk" "gnu.octave.$VERSION"'
+ Pop \$0
 EOF
   # shortcut for cmd win
   if [ -f $OCTAVE_SOURCE/cmdshell.bat ]; then 
@@ -348,7 +364,8 @@
     CreateShortCut "\$desktop\\GNU Octave (CLI).lnk" "\$R0\\octave.vbs" "--no-gui" "\$R2" 0 SW_SHOWMINIMIZED
     CreateShortCut "\$desktop\\GNU Octave (GUI).lnk" "\$R0\\octave.vbs" "--force-gui" "\$R2" 0 SW_SHOWMINIMIZED
 
-    ExecWait '"\$INSTDIR\\bin\\win7appid.exe" "\$desktop\\GNU Octave (GUI).lnk" "gnu.octave.\$R1"'
+    nsExec::Exec /TIMEOUT=30000 '"\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\win7appid.exe" "\$desktop\\GNU Octave (GUI).lnk" "gnu.octave.\$R1"'
+    Pop \$0
 
     Pop \$R2
     Pop \$R1
@@ -358,10 +375,10 @@
   ; BLAS set up
   \${If} \$InstallBlasLib == 1
     ; Reference BLAS
-    CopyFiles /SILENT "\$INSTDIR\\bin\\librefblas.dll" "\$INSTDIR\\bin\\libblas.dll"
+    CopyFiles /SILENT "\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\librefblas.dll" "\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\libblas.dll"
   \${Else}
     ; OpenBLAS
-    CopyFiles /SILENT "\$INSTDIR\\bin\\libopenblas.dll" "\$INSTDIR\\bin\\libblas.dll"
+    CopyFiles /SILENT "\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\libopenblas.dll" "\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\libblas.dll"
   \${EndIf}
 
 SectionEnd
@@ -383,13 +400,6 @@
   \${EndIf}
 SectionEnd
 
-Section "InstallPackages"
-  ; fix the installed packages (if any)
-  GetFullPathName /SHORT \$1 \$INSTDIR
-  SetOutPath "\$1"
-  ExecWait '"\$1\\bin\\octave-cli.exe" --no-gui -W -H -f -q --eval "pkg rebuild"' \$0
-SectionEnd
-
 Section "Uninstall"
 
   ReadRegDWORD \$0 HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave-$VERSION" "AllUsers"
@@ -458,7 +468,8 @@
  IfFileExists "\$desktop\\GNU Octave (GUI).lnk" 0 done_remove_desktop_shortcuts
  SetOutPath "%USERPROFILE%"
  CreateShortCut "\$desktop\\GNU Octave (GUI).lnk" "\$R0\\octave.vbs" "--force-gui" "\$R2" 0 SW_SHOWMINIMIZED
- ExecWait '"\$INSTDIR\\bin\\win7appid.exe" "\$desktop\\GNU Octave (GUI).lnk" "gnu.octave.\$R1"'
+ nsExec::Exec /TIMEOUT=30000 '"\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\win7appid.exe" "\$desktop\\GNU Octave (GUI).lnk" "gnu.octave.\$R1"'
+ Pop \$0
 
  GoTo done_remove_desktop_shortcuts
 
@@ -472,7 +483,7 @@
  Pop \$R0
 
  ; delete generated qt.conf file
- Delete "\$INSTDIR\\bin\\qt.conf"
+ Delete "\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\qt.conf"
 EOF
 
 # insert dir list (backwards order) for uninstall files
@@ -614,7 +625,8 @@
 
 ; Check whether prev install is here and no spaces in dest name
 Function CheckPrevInstallAndDest
-  IfFileExists "\$INSTDIR\\bin\\octave-cli.exe" inst_exists  inst_none
+  IfFileExists "\$INSTDIR\\bin\\octave-cli.exe" inst_exists  0
+  IfFileExists "\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\octave-cli.exe" inst_exists  inst_none
 inst_exists:
   MessageBox MB_YESNO|MB_ICONEXCLAMATION "Another Octave installation has been detected at that destination. It is recommended to uninstall it if you intend to use the same installation directory. Do you want to proceed with the installation anyway?" /SD IDYES IDYES inst_none IDNO 0
   Abort