2023-03-22 10:30:23 +00:00
|
|
|
{lib, stdenv, fetchurl, cmake, libcap, zlib, bzip2, perl, iconv, darwin}:
|
2007-10-19 14:16:43 +00:00
|
|
|
|
2008-12-16 14:06:46 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-08-12 19:47:47 +00:00
|
|
|
pname = "cdrkit";
|
|
|
|
version = "1.1.11";
|
2007-07-07 22:31:37 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-08-12 19:47:47 +00:00
|
|
|
url = "http://cdrkit.org/releases/cdrkit-${version}.tar.gz";
|
2012-03-14 00:44:14 +00:00
|
|
|
sha256 = "1nj7iv3xrq600i37na9a5idd718piiiqbs4zxvpjs66cdrsk1h6i";
|
2007-07-07 22:31:37 +00:00
|
|
|
};
|
|
|
|
|
2020-12-31 07:48:55 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2023-03-22 10:30:23 +00:00
|
|
|
buildInputs = [ zlib bzip2 perl ] ++
|
|
|
|
lib.optionals stdenv.isLinux [ libcap ] ++
|
|
|
|
lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ Carbon IOKit iconv ]);
|
2007-07-07 22:31:37 +00:00
|
|
|
|
2016-02-26 17:38:15 +00:00
|
|
|
hardeningDisable = [ "format" ];
|
2023-02-20 15:26:44 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isMusl "-D__THROW=";
|
2015-12-23 01:59:47 +00:00
|
|
|
|
2012-03-14 00:44:14 +00:00
|
|
|
# efi-boot-patch extracted from http://arm.koji.fedoraproject.org/koji/rpminfo?rpmID=174244
|
2021-09-24 21:28:41 +00:00
|
|
|
patches = [ ./include-path.patch ./cdrkit-1.1.9-efi-boot.patch ./cdrkit-1.1.11-fno-common.patch ];
|
2009-12-11 15:36:24 +00:00
|
|
|
|
2023-03-22 10:30:23 +00:00
|
|
|
postPatch = lib.optionalString stdenv.isDarwin ''
|
|
|
|
substituteInPlace libusal/scsi-mac-iokit.c \
|
|
|
|
--replace "IOKit/scsi-commands/SCSITaskLib.h" "IOKit/scsi/SCSITaskLib.h"
|
|
|
|
substituteInPlace genisoimage/sha256.c \
|
|
|
|
--replace "<endian.h>" "<machine/endian.h>"
|
|
|
|
substituteInPlace genisoimage/sha512.c \
|
|
|
|
--replace "<endian.h>" "<machine/endian.h>"
|
|
|
|
substituteInPlace genisoimage/sha256.h \
|
|
|
|
--replace "__THROW" ""
|
|
|
|
substituteInPlace genisoimage/sha512.h \
|
|
|
|
--replace "__THROW" ""
|
|
|
|
'';
|
|
|
|
|
2022-12-02 10:21:44 +00:00
|
|
|
preConfigure = lib.optionalString stdenv.hostPlatform.isMusl ''
|
|
|
|
substituteInPlace include/xconfig.h.in \
|
|
|
|
--replace "#define HAVE_RCMD 1" "#undef HAVE_RCMD"
|
|
|
|
'';
|
|
|
|
|
2023-03-22 10:30:23 +00:00
|
|
|
postConfigure = lib.optionalString stdenv.isDarwin ''
|
|
|
|
for f in */CMakeFiles/*.dir/link.txt ; do
|
|
|
|
substituteInPlace "$f" \
|
|
|
|
--replace "-lrt" "-framework IOKit"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2009-04-21 07:05:38 +00:00
|
|
|
postInstall = ''
|
|
|
|
# file name compatibility with the old cdrecord (growisofs wants this name)
|
|
|
|
ln -s $out/bin/genisoimage $out/bin/mkisofs
|
2009-05-13 10:21:24 +00:00
|
|
|
ln -s $out/bin/wodim $out/bin/cdrecord
|
2009-04-21 07:05:38 +00:00
|
|
|
'';
|
|
|
|
|
2022-05-04 01:00:49 +00:00
|
|
|
cmakeFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "-DBITFIELDS_HTOL=0" ];
|
|
|
|
|
2019-10-27 13:03:25 +00:00
|
|
|
makeFlags = [ "PREFIX=\$(out)" ];
|
2007-07-07 22:31:37 +00:00
|
|
|
|
|
|
|
meta = {
|
2007-10-19 14:16:43 +00:00
|
|
|
description = "Portable command-line CD/DVD recorder software, mostly compatible with cdrtools";
|
2008-12-16 14:06:46 +00:00
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
Cdrkit is a suite of programs for recording CDs and DVDs,
|
|
|
|
blanking CD-RW media, creating ISO-9660 filesystem images,
|
|
|
|
extracting audio CD data, and more. The programs included in
|
|
|
|
the cdrkit package were originally derived from several sources,
|
|
|
|
most notably mkisofs by Eric Youngdale and others, cdda2wav by
|
|
|
|
Heiko Eissfeldt, and cdrecord by Jörg Schilling. However,
|
|
|
|
cdrkit is not affiliated with any of these authors; it is now an
|
|
|
|
independent project.
|
|
|
|
'';
|
2020-12-31 07:48:55 +00:00
|
|
|
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://cdrkit.org/";
|
2021-01-15 09:19:50 +00:00
|
|
|
license = lib.licenses.gpl2;
|
2023-03-22 10:30:23 +00:00
|
|
|
platforms = lib.platforms.unix;
|
2007-07-07 22:31:37 +00:00
|
|
|
};
|
|
|
|
}
|