nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 m4,
6 acl,
7 libcap,
8}:
9
10stdenv.mkDerivation (finalAttrs: {
11 pname = "cdrtools";
12 version = "3.02a09";
13
14 src = fetchurl {
15 url = "mirror://sourceforge/cdrtools/cdrtools-${finalAttrs.version}.tar.bz2";
16 hash = "sha256-qihDj0WO8/MUt58gKdsnZ52uHV/+FWm23ld0JRGRXoE=";
17 };
18
19 nativeBuildInputs = [ m4 ];
20
21 buildInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [
22 acl
23 libcap
24 ];
25
26 env.NIX_CFLAGS_COMPILE = toString (
27 [
28 "-Wno-error=implicit-int"
29 "-Wno-error=implicit-function-declaration"
30 "-std=gnu89" # Isn't compatible with C23
31 ]
32 # https://github.com/macports/macports-ports/commit/656932616eebe60f4e8cfd96d8268801dad8224d
33 ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
34 "-DNO_SCANSTACK"
35 ]
36 );
37
38 postPatch = ''
39 sed "/\.mk3/d" -i libschily/Targets.man
40 substituteInPlace man/Makefile --replace "man4" ""
41 substituteInPlace RULES/rules.prg --replace "/bin/" ""
42
43 ln -sv i386-darwin-clang64.rul RULES/arm64-darwin-cc.rul
44 ln -sv i386-darwin-clang64.rul RULES/arm64-darwin-clang.rul
45 ln -sv i386-darwin-clang64.rul RULES/arm64-darwin-clang64.rul
46 ln -sv i586-linux-cc.rul RULES/riscv64-linux-cc.rul
47 '';
48
49 dontConfigure = true;
50
51 makeFlags = [
52 "GMAKE_NOWARN=true"
53 "INS_BASE=/"
54 "INS_RBASE=/"
55 "DESTDIR=${placeholder "out"}"
56 ];
57
58 enableParallelBuilding = false; # parallel building fails on some linux machines
59
60 hardeningDisable = lib.optional stdenv.hostPlatform.isMusl "fortify";
61
62 meta = {
63 homepage = "https://cdrtools.sourceforge.net/private/cdrecord.html";
64 description = "Highly portable CD/DVD/BluRay command line recording software";
65 license = with lib.licenses; [
66 cddl
67 gpl2Plus
68 lgpl21Plus
69 ];
70 maintainers = with lib.maintainers; [ wegank ];
71 platforms = with lib.platforms; linux ++ darwin;
72 # Licensing issues: This package contains code licensed under CDDL, GPL2
73 # and LGPL2. There is a debate regarding the legality of distributing this
74 # package in binary form.
75 hydraPlatforms = [ ];
76 };
77})