ps2eps: init at 1.70

+96
+68
pkgs/tools/typesetting/ps2eps/default.nix
··· 1 + { lib 2 + , fetchFromGitHub 3 + , perlPackages 4 + , substituteAll 5 + , ghostscript 6 + , installShellFiles 7 + }: 8 + 9 + 10 + perlPackages.buildPerlPackage rec { 11 + pname = "ps2eps"; 12 + version = "1.70"; 13 + 14 + src = fetchFromGitHub { 15 + owner = "roland-bless"; 16 + repo = pname; 17 + rev = "v${version}"; 18 + hash = "sha256-SPLwsGKLVhANoqSQ/GJ938cYjbjMbUOXkNn9so3aJTA="; 19 + }; 20 + patches = [ 21 + (substituteAll { 22 + src = ./hardcode-deps.patch; 23 + gs = "${ghostscript}/bin/gs"; 24 + # bbox cannot be substituted here because substituteAll doesn't know what 25 + # will be the $out path of the main derivation 26 + }) 27 + ]; 28 + 29 + nativeBuildInputs = [ 30 + installShellFiles 31 + ]; 32 + 33 + configurePhase = "true"; 34 + 35 + buildPhase = '' 36 + runHook preBuild 37 + 38 + make -C src/C bbox 39 + patchShebangs src/perl/ps2eps 40 + substituteInPlace src/perl/ps2eps \ 41 + --replace @bbox@ $out/bin/bbox 42 + 43 + runHook postBuild 44 + ''; 45 + 46 + # Override buildPerlPackage's outputs setting 47 + outputs = ["out" "man"]; 48 + installPhase = '' 49 + runHook preInstall 50 + 51 + installManPage \ 52 + doc/ps2eps.1 \ 53 + doc/bbox.1 54 + 55 + install -D src/perl/ps2eps $out/bin/ps2eps 56 + install -D src/C/bbox $out/bin/bbox 57 + 58 + runHook postInstall 59 + ''; 60 + 61 + meta = with lib; { 62 + inherit (src.meta) homepage; 63 + description = "Calculate correct bounding boxes for PostScript and PDF files"; 64 + license = licenses.gpl2Plus; 65 + platforms = platforms.unix; 66 + maintainers = [ maintainers.doronbehar ]; 67 + }; 68 + }
+26
pkgs/tools/typesetting/ps2eps/hardcode-deps.patch
··· 1 + diff --git i/src/perl/ps2eps w/src/perl/ps2eps 2 + index 1122a81..31d6a9a 100755 3 + --- i/src/perl/ps2eps 4 + +++ w/src/perl/ps2eps 5 + @@ -43,19 +43,13 @@ Getopt::Long::Configure("no_ignore_case"); 6 + 7 + $prgname= "ps2eps"; 8 + 9 + -if (! -d "/usr/bin") 10 + -{ # we assume that we are running under native windows 11 + - $ghostscriptname = "gswin32c"; 12 + - $NULLDEV = "nul"; 13 + -} 14 + -else 15 + { # Unix or cygwin 16 + - $ghostscriptname = "gs"; 17 + + $ghostscriptname = "@gs@"; 18 + $NULLDEV = "/dev/null 2>&1"; 19 + } 20 + 21 + $bboxver=`bbox >$NULLDEV -V`; 22 + -$bboxname= ($?== -1) ? "" : "bbox"; 23 + +$bboxname= ($?== -1) ? "" : "@bbox@"; 24 + $version= '$Id: ps2eps,v 1.70 2018-01-09 18:00:00 bless Exp $'; #' 25 + $insertPScode= 1; # Insert surrounding Postscript code 26 + $infhandle = STDIN; # Standard input is the default input file
+2
pkgs/top-level/all-packages.nix
··· 33080 33080 33081 33081 ps2client = callPackage ../applications/networking/ps2client { }; 33082 33082 33083 + ps2eps = callPackage ../tools/typesetting/ps2eps { }; 33084 + 33083 33085 psi = libsForQt5.callPackage ../applications/networking/instant-messengers/psi { }; 33084 33086 33085 33087 psi-plus = libsForQt5.callPackage ../applications/networking/instant-messengers/psi-plus { };