2014-10-01 00:46:51 +02:00
#!/bin/bash
# this script creates a windows32 version of ardour3
# cross-compiled on GNU/Linux
#
# It is intended to run in a pristine chroot or VM of a minimal
# debian system. see http://wiki.debian.org/cowbuilder
2014-10-02 06:10:54 +02:00
# but it can also be run as root on any system...
2014-10-01 00:46:51 +02:00
#
2014-10-01 21:04:41 +02:00
###############################################################################
### Quick start
### one-time cowbuilder/pbuilder setup on the build-host
2014-10-01 00:46:51 +02:00
#
# sudo apt-get install cowbuilder util-linux
2014-10-03 02:48:39 +02:00
# sudo mkdir -p /var/cache/pbuilder/jessie-amd64/aptcache
2014-10-01 00:46:51 +02:00
#
2014-10-03 02:48:39 +02:00
# sudo cowbuilder --create \
# --basepath /var/cache/pbuilder/jessie-amd64/base.cow \
2014-10-01 00:46:51 +02:00
# --distribution jessie \
2014-10-03 02:48:39 +02:00
# --debootstrapopts --arch --debootstrapopts amd64
2014-10-01 00:46:51 +02:00
#
2014-10-01 21:04:41 +02:00
### 'interactive build'
#
2014-10-03 02:48:39 +02:00
# sudo cowbuilder --login --bindmounts /tmp \
# --basepath /var/cache/pbuilder/jessie-amd64/base.cow
2014-10-01 00:46:51 +02:00
#
2014-10-01 21:04:41 +02:00
### now, inside cowbuilder (/tmp/ is shared with host, -> bindmounts)
#
2014-10-01 00:46:51 +02:00
# /tmp/this_script.sh
#
2014-10-02 06:10:54 +02:00
### go for a coffee and ~40min later find /tmp/ardour-{VERSION}-Setup.exe
2014-10-01 21:04:41 +02:00
###
### instead of cowbuilder --login, cowbuilder --execute /tmp/x-mingw.sh
### does it all by itself, a ~/.pbuilderrc or /etc//etc/pbuilderrc
### can be used to set bindmounts and basepath... last but not least
### ccache helps a lot to speed up recompiles. see also
### https://wiki.ubuntu.com/PbuilderHowto#Integration_with_ccache
###
2014-10-01 00:46:51 +02:00
###############################################################################
2014-10-01 21:04:41 +02:00
: ${ MAKEFLAGS =-j4 }
: ${ SRCDIR =/tmp/winsrc } # source-code tgz are cached here
: ${ ASIO = } # set to build with ASIO/waves backend
: ${ NOSTACK = } # set to skip building the build-stack
: ${ RMSTACK = } # rm -rf $PREFIX $BUILDD - exclusive with NOSTACK
# directories inside the build-chroot:
2014-10-01 00:46:51 +02:00
: ${ SRC =/usr/src }
: ${ PREFIX = $SRC /win-stack }
: ${ BUILDD = $SRC /win-build }
2014-10-01 21:04:41 +02:00
2014-10-03 02:48:39 +02:00
: ${ XARCH =i686 } # or x86-64 // experimental
: ${ ARDOURCFG =--with-dummy }
2014-10-01 21:04:41 +02:00
###############################################################################
2014-10-01 00:46:51 +02:00
if [ " $( id -u) " != "0" -a -z " $SUDO " ] ; then
echo "This script must be run as root in pbuilder" 1>& 2
2014-10-03 02:48:39 +02:00
echo " e.g sudo DIST=jessie cowbuilder --bindmounts /tmp --execute $0 "
2014-10-01 21:04:41 +02:00
exit 1
fi
if test -n " $NOSTACK " -a -n " $RMSTACK " ; then
echo "NOSTACK and RMSTACK are exclusive"
2014-10-01 00:46:51 +02:00
exit 1
fi
2014-10-01 21:04:41 +02:00
if test -n " $RMSTACK " ; then
rm -rf ${ PREFIX } ${ BUILDD }
fi
###############################################################################
2014-10-01 00:46:51 +02:00
set -e
2014-10-03 02:48:39 +02:00
if test " $XARCH " = "x86_64" -o " $XARCH " = "amd64" ; then
echo "Target: 64bit Windows (x86_64)"
XPREFIX = x86_64-w64-mingw32
HPREFIX = x86_64
WARCH = w64
DEBIANPKGS = "mingw-w64"
else
echo "Target: 32 Windows (i686)"
XPREFIX = i686-w64-mingw32
HPREFIX = i386
WARCH = w32
DEBIANPKGS = "gcc-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64-tools mingw32"
fi
2014-10-01 00:46:51 +02:00
apt-get -y install build-essential \
2014-10-03 02:48:39 +02:00
${ DEBIANPKGS } \
2014-10-02 00:48:36 +02:00
git autoconf automake libtool pkg-config \
curl unzip ed yasm cmake ca-certificates
2014-10-01 00:46:51 +02:00
2014-10-03 02:48:39 +02:00
#fixup mingw64 ccache for now
if test -d /usr/lib/ccache -a -f /usr/bin/ccache; then
export PATH = " /usr/lib/ccache: ${ PATH } "
cd /usr/lib/ccache
test -L ${ XPREFIX } -gcc || ln -s ../../bin/ccache ${ XPREFIX } -gcc
test -L ${ XPREFIX } -g++ || ln -s ../../bin/ccache ${ XPREFIX } -g++
fi
2014-10-01 00:46:51 +02:00
###############################################################################
mkdir -p ${ SRCDIR }
mkdir -p ${ PREFIX }
mkdir -p ${ BUILDD }
unset PKG_CONFIG_PATH
2014-10-03 02:48:39 +02:00
export XPREFIX
2014-10-01 00:46:51 +02:00
export PKG_CONFIG_PATH = ${ PREFIX } /lib/pkgconfig
export PREFIX
export SRCDIR
2014-10-03 02:48:39 +02:00
if test -n " $( which ${ XPREFIX } -pkg-config) " ; then
export PKG_CONFIG = ` which ${ XPREFIX } -pkg-config`
fi
2014-10-01 00:46:51 +02:00
function download {
echo " --- Downloading.. $2 "
test -f ${ SRCDIR } /$1 || curl -k -L -o ${ SRCDIR } /$1 $2
}
function src {
download ${ 1 } .${ 2 } $3
cd ${ BUILDD }
tar xf ${ SRCDIR } /${ 1 } .${ 2 }
cd $1
}
2014-10-03 02:48:39 +02:00
function autoconfconf {
2014-10-01 00:46:51 +02:00
set -e
echo " ======= $( pwd ) ======= "
2014-10-01 16:22:22 +02:00
#CPPFLAGS="-I${PREFIX}/include -DDEBUG$CPPFLAGS" \
2014-10-01 00:46:51 +02:00
CPPFLAGS = " -I ${ PREFIX } /include $CPPFLAGS " \
2014-10-01 16:22:22 +02:00
CFLAGS = " -I ${ PREFIX } /include -O2 -g -mstackrealign $CFLAGS " \
CXXFLAGS = " -I ${ PREFIX } /include -O2 -g -mstackrealign $CXXFLAGS " \
2014-10-01 00:46:51 +02:00
LDFLAGS = " -L ${ PREFIX } /lib $LDFLAGS " \
2014-10-03 02:48:39 +02:00
./configure --host= ${ XPREFIX } --build= ${ HPREFIX } -linux \
2014-10-01 00:46:51 +02:00
--prefix= $PREFIX $@
2014-10-03 02:48:39 +02:00
}
function autoconfbuild {
set -e
autoconfconf $@
2014-10-01 21:04:41 +02:00
make $MAKEFLAGS && make install
2014-10-01 00:46:51 +02:00
}
function wafbuild {
set -e
echo " ======= $( pwd ) ======= "
2014-10-03 02:48:39 +02:00
CC = ${ XPREFIX } -gcc \
CXX = ${ XPREFIX } -g++ \
CPP = ${ XPREFIX } -cpp \
AR = ${ XPREFIX } -ar \
LD = ${ XPREFIX } -ld \
NM = ${ XPREFIX } -nm \
AS = ${ XPREFIX } -as \
STRIP = ${ XPREFIX } -strip \
RANLIB = ${ XPREFIX } -ranlib \
DLLTOOL = ${ XPREFIX } -dlltool \
2014-10-01 16:22:22 +02:00
CPPFLAGS = " -I ${ PREFIX } /include $CPPFLAGS " \
CFLAGS = " -I ${ PREFIX } /include -O2 -g -mstackrealign $CFLAGS " \
CXXFLAGS = " -I ${ PREFIX } /include -O2 -g -mstackrealign $CXXFLAGS " \
LDFLAGS = " -L ${ PREFIX } /lib $LDFLAGS " \
2014-10-01 00:46:51 +02:00
./waf configure --prefix= $PREFIX $@ \
&& ./waf && ./waf install
}
################################################################################
if test -z " $NOSTACK " ; then
################################################################################
2014-10-03 02:48:39 +02:00
# jack headers, .def, .lib and pkg-config file from jackd 1.9.10
download jack_win3264.tar.xz http://robin.linuxaudio.org/jack_win3264.tar.xz
2014-10-01 00:46:51 +02:00
cd " $PREFIX "
2014-10-03 02:48:39 +02:00
tar xf ${ SRCDIR } /jack_win3264.tar.xz
" $PREFIX " /update_pc_prefix.sh ${ WARCH }
2014-10-01 00:46:51 +02:00
2014-10-01 16:22:22 +02:00
2014-10-01 00:46:51 +02:00
download pthreads-w32-2-9-1-release.tar.gz ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-9-1-release.tar.gz
cd ${ BUILDD }
tar xzf ${ SRCDIR } /pthreads-w32-2-9-1-release.tar.gz
cd pthreads-w32-2-9-1-release
2014-10-03 02:48:39 +02:00
make clean GC CROSS = ${ XPREFIX } -
2014-10-01 00:46:51 +02:00
mkdir -p ${ PREFIX } /bin
mkdir -p ${ PREFIX } /lib
mkdir -p ${ PREFIX } /include
cp -vf pthreadGC2.dll ${ PREFIX } /bin/
cp -vf libpthreadGC2.a ${ PREFIX } /lib/libpthread.a
cp -vf pthread.h sched.h ${ PREFIX } /include
src zlib-1.2.7 tar.gz ftp://ftp.simplesystems.org/pub/libpng/png/src/history/zlib/zlib-1.2.7.tar.gz
2014-10-03 02:48:39 +02:00
make -fwin32/Makefile.gcc PREFIX = ${ XPREFIX } -
2014-10-01 00:46:51 +02:00
make install -fwin32/Makefile.gcc SHARED_MODE = 1 \
INCLUDE_PATH = ${ PREFIX } /include \
LIBRARY_PATH = ${ PREFIX } /lib \
BINARY_PATH = ${ PREFIX } /bin
2014-10-03 02:48:39 +02:00
src tiff-4.0.3 tar.gz ftp://ftp.remotesensing.org/pub/libtiff/tiff-4.0.3.tar.gz
2014-10-01 00:46:51 +02:00
autoconfbuild
download jpegsrc.v9a.tar.gz http://www.ijg.org/files/jpegsrc.v9a.tar.gz
cd ${ BUILDD }
tar xzf ${ SRCDIR } /jpegsrc.v9a.tar.gz
cd jpeg-9a
autoconfbuild
src libogg-1.3.2 tar.gz http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gz
autoconfbuild
src libvorbis-1.3.4 tar.gz http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.4.tar.gz
autoconfbuild --disable-examples --with-ogg= ${ PREFIX }
2014-10-03 02:48:39 +02:00
src flac-1.3.0 tar.xz http://downloads.xiph.org/releases/flac/flac-1.3.0.tar.xz
2014-10-01 00:46:51 +02:00
ed Makefile.in << EOF
%s/examples / /
wq
EOF
autoconfbuild
src libsndfile-1.0.25 tar.gz http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.25.tar.gz
ed Makefile.in << EOF
%s/ examples regtest tests programs//
wq
EOF
LDFLAGS = " -lFLAC -lwsock32 -lvorbis -logg -lwsock32" \
autoconfbuild
ed $PREFIX /lib/pkgconfig/sndfile.pc << EOF
%s/ -lsndfile/ -lsndfile -lvorbis -lvorbisenc -lFLAC -logg -lwsock32/
wq
EOF
src libsamplerate-0.1.8 tar.gz http://www.mega-nerd.com/SRC/libsamplerate-0.1.8.tar.gz
ed Makefile.in << EOF
%s/ examples tests//
wq
EOF
autoconfbuild
src expat-2.1.0 tar.gz http://prdownloads.sourceforge.net/expat/expat-2.1.0.tar.gz
autoconfbuild
src libiconv-1.14 tar.gz ftp://ftp.gnu.org/gnu/libiconv/libiconv-1.14.tar.gz
autoconfbuild --with-included-gettext --with-libiconv-prefix= $PREFIX
2014-10-03 02:48:39 +02:00
src libxml2-2.9.1 tar.gz ftp://xmlsoft.org/libxslt/libxml2-2.9.1.tar.gz
2014-10-01 16:22:22 +02:00
CFLAGS = " -O0" CXXFLAGS = " -O0" \
2014-10-03 02:48:39 +02:00
autoconfbuild --with-threads= no --with-zlib= $PREFIX --without-python
2014-10-01 00:46:51 +02:00
2014-10-03 02:48:39 +02:00
src libpng-1.6.13 tar.xz https://downloads.sourceforge.net/project/libpng/libpng16/1.6.13/libpng-1.6.13.tar.xz
2014-10-01 16:23:24 +02:00
autoconfbuild
2014-10-01 00:46:51 +02:00
2014-10-01 16:23:24 +02:00
src freetype-2.5.3 tar.gz http://download.savannah.gnu.org/releases/freetype/freetype-2.5.3.tar.gz
autoconfbuild -with-harfbuzz= no
2014-10-01 00:46:51 +02:00
src fontconfig-2.11.0 tar.bz2 http://www.freedesktop.org/software/fontconfig/release/fontconfig-2.11.0.tar.bz2
ed Makefile.in << EOF
%s/conf.d test /conf.d /
wq
EOF
2014-10-01 16:23:24 +02:00
autoconfbuild --enable-libxml2
2014-10-01 00:46:51 +02:00
2014-10-03 02:48:39 +02:00
src pixman-0.32.2 tar.gz http://cgit.freedesktop.org/pixman/snapshot/pixman-0.32.2.tar.gz
2014-10-01 00:46:51 +02:00
./autogen.sh
autoconfbuild
src cairo-1.12.16 tar.xz http://cairographics.org/releases/cairo-1.12.16.tar.xz
autoconfbuild
2014-10-03 02:48:39 +02:00
src libffi-3.1 tar.gz ftp://sourceware.org/pub/libffi/libffi-3.1.tar.gz
2014-10-01 00:46:51 +02:00
autoconfbuild
2014-10-02 00:48:36 +02:00
src gettext-0.19.2 tar.gz http://ftp.gnu.org/pub/gnu/gettext/gettext-0.19.2.tar.gz
2014-10-01 00:46:51 +02:00
autoconfbuild
################################################################################
apt-get -y install python gettext libglib2.0-dev # /usr/bin/msgfmt , genmarshall
2014-10-03 02:48:39 +02:00
#NB. we could apt-get install wine instead and run the exe files in $PREFIX/bin
2014-10-01 00:46:51 +02:00
################################################################################
src glib-2.42.0 tar.xz http://ftp.gnome.org/pub/gnome/sources/glib/2.42/glib-2.42.0.tar.xz
LIBS = "-lpthread" \
autoconfbuild --with-pcre= internal --disable-silent-rules --with-libiconv= no
################################################################################
dpkg -P gettext python || true
################################################################################
2014-10-03 02:48:39 +02:00
src harfbuzz-0.9.35 tar.bz2 http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-0.9.35.tar.bz2
2014-10-01 16:23:24 +02:00
autoconfbuild
2014-10-01 00:46:51 +02:00
src pango-1.36.8 tar.xz http://ftp.gnome.org/pub/GNOME/sources/pango/1.36/pango-1.36.8.tar.xz
autoconfbuild --without-x --with-included-modules= yes
2014-10-03 02:48:39 +02:00
src atk-2.14.0 tar.bz2 http://ftp.gnome.org/pub/GNOME/sources/atk/2.14/atk-2.14.0.tar.xz
2014-10-01 00:46:51 +02:00
autoconfbuild --disable-rebuilds
2014-10-03 02:48:39 +02:00
src gdk-pixbuf-2.31.1 tar.xz http://ftp.acc.umu.se/pub/GNOME/sources/gdk-pixbuf/2.31/gdk-pixbuf-2.31.1.tar.xz
2014-10-01 00:46:51 +02:00
autoconfbuild --disable-modules --without-gdiplus --with-included-loaders= yes
src gtk+-2.24.24 tar.xz http://ftp.gnome.org/pub/gnome/sources/gtk+/2.24/gtk+-2.24.24.tar.xz
ed Makefile.in << EOF
%s/demos / /
wq
EOF
2014-10-03 02:48:39 +02:00
autoconfconf --disable-rebuilds # --disable-modules
if test " $WARCH " = "w64" ; then
make -n || true
rm gtk/gtk.def # workaround disable-rebuilds
fi
make && make install
2014-10-01 00:46:51 +02:00
################################################################################
dpkg -P libglib2.0-dev libpcre3-dev || true
################################################################################
src lv2-1.10.0 tar.bz2 http://lv2plug.in/spec/lv2-1.10.0.tar.bz2
wafbuild --no-plugins
src serd-0.20.0 tar.bz2 http://download.drobilla.net/serd-0.20.0.tar.bz2
wafbuild
src sord-0.12.2 tar.bz2 http://download.drobilla.net/sord-0.12.2.tar.bz2
ed wscript << EOF
%s/pthread/lpthread/
wq
EOF
wafbuild
src sratom-0.4.6 tar.bz2 http://download.drobilla.net/sratom-0.4.6.tar.bz2
wafbuild
src lilv-0.20.0 tar.bz2 http://download.drobilla.net/lilv-0.20.0.tar.bz2
ed wscript << EOF
2014-10-03 02:48:39 +02:00
/sys.platform.*win32
.s/win32/linux2/
/sys.platform.*win32
.s/win32/linux2/
2014-10-01 00:46:51 +02:00
%s/win32/linux/
wq
EOF
wafbuild
ed $PREFIX /lib/pkgconfig/lilv-0.pc << EOF
%s/-ldl//
wq
EOF
src suil-0.8.2 tar.bz2 http://download.drobilla.net/suil-0.8.2.tar.bz2
wafbuild
src curl-7.35.0 tar.bz2 http://curl.haxx.se/download/curl-7.35.0.tar.bz2
autoconfbuild
src libsigc++-2.4.0 tar.xz http://ftp.gnome.org/pub/GNOME/sources/libsigc++/2.4/libsigc++-2.4.0.tar.xz
autoconfbuild
2014-10-03 02:48:39 +02:00
src glibmm-2.42.0 tar.xz http://ftp.gnome.org/pub/GNOME/sources/glibmm/2.42/glibmm-2.42.0.tar.xz
2014-10-01 00:46:51 +02:00
autoconfbuild
2014-10-03 02:48:39 +02:00
src cairomm-1.11.2 tar.gz http://cairographics.org/releases/cairomm-1.11.2.tar.gz
2014-10-01 00:46:51 +02:00
autoconfbuild
2014-10-03 02:48:39 +02:00
src pangomm-2.34.0 tar.xz http://ftp.acc.umu.se/pub/gnome/sources/pangomm/2.34/pangomm-2.34.0.tar.xz
2014-10-01 00:46:51 +02:00
autoconfbuild
2014-10-03 02:48:39 +02:00
src atkmm-2.22.7 tar.xz http://ftp.gnome.org/pub/GNOME/sources/atkmm/2.22/atkmm-2.22.7.tar.xz
2014-10-01 00:46:51 +02:00
autoconfbuild
src gtkmm-2.24.4 tar.xz http://ftp.acc.umu.se/pub/GNOME/sources/gtkmm/2.24/gtkmm-2.24.4.tar.xz
autoconfbuild
src fftw-3.3.4 tar.gz http://www.fftw.org/fftw-3.3.4.tar.gz
autoconfbuild --enable-single --enable-float --enable-type-prefix --enable-sse --with-our-malloc --enable-avx --disable-mpi
make clean
autoconfbuild --enable-type-prefix --with-our-malloc --enable-avx --disable-mpi
################################################################################
src taglib-1.9.1 tar.gz http://taglib.github.io/releases/taglib-1.9.1.tar.gz
ed CMakeLists.txt << EOF
0i
set( CMAKE_SYSTEM_NAME Windows)
2014-10-03 02:48:39 +02:00
set( CMAKE_C_COMPILER ${ XPREFIX } -gcc)
set( CMAKE_CXX_COMPILER ${ XPREFIX } -c++)
set( CMAKE_RC_COMPILER ${ XPREFIX } -windres)
2014-10-01 00:46:51 +02:00
.
wq
EOF
2014-10-01 21:04:41 +02:00
rm -rf build/
2014-10-01 00:46:51 +02:00
mkdir build && cd build
cmake \
-DCMAKE_INSTALL_PREFIX= $PREFIX -DCMAKE_RELEASE_TYPE= Release \
-DCMAKE_SYSTEM_NAME= Windows -DZLIB_ROOT= $PREFIX \
..
make $MAKEFLAGS && make install
# windows target does not create .pc file...
cat > $PREFIX /lib/pkgconfig/taglib.pc << EOF
prefix = $PREFIX
exec_prefix = \$ { prefix}
libdir = \$ { exec_prefix} /lib
includedir = \$ { prefix} /include
Name: TagLib
Description: Audio meta-data library
Requires:
Version: 1.9.1
Libs: -L\$ { libdir} /lib -ltag
Cflags: -I\$ { includedir} /include/taglib
EOF
################################################################################
#git://liblo.git.sourceforge.net/gitroot/liblo/liblo
src liblo-0.28 tar.gz http://downloads.sourceforge.net/liblo/liblo-0.28.tar.gz
2014-10-03 02:48:39 +02:00
autoconfconf --enable-shared
2014-10-01 00:46:51 +02:00
ed src/Makefile << EOF
/noinst_PROGRAMS
.,+3d
wq
EOF
ed Makefile << EOF
%s/examples//
wq
EOF
make $MAKEFLAGS && make install
################################################################################
src boost_1_49_0 tar.bz2 http://sourceforge.net/projects/boost/files/boost/1.49.0/boost_1_49_0.tar.bz2
./bootstrap.sh --prefix= $PREFIX
2014-10-03 02:48:39 +02:00
echo " using gcc : 4.7 : ${ XPREFIX } -g++ :
<rc>${ XPREFIX } -windres
<archiver>${ XPREFIX } -ar
2014-10-01 00:46:51 +02:00
; " > user-config.jam
# PTW32_INCLUDE=${PREFIX}/include \
# PTW32_LIB=${PREFIX}/lib \
./b2 --prefix= $PREFIX \
toolset = gcc \
target-os= windows \
variant = release \
threading = multi \
threadapi = win32 \
link = shared \
runtime-link= shared \
--with-exception \
--with-regex \
--layout= tagged \
--user-config= user-config.jam \
2014-10-01 21:04:41 +02:00
$MAKEFLAGS install
2014-10-01 00:46:51 +02:00
################################################################################
download ladspa.h http://www.ladspa.org/ladspa_sdk/ladspa.h.txt
cp ${ SRCDIR } /ladspa.h $PREFIX /include/ladspa.h
################################################################################
src vamp-plugin-sdk-2.5 tar.gz http://code.soundsoftware.ac.uk/attachments/download/690/vamp-plugin-sdk-2.5.tar.gz
ed Makefile.in << EOF
2014-10-03 02:48:39 +02:00
%s/= ar/= ${ XPREFIX } -ar/
%s/= ranlib/= ${ XPREFIX } -ranlib/
2014-10-01 00:46:51 +02:00
wq
EOF
MAKEFLAGS = "sdk -j4" autoconfbuild
ed $PREFIX /lib/pkgconfig/vamp-hostsdk.pc << EOF
%s/-ldl//
wq
EOF
src rubberband-1.8.1 tar.bz2 http://code.breakfastquay.com/attachments/download/34/rubberband-1.8.1.tar.bz2
ed Makefile.in << EOF
2014-10-03 02:48:39 +02:00
%s/= ar/= ${ XPREFIX } -ar/
2014-10-01 00:46:51 +02:00
wq
EOF
autoconfbuild
ed $PREFIX /lib/pkgconfig/rubberband.pc << EOF
%s/ -lrubberband/ -lrubberband -lfftw3/
wq
EOF
src mingw-libgnurx-2.5.1 tar.gz http://sourceforge.net/projects/mingw/files/Other/UserContributed/regex/mingw-regex-2.5.1/mingw-libgnurx-2.5.1-src.tar.gz/download
autoconfbuild
src aubio-0.3.2 tar.gz http://aubio.org/pub/aubio-0.3.2 tar.gz
ed Makefile.in << EOF
%s/examples / /
wq
EOF
autoconfbuild
ed $PREFIX /lib/pkgconfig/aubio.pc << EOF
%s/ -laubio/ -laubio -lfftw3f/
wq
EOF
2014-10-03 02:48:39 +02:00
rm -f ${ PREFIX } /include/pa_asio.h ${ PREFIX } /include/portaudio.h ${ PREFIX } /include/asio.h
2014-10-01 21:04:41 +02:00
if test -n " $ASIO " ; then
2014-10-03 02:48:39 +02:00
if test ! -d ${ SRCDIR } /soundfind.git.reference; then
git clone --mirror git://github.com/aardvarkk/soundfind.git ${ SRCDIR } /soundfind.git.reference
fi
cd ${ BUILDD }
git clone --reference ${ SRCDIR } /soundfind.git.reference --depth 1 git://github.com/aardvarkk/soundfind.git || true
download pa_waves2.diff http://robin.linuxaudio.org/tmp/pa_waves2.diff
src portaudio tgz http://portaudio.com/archives/pa_stable_v19_20140130.tgz
patch -p1 < ${ SRCDIR } /pa_waves2.diff
autoconfconf --with-asiodir= ${ BUILDD } /soundfind/ASIOSDK2/ --with-winapi= asio,wmme --without-jack
ed Makefile << EOF
%s/-luuid//g
wq
EOF
make $MAKEFLAGS && make install
cp include/pa_asio.h ${ PREFIX } /include/
cp ${ BUILDD } /soundfind/ASIOSDK2/common/asio.h ${ PREFIX } /include/
2014-10-01 21:04:41 +02:00
else
2014-10-03 02:48:39 +02:00
src portaudio tgz http://portaudio.com/archives/pa_stable_v19_20140130.tgz
autoconfbuild
2014-10-01 21:04:41 +02:00
fi
2014-10-01 00:46:51 +02:00
################################################################################
fi # $NOSTACK
################################################################################
2014-10-01 21:04:41 +02:00
if test -n " $ASIO " ; then
2014-10-03 02:48:39 +02:00
ARDOURCFG = " $ARDOURCFG --with-wavesbackend "
fi
if test " $WARCH " = "w32" ; then
ARDOURCFG = " $ARDOURCFG --windows-vst "
2014-10-01 21:04:41 +02:00
fi
2014-10-01 00:46:51 +02:00
################################################################################
cd ${ SRC }
2014-10-03 02:48:39 +02:00
ARDOURSRC = ardour-${ WARCH }
# create a git cache to speed up future clones
if test ! -d ${ SRCDIR } /ardour.git.reference; then
git clone --mirror git://git.ardour.org/ardour/ardour.git ${ SRCDIR } /ardour.git.reference
fi
git clone --reference ${ SRCDIR } /ardour.git.reference -b cairocanvas git://git.ardour.org/ardour/ardour.git $ARDOURSRC || true
2014-10-01 00:46:51 +02:00
cd ${ ARDOURSRC }
2014-10-03 02:48:39 +02:00
export CC = ${ XPREFIX } -gcc
export CXX = ${ XPREFIX } -g++
export CPP = ${ XPREFIX } -cpp
export AR = ${ XPREFIX } -ar
export LD = ${ XPREFIX } -ld
export NM = ${ XPREFIX } -nm
export AS = ${ XPREFIX } -as
export STRIP = ${ XPREFIX } -strip
export RANLIB = ${ XPREFIX } -ranlib
export DLLTOOL = ${ XPREFIX } -dlltool
2014-10-01 00:46:51 +02:00
2014-10-01 16:22:22 +02:00
CFLAGS = "-mstackrealign" \
CXXFLAGS = "-mstackrealign" \
2014-10-01 00:46:51 +02:00
LDFLAGS = " -L ${ PREFIX } /lib " ./waf configure \
2014-10-03 02:48:39 +02:00
--dist-target= mingw \
2014-10-01 00:46:51 +02:00
--also-include= ${ PREFIX } /include \
2014-10-03 02:48:39 +02:00
$ARDOURCFG \
2014-10-01 00:46:51 +02:00
--prefix= ${ PREFIX }
./waf
2014-10-03 02:48:39 +02:00
################################################################################
if test -n " $NOBUNDLE " ; then
echo "Done. (NOBUNDLE)"
exit
fi
2014-10-01 00:46:51 +02:00
2014-10-02 00:48:36 +02:00
ARDOURVERSION = $( git describe | sed 's/-g.*$//' )
ARDOURDATE = $( date -R)
2014-10-03 02:48:39 +02:00
./waf install
2014-10-02 00:48:36 +02:00
2014-10-01 00:46:51 +02:00
################################################################################
################################################################################
################################################################################
2014-10-03 02:48:39 +02:00
if test -z " $DESTDIR " ; then
DESTDIR = ` mktemp -d`
trap 'rm -rf $DESTDIR' exit SIGINT SIGTERM
fi
2014-10-01 00:46:51 +02:00
2014-10-02 00:48:36 +02:00
echo " === bundle to $DESTDIR "
2014-10-01 00:46:51 +02:00
2014-10-03 02:48:39 +02:00
ALIBDIR = $DESTDIR /lib/ardour3
2014-10-01 00:46:51 +02:00
rm -rf $DESTDIR
mkdir -p $DESTDIR /bin
mkdir -p $DESTDIR /share/
mkdir -p $ALIBDIR /surfaces
mkdir -p $ALIBDIR /backends
mkdir -p $ALIBDIR /panners
mkdir -p $ALIBDIR /fst
2014-10-02 06:10:54 +02:00
cp build/libs/gtkmm2ext/gtkmm2ext-*.dll $DESTDIR /bin/
cp build/libs/midi++2/midipp-*.dll $DESTDIR /bin/
cp build/libs/evoral/evoral-*.dll $DESTDIR /bin/
cp build/libs/ardour/ardour-*.dll $DESTDIR /bin/
2014-10-01 00:46:51 +02:00
cp build/libs/timecode/timecode.dll $DESTDIR /bin/
2014-10-02 06:10:54 +02:00
cp build/libs/qm-dsp/qmdsp-*.dll $DESTDIR /bin/
cp build/libs/canvas/canvas-*.dll $DESTDIR /bin/
cp build/libs/pbd/pbd-*.dll $DESTDIR /bin/
cp build/libs/audiographer/audiographer-*.dll $DESTDIR /bin/
2014-10-03 02:48:39 +02:00
cp build/libs/fst/ardour-vst-scanner.exe $ALIBDIR /fst/ || true
2014-10-01 16:22:22 +02:00
cp ` ls -t build/gtk2_ardour/ardour-*.exe | head -n1` $DESTDIR /bin/ardour.exe
2014-10-01 21:04:41 +02:00
mkdir -p $DESTDIR /lib/gtk-2.0/engines
cp build/libs/clearlooks-newer/clearlooks.dll $DESTDIR /lib/gtk-2.0/engines/libclearlooks.la
2014-10-01 00:46:51 +02:00
cp $PREFIX /bin/*dll $DESTDIR /bin/
cp $PREFIX /lib/*dll $DESTDIR /bin/
rm -rf $DESTDIR /bin/libjack.dll
cp ` find build/libs/surfaces/ -iname "*.dll" ` $ALIBDIR /surfaces/
cp ` find build/libs/backends/ -iname "*.dll" ` $ALIBDIR /backends/
cp ` find build/libs/panners/ -iname "*.dll" ` $ALIBDIR /panners/
2014-10-01 16:22:22 +02:00
cp -r build/libs/LV2 $ALIBDIR /
2014-10-01 00:46:51 +02:00
2014-10-02 06:10:54 +02:00
mv $ALIBDIR /surfaces/ardourcp-*.dll $DESTDIR /bin/
2014-10-01 00:46:51 +02:00
2014-10-02 06:10:54 +02:00
# TODO use -static-libgcc -static-libstdc++ -- but for .exe files only
2014-10-03 02:48:39 +02:00
if update-alternatives --query ${ XPREFIX } -gcc | grep Value: | grep -q win32; then
cp /usr/lib/gcc/${ XPREFIX } /*-win32/libgcc_s_*.dll $DESTDIR /bin/
cp /usr/lib/gcc/${ XPREFIX } /*-win32/libstdc++-6.dll $DESTDIR /bin/
elif update-alternatives --query ${ XPREFIX } -gcc | grep Value: | grep -q posix; then
cp /usr/lib/gcc/${ XPREFIX } /*-posix/libgcc_s_*.dll $DESTDIR /bin/
cp /usr/lib/gcc/${ XPREFIX } /*-posix/libstdc++-6.dll $DESTDIR /bin/
2014-10-02 06:10:54 +02:00
else
2014-10-03 02:48:39 +02:00
cp /usr/lib/gcc/${ XPREFIX } /*/libgcc_s_sjlj-1.dll $DESTDIR /bin/
cp /usr/lib/gcc/${ XPREFIX } /*/libstdc++-6.dll $DESTDIR /bin/
2014-10-02 06:10:54 +02:00
fi
2014-10-01 00:46:51 +02:00
cp -r $PREFIX /share/ardour3 $DESTDIR /share/
cp -r $PREFIX /etc/ardour3/* $DESTDIR /share/ardour3/
2014-10-02 00:48:36 +02:00
cp COPYING $DESTDIR /share/
cp gtk2_ardour/icons/ardour.ico $DESTDIR /share/
2014-10-03 02:48:39 +02:00
# clean stack-dir after install
./waf uninstall
echo " === complete"
du -sh $DESTDIR
2014-10-01 00:46:51 +02:00
################################################################################
2014-10-03 02:48:39 +02:00
if test -f ${ SRCDIR } /gdb.exe; then
cp ${ SRCDIR } /gdb.exe $DESTDIR /bin/
cat > $DESTDIR /ardbg.bat << EOF
cd bin
START gdb.exe ardour.exe
EOF
fi
################################################################################
echo " === Preparing Windows Installer"
2014-10-02 00:48:36 +02:00
NSISFILE = $DESTDIR /a3.nsis
2014-10-03 02:48:39 +02:00
OUTFILE = " /tmp/ardour- ${ ARDOURVERSION } - ${ WARCH } -Setup.exe "
if test " $WARCH " = "w64" ; then
PGF = PROGRAMFILES64
else
PGF = PROGRAMFILES
fi
2014-10-02 00:48:36 +02:00
cat > $NSISFILE << EOF
SetCompressor /SOLID lzma
SetCompressorDictSize 32
!include MUI2.nsh
Name "Ardour3"
OutFile " ${ OUTFILE } "
RequestExecutionLevel admin
2014-10-03 02:48:39 +02:00
InstallDir " \$ ${ PGF } \\ardour3 "
InstallDirRegKey HKLM " Software\\Ardour\\ardour3\\ $WARCH " "Install_Dir"
2014-10-02 00:48:36 +02:00
!define MUI_ICON "share\\ardour.ico"
!define MUI_FINISHPAGE_TITLE "Welcome to Ardour"
!define MUI_FINISHPAGE_TEXT "This windows versions or Ardour is provided as-is.\$\\r\$\\nThe ardour community currently has no expertise in supporting windows users, and there are no developers focusing on windows specific issues either.\$\\r\$\\nIf you like Ardour, please consider helping out."
!define MUI_FINISHPAGE_LINK "Ardour Manual"
!define MUI_FINISHPAGE_LINK_LOCATION "http://manual.ardour.org"
!define MUI_FINISHPAGE_RUN "\$INSTDIR\\bin\\ardour.exe"
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
!define MUI_ABORTWARNING
!insertmacro MUI_PAGE_LICENSE "share\\COPYING"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
Section "Ardour3 (required)" SecArdour
SectionIn RO
SetOutPath \$ INSTDIR
File /r bin
File /r lib
File /r share
2014-10-03 02:48:39 +02:00
File /nonfatal ardbg.bat
WriteRegStr HKLM SOFTWARE\\ Ardour\\ ardour3\\ $WARCH "Install_Dir" "\$INSTDIR"
2014-10-02 00:48:36 +02:00
WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\ardour3" "DisplayName" "Ardour3"
WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\ardour3" "UninstallString" '"\$INSTDIR\\uninstall.exe"'
WriteRegDWORD HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\ardour3" "NoModify" 1
WriteRegDWORD HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\ardour3" "NoRepair" 1
WriteUninstaller "\$INSTDIR\uninstall.exe"
SectionEnd
Section "Start Menu Shortcuts" SecMenu
SetShellVarContext all
CreateDirectory "\$SMPROGRAMS\\ardour3"
CreateShortCut "\$SMPROGRAMS\\ardour3\\Ardour3.lnk" "\$INSTDIR\\bin\\ardour.exe" "" "\$INSTDIR\\bin\\ardour.exe" 0
CreateShortCut "\$SMPROGRAMS\\ardour3\\Uninstall.lnk" "\$INSTDIR\\uninstall.exe" "" "\$INSTDIR\\uninstall.exe" 0
SectionEnd
LangString DESC_SecArdour \$ { LANG_ENGLISH} " Ardour ${ ARDOURVERSION } \$\\r\$\\nDebug Version.\$\\r\$\\n ${ ARDOURDATE } "
LangString DESC_SecMenu \$ { LANG_ENGLISH} "Create Start-Menu Shortcuts (recommended)."
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT \$ { SecArdour} \$ ( DESC_SecArdour)
!insertmacro MUI_DESCRIPTION_TEXT \$ { SecMenu} \$ ( DESC_SecMenu)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
Section "Uninstall"
SetShellVarContext all
DeleteRegKey HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\ardour"
DeleteRegKey HKLM SOFTWARE\\ Ardour\\ ardour3
RMDir /r "\$INSTDIR\\bin"
RMDir /r "\$INSTDIR\\lib"
RMDir /r "\$INSTDIR\\share"
2014-10-03 02:48:39 +02:00
Delete "\$INSTDIR\\ardbg.bat"
2014-10-02 00:48:36 +02:00
Delete "\$INSTDIR\\uninstall.exe"
RMDir "\$INSTDIR"
Delete "\$SMPROGRAMS\\ardour3\\*.*"
RMDir "\$SMPROGRAMS\\ardour3"
SectionEnd
EOF
apt-get -y install nsis
rm -f ${ OUTFILE }
2014-10-03 02:48:39 +02:00
echo " === OutFile: $OUTFILE "
echo " === Building Windows Installer (lzma compression takes ages)"
2014-10-02 00:48:36 +02:00
makensis -V2 $NSISFILE
rm -rf $DESTDIR
ls -lh " $OUTFILE "