btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / li / lilv / package.nix
blobf0c2aa304546be08514642e36db50c94252a612d
1 { lib
2 , stdenv
3 , fetchurl
4 , lv2
5 , meson
6 , ninja
7 , pkg-config
8 , python3
9 , libsndfile
10 , serd
11 , sord
12 , sratom
13 , gitUpdater
15 # test derivations
16 , pipewire
19 stdenv.mkDerivation rec {
20   pname = "lilv";
21   version = "0.24.24";
23   outputs = [ "out" "dev" "man" ];
25   src = fetchurl {
26     url = "https://download.drobilla.net/${pname}-${version}.tar.xz";
27     hash = "sha256-a7a+n4hQQXbQZC8S3oCbK54txVYhporbjH7bma76u08=";
28   };
30   nativeBuildInputs = [ meson ninja pkg-config python3 ];
31   buildInputs = [ libsndfile serd sord sratom ];
32   propagatedBuildInputs = [ lv2 ];
34   mesonFlags = [
35     (lib.mesonOption "docs" "disabled")
36     # Tests require building a shared library.
37     (lib.mesonEnable "tests" (!stdenv.hostPlatform.isStatic))
38   ] # Add nix and NixOS specific lv2 paths
39     # The default values are from: https://github.com/lv2/lilv/blob/master/src/lilv_config.h
40     ++ lib.optional stdenv.isDarwin  (lib.mesonOption "default_lv2_path"
41       "~/.lv2:~/Library/Audio/Plug-Ins/LV2:"
42       + "/usr/local/lib/lv2:/usr/lib/lv2:"
43       + "/Library/Audio/Plug-Ins/LV2:"
44       + "~/.nix-profile/lib/lv2")
45     ++ lib.optional stdenv.isLinux  (lib.mesonOption "default_lv2_path"
46       "~/.lv2:/usr/local/lib/lv2:/usr/lib/lv2:"
47       + "~/.nix-profile/lib/lv2:/run/current-system/sw/lib/lv2");
49   passthru = {
50     tests = {
51       inherit pipewire;
52     };
53     updateScript = gitUpdater {
54       url = "https://gitlab.com/lv2/lilv.git";
55       rev-prefix = "v";
56     };
57   };
59   meta = with lib; {
60     homepage = "http://drobilla.net/software/lilv";
61     description = "C library to make the use of LV2 plugins";
62     license = licenses.mit;
63     maintainers = [ ];
64     platforms = platforms.unix;
65   };