summaryrefslogtreecommitdiff
path: root/graphics/asymptote/build-scripts/build-asymptote.dos
blob: 943c7ca0a1ba7a1ae9dcedad2bf10b8c8e73b671 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/sh -x
GC=7.6.2

MACHINE=`uname -m`
if [ $MACHINE == i686 ]; then
BINDIR=i386-windows
else
BINDIR=x86_64-windows
fi
SHARED=~/shared/asy
MAKEFLAGS=-j8
export MAKEFLAGS
VERSION=$1
if [ -z $VERSION ]; then
VERSION=`grep AC_INIT configure.ac | cut -s -d[ -f3 | cut -s -d] -f1`
if [ -z $VERSION ]; then
echo Usage: $0 VERSION
exit
fi
else
echo Building asymptote-$VERSION
cd ~/
rm -rf asymptote-$VERSION
mkdir -p CTAN
rm -rf CTAN/asymptote-$VERSION
tar -zxf $SHARED/asymptote-$VERSION.src.tgz -C CTAN
tar -zxf $SHARED/asymptote-$VERSION.src.tgz
mkdir -p CTAN/asymptote-$VERSION/binaries/$BINDIR/texlive
cd asymptote-$VERSION
fi
BUILD=build-$VERSION
ln -sf ../gc-$GC.tar.gz .
ln -sf ../gc-$GC .
make -n MSDOS=1 >& /dev/null || ./configure --enable-gc=$GC --with-latex=/usr/local/share --with-context=/usr/local/share
rm -rf $BUILD
mkdir -p $BUILD
cp -a $HOME/dll/cygwin/*.dll $BUILD
chmod 0644 $BUILD/*.dll
cp -a $BUILD/*.dll ~/CTAN/asymptote-$VERSION/binaries/$BINDIR/
make MSDOS=1 DESTDIR="$BUILD/" docdir="$BUILD/"
test -f asy.list || make MSDOS=1 keywords DESTDIR="$BUILD/" docdir="$BUILD/"
make MSDOS=1 install-asy DESTDIR="$BUILD/" docdir="$BUILD/"
cp asy.ico README LICENSE* $BUILD
pushd $BUILD
mv usr/local/bin/* .
mv usr/local/share/asymptote/GUI .
rm -rf usr/local/share/asymptote/GUI
mv usr/local/share/asymptote/* .
cp $SHARED/asydoc/*.pdf .
rm -rf bin share doc usr
popd
echo \!define PRODUCT_VERSION \"$VERSION\" > AsymptoteInstallInfo.nsi
# generate uninstallation commands
ls -p1 $BUILD \
    | awk '{ if(index($0,"/")==length($0)) print "RMDir /r $INSTDIR\\" substr($0,0,length($0)-1); else print "Delete $INSTDIR\\" $0 }' \
	> AsymptoteUninstallList.nsi

if [ $MACHINE == i686 ]; then
sed asymptote.nsi -e 's/$PROGRAMFILES64/$PROGRAMFILES/g' > asymptote32.nsi
/cygdrive/c/Program\ Files\ \(x86\)/NSIS/makensis.exe asymptote32.nsi
SUFFIX=-i386_32
else
/cygdrive/c/Program\ Files\ \(x86\)/NSIS/makensis.exe asymptote.nsi
SUFFIX=
fi
cp -a --no-preserve=mode asymptote-$VERSION-setup.exe $SHARED/asymptote-$VERSION-setup$SUFFIX.exe
mv asymptote-$VERSION-setup.exe ~/asymptote-$VERSION-setup$SUFFIX.exe

cd ~/
rm -rf asymptote-${VERSION}TL || exit
cp -a asymptote-$VERSION asymptote-${VERSION}TL
sed asymptote-$VERSION/config.h -e 's/ASYMPTOTE_SYSDIR ".*"/ASYMPTOTE_SYSDIR ""/g' > asymptote-${VERSION}TL/config.h
#sed asymptote-$VERSION/configure.ac -e 's/\-std=c++11//g' > asymptote-${VERSION}TL/configure.ac
touch -r asymptote-$VERSION/config.h asymptote-${VERSION}TL/config.h
touch -r asymptote-$VERSION/configure.ac asymptote-${VERSION}TL/configure.ac
cd asymptote-${VERSION}TL
rm settings.o
rm -f doc/*.aux doc/*.log doc/*.dvi
make MSDOS=1 DESTDIR="$BUILD/"
make MSDOS=1 install-asy DESTDIR="$BUILD/"
mv $BUILD/usr/local/bin/asy.exe $BUILD
cp $BUILD/asy.exe ~/CTAN/asymptote-$VERSION/binaries/$BINDIR/texlive
cp -a configure.ac ~/CTAN/asymptote-$VERSION/
cp -a $SHARED/asydoc/* ~/CTAN/asymptote-$VERSION/doc
cd ~/CTAN/asymptote-$VERSION/binaries/$BINDIR
cp -a ../../README .
cd ~/CTAN
cp -a ~/asymptote/build-scripts/README-binaries asymptote-$VERSION/binaries/$BINDIR/texlive/README
SHAREDBIN=$SHARED/CTAN/asymptote-$VERSION
if [ $MACHINE == i686 ]; then
mkdir -p $SHAREDBIN
cp -a asymptote-$VERSION/binaries/$BINDIR $SHAREDBIN
else
cp -a $SHAREDBIN/i386-windows ~/CTAN/asymptote-$VERSION/binaries
fi
tar cfz asymptote-$VERSION-CTAN.tgz asymptote-$VERSION
cp -a --no-preserve=mode asymptote-$VERSION-CTAN.tgz $SHARED