changeset 3384:0de28586712a

installer: Change gui shortcut path to libexec installed path * makeinst-script.sh: change shortcut path to libexec\\octave\\$OCTAVE_VERSION\\exec\\i686-pc-mingw32\\octave-gui.exe, get version from octave-version file. * src/octave-2-libexec.patch: new file to install octave-gui.exe to libexec * dist-files.mk: add octave-2-libexec.patch and octave-1-links.patch.
author John Donoghue <john.donoghue@ieee.org>
date Wed, 01 Jan 2014 17:45:54 -0500
parents 6dfbea9a9646
children d7a1542fa3b0
files dist-files.mk makeinst-script.sh src/octave-2-libexec.patch
diffstat 3 files changed, 101 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/dist-files.mk	Wed Jan 01 17:42:10 2014 -0500
+++ b/dist-files.mk	Wed Jan 01 17:45:54 2014 -0500
@@ -382,6 +382,8 @@
   ocaml-native-1-fixes.patch \
   ocaml-native.mk \
   octave.mk \
+  octave-1-links.patch \
+  octave-2-libexec.patch \
   of-communications.mk \
   of-control.mk \
   of-general.mk \
--- a/makeinst-script.sh	Wed Jan 01 17:42:10 2014 -0500
+++ b/makeinst-script.sh	Wed Jan 01 17:45:54 2014 -0500
@@ -14,13 +14,14 @@
 echo "Generating installer script ... "
 
 cd $TOPDIR
+MXEDIR=`cd ..; pwd`
 
 # find octave shortcut icon
 ICON=`find $OCTAVE_SOURCE -name octave-logo.ico -printf "%P" | head -1 | sed 's,/,\\\\,g'`
 
 # extract version number
-VERSION=`sed -n 's,.*id=\"octave-version\">\([0-9\.]*\).*,\1,p' < ../index.html`
-OCTAVE_VERSION=`sed -n 's,.*id=\"octave-version\">\([^<]*\).*,\1,p' < ../index.html`
+OCTAVE_VERSION=`head -1 $MXEDIR/octave/octave-version`
+VERSION=`echo $OCTAVE_VERSION | sed -n 's,\([0-9\.]*\).*,\1,p'`
 
 # create installer script
 echo "; octave setup script $OCTAVE_SOURCE" > octave.nsi
@@ -140,8 +141,10 @@
 
  CreateDirectory "\$SMPROGRAMS\\Octave"
  CreateShortCut "\$SMPROGRAMS\\Octave\\Uninstall.lnk" "\$INSTDIR\\uninstall.exe" "" "\$INSTDIR\\uninstall.exe" 0
+ SetOutPath "\$INSTDIR\\bin"
  CreateShortCut "\$SMPROGRAMS\\Octave\\Octave.lnk" "\$INSTDIR\\bin\\octave.exe" "" "\$INSTDIR\\$ICON" 0
- CreateShortCut "\$SMPROGRAMS\\Octave\\Octave (Experimental GUI).lnk" "\$INSTDIR\\bin\\octave-gui.exe" "" "\$INSTDIR\\$ICON" 0
+ CreateShortCut "\$SMPROGRAMS\\Octave\\Octave (Experimental GUI).lnk" "\$INSTDIR\\libexec\\octave\\$OCTAVE_VERSION\\exec\\i686-pc-mingw32\\octave-gui.exe" "" "\$INSTDIR\\$ICON" 0
+ SetOutPath "\$INSTDIR"
 EOF
   # if we have documentation files, create shortcuts
   if [ -d $OCTAVE_SOURCE/share/doc/octave ]; then
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/octave-2-libexec.patch	Wed Jan 01 17:45:54 2014 -0500
@@ -0,0 +1,93 @@
+
+# HG changeset patch
+# User John W. Eaton <jwe@octave.org>
+# Date 1387845274 18000
+# Node ID 65e4e0569ed4ed2aa368f0048561f0b9c19d1f81
+# Parent  bce3a82a4a8de81b81a0d0f26dd8a837932b2bbb
+install octave-gui binary in libexec directory
+
+* src/Makefile.am (archlib_PROGRAMS): New variable.  List octave-gui
+* here, not in OCTAVE_BINARIES (and, ultimately, bin_PROGRAMS).
+* src/main.in.cc (OCTAVE_ARCHLIBDIR): New macro.
+(get_octave_archlibdir): New function.
+(main): New variable octave_archlibdir.  If HAVE_OCTAVE_GUI, set file
+to octave-gui in the octave_archlibdir directory.
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -52,7 +52,7 @@
+ OCTAVE_VERSION_LINKS = octave-cli-$(version)$(EXEEXT)
+ 
+ if AMCOND_BUILD_GUI
+-  OCTAVE_BINARIES += octave-gui
++  archlib_PROGRAMS = octave-gui
+   OCTAVE_VERSION_LINKS += octave-gui-$(version)$(EXEEXT)
+ endif
+ 
+diff --git a/src/main.in.cc b/src/main.in.cc
+--- a/src/main.in.cc
++++ b/src/main.in.cc
+@@ -46,6 +46,10 @@
+ #define OCTAVE_VERSION %OCTAVE_VERSION%
+ #endif
+ 
++#ifndef OCTAVE_ARCHLIBDIR
++#define OCTAVE_ARCHLIBDIR %OCTAVE_ARCHLIBDIR%
++#endif
++
+ #ifndef OCTAVE_BINDIR
+ #define OCTAVE_BINDIR %OCTAVE_BINDIR%
+ #endif
+@@ -439,6 +443,20 @@
+   return obd.empty () ? subst_octave_home (std::string (OCTAVE_BINDIR)) : obd;
+ }
+ 
++static std::string
++get_octave_archlibdir (void)
++{
++  // Accept value from the environment literally, but substitute
++  // OCTAVE_HOME in the configuration value OCTAVE_ARCHLIBDIR in case
++  // Octave has been relocated to some installation directory other than
++  // the one originally configured.
++
++  std::string dir = octave_getenv ("OCTAVE_ARCHLIBDIR");
++
++  return dir.empty ()
++    ? subst_octave_home (std::string (OCTAVE_ARCHLIBDIR)) : dir;
++}
++
+ // Adapted from libtool wrapper.
+ #if defined (__WIN32__) && ! defined (__CYGWIN__)
+ 
+@@ -593,6 +611,7 @@
+   bool gui_libs = false;
+ 
+   std::string octave_bindir = get_octave_bindir ();
++  std::string octave_archlibdir = get_octave_archlibdir ();
+ 
+   std::string file
+     = octave_bindir + dir_sep_char + "octave-cli-" OCTAVE_VERSION;;
+@@ -609,12 +628,15 @@
+         {
+           start_gui = true;
+           gui_libs = true;
+-          file = octave_bindir + dir_sep_char;
+-          #if defined (HAVE_OCTAVE_GUI)
+-            file += "octave-gui-" OCTAVE_VERSION;
+-          #else
+-            file += "octave-cli-" OCTAVE_VERSION;
+-          #endif
++#if defined (HAVE_OCTAVE_GUI)
++          // The Octave version number is already embedded in the
++          // octave_archlibdir directory name so we don't need to
++          // append it to the octave-gui file name.
++
++          file = octave_archlibdir + dir_sep_char + "octave-gui";
++#else
++          file = octave_bindir + dir_sep_char + "octave-cli-" OCTAVE_VERSION;
++#endif
+           new_argv[k++] = argv[i];
+         }
+       else if (! strcmp (argv[i], "--no-gui-libs"))
+