From 270641fe05e3370ef839ab8128c3ed14ec6ca8c1 Mon Sep 17 00:00:00 2001 From: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Date: Sun, 16 Oct 2022 16:29:45 +0100 Subject: [PATCH 1/6] ardour: 6.9 -> 7.1 Release notes for 7.1: https://ardour.org/whatsnew.html (long-term link: https://ardour.org/news/7.1.html) Additionally create an 'ardour6' package for those that may wish to stay on a more stable release. To potentially be removed once 7.x stabilises. --- pkgs/applications/audio/ardour/6.nix | 190 +++++++++++++++++++++ pkgs/applications/audio/ardour/default.nix | 10 +- pkgs/top-level/all-packages.nix | 1 + 3 files changed, 196 insertions(+), 5 deletions(-) create mode 100644 pkgs/applications/audio/ardour/6.nix diff --git a/pkgs/applications/audio/ardour/6.nix b/pkgs/applications/audio/ardour/6.nix new file mode 100644 index 0000000000000..d5afcac86cd48 --- /dev/null +++ b/pkgs/applications/audio/ardour/6.nix @@ -0,0 +1,190 @@ +{ lib, stdenv +, fetchgit +, alsa-lib +, aubio +, boost +, cairomm +, cppunit +, curl +, dbus +, doxygen +, ffmpeg +, fftw +, fftwSinglePrec +, flac +, glibc +, glibmm +, graphviz +, gtkmm2 +, harvid +, itstool +, libarchive +, libjack2 +, liblo +, libogg +, libpulseaudio +, librdf_raptor +, librdf_rasqal +, libsamplerate +, libsigcxx +, libsndfile +, libusb1 +, libuv +, libwebsockets +, libxml2 +, libxslt +, lilv +, lrdf +, lv2 +, makeWrapper +, pango +, perl +, pkg-config +, python3 +, readline +, rubberband +, serd +, sord +, soundtouch +, sratom +, suil +, taglib +, vamp-plugin-sdk +, wafHook +, xjadeo +, videoSupport ? true +}: +stdenv.mkDerivation rec { + pname = "ardour"; + version = "6.9"; + + # don't fetch releases from the GitHub mirror, they are broken + src = fetchgit { + url = "git://git.ardour.org/ardour/ardour.git"; + rev = version; + sha256 = "0vlcbd70y0an881zv87kc3akmaiz4w7whsy3yaiiqqjww35jg1mm"; + }; + + patches = [ + # AS=as in the environment causes build failure https://tracker.ardour.org/view.php?id=8096 + ./as-flags.patch + ]; + + nativeBuildInputs = [ + doxygen + graphviz # for dot + itstool + makeWrapper + perl + pkg-config + python3 + wafHook + ]; + + buildInputs = [ + alsa-lib + aubio + boost + cairomm + cppunit + curl + dbus + ffmpeg + fftw + fftwSinglePrec + flac + glibmm + gtkmm2 + itstool + libarchive + libjack2 + liblo + libogg + libpulseaudio + librdf_raptor + librdf_rasqal + libsamplerate + libsigcxx + libsndfile + libusb1 + libuv + libwebsockets + libxml2 + libxslt + lilv + lrdf + lv2 + pango + perl + python3 + readline + rubberband + serd + sord + soundtouch + sratom + suil + taglib + vamp-plugin-sdk + ] ++ lib.optionals videoSupport [ harvid xjadeo ]; + + wafConfigureFlags = [ + "--cxx11" + "--docs" + "--freedesktop" + "--no-phone-home" + "--optimize" + "--ptformat" + "--run-tests" + "--test" + ]; + # removed because it fixes https://tracker.ardour.org/view.php?id=8161 and https://tracker.ardour.org/view.php?id=8437 + # "--use-external-libs" + + # Ardour's wscript requires git revision and date to be available. + # Since they are not, let's generate the file manually. + postPatch = '' + printf '#include "libs/ardour/ardour/revision.h"\nnamespace ARDOUR { const char* revision = "${version}"; const char* date = ""; }\n' > libs/ardour/revision.cc + sed 's|/usr/include/libintl.h|${glibc.dev}/include/libintl.h|' -i wscript + patchShebangs ./tools/ + substituteInPlace libs/ardour/video_tools_paths.cc \ + --replace 'ffmpeg_exe = X_("");' 'ffmpeg_exe = X_("${ffmpeg}/bin/ffmpeg");' \ + --replace 'ffprobe_exe = X_("");' 'ffprobe_exe = X_("${ffmpeg}/bin/ffprobe");' + ''; + + postInstall = '' + # wscript does not install these for some reason + install -vDm 644 "build/gtk2_ardour/ardour.xml" \ + -t "$out/share/mime/packages" + install -vDm 644 "build/gtk2_ardour/ardour6.desktop" \ + -t "$out/share/applications" + for size in 16 22 32 48 256 512; do + install -vDm 644 "gtk2_ardour/resources/Ardour-icon_''${size}px.png" \ + "$out/share/icons/hicolor/''${size}x''${size}/apps/ardour6.png" + done + install -vDm 644 "ardour.1"* -t "$out/share/man/man1" + '' + lib.optionalString videoSupport '' + # `harvid` and `xjadeo` must be accessible in `PATH` for video to work. + wrapProgram "$out/bin/ardour6" \ + --prefix PATH : "${lib.makeBinPath [ harvid xjadeo ]}" + ''; + + LINKFLAGS = "-lpthread"; + + meta = with lib; { + description = "Multi-track hard disk recording software"; + longDescription = '' + Ardour is a digital audio workstation (DAW), You can use it to + record, edit and mix multi-track audio and midi. Produce your + own CDs. Mix video soundtracks. Experiment with new ideas about + music and sound. + + Please consider supporting the ardour project financially: + https://community.ardour.org/donate + ''; + homepage = "https://ardour.org/"; + license = licenses.gpl2Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ goibhniu magnetophon mitchmindtree ]; + }; +} diff --git a/pkgs/applications/audio/ardour/default.nix b/pkgs/applications/audio/ardour/default.nix index d5afcac86cd48..55e4b373f07e4 100644 --- a/pkgs/applications/audio/ardour/default.nix +++ b/pkgs/applications/audio/ardour/default.nix @@ -56,13 +56,13 @@ }: stdenv.mkDerivation rec { pname = "ardour"; - version = "6.9"; + version = "7.1"; # don't fetch releases from the GitHub mirror, they are broken src = fetchgit { url = "git://git.ardour.org/ardour/ardour.git"; rev = version; - sha256 = "0vlcbd70y0an881zv87kc3akmaiz4w7whsy3yaiiqqjww35jg1mm"; + sha256 = "eLF9n71tjdPA+ks0B8UonmPZqRgcZEA7ok79+m9PioU="; }; patches = [ @@ -156,16 +156,16 @@ stdenv.mkDerivation rec { # wscript does not install these for some reason install -vDm 644 "build/gtk2_ardour/ardour.xml" \ -t "$out/share/mime/packages" - install -vDm 644 "build/gtk2_ardour/ardour6.desktop" \ + install -vDm 644 "build/gtk2_ardour/ardour7.desktop" \ -t "$out/share/applications" for size in 16 22 32 48 256 512; do install -vDm 644 "gtk2_ardour/resources/Ardour-icon_''${size}px.png" \ - "$out/share/icons/hicolor/''${size}x''${size}/apps/ardour6.png" + "$out/share/icons/hicolor/''${size}x''${size}/apps/ardour7.png" done install -vDm 644 "ardour.1"* -t "$out/share/man/man1" '' + lib.optionalString videoSupport '' # `harvid` and `xjadeo` must be accessible in `PATH` for video to work. - wrapProgram "$out/bin/ardour6" \ + wrapProgram "$out/bin/ardour7" \ --prefix PATH : "${lib.makeBinPath [ harvid xjadeo ]}" ''; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7063674249b93..a01b3da3d696a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -26939,6 +26939,7 @@ with pkgs; aqemu = libsForQt5.callPackage ../applications/virtualization/aqemu { }; + ardour_6 = callPackage ../applications/audio/ardour/6.nix { }; ardour = callPackage ../applications/audio/ardour { }; arelle = with python3Packages; toPythonApplication arelle; From bf2cdd359dc8c2506f9fd6cfa5c92b9d4cf6a292 Mon Sep 17 00:00:00 2001 From: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Date: Thu, 20 Oct 2022 01:03:06 +0100 Subject: [PATCH 2/6] ardour: switch from the 'sha256' parameter to 'hash' --- pkgs/applications/audio/ardour/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/audio/ardour/default.nix b/pkgs/applications/audio/ardour/default.nix index 55e4b373f07e4..fa88e1083a3d0 100644 --- a/pkgs/applications/audio/ardour/default.nix +++ b/pkgs/applications/audio/ardour/default.nix @@ -62,7 +62,7 @@ stdenv.mkDerivation rec { src = fetchgit { url = "git://git.ardour.org/ardour/ardour.git"; rev = version; - sha256 = "eLF9n71tjdPA+ks0B8UonmPZqRgcZEA7ok79+m9PioU="; + hash = "sha256-eLF9n71tjdPA+ks0B8UonmPZqRgcZEA7ok79+m9PioU="; }; patches = [ From 11214b408e3287e0a8b5e483aed342e5940b967f Mon Sep 17 00:00:00 2001 From: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Date: Thu, 20 Oct 2022 01:08:37 +0100 Subject: [PATCH 3/6] ardour: replace hardcoded major version number Also fix a small formatting error in the import statements. --- pkgs/applications/audio/ardour/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/audio/ardour/default.nix b/pkgs/applications/audio/ardour/default.nix index fa88e1083a3d0..3e0b76528a4cf 100644 --- a/pkgs/applications/audio/ardour/default.nix +++ b/pkgs/applications/audio/ardour/default.nix @@ -1,4 +1,5 @@ -{ lib, stdenv +{ lib +, stdenv , fetchgit , alsa-lib , aubio @@ -156,16 +157,16 @@ stdenv.mkDerivation rec { # wscript does not install these for some reason install -vDm 644 "build/gtk2_ardour/ardour.xml" \ -t "$out/share/mime/packages" - install -vDm 644 "build/gtk2_ardour/ardour7.desktop" \ + install -vDm 644 "build/gtk2_ardour/ardour${lib.versions.major version}.desktop" \ -t "$out/share/applications" for size in 16 22 32 48 256 512; do install -vDm 644 "gtk2_ardour/resources/Ardour-icon_''${size}px.png" \ - "$out/share/icons/hicolor/''${size}x''${size}/apps/ardour7.png" + "$out/share/icons/hicolor/''${size}x''${size}/apps/ardour${lib.versions.major version}.png" done install -vDm 644 "ardour.1"* -t "$out/share/man/man1" '' + lib.optionalString videoSupport '' # `harvid` and `xjadeo` must be accessible in `PATH` for video to work. - wrapProgram "$out/bin/ardour7" \ + wrapProgram "$out/bin/ardour${lib.versions.major version}" \ --prefix PATH : "${lib.makeBinPath [ harvid xjadeo ]}" ''; From 718471edfed4d038cd374822fb7f91c7f55c33f6 Mon Sep 17 00:00:00 2001 From: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Date: Thu, 20 Oct 2022 01:11:27 +0100 Subject: [PATCH 4/6] ardour: move the postPatch stage after patch stage --- pkgs/applications/audio/ardour/default.nix | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pkgs/applications/audio/ardour/default.nix b/pkgs/applications/audio/ardour/default.nix index 3e0b76528a4cf..7ca15cd29b9bd 100644 --- a/pkgs/applications/audio/ardour/default.nix +++ b/pkgs/applications/audio/ardour/default.nix @@ -71,6 +71,17 @@ stdenv.mkDerivation rec { ./as-flags.patch ]; + # Ardour's wscript requires git revision and date to be available. + # Since they are not, let's generate the file manually. + postPatch = '' + printf '#include "libs/ardour/ardour/revision.h"\nnamespace ARDOUR { const char* revision = "${version}"; const char* date = ""; }\n' > libs/ardour/revision.cc + sed 's|/usr/include/libintl.h|${glibc.dev}/include/libintl.h|' -i wscript + patchShebangs ./tools/ + substituteInPlace libs/ardour/video_tools_paths.cc \ + --replace 'ffmpeg_exe = X_("");' 'ffmpeg_exe = X_("${ffmpeg}/bin/ffmpeg");' \ + --replace 'ffprobe_exe = X_("");' 'ffprobe_exe = X_("${ffmpeg}/bin/ffprobe");' + ''; + nativeBuildInputs = [ doxygen graphviz # for dot @@ -142,17 +153,6 @@ stdenv.mkDerivation rec { # removed because it fixes https://tracker.ardour.org/view.php?id=8161 and https://tracker.ardour.org/view.php?id=8437 # "--use-external-libs" - # Ardour's wscript requires git revision and date to be available. - # Since they are not, let's generate the file manually. - postPatch = '' - printf '#include "libs/ardour/ardour/revision.h"\nnamespace ARDOUR { const char* revision = "${version}"; const char* date = ""; }\n' > libs/ardour/revision.cc - sed 's|/usr/include/libintl.h|${glibc.dev}/include/libintl.h|' -i wscript - patchShebangs ./tools/ - substituteInPlace libs/ardour/video_tools_paths.cc \ - --replace 'ffmpeg_exe = X_("");' 'ffmpeg_exe = X_("${ffmpeg}/bin/ffmpeg");' \ - --replace 'ffprobe_exe = X_("");' 'ffprobe_exe = X_("${ffmpeg}/bin/ffprobe");' - ''; - postInstall = '' # wscript does not install these for some reason install -vDm 644 "build/gtk2_ardour/ardour.xml" \ From 0c6d6fab5dfff3878bc39244d9915e9a5bd0c9c1 Mon Sep 17 00:00:00 2001 From: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Date: Sun, 30 Oct 2022 16:21:12 +0000 Subject: [PATCH 5/6] ardour: clarify why fetchFromGitea fails with git.ardour.org --- pkgs/applications/audio/ardour/6.nix | 3 ++- pkgs/applications/audio/ardour/default.nix | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/audio/ardour/6.nix b/pkgs/applications/audio/ardour/6.nix index d5afcac86cd48..140d20c2aad5b 100644 --- a/pkgs/applications/audio/ardour/6.nix +++ b/pkgs/applications/audio/ardour/6.nix @@ -58,7 +58,8 @@ stdenv.mkDerivation rec { pname = "ardour"; version = "6.9"; - # don't fetch releases from the GitHub mirror, they are broken + # We can't use `fetchFromGitea` here, as attempting to fetch release archives from git.ardour.org + # result in an empty archive. See https://tracker.ardour.org/view.php?id=7328 for more info. src = fetchgit { url = "git://git.ardour.org/ardour/ardour.git"; rev = version; diff --git a/pkgs/applications/audio/ardour/default.nix b/pkgs/applications/audio/ardour/default.nix index 7ca15cd29b9bd..be0a593a963c3 100644 --- a/pkgs/applications/audio/ardour/default.nix +++ b/pkgs/applications/audio/ardour/default.nix @@ -59,7 +59,8 @@ stdenv.mkDerivation rec { pname = "ardour"; version = "7.1"; - # don't fetch releases from the GitHub mirror, they are broken + # We can't use `fetchFromGitea` here, as attempting to fetch release archives from git.ardour.org + # result in an empty archive. See https://tracker.ardour.org/view.php?id=7328 for more info. src = fetchgit { url = "git://git.ardour.org/ardour/ardour.git"; rev = version; From 67929885e8099106d8a5185c5bf1bde5b457fc10 Mon Sep 17 00:00:00 2001 From: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Date: Sun, 30 Oct 2022 18:01:45 +0000 Subject: [PATCH 6/6] ardour: install optional bundled content --- pkgs/applications/audio/ardour/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/applications/audio/ardour/default.nix b/pkgs/applications/audio/ardour/default.nix index be0a593a963c3..44b54111fd360 100644 --- a/pkgs/applications/audio/ardour/default.nix +++ b/pkgs/applications/audio/ardour/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchgit +, fetchzip , alsa-lib , aubio , boost @@ -67,6 +68,13 @@ stdenv.mkDerivation rec { hash = "sha256-eLF9n71tjdPA+ks0B8UonmPZqRgcZEA7ok79+m9PioU="; }; + bundledContent = fetchzip { + url = "https://web.archive.org/web/20221026200824/http://stuff.ardour.org/loops/ArdourBundledMedia.zip"; + hash = "sha256-IbPQWFeyMuvCoghFl1ZwZNNcSvLNsH84rGArXnw+t7A="; + # archive does not contain a single folder at the root + stripRoot = false; + }; + patches = [ # AS=as in the environment causes build failure https://tracker.ardour.org/view.php?id=8096 ./as-flags.patch @@ -165,6 +173,9 @@ stdenv.mkDerivation rec { "$out/share/icons/hicolor/''${size}x''${size}/apps/ardour${lib.versions.major version}.png" done install -vDm 644 "ardour.1"* -t "$out/share/man/man1" + + # install additional bundled beats, chords and progressions + cp -rp "${bundledContent}"/* "$out/share/ardour${lib.versions.major version}/media" '' + lib.optionalString videoSupport '' # `harvid` and `xjadeo` must be accessible in `PATH` for video to work. wrapProgram "$out/bin/ardour${lib.versions.major version}" \