diff --git a/pkgs/tools/graphics/pdflrf/default.nix b/pkgs/tools/graphics/pdflrf/default.nix new file mode 100644 index 000000000000..84db0653283b --- /dev/null +++ b/pkgs/tools/graphics/pdflrf/default.nix @@ -0,0 +1,40 @@ +{stdenv, fetchurl, expat, freetype, fontconfig, libstdcpp5}: + +stdenv.mkDerivation ( rec { + name = "pdflrf-0.99"; + + src = fetchurl { + # I got it from http://www.mobileread.com/forums/showthread.php?t=13135 + # But that needs user registration to allow downloading. + # I unpacked the executable (upx) to allow patchelf to manage it + # Temporary place: + url = http://vicerveza.homeunix.net/~viric/soft/pdflrf-linux-0.99.bz2; + sha256 = "faf8c68b586d367e227581294a4dc22b2865291446d40b72d70b4dd53f7088d4"; + }; + + buildInputs = [ expat freetype fontconfig libstdcpp5 ]; + + phases = "unpackPhase patchPhase installPhase"; + + unpackPhase = "bunzip2 -c $src > pdflrf ; chmod +x pdflrf"; + + patchPhase = '' + set -x + fullPath= + for i in $buildInputs; do + fullPath=$fullPath:$i/lib + done + + patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \ + --set-rpath $fullPath pdflrf + ''; + + installPhase = "ensureDir $out/bin; cp pdflrf $out/bin"; + + meta = { + description = "PDF to LRF converter (Sony Portable Reader System format)"; + homepage = http://www.mobileread.com/forums/showthread.php?t=13135; + # The program comes as binary-only, but free to use. + license = "free"; + }; +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ecea429abf80..6a050235ecdd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1076,6 +1076,11 @@ let inherit fetchurl stdenv; }; + pdflrf = import ../tools/graphics/pdflrf { + inherit fetchurl stdenv expat freetype fontconfig; + libstdcpp5 = gcc33.gcc; + }; + pdsh = import ../tools/networking/pdsh { inherit fetchurl stdenv perl; readline = if getPkgConfig "pdsh" "readline" true then readline else null;