Steps to compile Ardour (git) under Windows

The following steps allow native Ardour (git) compilation under Windows with the mingw64 compiler. Optional steps or alternatives are commented out. You will need about 5Gb of free disk space and a powerful CPU to compile everything.


Support files:

1. Install msys2 from http://www.msys2.org/ in a short path (i.e. f:/a)
# From the msys2 terminal
pacman -Syu
# Close the msys2 terminal and open it again
pacman -Su

2. From mingw64 shell from now on, install common packages:
pacman -S \
mingw-w64-x86_64-toolchain \
python3 \
python3-setuptools \
mingw-w64-x86_64-python3 \
mingw-w64-x86_64-python3-setuptools \
python2 \
python2-setuptools \
pkg-config \
mingw-w64-x86_64-pkg-config \
autoconf \
automake \
perl \
gtk-doc \
flex \
bison \
patch \
libtool \
mingw-w64-x86_64-libtool \
wget \
git \
nasm \
mingw-w64-x86_64-nasm \
dos2unix \
mingw-w64-x86_64-cmake

3. Install pre-built dependencies
pacman -S \
mingw-w64-x86_64-glib2 \
mingw-w64-x86_64-gobject-introspection \
mingw-w64-x86_64-pkg-config \
mingw-w64-x86_64-c-ares \
mingw-w64-x86_64-ca-certificates \
mingw-w64-x86_64-gnutls \
mingw-w64-x86_64-libidn \
mingw-w64-x86_64-libssh2 \
mingw-w64-x86_64-rtmpdump \
mingw-w64-x86_64-gnutls \
libgnutls-devel \
libutil-linux-devel \
gtk-doc \
mingw-w64-x86_64-docbook-xsl \
intltool \
mingw-w64-x86_64-libjpeg-turbo \
mingw-w64-x86_64-jbigkit \
mingw-w64-x86_64-ladspa-sdk

# Ardour uses specific versions of the following libraries, but we use default packages
pacman -S \
mingw-w64-x86_64-icu \
mingw-w64-x86_64-boost \
mingw-w64-x86_64-curl \
mingw-w64-x86_64-fftw \
mingw-w64-x86_64-libusb \
mingw-w64-x86_64-libxml2 \
mingw-w64-x86_64-libogg \
mingw-w64-x86_64-flac \
mingw-w64-x86_64-libvorbis \
mingw-w64-x86_64-libsndfile \
mingw-w64-x86_64-libsamplerate \
mingw-w64-x86_64-soundtouch \
mingw-w64-x86_64-wineditline \
mingw-w64-x86_64-pcre \
mingw-w64-x86_64-cppunit \
mingw-w64-x86_64-taglib \
mingw-w64-x86_64-dlfcn \
mingw-w64-x86_64-gobject-introspection \
mingw-w64-x86_64-gtk-doc \
mingw-w64-x86_64-gnome-common \
mingw-w64-x86_64-atk \
mingw-w64-x86_64-libpng \
mingw-w64-x86_64-harfbuzz \
mingw-w64-x86_64-cairo \
mingw-w64-x86_64-fontconfig \
mingw-w64-x86_64-freetype \
mingw-w64-x86_64-pixman \
mingw-w64-x86_64-pango \
mingw-w64-x86_64-libjpeg-turbo \
mingw-w64-x86_64-jasper \
mingw-w64-x86_64-libtiff \
mingw-w64-x86_64-shared-mime-info \
mingw-w64-x86_64-gtk2 \
mingw-w64-x86_64-libsigc++ \
mingw-w64-x86_64-cairomm \
mingw-w64-x86_64-glibmm \
mingw-w64-x86_64-atkmm \
mingw-w64-x86_64-pangomm \
mingw-w64-x86_64-gtkmm \
mingw-w64-x86_64-rubberband \
mingw-w64-x86_64-vamp-plugin-sdk \
mingw-w64-x86_64-meson \
mingw-w64-x86_64-giflib \
mingw-w64-x86_64-libexif \
mingw-w64-x86_64-expat \
mingw-w64-x86_64-libffi \
mingw-w64-x86_64-gettext \
mingw-w64-x86_64-fribidi \
mingw-w64-x86_64-libepoxy \
mingw-w64-x86_64-libgnurx \
mingw-w64-x86_64-ncurses \
mingw-w64-x86_64-gdk-pixbuf2 \
mingw-w64-x86_64-libgdiplus \
mingw-w64-x86_64-libarchive

ln -s /mingw64/bin/mingw32-make.exe /mingw64/bin/make.exe

# Build the following packages with these commands in /usr/src:
cd /usr/src
cd #PACKAGE_DIR#
makepkg-mingw -g >> PKGBUILD
makepkg-mingw
pacman -U *.pkg.tar.xz
cd ..

mingw-w64-liblo
mingw-w64-serd
mingw-w64-sord
mingw-w64-lv2
mingw-w64-sratom
mingw-w64-lilv
mingw-w64-aubio
mingw-w64-suil
mingw-w64-portaudio
mingw-w64-jack
mingw-w64-libltc

4. Build Ardour
cd /usr/src
git clone --recurse-submodules -b master git://github.com/ardour/ardour.git
cd /usr/src/ardour
export CFLAGS="-mstackrealign -mxsave -mmmx -msse"
export CPPFLAGS="-mstackrealign -mxsave -mmmx -msse"
# Patches
sed -i 's/#!\/usr\/bin\/env python/#!\/usr\/bin\/env python2/' waf
sed -i 's/Libs: -L${libdir} -larchive/Libs: -L${libdir} -larchive -lbcrypt/' /mingw64/lib/pkgconfig/libarchive.pc
# Build
#./waf distclean
#./waf configure --keepflags --dist-target=mingw --prefix=${PREFIX} --ptformat --windows-vst --with-backends=jack,dummy,portaudio # Debug version
./waf configure --dist-target=mingw --ptformat --optimize --windows-vst --with-backends=jack,portaudio,dummy
./waf
#./waf i18n

5. Pack files
# Place ardour_pack.sh in /usr/src
./ardour_pack.sh

NOTE: The Ardour git build still does not work, because of some bugs in the code. It can compile just fine, but some more tweaking is needed to make it usable. If you want to contribute, feel free to get in touch.

Latest error:

Ardour: [ERROR]: ControlProtocolManager: module “F:\a\usr\src\ardour6\lib\ardour6\surfaces\ardourcp.dll” has no descriptor function.
Ardour: [ERROR]: ‘protocol_descriptor’: The specified procedure could not be found.
Ardour: [ERROR]: ControlProtocolManager: cannot load module “F:\a\usr\src\ardour6\lib\ardour6\surfaces\ardour_contourdesign.dll” (‘F:\a\usr\src\ardour6\lib\ardour6\surfaces\ardour_contourdesign.dll’: The specified module could not be found.)
Ardour: [ERROR]: ControlProtocolManager: cannot load module “F:\a\usr\src\ardour6\lib\ardour6\surfaces\ardour_push2.dll” (‘F:\a\usr\src\ardour6\lib\ardour6\surfaces\ardour_push2.dll’: The specified module could not be found.)
Ardour: [ERROR]: AudioEngine: cannot load module “F:\a\usr\src\ardour6\lib\ardour6\backends\jack_audiobackend.dll” (‘F:\a\usr\src\ardour6\lib\ardour6\backends\jack_audiobackend.dll’: The specified module could not be found.)
Ardour: [ERROR]: AudioEngine: cannot load module “F:\a\usr\src\ardour6\lib\ardour6\backends\portaudio_callback_backend.dll” (‘F:\a\usr\src\ardour6\lib\ardour6\backends\portaudio_callback_backend.dll’: The specified module could not be found.)
Copyright © 2017-2022 musicsecrets.euniversity.pub. All Rights Reserved.