From 8df865561fbc53922f1e801c3deeb53c12ce8c4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Mancilla?= Date: Thu, 18 Nov 2021 15:13:49 -0300 Subject: [PATCH] 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. --- pkgs/development/python-modules/pdftotext/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/pdftotext/default.nix b/pkgs/development/python-modules/pdftotext/default.nix index dd22bc5be65b..2ba18dd92e4e 100644 --- a/pkgs/development/python-modules/pdftotext/default.nix +++ b/pkgs/development/python-modules/pdftotext/default.nix @@ -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; {