3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/pdf2xml/default.nix
Franz Pletz aff1f4ab94 Use general hardening flag toggle lists
The following parameters are now available:

  * hardeningDisable
    To disable specific hardening flags
  * hardeningEnable
    To enable specific hardening flags

Only the cc-wrapper supports this right now, but these may be reused by
other wrappers, builders or setup hooks.

cc-wrapper supports the following flags:

  * fortify
  * stackprotector
  * pie (disabled by default)
  * pic
  * strictoverflow
  * format
  * relro
  * bindnow
2016-03-05 18:55:26 +01:00

35 lines
734 B
Nix

{stdenv, fetchurl, libxpdf, libxml2}:
stdenv.mkDerivation {
name = "pdf2xml";
src = fetchurl {
url = http://tarballs.nixos.org/pdf2xml.tar.gz;
sha256 = "04rl7ppxqgnvxvvws669cxp478lnrdmiqj0g3m4p69bawfjc4z3w";
};
sourceRoot = "pdf2xml/pdf2xml";
buildInputs = [libxml2 libxpdf];
patches = [./pdf2xml.patch];
hardeningDisable = [ "format" ];
preBuild = ''
cp Makefile.linux Makefile
sed -i 's|/usr/include/libxml2|${libxml2}/include/libxml2|' Makefile
sed -i 's|-lxml2|-lxml2 -L${libxml2}/lib|' Makefile
sed -i 's|XPDF = xpdf_3.01|XPDF = ${libxpdf}/lib|' Makefile
mkdir exe
buildFlags+=" CXX=$CXX"
'';
installPhase = ''
mkdir -p $out/bin
cp exe/* $out/bin
'';
}