-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-ptexlive-binaries
executable file
·288 lines (251 loc) · 6.67 KB
/
build-ptexlive-binaries
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
#!/usr/bin/env bash
#
# Changelog
# 2012-11-07 update from HK fro pmpost and fixes for current svn sources
# 2013-01-06 move patches to quilt, include reautoconf patch so that
# call to reautoconf is not necessary anymore
# 2014-05-06 remove most stuff for other packages, only pmpost and upmpost
#
# on Debian, needs:
# libx11-dev, libxaw7-dev, libfontconfig1-dev, bison, flex
# automake autoconf zip
# maybe gettext ???
set -e
DO_APPLE=0
DO_NOX=0
DO_NOPREP=0
DO_MAINT=0
while [ "${1+defined}" ]; do
case "$1" in
"--macosx") DO_APPLE=1;;
"--nox") DO_NOX=1;;
"--noprep") DO_NOPREP=1;;
"--maintainer") DO_MAINT=1;;
*) echo "unsupported argument $1, exit."; exit 1 ;;
esac
shift
done
#
# the place where you have already the sources, or you want to place them!
SOURCE=${BUILD_SOURCE:-/tmp/build-place/source}
#
TL_INSTALL_DEST=${TL_INSTALL_DEST:-$SOURCE/inst}
unset TL_WORKDIR
unset TL_CONFIGURE
#
# where the zip of the binaries are placed
TARGET=${BUILD_TARGET:-/tmp}
#
# location of the patches
PATCHES=${BUILD_PATCHES:-`pwd`}
#
# verbose rsync
VERBOSE=${BUILD_VERBOSE:-}
#
# don't run rsync
NORSYNC=${BUILD_NORSYNC:-0}
#
# make flags
MAKEFLAGS=${BUILD_MAKEFLAGS:-}
# auto detect gpatch and gmake (for non-Linux system)
PATCH=patch
gpatch --version > /dev/null 2>&1 && PATCH=gpatch ||:
MAKE=make
gmake --version > /dev/null 2>&1 && MAKE=gmake ||:
if [ $DO_APPLE == 1 ] ; then
#
# set build arch
U_ARCH=${BUILD_ARCH:-x86_64}
U_RELEASE=`uname -r`
case $U_ARCH in
x86_64) # compile 10.6+ binaries on OS X 10.9
MACOSX_DEPLOYMENT_TARGET='10.6'
U_SDK=/Xcode4/SDKs/MacOSX${MACOSX_DEPLOYMENT_TARGET}.sdk
CC=/Xcode4/usr/bin/gcc-4.2
CXX=/Xcode4/usr/bin/g++-4.2
;;
i686|ppc) # cross-compile 10.5+ binaries on OS X 10.9
MACOSX_DEPLOYMENT_TARGET='10.5'
U_SDK=/Xcode3/SDKs/MacOSX${MACOSX_DEPLOYMENT_TARGET}.sdk
CC=/Xcode3/usr/bin/gcc-4.2
CXX=/Xcode3/usr/bin/g++-4.2
;;
*)
exit 1
;;
esac
CFLAGS="-O2 -isysroot ${U_SDK} -arch ${U_ARCH} -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}"
LDFLAGS="-isysroot ${U_SDK} -Wl,-syslibroot,${U_SDK} -arch ${U_ARCH} -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}"
CXXFLAGS="${CFLAGS}"
export MACOSX_DEPLOYMENT_TARGET CC CXX CFLAGS CXXFLAGS LDFLAGS
cat<<EOF
MACOSX_DEPLOYMENT_TARGET: $MACOSX_DEPLOYMENT_TARGET
CC: $CC
CXX: $CXX
CFLAGS: $CFLAGS
CXXFLAGS: $CXXFLAGS
LDFLAGS: $LDFLAGS
EOF
sleep 5
fi
if [ $DO_NOPREP = 0 ] ; then
# get current TL sources
if [ "$NORSYNC" != "1" ] ; then
mkdir -p $SOURCE
echo "fetching/updating the sources of TL, that may take some time! ... "
rsync -az $VERBOSE --delete --exclude=.svn tug.org::tldevsrc/Build/source/ $SOURCE
fi
cd $SOURCE
# pxdvi
# DISABLE for now, as patches are outdated
# echo "creating pxdvi folder"
# cp -pR texk/xdvik texk/pxdvik
echo "applying patches"
if which quilt >/dev/null ; then
if [ $DO_MAINT = 1 ] ; then
export QUILT_PATCHES="$PATCHES/patches"
while [ $(basename `quilt next`) != "reautoconf-stuff" ] ; do
quilt push
done
tempdir=$(mktemp -d)
echo "Copying source for reautoconf diff"
cp -a "$SOURCE" $tempdir/source-reautoconf
cd $tempdir/source-reautoconf
echo "Running reautoconf"
TL_AUTOMAKE=automake-1.14 TL_ACLOCAL=aclocal-1.14 ./reautoconf
echo "Updating reautoconf-stuff patch"
diff -urN -x 'autom4te.cache' "$SOURCE" $tempdir/source-reautoconf > $PATCHES/patches/reautoconf-stuff
cd "$SOURCE"
rm -rf $tempdir
echo "Pushing new changes ... please verify it worked!"
quilt push
exit $?
# update the reautoconf patch!
else
QUILT_PATCHES="$PATCHES/patches" quilt push -a
fi
else
if [ $DO_MAINT = 1 ] ; then
echo "Cannot work without quilt in maintainer mode, exiting here."
echo "Please clean up yourself."
exit 1
fi
cat "$PATCHES/patches/series" | while read p r ; do
echo $p | grep '^#' >/dev/null || \
$PATCH -p1 $r < "$PATCHES/patches/$p"
done
fi
#echo "running reautoconf"
#TL_AUTOMAKE=automake-1.13 TL_ACLOCAL=aclocal-1.13 ./reautoconf
fi # of $DO_NOPREP = 0
#
TL_CONFIGURE_ARGS="-C \
--disable-all-pkgs \
--enable-texlive \
--disable-linked-scripts \
--enable-web2c \
--disable-tex \
--disable-etex \
--disable-ptex \
--disable-eptex \
--disable-uptex \
--disable-euptex \
--disable-aleph \
--disable-pdftex \
--disable-luatex \
--disable-luajittex \
--disable-mp \
--disable-xetex \
--disable-web-progs \
--disable-mf-nowin \
--disable-mf \
--disable-omfonts \
--enable-pmp \
--enable-upmp \
--enable-dvipdfm-x \
"
#TL_CONFIGURE_ARGS=" \
# -C \
# --enable-texlive \
# --disable-all-pkgs \
# --disable-xdvipdfmx \
# --disable-xetex \
# --enable-ptex \
# --enable-eptex \
# --enable-uptex \
# --enable-euptex \
# --enable-omfonts \
# --enable-pmp \
# --enable-upmp \
# --enable-makejvf \
# --enable-dvipdfmx \
# --enable-dvipdfm-x \
# --enable-dvipsk \
# --enable-web2c \
# --enable-mendexk \
# "
if [ $DO_NOX = 1 ] ; then
TL_CONFIGURE_ARGS="$TL_CONFIGURE_ARGS \
--without-mf-x-toolkit \
--without-x"
# DISABLE for now, as there are no updated patches
# else
# TL_CONFIGURE_ARGS="$TL_CONFIGURE_ARGS
# --enable-pxdvik"
fi
if [ $DO_APPLE == 1 ] ; then
TL_CONFIGURE_ARGS=" \
--host=${U_ARCH}-apple-darwin${U_RELEASE} \
--build=x86_64-apple-darwin${U_RELEASE} \
$TL_CONFIGURE_ARGS"
fi
TL_MAKE_FLAGS=$MAKEFLAGS
export TL_CONFIGURE_ARGS TL_MAKE_FLAGS
# in case we haven't prepared the sources, make sure we are really there
cd $SOURCE
TL_MAKE=$MAKE ./Build
EXT=
case `uname` in
*CYGWIN*|*cygwin*) EXT='*' ;;
*) EXT= ;;
esac
cd $TL_INSTALL_DEST/bin
arch=`/bin/ls`
# dvips: Fix a pTeX-extension bug in bbox.c (r31350).
# cf. http://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=1070
# pTeX: Fix a potential bug in ptexenc (r30905).
# e-pTeX: Update to e-pTeX 130605 (r30897).
# cf. http://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=1024
# disabled for now, until someone updates the patches
# */pxdvi$EXT \
# */pxdvi-xaw$EXT \
#zip -r $TARGET/binaries.zip \
# */afm2tfm$EXT \
# */dvi2tty$EXT \
# */dvipdfmx$EXT \
# */dvips$EXT \
# */eptex$EXT \
# */euptex$EXT \
# */makejvf$EXT \
# */mendex$EXT \
# */pbibtex$EXT \
# */pdvitype$EXT \
# */pmpost$EXT \
# */ppltotf$EXT \
# */ptex$EXT \
# */ptftopl$EXT \
# */upbibtex$EXT \
# */updvitype$EXT \
# */upmpost$EXT \
# */uppltotf$EXT \
# */uptex$EXT \
# */uptftopl$EXT \
# */wovp2ovf$EXT \
zip -r $TARGET/binaries.zip \
*/dvipdfmx*$EXT \
*/pmpost$EXT \
*/upmpost$EXT \
echo ""
echo "Please send $TARGET/binaries.zip to Preining Norbert!"
echo ""
echo "Finished."