From 79617c03eb524f1b3ea9b12891773f0dec573f12 Mon Sep 17 00:00:00 2001 From: Joachim Schiele Date: Wed, 13 Aug 2014 20:03:04 +0200 Subject: [PATCH] pdfgrep: added a nice util to search in pdf files --- pkgs/tools/typesetting/pdfgrep/default.nix | 32 ++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 33 insertions(+) create mode 100644 pkgs/tools/typesetting/pdfgrep/default.nix diff --git a/pkgs/tools/typesetting/pdfgrep/default.nix b/pkgs/tools/typesetting/pdfgrep/default.nix new file mode 100644 index 000000000000..e05e4d16a06e --- /dev/null +++ b/pkgs/tools/typesetting/pdfgrep/default.nix @@ -0,0 +1,32 @@ +{ fetchurl, stdenv, pkgconfig, poppler, poppler_data, makeWrapper }: + +stdenv.mkDerivation rec { + name = "pdfgrep-${version}"; + version = "1.3.1"; + + src = fetchurl { + url = "http://downloads.sourceforge.net/project/pdfgrep/${version}/${name}.tar.gz"; + sha256 = "6e8bcaf8b219e1ad733c97257a97286a94124694958c27506b2ea7fc8e532437"; + }; + + buildInputs = [ pkgconfig poppler poppler_data 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/; + license = "free"; + maintainers = with stdenv.lib.maintainers; [qknight]; + platforms = with stdenv.lib.platforms; linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b3ba6a64df2f..ea17ea117cae 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9241,6 +9241,7 @@ let }; pdftk = callPackage ../tools/typesetting/pdftk { }; + pdfgrep = callPackage ../tools/typesetting/pdfgrep { }; pianobar = callPackage ../applications/audio/pianobar { };