poppler_data: embed into poppler, make an option
Previously we relied on an environment variable POPPLER_DATADIR which practically noone used and everyone was expected to set. This is a good candidate for a feature option because noone really _noticed_ that this data is not available. Disabled by default because of this and size of the data (22M).
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{ fetchurl, stdenv, pkgconfig, poppler, poppler_data, makeWrapper }:
|
||||
{ fetchurl, stdenv, pkgconfig, poppler, makeWrapper }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "pdfgrep-${version}";
|
||||
@@ -9,19 +9,13 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "6e8bcaf8b219e1ad733c97257a97286a94124694958c27506b2ea7fc8e532437";
|
||||
};
|
||||
|
||||
buildInputs = [ pkgconfig poppler poppler_data makeWrapper ];
|
||||
buildInputs = [ pkgconfig poppler makeWrapper ];
|
||||
|
||||
patchPhase = ''
|
||||
sed -i -e "s%cpp/poppler-document.h%poppler/cpp/poppler-document.h%" pdfgrep.cc
|
||||
sed -i -e "s%cpp/poppler-page.h%poppler/cpp/poppler-page.h%" pdfgrep.cc
|
||||
'';
|
||||
|
||||
# workarround since it can't be hardcoded in pdfgrep
|
||||
preFixup = ''
|
||||
wrapProgram "$out/bin/pdfgrep" \
|
||||
--set POPPLER_DATADIR "${poppler_data}/share/poppler"
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "A tool to search text in PDF files";
|
||||
homepage = http://pdfgrep.sourceforge.net/;
|
||||
|
||||
Reference in New Issue
Block a user