Skip to content

Commit

Permalink
cdrkit: darwin link with CF (#351761)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilazy authored Oct 28, 2024
2 parents 1feea79 + 0046e13 commit 25668ad
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions pkgs/tools/cd-dvd/cdrkit/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{lib, stdenv, fetchurl, cmake, libcap, zlib, bzip2, perl, iconv, darwin}:
{lib, stdenv, fetchurl, cmake, libcap, zlib, bzip2, perl}:

stdenv.mkDerivation rec {
pname = "cdrkit";
Expand All @@ -11,8 +11,7 @@ stdenv.mkDerivation rec {

nativeBuildInputs = [ cmake ];
buildInputs = [ zlib bzip2 perl ] ++
lib.optionals stdenv.hostPlatform.isLinux [ libcap ] ++
lib.optionals stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [ Carbon IOKit iconv ]);
lib.optionals stdenv.hostPlatform.isLinux [ libcap ];

hardeningDisable = [ "format" ];
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.hostPlatform.isMusl [
Expand Down Expand Up @@ -44,10 +43,8 @@ stdenv.mkDerivation rec {
'';

postConfigure = lib.optionalString stdenv.hostPlatform.isDarwin ''
for f in */CMakeFiles/*.dir/link.txt ; do
substituteInPlace "$f" \
--replace "-lrt" "-framework IOKit"
done
substituteInPlace */CMakeFiles/*.dir/link.txt \
--replace-warn "-lrt" "-framework IOKit -framework CoreFoundation"
'';

postInstall = ''
Expand Down

0 comments on commit 25668ad

Please sign in to comment.