Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at netboot-syslinux-multiplatform 76 lines 2.8 kB view raw
1{lib, stdenv, fetchurl, cmake, libcap, zlib, bzip2, perl, iconv, darwin}: 2 3stdenv.mkDerivation rec { 4 pname = "cdrkit"; 5 version = "1.1.11"; 6 7 src = fetchurl { 8 url = "http://cdrkit.org/releases/cdrkit-${version}.tar.gz"; 9 sha256 = "1nj7iv3xrq600i37na9a5idd718piiiqbs4zxvpjs66cdrsk1h6i"; 10 }; 11 12 nativeBuildInputs = [ cmake ]; 13 buildInputs = [ zlib bzip2 perl ] ++ 14 lib.optionals stdenv.isLinux [ libcap ] ++ 15 lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ Carbon IOKit iconv ]); 16 17 hardeningDisable = [ "format" ]; 18 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isMusl "-D__THROW="; 19 20 # efi-boot-patch extracted from http://arm.koji.fedoraproject.org/koji/rpminfo?rpmID=174244 21 patches = [ ./include-path.patch ./cdrkit-1.1.9-efi-boot.patch ./cdrkit-1.1.11-fno-common.patch ]; 22 23 postPatch = lib.optionalString stdenv.isDarwin '' 24 substituteInPlace libusal/scsi-mac-iokit.c \ 25 --replace "IOKit/scsi-commands/SCSITaskLib.h" "IOKit/scsi/SCSITaskLib.h" 26 substituteInPlace genisoimage/sha256.c \ 27 --replace "<endian.h>" "<machine/endian.h>" 28 substituteInPlace genisoimage/sha512.c \ 29 --replace "<endian.h>" "<machine/endian.h>" 30 substituteInPlace genisoimage/sha256.h \ 31 --replace "__THROW" "" 32 substituteInPlace genisoimage/sha512.h \ 33 --replace "__THROW" "" 34 ''; 35 36 preConfigure = lib.optionalString stdenv.hostPlatform.isMusl '' 37 substituteInPlace include/xconfig.h.in \ 38 --replace "#define HAVE_RCMD 1" "#undef HAVE_RCMD" 39 ''; 40 41 postConfigure = lib.optionalString stdenv.isDarwin '' 42 for f in */CMakeFiles/*.dir/link.txt ; do 43 substituteInPlace "$f" \ 44 --replace "-lrt" "-framework IOKit" 45 done 46 ''; 47 48 postInstall = '' 49 # file name compatibility with the old cdrecord (growisofs wants this name) 50 ln -s $out/bin/genisoimage $out/bin/mkisofs 51 ln -s $out/bin/wodim $out/bin/cdrecord 52 ''; 53 54 cmakeFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "-DBITFIELDS_HTOL=0" ]; 55 56 makeFlags = [ "PREFIX=\$(out)" ]; 57 58 meta = { 59 description = "Portable command-line CD/DVD recorder software, mostly compatible with cdrtools"; 60 61 longDescription = '' 62 Cdrkit is a suite of programs for recording CDs and DVDs, 63 blanking CD-RW media, creating ISO-9660 filesystem images, 64 extracting audio CD data, and more. The programs included in 65 the cdrkit package were originally derived from several sources, 66 most notably mkisofs by Eric Youngdale and others, cdda2wav by 67 Heiko Eissfeldt, and cdrecord by Jörg Schilling. However, 68 cdrkit is not affiliated with any of these authors; it is now an 69 independent project. 70 ''; 71 72 homepage = "http://cdrkit.org/"; 73 license = lib.licenses.gpl2; 74 platforms = lib.platforms.unix; 75 }; 76}