Ignore:
Timestamp:
2014-08-11T02:02:24+02:00 (11 years ago)
Author:
donvip
Message:

[josm_nsis] see #josm5302 - prepare ground for 64-bit binaries

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/nsis/josm-setup-unix.sh

    r29984 r30580  
    66# apt-get install nsis
    77# replace the  /usr/share/nsis/Plugins/System.dll with the Version from the nsis .zip File
    8 # The one comming with the debian package is missing the Call:: Function
     8# The one coming with the debian package is missing the Call:: Function
    99# See also /usr/share/doc/nsis/README.Debian
    1010#
    1111# Then download launch4j from http://launch4j.sourceforge.net/
    12 # wget http://mesh.dl.sourceforge.net/sourceforge/launch4j/launch4j-3.0.0-pre2-linux.tgz
     12# wget http://softlayer-ams.dl.sourceforge.net/project/launch4j/launch4j-3/3.4/launch4j-3.4-linux.tgz
    1313# and unpack it to /usr/share/launch4j
    1414
     
    1616
    1717# trying to find launch4j
    18 if [ -s /cygdrive/c/Programme/Launch4j/launch4jc.exe ]; then
    19     # Windows under cygwin
    20     LAUNCH4J="/cygdrive/c/Programme/Launch4j/launch4jc.exe"
     18if [ -s "/cygdrive/c/Program Files (x86)/Launch4j/launch4jc.exe" ]; then
     19    # Windows under cygwin or MobaXterm
     20    LAUNCH4J="/cygdrive/c/Program Files (x86)/Launch4j/launch4jc.exe"
    2121elif [ -s /usr/share/launch4j/launch4j.jar ]; then
    2222    # as described above
     
    3333
    3434# trying to find makensis
    35 if [ -s /cygdrive/c/Programme/nsis/makensis.exe ]; then
    36     # Windows under cygwin
    37     MAKENSIS="/cygdrive/c/Programme/nsis/makensis.exe"
     35if [ -s "/cygdrive/c/Program Files (x86)/NSIS/makensis.exe" ]; then
     36    # Windows under cygwin or MobaXterm
     37    MAKENSIS="/cygdrive/c/Program Files (x86)/NSIS/makensis.exe"
    3838else
    3939    # UNIX like
     
    4848  export JOSM_FILE="/home/josm/www/download/josm-tested.jar"
    4949else
    50   svncorerevision=`svnversion ../core`
    51   svnpluginsrevision=`svnversion ../plugins`
    52   svnrevision="$svncorerevision-$svnpluginsrevision"
     50  svncorerevision=`svnversion -n ../core`
     51  #svnpluginsrevision=`svnversion -n ../plugins`
     52  #svnrevision="$svncorerevision-$svnpluginsrevision"
    5353
    54   export VERSION=custom-${svnrevision}
     54  #export VERSION=custom-${svnrevision}
     55  export VERSION=`echo ${svncorerevision} | sed -e 's/M//g' -e 's/S//g' -e 's/P//g'`
    5556  export JOSM_BUILD="yes"
    5657  export WEBKIT_DOWNLOAD="yes"
     
    5859fi
    5960
    60 echo "Creating Windows Installer for josm-$VERSION"
     61echo "Creating Windows Installers for josm-$VERSION"
    6162
    6263echo
     
    9697
    9798/bin/cp $JOSM_FILE josm-tested.jar
    98 echo
    99 echo "##################################################################"
    100 echo "### convert jar to exe with launch4j"
    101 # (an exe file makes attaching to file extensions a lot easier)
    102 # launch4j - http://launch4j.sourceforge.net/
    103 # delete old exe file first
    104 /bin/rm -f josm.exe
    105 $LAUNCH4J "launch4j.xml"
    10699
    107 if ! [ -s josm.exe ]; then
    108     echo "NO Josm File Created"
    109     exit -1
    110 fi
     100function build_exe {
    111101
    112 echo
    113 echo "##################################################################"
    114 echo "### create the josm-installer-${VERSION}.exe with makensis"
    115 # NSIS - http://nsis.sourceforge.net/Main_Page
    116 # apt-get install nsis
    117 $MAKENSIS -V2 -DVERSION=$VERSION josm.nsi
     102        export TARGET=$1        # josm / josm64. Used in file name of launcher and installer
     103        #export RTBITS=$2       # L4J "runtimeBits" (JVM architecture used by launcher)
     104        #export INIHEAP=$3      # L4J "initialHeapSize" (initial heap size in MB)
     105        #export MAXHEAP=$4      # L4J "maxHeapSize" (max heap size in MB)
     106       
     107        /bin/rm -f "launch4j_${TARGET}.xml"
     108        /bin/sed -e "s/%TARGET%/$1/" -e "s/%RTBITS%/$2/" -e "s/%INIHEAP%/$3/" -e "s/%MAXHEAP%/$4/" -e "s/%VERSION%/$VERSION/" "launch4j.xml" > "launch4j_${TARGET}.xml"
     109       
     110        echo
     111        echo "##################################################################"
     112        echo "### convert jar to ${TARGET}.exe with launch4j"
     113        # (an exe file makes attaching to file extensions a lot easier)
     114        # launch4j - http://launch4j.sourceforge.net/
     115        # delete old exe file first
     116        /bin/rm -f ${TARGET}.exe
     117        "$LAUNCH4J" "launch4j_${TARGET}.xml"
    118118
    119 # keep the intermediate file, for debugging
    120 /bin/rm josm-intermediate.exe 2>/dev/null >/dev/null
     119        if ! [ -s ${TARGET}.exe ]; then
     120                echo "NO ${TARGET}.exe File Created"
     121                exit -1
     122        fi
     123
     124        /bin/rm -f "launch4j_${TARGET}.xml"
     125
     126        echo
     127        echo "##################################################################"
     128        echo "### create the ${TARGET}-installer-${VERSION}.exe with makensis"
     129        # NSIS - http://nsis.sourceforge.net/Main_Page
     130        # apt-get install nsis
     131        "$MAKENSIS" -V2 -DVERSION=$VERSION -DDEST=$TARGET josm.nsi
     132
     133        # keep the intermediate file, for debugging
     134        /bin/rm -f ${TARGET}-intermediate.exe 2>/dev/null >/dev/null
     135        /bin/mv ${TARGET}.exe ${TARGET}-intermediate.exe 2>/dev/null >/dev/null
     136}
     137
     138build_exe "josm" "64\/32" 128 1024
     139build_exe "josm64"  "64" 256 2048
     140
    121141/bin/rm -f josm-tested.jar 2>/dev/null >/dev/null
    122 /bin/mv josm.exe josm-intermediate.exe 2>/dev/null >/dev/null
Note: See TracChangeset for help on using the changeset viewer.