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