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