From 8cbe9a8ca2d8b49ebefb0491f6e6ac9efb88bcd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 25 Sep 2024 11:31:33 +0200 Subject: [PATCH 1/2] cpython: add availableOn helper --- pkgs/development/interpreters/python/cpython/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index 56e0be3ea59cb..d679a4a38bdc4 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -655,6 +655,8 @@ in with passthru; stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = with pkgsBuildBuild.python3.pkgs; [ sphinxHook python-docs-theme ]; }; + availableOn = platform: !platform.isStatic && lib.meta.availableOn platform self; + tests = passthru.tests // { pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; }; From a2637a3a4fbdfa4cb38af9696c7f205c8ee4c596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 24 Sep 2024 15:15:39 +0200 Subject: [PATCH 2/2] libpsl: don't depend on python when we cross compile this is quite a big dependency that we don't want. --- pkgs/development/libraries/libpsl/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/libpsl/default.nix b/pkgs/development/libraries/libpsl/default.nix index 1659a55cb4ef9..54af3aee0f67f 100644 --- a/pkgs/development/libraries/libpsl/default.nix +++ b/pkgs/development/libraries/libpsl/default.nix @@ -12,6 +12,7 @@ , python3 , buildPackages , publicsuffix-list +, enablePython3 ? python3.availableOn stdenv.hostPlatform }: stdenv.mkDerivation rec { @@ -25,7 +26,7 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" ] # bin/psl-make-dafsa brings a large runtime closure through python3 - ++ lib.optional (!stdenv.hostPlatform.isStatic) "bin"; + ++ lib.optional enablePython3 "bin"; nativeBuildInputs = [ autoreconfHook @@ -41,13 +42,13 @@ stdenv.mkDerivation rec { libidn2 libunistring libxslt - ] ++ lib.optional (!stdenv.hostPlatform.isStatic) python3; + ] ++ lib.optional enablePython3 python3; propagatedBuildInputs = [ publicsuffix-list ]; - postPatch = lib.optionalString (!stdenv.hostPlatform.isStatic) '' + postPatch = lib.optionalString enablePython3 '' patchShebangs src/psl-make-dafsa '';