3 # apt-get install build-essential autoconf libtool cmake libglib2.0-dev libgl1-mesa-dev
5 # ---------------------------------------------------------------------------------------------------------------------
10 # ---------------------------------------------------------------------------------------------------------------------
15 # ---------------------------------------------------------------------------------------------------------------------
20 # ---------------------------------------------------------------------------------------------------------------------
21 # function to remove old stuff
26 rm -rf ${TARGETDIR}/carla32
/ ${TARGETDIR}/carla64
/
42 # ---------------------------------------------------------------------------------------------------------------------
43 # function to build base libs
51 export PREFIX
=${TARGETDIR}/carla
${ARCH}
52 export PATH
=${PREFIX}/bin
:/usr
/bin
:/bin
:/usr
/sbin
:/sbin
:/usr
/local
/bin
53 export PKG_CONFIG_PATH
=${PREFIX}/lib
/pkgconfig
55 export CFLAGS
="-O3 -mtune=generic -msse -msse2 -mfpmath=sse -fvisibility=hidden -fdata-sections -ffunction-sections"
56 export CFLAGS
="${CFLAGS} -fPIC -DPIC -DNDEBUG -I${PREFIX}/include -m${ARCH}"
57 export CXXFLAGS
="${CFLAGS} -fvisibility-inlines-hidden"
59 export LDFLAGS
="-fdata-sections -ffunction-sections -Wl,--gc-sections -Wl,-O1 -Wl,--as-needed -Wl,--strip-all"
60 export LDFLAGS
="${LDFLAGS} -L${PREFIX}/lib -m${ARCH}"
62 # ---------------------------------------------------------------------------------------------------------------------
65 if [ ! -d pkg-config-
${PKG_CONFIG_VERSION} ]; then
66 aria2c https
://pkg-config.freedesktop.org
/releases
/pkg-config-
${PKG_CONFIG_VERSION}.
tar.gz
67 tar -xf pkg-config-
${PKG_CONFIG_VERSION}.
tar.gz
70 if [ ! -f pkg-config-
${PKG_CONFIG_VERSION}_
$ARCH/build-done
]; then
71 cp -r pkg-config-
${PKG_CONFIG_VERSION} pkg-config-
${PKG_CONFIG_VERSION}_
$ARCH
72 cd pkg-config-
${PKG_CONFIG_VERSION}_
$ARCH
73 .
/configure
--enable-indirect-deps --with-internal-glib --with-pc-path=$PKG_CONFIG_PATH --prefix=${PREFIX}
80 # ---------------------------------------------------------------------------------------------------------------------
83 if [ ! -d liblo-
${LIBLO_VERSION} ]; then
84 aria2c https
://download.sourceforge.net
/liblo
/liblo-
${LIBLO_VERSION}.
tar.gz
85 tar -xf liblo-
${LIBLO_VERSION}.
tar.gz
88 if [ ! -f liblo-
${LIBLO_VERSION}_
$ARCH/build-done
]; then
89 cp -r liblo-
${LIBLO_VERSION} liblo-
${LIBLO_VERSION}_
$ARCH
90 cd liblo-
${LIBLO_VERSION}_
$ARCH
91 .
/configure
--enable-static --disable-shared --prefix=${PREFIX} \
93 --disable-examples --disable-tools
100 # ---------------------------------------------------------------------------------------------------------------------
102 if [ x
"${ARCH}" = x
"32" ] && [ x
"${TARGET}" != x
"32" ]; then
106 # ---------------------------------------------------------------------------------------------------------------------
109 if [ ! -d qtbase-opensource-src-
${QT5_VERSION} ]; then
110 aria2c http
://download.qt.io
/archive
/qt
/${QT5_MVERSION}/${QT5_VERSION}/submodules/qtbase-opensource-src-${QT5_VERSION}.
tar.xz
111 tar xf qtbase-opensource-src-
${QT5_VERSION}.
tar.xz
114 if [ ! -f qtbase-opensource-src-
${QT5_VERSION}/build-done
]; then
115 cd qtbase-opensource-src-
${QT5_VERSION}
116 if [ ! -f configured
]; then
117 .
/configure
-release -strip -silent \
119 -no-sse3 -no-ssse3 -no-sse4.1
-no-sse4.2 \
120 -no-avx -no-avx2 -no-avx512 \
122 -opensource -confirm-license \
123 -optimize-size -optimized-qmake \
149 # ---------------------------------------------------------------------------------------------------------------------
152 if [ ! -d qtsvg-opensource-src-
${QT5_VERSION} ]; then
153 aria2c http
://download.qt.io
/archive
/qt
/${QT5_MVERSION}/${QT5_VERSION}/submodules/qtsvg-opensource-src-${QT5_VERSION}.
tar.xz
154 tar xf qtsvg-opensource-src-
${QT5_VERSION}.
tar.xz
157 if [ ! -f qtsvg-opensource-src-
${QT5_VERSION}/build-done
]; then
158 cd qtsvg-opensource-src-
${QT5_VERSION}
166 # ---------------------------------------------------------------------------------------------------------------------
169 if [ ! -d zlib-
${ZLIB_VERSION} ]; then
170 aria2c https
://github.com
/madler
/zlib
/archive
/v
${ZLIB_VERSION}.
tar.gz
171 tar -xf zlib-
${ZLIB_VERSION}.
tar.gz
174 if [ ! -f zlib-
${ZLIB_VERSION}/build-done
]; then
175 cd zlib-
${ZLIB_VERSION}
176 .
/configure
--static --prefix=${PREFIX}
183 # ---------------------------------------------------------------------------------------------------------------------
186 if [ ! -d file-
${FILE_VERSION} ]; then
187 wget
ftp://ftp.astron.com
/pub
/file
/file-
${FILE_VERSION}.
tar.gz
188 tar -xf file-
${FILE_VERSION}.
tar.gz
191 if [ ! -f file-
${FILE_VERSION}/build-done
]; then
192 cd file-
${FILE_VERSION}
193 .
/configure
--enable-static --disable-shared --prefix=${PREFIX}
200 # ---------------------------------------------------------------------------------------------------------------------
203 if [ ! -d libogg-
${LIBOGG_VERSION} ]; then
204 aria2c https
://ftp.osuosl.org
/pub
/xiph
/releases
/ogg
/libogg-
${LIBOGG_VERSION}.
tar.gz
205 tar -xf libogg-
${LIBOGG_VERSION}.
tar.gz
208 if [ ! -f libogg-
${LIBOGG_VERSION}/build-done
]; then
209 cd libogg-
${LIBOGG_VERSION}
210 .
/configure
--enable-static --disable-shared --prefix=${PREFIX}
217 # ---------------------------------------------------------------------------------------------------------------------
220 if [ ! -d libvorbis-
${LIBVORBIS_VERSION} ]; then
221 aria2c https
://ftp.osuosl.org
/pub
/xiph
/releases
/vorbis
/libvorbis-
${LIBVORBIS_VERSION}.
tar.gz
222 tar -xf libvorbis-
${LIBVORBIS_VERSION}.
tar.gz
225 if [ ! -f libvorbis-
${LIBVORBIS_VERSION}/build-done
]; then
226 cd libvorbis-
${LIBVORBIS_VERSION}
227 .
/configure
--enable-static --disable-shared --prefix=${PREFIX}
234 # ---------------------------------------------------------------------------------------------------------------------
237 if [ ! -d flac-
${FLAC_VERSION} ]; then
238 aria2c https
://ftp.osuosl.org
/pub
/xiph
/releases
/flac
/flac-
${FLAC_VERSION}.
tar.xz
239 tar -xf flac-
${FLAC_VERSION}.
tar.xz
242 if [ ! -f flac-
${FLAC_VERSION}/build-done
]; then
243 cd flac-
${FLAC_VERSION}
244 chmod +x configure install-sh
245 .
/configure
--enable-static --disable-shared --prefix=${PREFIX} \
253 # ---------------------------------------------------------------------------------------------------------------------
256 if [ ! -d libsndfile-
${LIBSNDFILE_VERSION} ]; then
257 wget http
://www.mega-nerd.com
/libsndfile
/files
/libsndfile-
${LIBSNDFILE_VERSION}.
tar.gz
258 tar -xf libsndfile-
${LIBSNDFILE_VERSION}.
tar.gz
261 if [ ! -f libsndfile-
${LIBSNDFILE_VERSION}/build-done
]; then
262 cd libsndfile-
${LIBSNDFILE_VERSION}
263 .
/configure
--enable-static --disable-shared --prefix=${PREFIX} \
264 --disable-full-suite --disable-alsa --disable-sqlite
271 # ---------------------------------------------------------------------------------------------------------------------
274 if [ ! -d ${PREFIX}/include
/glib-2.0
]; then
275 cp -r /usr
/include
/glib-2.0
${PREFIX}/include
/
278 if [ ! -f ${PREFIX}/lib
/pkgconfig
/glib-2.0.pc
]; then
279 if [ -f /usr
/lib
/x86_64-linux-gnu
/pkgconfig
/glib-2.0.pc
]; then
280 cp /usr
/lib
/x86_64-linux-gnu
/pkgconfig
/glib-2.0.pc
${PREFIX}/lib
/pkgconfig
/
281 cp /usr
/lib
/x86_64-linux-gnu
/pkgconfig
/gthread-2.0.pc
${PREFIX}/lib
/pkgconfig
/
282 cp /usr
/lib
/x86_64-linux-gnu
/pkgconfig
/libpcre.pc
${PREFIX}/lib
/pkgconfig
/
284 cp /usr
/lib
/pkgconfig
/glib-2.0.pc
${PREFIX}/lib
/pkgconfig
/
285 cp /usr
/lib
/pkgconfig
/gthread-2.0.pc
${PREFIX}/lib
/pkgconfig
/
289 # ---------------------------------------------------------------------------------------------------------------------
292 if [ ! -d fluidsynth-
${FLUIDSYNTH_VERSION} ]; then
293 aria2c https
://github.com
/FluidSynth
/fluidsynth
/archive
/v
${FLUIDSYNTH_VERSION}.
tar.gz
294 tar -xf fluidsynth-
${FLUIDSYNTH_VERSION}.
tar.gz
297 if [ ! -f fluidsynth-
${FLUIDSYNTH_VERSION}/build-done
]; then
298 cd fluidsynth-
${FLUIDSYNTH_VERSION}
299 if [ ! -f patched
]; then
300 patch -p1 -i ..
/..
/patches
/fluidsynth-skip-drivers-build.
patch
303 sed -i "s/3.0.2/2.8.0/" CMakeLists.txt
304 sed -i 's/_init_lib_suffix "64"/_init_lib_suffix ""/' CMakeLists.txt
305 cmake .
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=${PREFIX} -DBUILD_SHARED_LIBS=OFF \
306 -Denable-debug=OFF
-Denable-profiling=OFF
-Denable-ladspa=OFF
-Denable-fpe-check=OFF
-Denable-portaudio=OFF \
307 -Denable-trap-on-fpe=OFF
-Denable-aufile=OFF
-Denable-dbus=OFF
-Denable-ipv6=OFF
-Denable-jack=OFF \
308 -Denable-midishare=OFF
-Denable-oss=OFF
-Denable-pulseaudio=OFF
-Denable-readline=OFF
-Denable-ladcca=OFF \
309 -Denable-lash=OFF
-Denable-alsa=OFF
-Denable-coreaudio=OFF
-Denable-coremidi=OFF
-Denable-framework=OFF \
313 sed -i -e "s|-lfluidsynth|-lfluidsynth -lglib-2.0 -lgthread-2.0 -lsndfile -lFLAC -lvorbisenc -lvorbis -logg -pthread -lm|" ${PREFIX}/lib
/pkgconfig
/fluidsynth.pc
318 # ---------------------------------------------------------------------------------------------------------------------
321 if [ ! -d mxml-
${MXML_VERSION} ]; then
322 aria2c https
://github.com
/michaelrsweet
/mxml
/releases
/download
/v
${MXML_VERSION}/mxml-
${MXML_VERSION}.
tar.gz
323 tar -xf mxml-
${MXML_VERSION}.
tar.gz
326 if [ ! -f mxml-
${MXML_VERSION}/build-done
]; then
327 cd mxml-
${MXML_VERSION}
328 .
/configure
--disable-shared --prefix=$PREFIX
331 cp *.pc
$PREFIX/lib
/pkgconfig
/
332 cp mxml.h
$PREFIX/include
/
337 # ---------------------------------------------------------------------------------------------------------------------
338 # fftw3 (needs to be last as it modifies C[XX]FLAGS)
340 if [ ! -d fftw-
${FFTW3_VERSION} ]; then
341 aria2c http
://www.fftw.org
/fftw-
${FFTW3_VERSION}.
tar.gz
342 tar -xf fftw-
${FFTW3_VERSION}.
tar.gz
345 if [ ! -f fftw-
${FFTW3_VERSION}/build-done
]; then
346 export CFLAGS
="${CFLAGS} -ffast-math"
347 export CXXFLAGS
="${CXXFLAGS} -ffast-math"
348 cd fftw-
${FFTW3_VERSION}
349 .
/configure
--enable-static --disable-shared --prefix=${PREFIX} \
351 --disable-debug --disable-alloca --disable-fortran \
356 .
/configure
--enable-static --disable-shared --prefix=${PREFIX} \
357 --enable-sse2 --enable-sse --enable-single \
358 --disable-debug --disable-alloca --disable-fortran \
369 # ---------------------------------------------------------------------------------------------------------------------
376 if [ x
"${TARGET}" != x
"32" ]; then
381 # ---------------------------------------------------------------------------------------------------------------------