skia: make use of gnFlags

This commit is contained in:
jopejoe1 2024-08-31 17:44:38 +02:00 committed by Francesco Gazzetta
parent 23f4d2edd4
commit 8b4061fd60

View File

@ -70,16 +70,14 @@ 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 ([
in [
# Build in release mode
"is_official_build=true"
"is_component_build=true"
@ -99,10 +97,7 @@ stdenv.mkDerivation (finalAttrs: {
"libwebp"
] ++ lib.optionals enableVulkan [
"skia_use_vulkan=true"
])}'
cd build
runHook postConfigure
'';
];
# 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