@@ -0,0 +1,86 @@
1+{ stdenv, fetchFromGitHub, alsaLib, aubio, boost, cairomm, curl, doxygen, dbus, fftw
2+, fftwSinglePrec, flac, glibc, glibmm, graphviz, gtkmm2, libjack2
3+, libgnomecanvas, libgnomecanvasmm, liblo, libmad, libogg, librdf
4+, librdf_raptor, librdf_rasqal, libsamplerate, libsigcxx, libsndfile
5+, libusb, libuuid, libxml2, libxslt, lilv-svn, lv2, makeWrapper, pango
6+, perl, pkgconfig, python, rubberband, serd, sord-svn, sratom, suil, taglib, vampSDK }:
7+
8+let
9+
10+ # Ardour git repo uses a mix of annotated and lightweight tags. Annotated
11+ # tags are used for MAJOR.MINOR versioning, and lightweight tags are used
12+ # in-between; MAJOR.MINOR.REV where REV is the number of commits since the
13+ # last annotated tag. A slightly different version string format is needed
14+ # for the 'revision' info that is built into the binary; it is the format of
15+ # "git describe" when _not_ on an annotated tag(!): MAJOR.MINOR-REV-HASH.
16+
17+ # Version to build.
18+ tag = "4.7";
19+
20+in
21+
22+stdenv.mkDerivation rec {
23+ name = "ardour-${tag}";
24+
25+ src = fetchFromGitHub {
26+ owner = "Ardour";
27+ repo = "ardour";
28+ rev = "d84a8222f2b6dab5028b2586f798535a8766670e";
29+ sha256 = "149gswphz77m3pkzsn2nqbm6yvcfa3fva560bcvjzlgb73f64q5l";
30+ };
31+
32+ buildInputs =
33+ [ alsaLib aubio boost cairomm curl doxygen dbus fftw fftwSinglePrec flac glibc
34+ glibmm graphviz gtkmm2 libjack2 libgnomecanvas libgnomecanvasmm liblo
35+ libmad libogg librdf librdf_raptor librdf_rasqal libsamplerate
36+ libsigcxx libsndfile libusb libuuid libxml2 libxslt lilv-svn lv2
37+ makeWrapper pango perl pkgconfig python rubberband serd sord-svn sratom suil taglib vampSDK
38+ ];
39+
40+ # ardour's wscript has a "tarball" target but that required the git revision
41+ # be available. Since this is an unzipped tarball fetched from github we
42+ # have to do that ourself.
43+ patchPhase = ''
44+ printf '#include "libs/ardour/ardour/revision.h"\nnamespace ARDOUR { const char* revision = \"${tag}-${builtins.substring 0 8 src.rev}\"; }\n' > libs/ardour/revision.cc
45+ sed 's|/usr/include/libintl.h|${glibc.dev}/include/libintl.h|' -i wscript
46+ patchShebangs ./tools/
47+ '';
48+
49+ configurePhase = "python waf configure --optimize --docs --with-backends=jack,alsa --prefix=$out";
50+
51+ buildPhase = "python waf";
52+
53+ installPhase = ''
54+ python waf install
55+ # Install desktop file
56+ mkdir -p "$out/share/applications"
57+ cat > "$out/share/applications/ardour.desktop" << EOF
58+ [Desktop Entry]
59+ Name=Ardour 4
60+ GenericName=Digital Audio Workstation
61+ Comment=Multitrack harddisk recorder
62+ Exec=$out/bin/ardour4
63+ Icon=$out/share/ardour4/icons/ardour_icon_256px.png
64+ Terminal=false
65+ Type=Application
66+ X-MultipleArgs=false
67+ Categories=GTK;Audio;AudioVideoEditing;AudioVideo;Video;
68+ EOF
69+ '';
70+
71+ meta = with stdenv.lib; {
72+ description = "Multi-track hard disk recording software";
73+ longDescription = ''
74+ Ardour is a digital audio workstation (DAW), You can use it to
75+ record, edit and mix multi-track audio and midi. Produce your
76+ own CDs. Mix video soundtracks. Experiment with new ideas about
77+ music and sound.
78+ Please consider supporting the ardour project financially:
79+ https://community.ardour.org/node/8288
80+ '';
81+ homepage = http://ardour.org/;
82+ license = licenses.gpl2;
83+ platforms = platforms.linux;
84+ maintainers = [ maintainers.goibhniu maintainers.fps ];
85+ };
86+}