Skip to content

Commit 8df8655

Browse files
smancilljonringer
authored andcommitted
python3Packages.pdftotext: fix build on darwin
The setup.py file tries to call brew command to locate the Homebrew version of poppler. Patch the file to stop the call and use the poppler derivation instead.
1 parent 181f7a7 commit 8df8655

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkgs/development/python-modules/pdftotext/default.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ lib, buildPythonPackage, fetchPypi, poppler }:
1+
{ lib, stdenv, buildPythonPackage, fetchPypi, poppler }:
22

33
buildPythonPackage rec {
44
pname = "pdftotext";
@@ -9,6 +9,11 @@ buildPythonPackage rec {
99
sha256 = "a067c121654917ecbe07fbd71c807c34bbdb1ea029e269ddd11925ee7e191d3f";
1010
};
1111

12+
postPatch = lib.optionalString stdenv.isDarwin ''
13+
substituteInPlace setup.py \
14+
--replace '= brew_poppler_include()' '= "${lib.getDev poppler}/include", "${lib.getLib poppler}/lib"'
15+
'';
16+
1217
buildInputs = [ poppler ];
1318

1419
meta = with lib; {

0 commit comments

Comments
 (0)