frigate.web: fix build on Node 22.12, add missing meta (#375967)
[NixPkgs.git] / pkgs / by-name / wh / whipper / package.nix
blob1d9019d97773ff83e5f92d11fc3875eb5739f30b
2   lib,
3   python3,
4   fetchFromGitHub,
5   fetchpatch,
6   installShellFiles,
7   wrapGAppsNoGuiHook,
8   gobject-introspection,
9   libcdio-paranoia,
10   cdrdao,
11   libsndfile,
12   glib,
13   flac,
14   sox,
15   util-linux,
16   testers,
17   whipper,
20 let
21   bins = [
22     libcdio-paranoia
23     cdrdao
24     flac
25     sox
26     util-linux
27   ];
29 python3.pkgs.buildPythonApplication rec {
30   pname = "whipper";
31   version = "0.10.0";
32   pyproject = true;
34   src = fetchFromGitHub {
35     owner = "whipper-team";
36     repo = "whipper";
37     rev = "v${version}";
38     sha256 = "00cq03cy5dyghmibsdsq5sdqv3bzkzhshsng74bpnb5lasxp3ia5";
39   };
41   patches = [
42     (fetchpatch {
43       # Use custom YAML subclass to be compatible with ruamel_yaml>=0.17
44       # https://github.com/whipper-team/whipper/pull/543
45       url = "https://github.com/whipper-team/whipper/commit/3ce5964dfe8be1e625c3e3b091360dd0bc34a384.patch";
46       sha256 = "0n9dmib884y8syvypsg88j0h71iy42n1qsrh0am8pwna63sl15ah";
47     })
48   ];
50   nativeBuildInputs = [
51     installShellFiles
52     wrapGAppsNoGuiHook
53     gobject-introspection
54   ];
56   build-system = with python3.pkgs; [
57     docutils
58     setuptools-scm
59   ];
61   propagatedBuildInputs = with python3.pkgs; [
62     musicbrainzngs
63     mutagen
64     pycdio
65     pygobject3
66     ruamel-yaml
67     discid
68     pillow
69     setuptools
70   ];
72   buildInputs = [
73     libsndfile
74     glib
75   ];
77   nativeCheckInputs =
78     with python3.pkgs;
79     [
80       twisted
81       pytestCheckHook
82     ]
83     ++ bins;
85   makeWrapperArgs = [
86     "--prefix"
87     "PATH"
88     ":"
89     (lib.makeBinPath bins)
90     "\${gappsWrapperArgs[@]}"
91   ];
93   dontWrapGApps = true;
95   outputs = [
96     "out"
97     "man"
98   ];
99   postBuild = ''
100     make -C man
101   '';
103   preCheck = ''
104     # disable tests that require internet access
105     # https://github.com/JoeLametta/whipper/issues/291
106     substituteInPlace whipper/test/test_common_accurip.py \
107       --replace "test_AccurateRipResponse" "dont_test_AccurateRipResponse"
108     export HOME=$TMPDIR
109   '';
111   postInstall = ''
112     installManPage man/*.1
113   '';
115   passthru.tests.version = testers.testVersion {
116     package = whipper;
117     command = "HOME=$TMPDIR whipper --version";
118   };
120   meta = with lib; {
121     homepage = "https://github.com/whipper-team/whipper";
122     description = "CD ripper aiming for accuracy over speed";
123     maintainers = with maintainers; [ emily ];
124     license = licenses.gpl3Plus;
125     platforms = platforms.unix;
126   };