Unverified Commit 25668ad0 authored by Emily's avatar Emily Committed by GitHub
Browse files

cdrkit: darwin link with CF (#351761)

parents 1feea796 0046e139
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
{lib, stdenv, fetchurl, cmake, libcap, zlib, bzip2, perl, iconv, darwin}:
{lib, stdenv, fetchurl, cmake, libcap, zlib, bzip2, perl}:

stdenv.mkDerivation rec {
  pname = "cdrkit";
@@ -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 [
@@ -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 = ''