From 8b4061fd60ccc3b3f44b73faa7c983eacf7a6f7b Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Sat, 31 Aug 2024 17:44:38 +0200 Subject: [PATCH] skia: make use of gnFlags --- pkgs/by-name/sk/skia/package.nix | 53 +++++++++++++++----------------- 1 file changed, 24 insertions(+), 29 deletions(-) diff --git a/pkgs/by-name/sk/skia/package.nix b/pkgs/by-name/sk/skia/package.nix index f40279875d02..6c70e99bb2fb 100644 --- a/pkgs/by-name/sk/skia/package.nix +++ b/pkgs/by-name/sk/skia/package.nix @@ -70,39 +70,34 @@ stdenv.mkDerivation (finalAttrs: { vulkan-memory-allocator ]; - configurePhase = let + gnFlags = let cpu = { "x86_64" = "x64"; "i686" = "x86"; "arm" = "arm"; "aarch64" = "arm64"; }.${stdenv.hostPlatform.parsed.cpu.name}; - in '' - runHook preConfigure - gn gen build --args='${toString ([ - # Build in release mode - "is_official_build=true" - "is_component_build=true" - # Don't use missing tools - "skia_use_dng_sdk=false" - "skia_use_wuffs=false" - # Use system dependencies - "extra_cflags=[\"-I${harfbuzzFull.dev}/include/harfbuzz\"]" - "cc=\"${stdenv.cc.targetPrefix}cc\"" - "cxx=\"${stdenv.cc.targetPrefix}c++\"" - "ar=\"${stdenv.cc.targetPrefix}ar\"" - "target_cpu=\"${cpu}\"" - ] ++ map (lib: "skia_use_system_${lib}=true") [ - "zlib" - "harfbuzz" - "libpng" - "libwebp" - ] ++ lib.optionals enableVulkan [ - "skia_use_vulkan=true" - ])}' - cd build - runHook postConfigure - ''; + in [ + # Build in release mode + "is_official_build=true" + "is_component_build=true" + # Don't use missing tools + "skia_use_dng_sdk=false" + "skia_use_wuffs=false" + # Use system dependencies + "extra_cflags=[\"-I${harfbuzzFull.dev}/include/harfbuzz\"]" + "cc=\"${stdenv.cc.targetPrefix}cc\"" + "cxx=\"${stdenv.cc.targetPrefix}c++\"" + "ar=\"${stdenv.cc.targetPrefix}ar\"" + "target_cpu=\"${cpu}\"" + ] ++ map (lib: "skia_use_system_${lib}=true") [ + "zlib" + "harfbuzz" + "libpng" + "libwebp" + ] ++ lib.optionals enableVulkan [ + "skia_use_vulkan=true" + ]; # Somewhat arbitrary, but similar to what other distros are doing installPhase = '' @@ -113,10 +108,10 @@ stdenv.mkDerivation (finalAttrs: { cp *.so *.a $out/lib # Includes - pushd ../include + pushd ../../include find . -name '*.h' -exec install -Dm644 {} $out/include/skia/{} \; popd - pushd ../modules + pushd ../../modules find . -name '*.h' -exec install -Dm644 {} $out/include/skia/modules/{} \; popd