1 { lib, stdenv, fetchurl, m4, acl, libcap, Carbon, IOKit }:
3 stdenv.mkDerivation rec {
8 url = "mirror://sourceforge/cdrtools/${pname}-${version}.tar.bz2";
9 sha256 = "10ayj48jax2pvsv6j5gybwfsx7b74zdjj84znwag7wwf8n7l6a5a";
12 nativeBuildInputs = [ m4 ];
13 buildInputs = if stdenv.hostPlatform.isDarwin then [ Carbon IOKit ] else [ acl libcap ];
16 sed "/\.mk3/d" -i libschily/Targets.man
17 substituteInPlace man/Makefile --replace "man4" ""
18 substituteInPlace RULES/rules.prg --replace "/bin/" ""
20 ln -sv i386-darwin-clang64.rul RULES/arm64-darwin-cc.rul
21 ln -sv i386-darwin-clang64.rul RULES/arm64-darwin-clang.rul
22 ln -sv i386-darwin-clang64.rul RULES/arm64-darwin-clang64.rul
23 ln -sv i586-linux-cc.rul RULES/riscv64-linux-cc.rul
28 makeFlags = [ "GMAKE_NOWARN=true" "INS_BASE=/" "INS_RBASE=/" "DESTDIR=${placeholder "out"}" ];
30 enableParallelBuilding = false; # parallel building fails on some linux machines
32 hardeningDisable = lib.optional stdenv.hostPlatform.isMusl "fortify";
35 homepage = "https://cdrtools.sourceforge.net/private/cdrecord.html";
36 description = "Highly portable CD/DVD/BluRay command line recording software";
37 license = with licenses; [ cddl gpl2Plus lgpl21 ];
38 platforms = with platforms; linux ++ darwin;
39 # Licensing issues: This package contains code licensed under CDDL, GPL2
40 # and LGPL2. There is a debate regarding the legality of distributing this
41 # package in binary form.