From 78705eaeb1069a02a6f4db525d23151839436bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliv=C3=A9r=20Falvai?= Date: Fri, 8 Nov 2024 19:25:52 +0100 Subject: [PATCH] skia: unbreak darwin --- pkgs/by-name/sk/skia/package.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/sk/skia/package.nix b/pkgs/by-name/sk/skia/package.nix index 2790b77101d5..6622b305e5b7 100644 --- a/pkgs/by-name/sk/skia/package.nix +++ b/pkgs/by-name/sk/skia/package.nix @@ -17,6 +17,9 @@ , vulkan-headers , vulkan-memory-allocator , xcbuild +, cctools +, zlib +, apple-sdk_11 , enableVulkan ? !stdenv.hostPlatform.isDarwin }: @@ -46,7 +49,7 @@ stdenv.mkDerivation (finalAttrs: { gn ninja python3 - ] ++ lib.optional stdenv.hostPlatform.isDarwin xcbuild; + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild cctools.libtool zlib ]; buildInputs = [ expat @@ -61,6 +64,8 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optionals enableVulkan [ vulkan-headers vulkan-memory-allocator + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_11 # can be removed once x86_64-darwin defaults to a newer SDK ]; gnFlags = let @@ -92,13 +97,15 @@ stdenv.mkDerivation (finalAttrs: { "skia_use_vulkan=true" ]; + env.NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-lz"; + # Somewhat arbitrary, but similar to what other distros are doing installPhase = '' runHook preInstall # Libraries mkdir -p $out/lib - cp *.so *.a $out/lib + cp *.so *.a *.dylib $out/lib # Includes pushd ../../include @@ -144,7 +151,5 @@ stdenv.mkDerivation (finalAttrs: { maintainers = with lib.maintainers; [ fgaz ]; platforms = with lib.platforms; arm ++ aarch64 ++ x86 ++ x86_64; pkgConfigModules = [ "skia" ]; - # https://github.com/NixOS/nixpkgs/pull/325871#issuecomment-2220610016 - broken = stdenv.hostPlatform.isDarwin; }; })