6 updateAutotoolsGnuConfigScriptsHook,
10 stdenv.mkDerivation rec {
11 pname = "cdparanoia-III";
15 url = "https://downloads.xiph.org/releases/cdparanoia/cdparanoia-III-${version}.src.tgz";
16 sha256 = "1pv4zrajm46za0f6lv162iqffih57a8ly4pc69f7y0gfyigb8p80";
20 lib.optionals stdenv.hostPlatform.isDarwin [
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
27 excludes = [ "configure.in" ];
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=";
33 # add missing include files needed for function prototypes
35 url = "https://github.com/macports/macports-ports/raw/f210a6061bc53c746730a37922399c6de6d69cb7/audio/cdparanoia/files/fixing-include.patch";
36 hash = "sha256-6a/u4b8/H/4XjyFup23xySgyAI9SMVMom4PLvH8KzhE=";
40 # Has to come after darwin patches
41 ./fix_private_keyword.patch
42 # Order does not matter
46 url = "https://github.com/macports/macports-ports/raw/f210a6061bc53c746730a37922399c6de6d69cb7/audio/cdparanoia/files/fixing-labs.patch";
47 hash = "sha256-BMMQ5bbPP3eevuwWUVjQCtRBiWbkAHD+O0C0fp+BPaw=";
49 # use "%s" for passing a buffer to fprintf
51 url = "https://github.com/macports/macports-ports/raw/f210a6061bc53c746730a37922399c6de6d69cb7/audio/cdparanoia/files/fixing-fprintf.patch";
52 hash = "sha256-2dJl16p+f5l3wxVOJhsuLiQ9a4prq7jsRZP8/ygEae4=";
54 # add support for IDE4-9
56 url = "https://salsa.debian.org/optical-media-team/cdparanoia/-/raw/bbf353721834b3784ccc0fd54a36a6b25181f5a4/debian/patches/02-ide-devices.patch";
57 hash = "sha256-S6OzftUIPPq9JHsoAE2K51ltsI1WkVaQrpgCjgm5AG4=";
59 # check buffer is non-null before dereferencing
61 url = "https://salsa.debian.org/optical-media-team/cdparanoia/-/raw/f7bab3024c5576da1fdb7497abbd6abc8959a98c/debian/patches/04-endian.patch";
62 hash = "sha256-krfprwls0L3hsNfoj2j69J5k1RTKEQtzE0fLYG9EJKo=";
65 ++ lib.optional stdenv.hostPlatform.isMusl ./utils.patch;
68 updateAutotoolsGnuConfigScriptsHook
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;
82 homepage = "https://xiph.org/paranoia";
83 description = "Tool and library for reading digital audio from CDs";
84 license = with licenses; [
88 platforms = platforms.unix;
89 mainProgram = "cdparanoia";