summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pypdfium2/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/pypdfium2/default.nix')
-rw-r--r--pkgs/development/python-modules/pypdfium2/default.nix19
1 files changed, 19 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/pypdfium2/default.nix b/pkgs/development/python-modules/pypdfium2/default.nix
index 933302eb81e3..66cdf166a6fb 100644
--- a/pkgs/development/python-modules/pypdfium2/default.nix
+++ b/pkgs/development/python-modules/pypdfium2/default.nix
@@ -1,4 +1,5 @@
{
+ stdenv,
lib,
pkgs,
buildPythonPackage,
@@ -9,6 +10,9 @@
numpy,
pillow,
pytestCheckHook,
+ removeReferencesTo,
+ python,
+ replaceVars,
}:
let
@@ -37,6 +41,12 @@ let
hash = "sha256-3JA7cW/xaEj/DxMHEypROwrKGo7EwUEcipRqALTvydw=";
};
+ patches = [
+ (replaceVars ./fix-cc-detection.patch {
+ cc = "${stdenv.cc.targetPrefix}cc";
+ })
+ ];
+
build-system = [
setuptools-scm
];
@@ -62,6 +72,10 @@ buildPythonPackage rec {
setuptools-scm
];
+ nativeBuildInputs = [
+ removeReferencesTo
+ ];
+
propagatedBuildInputs = [
pdfium-binaries
];
@@ -104,6 +118,11 @@ buildPythonPackage rec {
'';
env.PDFIUM_PLATFORM = "system:${pdfiumVersion}";
+ # Remove references to stdenv in comments.
+ postInstall = ''
+ remove-references-to -t ${stdenv.cc.cc} $out/${python.sitePackages}/pypdfium2_raw/bindings.py
+ '';
+
nativeCheckInputs = [
numpy
pillow