-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-dep.sh
executable file
·99 lines (81 loc) · 2.38 KB
/
build-dep.sh
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
#!/bin/sh -e
WORK=`realpath $1` || true
PREFIX=`realpath $2` || true
PDIR=`realpath ./fgtest.py` || true
PDIR=`dirname $PDIR`
WHAT=$3
if [ -z "${PREFIX}" -o -z "${WORK}" -o -z "${PDIR}" ]
then
echo "Usage: $0 work/dir dest/prefix [sdl|py|gir|rst|all]"
echo "Please run this from the fgtestbed directory."
exit 1
fi
export CFLAGS="-g $CFLAGS"
export PATH=$PREFIX/bin:$PATH
if [ ! -d $WORK/pyopengl ]
then
echo "Cloning pyopengl repository"
bzr branch lp:pyopengl $WORK/pyopengl
fi
if [ ! -d $WORK/pgreloaded ]
then
echo "Cloning pygame2 repository"
hg clone https://code.google.com/p/pgreloaded $WORK/pgreloaded
fi
if [ ! -d $WORK/SDL ]
then
echo "Cloning SDL2 repository"
hg clone http://hg.libsdl.org/SDL $WORK/SDL
fi
if [ ! -d $WORK/SDL_image ]
then
echo "Cloning SDL_image repository"
hg clone http://hg.libsdl.org/SDL_image $WORK/SDL_image
fi
if [ ! -d $WORK/SDL_ttf ]
then
echo "Cloning SDL_ttf repository"
hg clone http://hg.libsdl.org/SDL_ttf $WORK/SDL_ttf
fi
if [ "sdl" = "$WHAT" -o "all" = "$WHAT" ]
then
[ -d $WORK/build-all ] && rm -r $WORK/build-all
mkdir -p $WORK/build-all/sdl $WORK/build-all/image $WORK/build-all/ttf
echo "Building and installing SDL2"
cd $WORK/build-all/sdl
$WORK/SDL/configure --prefix $PREFIX && make -j 4 install
echo "Building and installing SDL_image"
cd $WORK/build-all/image
$WORK/SDL_image/configure --prefix $PREFIX && make -j 4 install
echo "Building and installing SDL_ttf"
cd $WORK/build-all/ttf
$WORK/SDL_ttf/configure --prefix $PREFIX && make -j 4 install
fi
if [ "py" = "$WHAT" -o "all" = "$WHAT" ]
then
echo "Installing pyopengl"
cd $WORK/pyopengl
python3.2 setup.py install --prefix=$PREFIX
echo "Installing pygame2"
cd $WORK/pgreloaded
python3.2 setup.py install --prefix=$PREFIX
fi
if [ "gir" = "$WHAT" ]
then
echo "Compiling ft2 typelib"
g-ir-compiler -o $PDIR/lib/gir/freetype2-2.0.typelib $PDIR/lib/gir/freetype2-2.0.gir
fi
if [ "rst" = "$WHAT" ]
then
echo "Converting docs to HTML"
for WHAT in $PDIR/*.rst
do
rst2html $WHAT `echo $WHAT | sed -e s/rst\$/html/g`
done
fi
( echo "#!/bin/sh"
echo export PGLIBDIR=$PREFIX/lib
echo export PYTHONPATH=$PREFIX/lib/python3.2/site-packages:$PDIR/lib/python
echo export GI_TYPELIB_PATH=$PDIR/lib/gir
echo '"$@"' ) >$PDIR/run
chmod a+x $PDIR/run