Mercurial > mxe-octave
annotate mk-dist @ 3255:a3df5e820bcd
brackets missed in 4c8eca3ca2ba
author | Markus Bergholz <markuman+brokeit@gmail.com> |
---|---|
date | Thu, 26 Sep 2013 20:22:36 +0000 |
parents | 100e618349f7 |
children | e7cb2340feff |
rev | line source |
---|---|
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
1 #! /bin/bash |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
2 |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
3 set -e |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
4 |
2945 | 5 jobs=9 |
6 | |
2957 | 7 OCTAVE_TARGET=octave |
2987
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
8 |
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
9 strip=yes |
2992
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
10 installer=no |
2945 | 11 while [ $# -gt 0 ]; do |
12 case "$1" in | |
13 --jobs) | |
14 shift | |
15 if [ $# -gt 0 ]; then | |
16 jobs=$1 | |
17 shift | |
18 else | |
19 echo "mk-dist: expecting argument for --jobs option" 1>&2 | |
20 exit 1 | |
21 fi | |
22 ;; | |
2957 | 23 --stable) |
24 OCTAVE_TARGET=stable-octave | |
25 shift | |
26 ;; | |
2987
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
27 --no-strip) |
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
28 strip=no |
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
29 shift |
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
30 ;; |
2992
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
31 --installer) |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
32 installer=yes |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
33 echo "making installer" |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
34 shift |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
35 ;; |
2945 | 36 *) |
37 echo "mk-dist: unrecognized option: $1" 1>&2 | |
38 exit 1 | |
39 ;; | |
40 esac | |
41 done | |
42 | |
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
43 TOPDIR=$(pwd) |
2945 | 44 PATH=$TOPDIR/usr/bin:$PATH |
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
45 TARGET=i686-pc-mingw32 |
3012
100e618349f7
Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents:
3010
diff
changeset
|
46 PREFIX=/usr/$TARGET |
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
47 STRIP=$TARGET-strip |
2962
486c081fd0b5
mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents:
2958
diff
changeset
|
48 DATE=$(date +%Y-%m-%d-%H-%M) |
486c081fd0b5
mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents:
2958
diff
changeset
|
49 OCTAVE_DIST_DIR=$TOPDIR/dist/$OCTAVE_TARGET-$DATE |
2992
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
50 INSTALLER_PKG= |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
51 |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
52 if [ $installer = "yes" ]; then |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
53 echo "Adding installer to build dependancies" |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
54 INSTALLER_PKG="nsis" |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
55 fi |
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
56 |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
57 echo "deleting previous dist directory..." |
2962
486c081fd0b5
mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents:
2958
diff
changeset
|
58 rm -rf $TOPDIR/dist |
486c081fd0b5
mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents:
2958
diff
changeset
|
59 mkdir -p $OCTAVE_DIST_DIR |
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
60 |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
61 echo "building octave and dependencies..." |
2992
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
62 make $OCTAVE_TARGET $INSTALLER_PKG msys-base native-gcc native-binutils octave-forge-packages npp JOBS=$jobs |
2945 | 63 |
2956 | 64 echo "generating lists of files to exclude..." |
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
65 |
2956 | 66 echo " native files..." |
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
67 cat > $TOPDIR/excluded-native-files << EOF |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
68 ./$TARGET |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
69 ./bin/$TARGET-*.exe |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
70 EOF |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
71 |
2956 | 72 echo " gcc cross compiler files..." |
3012
100e618349f7
Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents:
3010
diff
changeset
|
73 cd $TOPDIR/cross-tools/$TOPDIR/$PREFIX |
2956 | 74 find . -type f -o -type l | sed "s,./,," > $TOPDIR/excluded-gcc-files |
75 | |
76 echo "copying files..." | |
77 | |
78 echo " octave and dependencies..." | |
3012
100e618349f7
Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents:
3010
diff
changeset
|
79 cd $TOPDIR/$PREFIX |
2962
486c081fd0b5
mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents:
2958
diff
changeset
|
80 tar -c -h -X $TOPDIR/excluded-gcc-files -f - . | ( cd $OCTAVE_DIST_DIR ; tar xpf - ) |
486c081fd0b5
mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents:
2958
diff
changeset
|
81 cp $TOPDIR/build_packages.m $OCTAVE_DIST_DIR/src |
2957 | 82 |
2965 | 83 echo " octaverc file..." |
84 cp $TOPDIR/octaverc $OCTAVE_DIST_DIR/share/octave/site/m/startup/octaverc | |
85 | |
2956 | 86 echo " native tools..." |
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
87 cd $TOPDIR/native-tools/usr |
2962
486c081fd0b5
mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents:
2958
diff
changeset
|
88 tar -c -h -X $TOPDIR/excluded-native-files -f - . | ( cd $OCTAVE_DIST_DIR ; tar xpf - ) |
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
89 |
2956 | 90 echo " libgcc_s_dw2-1.dll to bin directory" |
2962
486c081fd0b5
mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents:
2958
diff
changeset
|
91 cd $OCTAVE_DIST_DIR |
2956 | 92 cp lib/gcc/i686-pc-mingw32/libgcc_s_dw2-1.dll bin |
93 | |
94 echo " msys base files..." | |
95 cd $TOPDIR/msys-base | |
2962
486c081fd0b5
mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents:
2958
diff
changeset
|
96 tar -c -h -f - . | ( cd $OCTAVE_DIST_DIR ; tar xpf - ) |
2956 | 97 |
2964 | 98 echo " notepad++..." |
99 cd $TOPDIR | |
100 tar -c -h -f - notepad++ | ( cd $OCTAVE_DIST_DIR ; tar xpf - ) | |
101 cp $TOPDIR/build_packages.m $OCTAVE_DIST_DIR/src | |
102 | |
2930 | 103 echo "making all files writable by user..." |
2962
486c081fd0b5
mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents:
2958
diff
changeset
|
104 chmod -R u+w $OCTAVE_DIST_DIR |
2930 | 105 |
2987
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
106 if [ $strip = "yes" ]; then |
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
107 echo "stripping files..." |
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
108 cd $OCTAVE_DIST_DIR |
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
109 for f in $(find . -name '*.dll' -o -name '*.exe'); do |
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
110 echo " $f" |
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
111 $STRIP $f |
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
112 done |
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
113 fi |
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
114 |
2956 | 115 #echo "creating tar file..." |
116 #cd $TOPDIR/dist | |
2962
486c081fd0b5
mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents:
2958
diff
changeset
|
117 #tar -c -j -f $OCTAVE_TARGET-$DATE.tar.bz2 $OCTAVE_TARGET-$DATE |
2956 | 118 |
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
119 cd $TOPDIR/dist |
2992
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
120 |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
121 if [ $installer = "yes" ]; then |
3010
8ac67219c241
Updates for nsis build and installer creation
John Donoghue <john.donoghue@ieee.org>
parents:
2992
diff
changeset
|
122 $SHELL ../makeinst-script.sh $OCTAVE_TARGET-$DATE |
2992
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
123 |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
124 echo "Generating installer ..." |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
125 $TOPDIR/usr/bin/$TARGET-makensis octave.nsi > /dev/null |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
126 |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
127 if [ -e Octave-Installer.exe ]; then |
3010
8ac67219c241
Updates for nsis build and installer creation
John Donoghue <john.donoghue@ieee.org>
parents:
2992
diff
changeset
|
128 echo "Installer created" |
2992
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
129 rm octave.nsi |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
130 fi |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
131 |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
132 else |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
133 echo "creating zip file..." |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
134 zip -q -9 -r $OCTAVE_TARGET-$DATE.zip $OCTAVE_TARGET-$DATE |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
135 fi |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
136 |