Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libpsl: don't depend on python when we cross compile #344211

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkgs/development/interpreters/python/cpython/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python can be built statically. Even if it didn't, we could encode that using badPlatforms = [ lib.systems.inspect.platformPatterns.isStatic ], with no need to invent a new helper.


tests = passthru.tests // {
pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
};
Expand Down
7 changes: 4 additions & 3 deletions pkgs/development/libraries/libpsl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
, python3
, buildPackages
, publicsuffix-list
, enablePython3 ? python3.availableOn stdenv.hostPlatform
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we go.

}:

stdenv.mkDerivation rec {
Expand All @@ -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
Expand All @@ -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
'';

Expand Down