Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{lib, stdenv, fetchurl, libxpdf, libxml2}: 2 3stdenv.mkDerivation { 4 name = "pdf2xml"; 5 6 src = fetchurl { 7 url = "http://tarballs.nixos.org/pdf2xml.tar.gz"; 8 sha256 = "04rl7ppxqgnvxvvws669cxp478lnrdmiqj0g3m4p69bawfjc4z3w"; 9 }; 10 sourceRoot = "pdf2xml/pdf2xml"; 11 12 buildInputs = [libxml2 libxpdf]; 13 14 patches = [./pdf2xml.patch]; 15 16 hardeningDisable = [ "format" ]; 17 18 preBuild = '' 19 cp Makefile.linux Makefile 20 21 sed -i 's|/usr/include/libxml2|${libxml2.dev}/include/libxml2|' Makefile 22 sed -i 's|-lxml2|-lxml2 -L${libxml2.out}/lib|' Makefile 23 sed -i 's|XPDF = xpdf_3.01|XPDF = ${libxpdf}/lib|' Makefile 24 25 mkdir exe 26 27 buildFlags+=" CXX=$CXX" 28 ''; 29 30 installPhase = '' 31 mkdir -p $out/bin 32 cp exe/* $out/bin 33 ''; 34 35 meta = with lib; { 36 description = "PDF to XML converter"; 37 homepage = "https://sourceforge.net/projects/pdf2xml/"; 38 platforms = platforms.unix; 39 license = licenses.gpl2; 40 }; 41}