2010-08-25 14:25:51 +00:00
|
|
|
{stdenv, fetchurl, libxpdf, libxml2}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "pdf2xml";
|
2016-03-01 12:28:06 +00:00
|
|
|
|
2010-08-25 14:25:51 +00:00
|
|
|
src = fetchurl {
|
2020-04-01 01:11:51 +00:00
|
|
|
url = "http://tarballs.nixos.org/pdf2xml.tar.gz";
|
2010-08-25 14:25:51 +00:00
|
|
|
sha256 = "04rl7ppxqgnvxvvws669cxp478lnrdmiqj0g3m4p69bawfjc4z3w";
|
|
|
|
};
|
|
|
|
sourceRoot = "pdf2xml/pdf2xml";
|
2016-03-01 12:28:06 +00:00
|
|
|
|
2010-08-25 14:25:51 +00:00
|
|
|
buildInputs = [libxml2 libxpdf];
|
|
|
|
|
|
|
|
patches = [./pdf2xml.patch];
|
|
|
|
|
2016-02-26 17:38:15 +00:00
|
|
|
hardeningDisable = [ "format" ];
|
2016-03-01 12:28:06 +00:00
|
|
|
|
2010-08-25 14:25:51 +00:00
|
|
|
preBuild = ''
|
|
|
|
cp Makefile.linux Makefile
|
2016-03-01 12:28:06 +00:00
|
|
|
|
2015-10-05 11:23:01 +00:00
|
|
|
sed -i 's|/usr/include/libxml2|${libxml2.dev}/include/libxml2|' Makefile
|
|
|
|
sed -i 's|-lxml2|-lxml2 -L${libxml2.out}/lib|' Makefile
|
2010-08-25 14:25:51 +00:00
|
|
|
sed -i 's|XPDF = xpdf_3.01|XPDF = ${libxpdf}/lib|' Makefile
|
|
|
|
|
|
|
|
mkdir exe
|
2014-12-17 18:11:30 +00:00
|
|
|
|
|
|
|
buildFlags+=" CXX=$CXX"
|
2010-08-25 14:25:51 +00:00
|
|
|
'';
|
2016-03-01 12:28:06 +00:00
|
|
|
|
2010-08-25 14:25:51 +00:00
|
|
|
installPhase = ''
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $out/bin
|
2010-08-25 14:25:51 +00:00
|
|
|
cp exe/* $out/bin
|
|
|
|
'';
|
2016-08-02 16:06:29 +00:00
|
|
|
|
2020-06-27 09:44:37 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "PDF to XML converter";
|
|
|
|
platforms = platforms.unix;
|
|
|
|
license = licenses.gpl2;
|
2016-08-02 16:06:29 +00:00
|
|
|
};
|
2010-08-25 14:25:51 +00:00
|
|
|
}
|