nixpkgs/pkgs/development/libraries/pdf2xml/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
939 B
Nix
Raw Normal View History

{lib, stdenv, fetchurl, libxpdf, libxml2}:
stdenv.mkDerivation {
name = "pdf2xml";
2016-03-01 12:28:06 +00:00
src = fetchurl {
url = "http://tarballs.nixos.org/pdf2xml.tar.gz";
sha256 = "04rl7ppxqgnvxvvws669cxp478lnrdmiqj0g3m4p69bawfjc4z3w";
};
sourceRoot = "pdf2xml/pdf2xml";
2016-03-01 12:28:06 +00:00
buildInputs = [libxml2 libxpdf];
patches = [./pdf2xml.patch];
hardeningDisable = [ "format" ];
2016-03-01 12:28:06 +00:00
preBuild = ''
cp Makefile.linux Makefile
2016-03-01 12:28:06 +00:00
sed -i 's|/usr/include/libxml2|${libxml2.dev}/include/libxml2|' Makefile
sed -i 's|-lxml2|-lxml2 -L${libxml2.out}/lib|' Makefile
sed -i 's|XPDF = xpdf_3.01|XPDF = ${libxpdf}/lib|' Makefile
mkdir exe
buildFlags+=" CXX=$CXX"
'';
2016-03-01 12:28:06 +00:00
installPhase = ''
mkdir -p $out/bin
cp exe/* $out/bin
'';
meta = with lib; {
2020-06-27 09:44:37 +00:00
description = "PDF to XML converter";
2022-02-21 21:17:57 +00:00
homepage = "https://sourceforge.net/projects/pdf2xml/";
2020-06-27 09:44:37 +00:00
platforms = platforms.unix;
license = licenses.gpl2;
};
}