From 11ef5d37a8d2da133c3fbd273af5077a31c4bc8f Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 21 May 2014 05:59:03 +0100 Subject: [PATCH] Update scripts --- data/macos/build-deps.sh | 206 ++++++++++++++++++++++++--------------- data/macos/env-vars.sh | 8 +- 2 files changed, 131 insertions(+), 83 deletions(-) diff --git a/data/macos/build-deps.sh b/data/macos/build-deps.sh index b8115bf3f..577ec5890 100755 --- a/data/macos/build-deps.sh +++ b/data/macos/build-deps.sh @@ -1,20 +1,33 @@ #!/bin/bash +# ------------------------------------------------------------------------------------ +# stop on error + set -e +# ------------------------------------------------------------------------------------ +# cd to correct path + if [ -f Makefile ]; then cd data/macos fi -export MACOS=true -export CC=gcc-4.2 -export CXX=g++-4.2 -export PATH=/opt/kxstudio/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin -export PKG_CONFIG_PATH=/opt/kxstudio/lib/pkgconfig +# ------------------------------------------------------------------------------------ +# function to build base libs + +build_base() +{ -export CFLAGS="-O2 -mtune=generic -msse -msse2 -m64 -fPIC -DPIC" +export CC=gcc +export CXX=g++ + +export CFLAGS="-O2 -mtune=generic -msse -msse2 -m$ARCH -fPIC -DPIC" export CXXFLAGS=$CFLAGS +export PREFIX=/opt/kxstudio$ARCH +export PATH=$PREFIX/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin +export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig + # ------------------------------------------------------------------------------------ # pkgconfig @@ -23,11 +36,13 @@ curl -O http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz tar -xf pkg-config-0.28.tar.gz fi -if [ ! -f pkg-config-0.28/Makefile ]; then -cd pkg-config-0.28 -./configure --enable-indirect-deps --with-internal-glib --with-pc-path=$PKG_CONFIG_PATH --prefix=/opt/kxstudio +if [ ! -f pkg-config-0.28_$ARCH/build-done ]; then +cp -r pkg-config-0.28 pkg-config-0.28_$ARCH +cd pkg-config-0.28_$ARCH +./configure --enable-indirect-deps --with-internal-glib --with-pc-path=$PKG_CONFIG_PATH --prefix=$PREFIX make sudo make install +touch build-done cd .. fi @@ -39,11 +54,13 @@ curl -O http://zlib.net/zlib-1.2.8.tar.gz tar -xf zlib-1.2.8.tar.gz fi -if [ ! -f zlib-1.2.8/zlib.pc ]; then -cd zlib-1.2.8 -./configure --static --prefix=/opt/kxstudio +if [ ! -f zlib-1.2.8_$ARCH/build-done ]; then +cp -r zlib-1.2.8 zlib-1.2.8_$ARCH +cd zlib-1.2.8_$ARCH +./configure --static --prefix=$PREFIX make sudo make install +touch build-done cd .. fi @@ -55,11 +72,13 @@ curl -L http://download.sourceforge.net/liblo/liblo-0.28.tar.gz -o liblo-0.28.ta tar -xf liblo-0.28.tar.gz fi -if [ ! -f liblo-0.28/liblo.pc ]; then -cd liblo-0.28 -./configure --enable-static --disable-shared --prefix=/opt/kxstudio +if [ ! -f liblo-0.28_$ARCH/build-done ]; then +cp -r liblo-0.28 liblo-0.28_$ARCH +cd liblo-0.28_$ARCH +./configure --enable-static --disable-shared --prefix=$PREFIX make sudo make install +touch build-done cd .. fi @@ -71,55 +90,58 @@ curl -O http://www.msweet.org/files/project3/mxml-2.8.tar.gz tar -xf mxml-2.8.tar.gz fi -if [ ! -f mxml-2.8/mxml.pc ]; then -cd mxml-2.8 -./configure --enable-static --disable-shared --prefix=/opt/kxstudio +if [ ! -f mxml-2.8_$ARCH/build-done ]; then +cp -r mxml-2.8 mxml-2.8_$ARCH +cd mxml-2.8_$ARCH +./configure --enable-static --disable-shared --prefix=$PREFIX make -sudo cp *.a /opt/kxstudio/lib/ -sudo cp *.pc /opt/kxstudio/lib/pkgconfig/ -sudo cp mxml.h /opt/kxstudio/include/ +sudo cp *.a $PREFIX/lib/ +sudo cp *.pc $PREFIX/lib/pkgconfig/ +sudo cp mxml.h $PREFIX/include/ +touch build-done cd .. fi # ------------------------------------------------------------------------------------ -# fltk +# fftw3 -if [ ! -d fltk-1.3.2 ]; then -curl -O http://fltk.org/pub/fltk/1.3.2/fltk-1.3.2-source.tar.gz -tar -xf fltk-1.3.2-source.tar.gz +if [ ! -d fftw-3.3.4 ]; then +curl -O http://www.fftw.org/fftw-3.3.4.tar.gz +tar -xf fftw-3.3.4.tar.gz fi -if [ ! -f fltk-1.3.2/fltk-config ]; then -cd fltk-1.3.2 -./configure --enable-static --enable-localjpeg --enable-localpng --enable-localzlib \ - --disable-shared --disable-x11 --disable-cairoext --disable-cairo --disable-gl --prefix=/opt/kxstudio +if [ ! -f fftw-3.3.4_$ARCH/build-done ]; then +export CFLAGS="-O2 -mtune=generic -msse -msse2 -ffast-math -mfpmath=sse -m$ARCH -fPIC -DPIC" +export CXXFLAGS=$CFLAGS +cp -r fftw-3.3.4 fftw-3.3.4_$ARCH +cd fftw-3.3.4_$ARCH +./configure --enable-static --enable-sse2 --disable-shared --disable-debug --prefix=$PREFIX +make +sudo make install +make clean +./configure --enable-static --enable-sse --enable-sse2 --enable-single --disable-shared --disable-debug --prefix=$PREFIX make sudo make install +make clean +touch build-done cd .. fi +# TODO - add qt (for 32bit and 64bit) + +} + # ------------------------------------------------------------------------------------ -# qt5 +# build base libs -if [ ! -d qtbase5-mac10.6 ]; then -/opt/local/bin/git clone git://github.com/falkTX/qtbase5-mac10.6 --depth 1 -fi +export $ARCH=32 +build_base -if [ ! -f qtbase5-mac10.6/bin/moc ]; then -cd qtbase5-mac10.6 -export QMAKESPEC=macx-g++42 -./configure -release -shared -opensource -confirm-license -force-pkg-config \ - -prefix /opt/kxstudio -plugindir /opt/kxstudio/lib/qt5/plugins -headerdir /opt/kxstudio/include/qt5 \ - -qt-freetype -qt-libjpeg -qt-libpng -qt-pcre -qt-sql-sqlite -qt-zlib -opengl no -no-c++11 -no-framework -qpa cocoa \ - -no-directfb -no-eglfs -no-kms -no-linuxfb -no-mtdev -no-xcb -no-xcb-xlib \ - -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 -no-neon -no-mips_dsp -no-mips_dspr2 \ - -no-cups -no-dbus -no-fontconfig -no-harfbuzz -no-iconv -no-icu -no-gif -no-glib -no-nis -no-openssl -no-pch -no-sql-ibase -no-sql-odbc \ - -no-audio-backend -no-javascript-jit -no-qml-debug -no-separate-debug-info \ - -no-compile-examples -nomake examples -nomake tests -make libs -make tools -make -j 2 -sudo make install -cd .. -fi +export $ARCH=64 +build_base + +# TODO +exit 0 # ------------------------------------------------------------------------------------ # python @@ -137,6 +159,21 @@ sudo make install cd .. fi +# ------------------------------------------------------------------------------------ +# cxfreeze + +if [ ! -d cx_Freeze-4.3.3 ]; then +curl -L http://download.sourceforge.net/cx-freeze/cx_Freeze-4.3.3.tar.gz -o cx_Freeze-4.3.3.tar.gz +tar -xf cx_Freeze-4.3.3.tar.gz +fi + +if [ ! -d cx_Freeze-4.3.3/build ]; then +cd cx_Freeze-4.3.3 +python3 setup.py build +sudo python3 setup.py install --prefix=/opt/kxstudio +cd .. +fi + # ------------------------------------------------------------------------------------ # sip @@ -154,57 +191,68 @@ cd .. fi # ------------------------------------------------------------------------------------ -# pyqt5 +# switch to clang for Qt -if [ ! -d PyQt-gpl-5.2.1 ]; then -curl -L http://download.sourceforge.net/pyqt/PyQt-gpl-5.2.1.tar.gz -o PyQt-gpl-5.2.1.tar.gz -tar -xf PyQt-gpl-5.2.1.tar.gz +export CC=clang +export CXX=clang + +# ------------------------------------------------------------------------------------ +# qt5-base + +if [ ! -d qtbase5-mac10.6 ]; then +/opt/local/bin/git clone git://github.com/falkTX/qtbase5-mac10.6 --depth 1 fi -if [ ! -f PyQt-gpl-5.2.1/Makefile ]; then -cd PyQt-gpl-5.2.1 -python3 configure.py --confirm-license -make +if [ ! -f qtbase5-mac10.6/bin/moc ]; then +cd qtbase5-mac10.6 +export QMAKESPEC=macx-g++42 +./configure -release -shared -opensource -confirm-license -force-pkg-config \ + -prefix /opt/kxstudio -plugindir /opt/kxstudio/lib/qt5/plugins -headerdir /opt/kxstudio/include/qt5 \ + -qt-freetype -qt-libjpeg -qt-libpng -qt-pcre -qt-sql-sqlite -qt-zlib -no-framework -opengl desktop -qpa cocoa \ + -no-directfb -no-eglfs -no-kms -no-linuxfb -no-mtdev -no-xcb -no-xcb-xlib \ + -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 -no-neon -no-mips_dsp -no-mips_dspr2 \ + -no-cups -no-dbus -no-fontconfig -no-harfbuzz -no-iconv -no-icu -no-gif -no-glib -no-nis -no-openssl -no-pch -no-sql-ibase -no-sql-odbc \ + -no-audio-backend -no-javascript-jit -no-qml-debug -no-separate-debug-info \ + -no-compile-examples -nomake examples -nomake tests -make libs -make tools +make -j 2 sudo make install cd .. fi # ------------------------------------------------------------------------------------ -# cxfreeze +# qt5-svg -if [ ! -d cx_Freeze-4.3.3 ]; then -curl -L http://download.sourceforge.net/cx-freeze/cx_Freeze-4.3.3.tar.gz -o cx_Freeze-4.3.3.tar.gz -tar -xf cx_Freeze-4.3.3.tar.gz +if [ ! -d qtsvg-opensource-src-5.3.0 ]; then +curl -O http://download.qt-project.org/official_releases/qt/5.3/5.3.0/submodules/qtsvg-opensource-src-5.3.0.tar.gz fi -if [ ! -d cx_Freeze-4.3.3/build ]; then -cd cx_Freeze-4.3.3 -python3 setup.py build -sudo python3 setup.py install --prefix=/opt/kxstudio +if [ ! -f qtsvg-opensource-src-5.3.0/xx ]; then +cd qtsvg-opensource-src-5.3.0 +exit 1 +make -j 2 +sudo make install cd .. fi # ------------------------------------------------------------------------------------ -# fftw3 +# switch back to gcc -if [ ! -d fftw-3.3.4 ]; then -curl -O http://www.fftw.org/fftw-3.3.4.tar.gz -tar -xf fftw-3.3.4.tar.gz +export CC=gcc-4.2 +export CXX=g++-4.2 + +# ------------------------------------------------------------------------------------ +# pyqt5 + +if [ ! -d PyQt-gpl-5.2.1 ]; then +curl -L http://download.sourceforge.net/pyqt/PyQt-gpl-5.2.1.tar.gz -o PyQt-gpl-5.2.1.tar.gz +tar -xf PyQt-gpl-5.2.1.tar.gz fi -if [ ! -f fftw-3.3.4/build-done ]; then -export CFLAGS="-O2 -mtune=generic -msse -msse2 -ffast-math -mfpmath=sse -m64 -fPIC -DPIC" -export CXXFLAGS=$CFLAGS -cd fftw-3.3.4 -./configure --enable-static --enable-sse2 --disable-shared --disable-debug --prefix=/opt/kxstudio -make -sudo make install -make clean -./configure --enable-static --enable-sse --enable-sse2 --enable-single --disable-shared --disable-debug --prefix=/opt/kxstudio +if [ ! -f PyQt-gpl-5.2.1/Makefile ]; then +cd PyQt-gpl-5.2.1 +python3 configure.py --confirm-license make sudo make install -make clean -touch build-done cd .. fi diff --git a/data/macos/env-vars.sh b/data/macos/env-vars.sh index 8cc2f7b92..fbd2e6574 100755 --- a/data/macos/env-vars.sh +++ b/data/macos/env-vars.sh @@ -1,7 +1,7 @@ #!/bin/bash export MACOS="true" -export CC=gcc-4.2 -export CXX=g++-4.2 -export PATH=/opt/kxstudio/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin -export PKG_CONFIG_PATH=/opt/kxstudio/lib/pkgconfig +export CC=clang +export CXX=clang++ +export PATH=/opt/kxstudio64/bin:/opt/kxstudio/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin +export PKG_CONFIG_PATH=/opt/kxstudio64/lib/pkgconfig:/opt/kxstudio/lib/pkgconfig