nixpkgs/pkgs/applications/audio/ardour/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

182 lines
3.7 KiB
Nix

{ lib, stdenv
, fetchgit
, alsaLib
, aubio
, boost
, cairomm
, cppunit
, curl
, dbus
, doxygen
, ffmpeg_3
, fftw
, fftwSinglePrec
, flac
, glibc
, glibmm
, graphviz
, gtkmm2
, itstool
, libarchive
, libjack2
, liblo
, libogg
, libpulseaudio
, librdf_raptor
, librdf_rasqal
, libsamplerate
, libsigcxx
, libsndfile
, libusb1
, libuv
, libwebsockets
, libxml2
, libxslt
, lilv
, lrdf
, lv2
, pango
, perl
, pkg-config
, python3
, readline
, rubberband
, serd
, sord
, soundtouch
, sratom
, suil
, taglib
, vamp-plugin-sdk
, wafHook
}:
stdenv.mkDerivation rec {
pname = "ardour";
version = "6.5";
# don't fetch releases from the GitHub mirror, they are broken
src = fetchgit {
url = "git://git.ardour.org/ardour/ardour.git";
rev = version;
sha256 = "0sd38hchyr16biq9hcxha4ljy3pf0yhcgn90i5zfqcznnc57ildx";
};
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
perl
pkg-config
python3
wafHook
];
buildInputs = [
alsaLib
aubio
boost
cairomm
cppunit
curl
dbus
ffmpeg_3
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
];
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_3}/bin/ffmpeg");' \
--replace 'ffprobe_exe = X_("");' 'ffprobe_exe = X_("${ffmpeg_3}/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"
'';
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.gpl2;
platforms = platforms.linux;
maintainers = with maintainers; [ goibhniu magnetophon ];
};
}