Fix invalid pythonImportsCheck attributes (#374927)
[NixPkgs.git] / pkgs / applications / audio / cdparanoia / default.nix
blobe3760c9e2012728bbeb16ce32ae55515b2183c7d
2   lib,
3   stdenv,
4   fetchurl,
5   fetchpatch,
6   updateAutotoolsGnuConfigScriptsHook,
7   autoreconfHook,
8 }:
10 stdenv.mkDerivation rec {
11   pname = "cdparanoia-III";
12   version = "10.2";
14   src = fetchurl {
15     url = "https://downloads.xiph.org/releases/cdparanoia/cdparanoia-III-${version}.src.tgz";
16     sha256 = "1pv4zrajm46za0f6lv162iqffih57a8ly4pc69f7y0gfyigb8p80";
17   };
19   patches =
20     lib.optionals stdenv.hostPlatform.isDarwin [
21       (fetchpatch {
22         url = "https://github.com/macports/macports-ports/raw/c8e15973bc3c1e1ab371bc0ee2de14209e639f17/audio/cdparanoia/files/osx_interface.patch";
23         hash = "sha256-9p4+9dRvqLHkpR0RWLQcNL1m7fb7L6r+c9Q2tt4jh0U=";
24         # Our configure patch will subsume it, but we want our configure
25         # patch to be used on all platforms so we cannot just start where
26         # this leaves off.
27         excludes = [ "configure.in" ];
28       })
29       (fetchurl {
30         url = "https://trac.macports.org/export/70964/trunk/dports/audio/cdparanoia/files/patch-paranoia_paranoia.c.10.4.diff";
31         hash = "sha256-TW1RkJ0bKaPIrDSfUTKorNlmKDVRF++z8ZJAjSzEgp4=";
32       })
33       # add missing include files needed for function prototypes
34       (fetchpatch {
35         url = "https://github.com/macports/macports-ports/raw/f210a6061bc53c746730a37922399c6de6d69cb7/audio/cdparanoia/files/fixing-include.patch";
36         hash = "sha256-6a/u4b8/H/4XjyFup23xySgyAI9SMVMom4PLvH8KzhE=";
37       })
38     ]
39     ++ [
40       # Has to come after darwin patches
41       ./fix_private_keyword.patch
42       # Order does not matter
43       ./configure.patch
44       # labs for long
45       (fetchpatch {
46         url = "https://github.com/macports/macports-ports/raw/f210a6061bc53c746730a37922399c6de6d69cb7/audio/cdparanoia/files/fixing-labs.patch";
47         hash = "sha256-BMMQ5bbPP3eevuwWUVjQCtRBiWbkAHD+O0C0fp+BPaw=";
48       })
49       # use "%s" for passing a buffer to fprintf
50       (fetchpatch {
51         url = "https://github.com/macports/macports-ports/raw/f210a6061bc53c746730a37922399c6de6d69cb7/audio/cdparanoia/files/fixing-fprintf.patch";
52         hash = "sha256-2dJl16p+f5l3wxVOJhsuLiQ9a4prq7jsRZP8/ygEae4=";
53       })
54       # add support for IDE4-9
55       (fetchpatch {
56         url = "https://salsa.debian.org/optical-media-team/cdparanoia/-/raw/bbf353721834b3784ccc0fd54a36a6b25181f5a4/debian/patches/02-ide-devices.patch";
57         hash = "sha256-S6OzftUIPPq9JHsoAE2K51ltsI1WkVaQrpgCjgm5AG4=";
58       })
59       # check buffer is non-null before dereferencing
60       (fetchpatch {
61         url = "https://salsa.debian.org/optical-media-team/cdparanoia/-/raw/f7bab3024c5576da1fdb7497abbd6abc8959a98c/debian/patches/04-endian.patch";
62         hash = "sha256-krfprwls0L3hsNfoj2j69J5k1RTKEQtzE0fLYG9EJKo=";
63       })
64     ]
65     ++ lib.optional stdenv.hostPlatform.isMusl ./utils.patch;
67   nativeBuildInputs = [
68     updateAutotoolsGnuConfigScriptsHook
69     autoreconfHook
70   ];
72   # Build system reuses the same object file names for shared and static
73   # library. Occasionally fails in the middle:
74   #    gcc -O2 -fsigned-char -g -O2 -c scan_devices.c
75   #    rm  -f *.o core *~ *.out
76   #    gcc -O2 -fsigned-char -g -O2 -fpic -c scan_devices.c
77   #    gcc -fpic -shared -o libcdda_interface.so.0.10.2 ... scan_devices.o ...
78   #    scan_devices.o: file not recognized: file format not recognized
79   enableParallelBuilding = false;
81   meta = with lib; {
82     homepage = "https://xiph.org/paranoia";
83     description = "Tool and library for reading digital audio from CDs";
84     license = with licenses; [
85       gpl2Plus
86       lgpl21Plus
87     ];
88     platforms = platforms.unix;
89     mainProgram = "cdparanoia";
90   };