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.
This commit is contained in:
Sebastián Mancilla 2021-11-18 15:13:49 -03:00 committed by Jonathan Ringer
parent 181f7a7830
commit 8df865561f

View File

@ -1,4 +1,4 @@
{ lib, buildPythonPackage, fetchPypi, poppler }:
{ lib, stdenv, buildPythonPackage, fetchPypi, poppler }:
buildPythonPackage rec {
pname = "pdftotext";
@ -9,6 +9,11 @@ buildPythonPackage rec {
sha256 = "a067c121654917ecbe07fbd71c807c34bbdb1ea029e269ddd11925ee7e191d3f";
};
postPatch = lib.optionalString stdenv.isDarwin ''
substituteInPlace setup.py \
--replace '= brew_poppler_include()' '= "${lib.getDev poppler}/include", "${lib.getLib poppler}/lib"'
'';
buildInputs = [ poppler ];
meta = with lib; {