diff --git a/cmake/build_mingw32.sh b/cmake/build_mingw32.sh index f485daf9a..3ee88930d 100755 --- a/cmake/build_mingw32.sh +++ b/cmake/build_mingw32.sh @@ -8,7 +8,7 @@ else CMAKE_OPTS="$CMAKE_OPTS -DLMMS_BUILD_MSYS=1" fi -export PATH=$PATH:$MINGW/bin +export PATH=$MINGW/bin:$PATH export CFLAGS="-march=pentium3 -mtune=generic -mpreferred-stack-boundary=5 -mfpmath=sse" export CXXFLAGS="$CFLAGS" diff --git a/cmake/build_mingw64.sh b/cmake/build_mingw64.sh index ceb850455..da66299c5 100755 --- a/cmake/build_mingw64.sh +++ b/cmake/build_mingw64.sh @@ -8,7 +8,7 @@ else CMAKE_OPTS="$CMAKE_OPTS -DLMMS_BUILD_MSYS=1" fi -export PATH=$PATH:$MINGW/bin +export PATH=$MINGW/bin:$PATH if [ "$1" = "-qt5" ]; then QT5=True diff --git a/cmake/msys/fetch_ppa.sh b/cmake/msys/fetch_ppa.sh index de80e4010..17372f770 100644 --- a/cmake/msys/fetch_ppa.sh +++ b/cmake/msys/fetch_ppa.sh @@ -17,10 +17,20 @@ PPA_URL=$PPA_ROOT/dists/$PPA_DISTRO/main/binary-$PPA_ARCH/Packages ppa_dir=./ppa/ temp_file=/tmp/ppa_listing_$$ +temp_temp_file=/tmp/ppa_listing_temp_$$ + +skip_files="binutils openssl flac libgig libogg libvorbis x-bootstrap zlib" +skip_files="$skip_files x-runtime gcc qt_4 qt5 x-stk pkgconfig" +skip_files="$skip_files glib2 libpng" echo "Connecting to $PPA_HOST to get list of packages..." wget -qO- $PPA_URL |grep "Filename:" > $temp_file +for j in $skip_files ; do + grep -v $j $temp_file > $temp_temp_file + mv $temp_temp_file $temp_file +done + line_count=`wc -l $temp_file |awk '{print $1}'` echo "Found $line_count packages for download..." diff --git a/cmake/msys/msys_helper.sh b/cmake/msys/msys_helper.sh index f7b91dfc6..041036237 100644 --- a/cmake/msys/msys_helper.sh +++ b/cmake/msys/msys_helper.sh @@ -61,6 +61,11 @@ else fi fltkver="1.3.3" +oggver="1.3.2" +vorbisver="1.3.5" +flacver="1.3.2" +gigver="4.0.0" +stkver="4.5.1" info "Downloading and building fltk $fltkver" @@ -75,24 +80,207 @@ if [ $? -ne 0 ]; then pushd $HOME/fltk-$fltkver info " - Compiling fltk $fltkver..." - ./configure + ./configure --prefix=$mingw_root --enable-shared make info " - Installing fltk..." - make install DESTDIR=$mingw_root + make install if [ $? -ne 0 ]; then err "ERROR: Could not build/install fltk -- Zyn needs this. Exiting." fi - ln -s $mingw_root/usr/local/bin/fluid.exe $mingw_root/bin/fluid.exe +# ln -s $mingw_root/usr/local/bin/fluid.exe $mingw_root/bin/fluid.exe + popd else warn " - Skipping, fluid binary already exists" fi -popd +info "Downloading and building libogg $oggver" + +if [ ! -e $mingw_root/lib/libogg.dll.a ]; then + wget http://downloads.xiph.org/releases/ogg/libogg-$oggver.tar.xz -O $HOME/libogg-source.tar.xz + if [ $? -ne 0 ]; then + err "ERROR: Could not download libogg. Exiting." + fi + tar xf $HOME/libogg-source.tar.xz -C $HOME/ + pushd $HOME/libogg-$oggver + + info " - Compiling libogg $oggver..." + ./configure --prefix=$mingw_root + + make + + info " - Installing libogg..." + make install + + # for some reason libgig needs this + ./configure --prefix=/opt$mingw_root + + make + + info " - Installing libogg..." + make install + + if [ $? -ne 0 ]; then + err "ERROR: Could not build/install fltk -- lmms needs this. Exiting." + fi + + popd +else + warn " - Skipping, libogg binary already exists" +fi + + +info "Downloading and building libvorbis $vorbisver" + +if [ ! -e $mingw_root/lib/libvorbis.dll.a ]; then + wget http://downloads.xiph.org/releases/vorbis/libvorbis-$vorbisver.tar.xz -O $HOME/libvorbis-source.tar.xz + if [ $? -ne 0 ]; then + err "ERROR: Could not download libogg. Exiting." + fi + tar xf $HOME/libvorbis-source.tar.xz -C $HOME/ + pushd $HOME/libvorbis-$vorbisver + + info " - Compiling libvorbis $vorbisver..." + ./configure --prefix=$mingw_root + + make + + info " - Installing libvorbis..." + make install + + # for some reason libgig needs this + ./configure --prefix=/opt$mingw_root + + make + + info " - Installing libvorbis..." + make install + + if [ $? -ne 0 ]; then + err "ERROR: Could not build/install libvorbis -- lmms needs this. Exiting." + fi + + popd +else + warn " - Skipping, libvorbis binary already exists" +fi + +info "Downloading and building flac $flacver" + +if [ ! -e $mingw_root/lib/libFLAC.dll.a ]; then + wget http://downloads.xiph.org/releases/flac/flac-$flacver.tar.xz -O $HOME/flac-source.tar.xz + if [ $? -ne 0 ]; then + err "ERROR: Could not download flac. Exiting." + fi + tar xf $HOME/flac-source.tar.xz -C $HOME/ + pushd $HOME/flac-$flacver + + info " - Compiling flac $flacver..." + ./configure --prefix=$mingw_root + + make + + info " - Installing flac..." + make install + + # for some reason libgig needs this + ./configure --prefix=/opt$mingw_root + + make + + info " - Installing flac..." + make install + + if [ $? -ne 0 ]; then + err "ERROR: Could not build/install flac -- lmms needs this. Exiting." + fi + + popd +else + warn " - Skipping, libvorbis flac already exists" +fi + +info "Downloading and building libgig $gigver" + +if [ ! -e $mingw_root/lib/libgig/libgig.dll.a ]; then + wget http://download.linuxsampler.org/packages/libgig-$gigver.tar.bz2 -O $HOME/gig-source.tar.xz + if [ $? -ne 0 ]; then + err "ERROR: Could not download libgig. Exiting." + fi + tar xf $HOME/gig-source.tar.xz -C $HOME/ + pushd $HOME/libgig-$gigver + + info " - Compiling libgig $gigver..." + ./configure --prefix=$mingw_root + + make + + info " - Installing libgig..." + make install + + mv $mingw_root/lib/bin/libakai-0.dll $mingw_root/bin + mv $mingw_root/lib/bin/libgig-7.dll $mingw_root/bin + + if [ $? -ne 0 ]; then + err "ERROR: Could not build/install libgig -- gigplayer needs this. Exiting." + fi + + popd +else + warn " - Skipping, libgig binary already exists" +fi + +info "Downloading and building stk $stkver" + +if [ ! -e $mingw_root/lib/libstk.dll ]; then + wget http://ccrma.stanford.edu/software/stk/release/stk-$stkver.tar.gz -O $HOME/stk-source.tar.xz + if [ $? -ne 0 ]; then + err "ERROR: Could not download stk. Exiting." + fi + tar xf $HOME/stk-source.tar.xz -C $HOME/ + pushd $HOME/stk-$stkver + + info " - Compiling stk $stkver..." + ./configure --prefix=$mingw_root + + make + + info " - Installing stk..." + make install + + if [ $? -ne 0 ]; then + err "ERROR: Could not build/install stk -- mallotstk needs this. Exiting." + fi + + mv $mingw_root/lib/libstk.so $mingw_root/lib/libstk.dll + mv $mingw_root/lib/libstk-$stkver.so $mingw_root/lib/libstk-$stkver.dll + + popd +else + warn " - Skipping, stk binary already exists" +fi + +# make a symlink to make cmake happy +if [ $mingw_root = "/mingw64" ]; then + if [ ! -e /opt/mingw64/bin/x86_64-w64-mingw32-pkg-config ]; then + ln -s /usr/bin/pkg-config /opt/mingw64/bin/x86_64-w64-mingw32-pkg-config + fi +fi +if [ $mingw_root = "/mingw32" ]; then + + if [ ! -e /opt/mingw32/bin/i686-w64-mingw32-pkg-config ]; then + ln -s /usr/bin/pkg-config /opt/mingw32/bin/i686-w64-mingw32-pkg-config + fi +fi info "Cleaning up..." rm -rf $HOME/fltk-$fltkver +rm -rf $HOME/libogg-$oggver +rm -rf $HOME/libvorbis-$vorbisver +rm -rf $HOME/flac-$flacver +rm -rf $HOME/libgig-$gigver +rm -rf $HOME/stk-$stkver info "Done."