|
| 1 | +{ |
| 2 | + lib, |
| 3 | + stdenv, |
| 4 | + fetchgit, |
| 5 | + fetchzip, |
| 6 | + alsa-lib, |
| 7 | + aubio, |
| 8 | + boost, |
| 9 | + cairomm, |
| 10 | + cppunit, |
| 11 | + curl, |
| 12 | + dbus, |
| 13 | + doxygen, |
| 14 | + ffmpeg, |
| 15 | + fftw, |
| 16 | + fftwSinglePrec, |
| 17 | + flac, |
| 18 | + fluidsynth, |
| 19 | + glibc, |
| 20 | + glibmm, |
| 21 | + graphviz, |
| 22 | + harvid, |
| 23 | + hidapi, |
| 24 | + itstool, |
| 25 | + kissfft, |
| 26 | + libarchive, |
| 27 | + libjack2, |
| 28 | + liblo, |
| 29 | + libltc, |
| 30 | + libogg, |
| 31 | + libpulseaudio, |
| 32 | + librdf_rasqal, |
| 33 | + libsamplerate, |
| 34 | + libsigcxx, |
| 35 | + libsndfile, |
| 36 | + libusb1, |
| 37 | + libuv, |
| 38 | + libwebsockets, |
| 39 | + libxml2, |
| 40 | + libxslt, |
| 41 | + lilv, |
| 42 | + lrdf, |
| 43 | + lv2, |
| 44 | + makeWrapper, |
| 45 | + pango, |
| 46 | + pangomm, |
| 47 | + perl, |
| 48 | + pkg-config, |
| 49 | + python3, |
| 50 | + qm-dsp, |
| 51 | + readline, |
| 52 | + rubberband, |
| 53 | + serd, |
| 54 | + sord, |
| 55 | + soundtouch, |
| 56 | + sratom, |
| 57 | + suil, |
| 58 | + taglib, |
| 59 | + vamp-plugin-sdk, |
| 60 | + wafHook, |
| 61 | + xjadeo, |
| 62 | + libxrandr, |
| 63 | + libxinerama, |
| 64 | + optimize ? true, # disable to print Lua DSP script output to stdout |
| 65 | + videoSupport ? true, |
| 66 | +}: |
| 67 | +stdenv.mkDerivation ( |
| 68 | + finalAttrs: |
| 69 | + let |
| 70 | + majorVersion = lib.versions.major finalAttrs.version; |
| 71 | + in |
| 72 | + { |
| 73 | + pname = "ardour"; |
| 74 | + version = "8.12"; |
| 75 | + |
| 76 | + # We can't use `fetchFromGitea` here, as attempting to fetch release archives from git.ardour.org |
| 77 | + # result in an empty archive. See https://tracker.ardour.org/view.php?id=7328 for more info. |
| 78 | + src = fetchgit { |
| 79 | + url = "git://git.ardour.org/ardour/ardour.git"; |
| 80 | + rev = finalAttrs.version; |
| 81 | + hash = "sha256-4IgBQ53cwPA35YwNQyo+qBqsMGv+TLn6w1zaDX97erE="; |
| 82 | + }; |
| 83 | + |
| 84 | + bundledContent = fetchzip { |
| 85 | + url = "https://web.archive.org/web/20221026200824/http://stuff.ardour.org/loops/ArdourBundledMedia.zip"; |
| 86 | + hash = "sha256-IbPQWFeyMuvCoghFl1ZwZNNcSvLNsH84rGArXnw+t7A="; |
| 87 | + # archive does not contain a single folder at the root |
| 88 | + stripRoot = false; |
| 89 | + }; |
| 90 | + |
| 91 | + patches = [ |
| 92 | + # AS=as in the environment causes build failure https://tracker.ardour.org/view.php?id=8096 |
| 93 | + ./as-flags.patch |
| 94 | + ./default-plugin-search-paths.patch |
| 95 | + ]; |
| 96 | + |
| 97 | + # Ardour's wscript requires git revision and date to be available. |
| 98 | + # Since they are not, let's generate the file manually. |
| 99 | + postPatch = '' |
| 100 | + printf '#include "libs/ardour/ardour/revision.h"\nnamespace ARDOUR { const char* revision = "${finalAttrs.version}"; const char* date = ""; }\n' > libs/ardour/revision.cc |
| 101 | + sed 's|/usr/include/libintl.h|${glibc.dev}/include/libintl.h|' -i wscript |
| 102 | + patchShebangs ./tools/ |
| 103 | + substituteInPlace libs/ardour/video_tools_paths.cc \ |
| 104 | + --replace-fail 'ffmpeg_exe = X_("");' 'ffmpeg_exe = X_("${ffmpeg}/bin/ffmpeg");' \ |
| 105 | + --replace-fail 'ffprobe_exe = X_("");' 'ffprobe_exe = X_("${ffmpeg}/bin/ffprobe");' |
| 106 | + ''; |
| 107 | + |
| 108 | + nativeBuildInputs = [ |
| 109 | + doxygen |
| 110 | + graphviz # for dot |
| 111 | + itstool |
| 112 | + makeWrapper |
| 113 | + perl |
| 114 | + pkg-config |
| 115 | + python3 |
| 116 | + wafHook |
| 117 | + ]; |
| 118 | + |
| 119 | + buildInputs = [ |
| 120 | + alsa-lib |
| 121 | + aubio |
| 122 | + boost |
| 123 | + cairomm |
| 124 | + cppunit |
| 125 | + curl |
| 126 | + dbus |
| 127 | + ffmpeg |
| 128 | + fftw |
| 129 | + fftwSinglePrec |
| 130 | + flac |
| 131 | + fluidsynth |
| 132 | + glibmm |
| 133 | + hidapi |
| 134 | + itstool |
| 135 | + kissfft |
| 136 | + libarchive |
| 137 | + libjack2 |
| 138 | + liblo |
| 139 | + libltc |
| 140 | + libogg |
| 141 | + libpulseaudio |
| 142 | + librdf_rasqal |
| 143 | + libsamplerate |
| 144 | + libsigcxx |
| 145 | + libsndfile |
| 146 | + libusb1 |
| 147 | + libuv |
| 148 | + libwebsockets |
| 149 | + libxml2 |
| 150 | + libxslt |
| 151 | + lilv |
| 152 | + lrdf |
| 153 | + lv2 |
| 154 | + pango |
| 155 | + pangomm |
| 156 | + perl |
| 157 | + python3 |
| 158 | + qm-dsp |
| 159 | + readline |
| 160 | + rubberband |
| 161 | + serd |
| 162 | + sord |
| 163 | + soundtouch |
| 164 | + sratom |
| 165 | + suil |
| 166 | + taglib |
| 167 | + vamp-plugin-sdk |
| 168 | + libxinerama |
| 169 | + libxrandr |
| 170 | + ] |
| 171 | + ++ lib.optionals videoSupport [ |
| 172 | + harvid |
| 173 | + xjadeo |
| 174 | + ]; |
| 175 | + |
| 176 | + wafConfigureFlags = [ |
| 177 | + "--cxx17" |
| 178 | + "--docs" |
| 179 | + "--freedesktop" |
| 180 | + "--no-phone-home" |
| 181 | + "--ptformat" |
| 182 | + "--run-tests" |
| 183 | + "--test" |
| 184 | + # since we don't have https://github.com/agfline/LibAAF yet, |
| 185 | + # we need to use some of ardours internal libs, see: |
| 186 | + # https://discourse.ardour.org/t/ardour-8-2-released/109615/6 |
| 187 | + # and |
| 188 | + # https://discourse.ardour.org/t/ardour-8-2-released/109615/8 |
| 189 | + # "--use-external-libs" |
| 190 | + ] |
| 191 | + ++ lib.optional optimize "--optimize"; |
| 192 | + |
| 193 | + postInstall = '' |
| 194 | + # wscript does not install these for some reason |
| 195 | + install -vDm 644 "build/gtk2_ardour/ardour.xml" \ |
| 196 | + -t "$out/share/mime/packages" |
| 197 | + install -vDm 644 "build/gtk2_ardour/ardour${majorVersion}.desktop" \ |
| 198 | + -t "$out/share/applications" |
| 199 | + for size in 16 22 32 48 256 512; do |
| 200 | + install -vDm 644 "gtk2_ardour/resources/Ardour-icon_''${size}px.png" \ |
| 201 | + "$out/share/icons/hicolor/''${size}x''${size}/apps/ardour${majorVersion}.png" |
| 202 | + done |
| 203 | + install -vDm 644 "ardour.1"* -t "$out/share/man/man1" |
| 204 | +
|
| 205 | + # install additional bundled beats, chords and progressions |
| 206 | + cp -rp "${finalAttrs.bundledContent}"/* "$out/share/ardour${majorVersion}/media" |
| 207 | + '' |
| 208 | + + lib.optionalString videoSupport '' |
| 209 | + # `harvid` and `xjadeo` must be accessible in `PATH` for video to work. |
| 210 | + wrapProgram "$out/bin/ardour${majorVersion}" \ |
| 211 | + --prefix PATH : "${ |
| 212 | + lib.makeBinPath [ |
| 213 | + harvid |
| 214 | + xjadeo |
| 215 | + ] |
| 216 | + }" |
| 217 | + ''; |
| 218 | + |
| 219 | + LINKFLAGS = "-lpthread"; |
| 220 | + |
| 221 | + meta = { |
| 222 | + description = "Multi-track hard disk recording software"; |
| 223 | + longDescription = '' |
| 224 | + Ardour is a digital audio workstation (DAW), You can use it to |
| 225 | + record, edit and mix multi-track audio and midi. Produce your |
| 226 | + own CDs. Mix video soundtracks. Experiment with new ideas about |
| 227 | + music and sound. |
| 228 | +
|
| 229 | + Please consider supporting the ardour project financially: |
| 230 | + https://community.ardour.org/donate |
| 231 | + ''; |
| 232 | + homepage = "https://ardour.org/"; |
| 233 | + license = lib.licenses.gpl2Plus; |
| 234 | + mainProgram = "ardour8"; |
| 235 | + platforms = lib.platforms.linux; |
| 236 | + maintainers = with lib.maintainers; [ |
| 237 | + magnetophon |
| 238 | + mitchmindtree |
| 239 | + ryand56 |
| 240 | + ]; |
| 241 | + }; |
| 242 | + } |
| 243 | +) |
0 commit comments