-
Notifications
You must be signed in to change notification settings - Fork 3
/
install-libs
executable file
·105 lines (95 loc) · 2.72 KB
/
install-libs
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
#!/bin/sh
. ./BUILDDEFS
# FIXME: Grab libs from system if we build dynamic, but don't build libs here!
set -ex
if [ ! -d "${WORKDIR}/libs-build" ]; then
mkdir -p "${WORKDIR}/libs-build"
fi
rm -rf "${WORKDIR}/linux-bundle-lib"
if [ "${KOBO_STATIC_LINUX}" = true ] ; then
AUTOTOOLS_EXTRA="--enable-static --disable-shared"
LIBPNG_FLAGS="--enable-png --disable-png-shared"
CMAKE_EXTRA="-DBUILD_SHARED_LIBS=OFF"
else
AUTOTOOLS_EXTRA="--disable-static --enable-shared"
LIBPNG_FLAGS="--enable-png --enable-png-shared"
CMAKE_EXTRA="-DBUILD_SHARED_LIBS=ON"
mkdir "${WORKDIR}/linux-bundle-lib"
fi
cd "${WORKDIR}/libs-build"
# SDL2
if pkg-config sdl2 --exists; then
echo "SDL2 already installed in the system!"
else
if [ ! -f "SDL2-${SDLRELEASE}.tar.gz" ]; then
curl -O ${SDLURL}
fi
tar -xzvf "SDL2-${SDLRELEASE}.tar.gz"
cd SDL2-${SDLRELEASE}
./configure --prefix=/usr ${AUTOTOOLS_EXTRA}
make
sudo make install
if [ ! "${KOBO_STATIC_LINUX}" = true ] ; then
cp -L build/.libs/libSDL2-*.so.0 "${WORKDIR}/linux-bundle-lib"
fi
cd ..
fi
# libPNG
if [ -f "/usr/include/png.h" ]; then
echo "libpng already installed in the system!"
else
if [ ! -f "libpng-${PNGRELEASE}.tar.xz" ]; then
curl -O ${PNGURL}
fi
tar -xf "libpng-${PNGRELEASE}.tar.xz"
cd libpng-${PNGRELEASE}
./configure --prefix=/usr ${AUTOTOOLS_EXTRA}
make
sudo make install
if [ ! "${KOBO_STATIC_LINUX}" = true ] ; then
cp -L build/.libs/libSDL2-*.so.0 "${WORKDIR}/linux-bundle-lib"
fi
cd ..
fi
# SDL2_image
if [ -f "/usr/include/SDL2/SDL_image.h" ]; then
echo "SDL2_image already installed in the system!"
else
if [ ! -f "SDL2_image-${IMGRELEASE}.tar.gz" ]; then
curl -O ${IMGURL}
fi
tar -xzvf "SDL2_image-${IMGRELEASE}.tar.gz"
cd SDL2_image-${IMGRELEASE}
./configure --prefix=/usr ${AUTOTOOLS_EXTRA} ${LIBPNG_FLAGS} --disable-bmp --disable-gif --disable-jpg --disable-jpg-shared --disable-lbm --disable-pcx --disable-pnm --disable-tga --disable-tif --disable-tif-shared --disable-xcf --disable-xpm --disable-xv --disable-webp --disable-webp-shared
make
sudo make install
if [ ! "${KOBO_STATIC_LINUX}" = true ] ; then
cp -L .libs/libSDL2_image-*.so.0 "${WORKDIR}/linux-bundle-lib"
fi
cd ..
fi
# Audiality 2
if pkg-config audiality2 --exists; then
echo "Audiality 2 already installed in the system!"
else
if [ ! -d "audiality2" ]; then
git clone https://github.com/olofson/audiality2.git
cd audiality2
else
cd audiality2
git checkout master
git pull
fi
git checkout v${A2RELEASE}
./configure static
cd build/static
make
sudo make install
if [ ! "${KOBO_STATIC_LINUX}" = true ] ; then
cp -L build/src/libaudiality2-*.so.0 "${WORKDIR}/linux-bundle-lib"
fi
cd ../..
fi
if [ ! "${KOBO_STATIC_LINUX}" = true ] ; then
strip "${WORKDIR}/linux-bundle-lib/*"
fi