summary refs log tree commit diff
path: root/pkgs/tools/graphics/epstool
diff options
context:
space:
mode:
authorAlastair Pharo <asppsa@gmail.com>2017-03-16 16:40:01 +1100
committerAlastair Pharo <asppsa@gmail.com>2017-04-09 14:35:06 +1000
commitf0ebcc64445bf009d781f494a2e583cbf67846c4 (patch)
tree29e8ff92dc9f86645afb1d9c69b2c6750b40a918 /pkgs/tools/graphics/epstool
parentec674a63720969a016091171282f9ea014e5f45a (diff)
downloadnixpkgs-f0ebcc64445bf009d781f494a2e583cbf67846c4.tar
nixpkgs-f0ebcc64445bf009d781f494a2e583cbf67846c4.tar.gz
nixpkgs-f0ebcc64445bf009d781f494a2e583cbf67846c4.tar.bz2
nixpkgs-f0ebcc64445bf009d781f494a2e583cbf67846c4.tar.lz
nixpkgs-f0ebcc64445bf009d781f494a2e583cbf67846c4.tar.xz
nixpkgs-f0ebcc64445bf009d781f494a2e583cbf67846c4.tar.zst
nixpkgs-f0ebcc64445bf009d781f494a2e583cbf67846c4.zip
epstool: add package
Diffstat (limited to 'pkgs/tools/graphics/epstool')
-rw-r--r--pkgs/tools/graphics/epstool/default.nix25
-rw-r--r--pkgs/tools/graphics/epstool/gcc43.patch20
2 files changed, 45 insertions, 0 deletions
diff --git a/pkgs/tools/graphics/epstool/default.nix b/pkgs/tools/graphics/epstool/default.nix
new file mode 100644
index 00000000000..9735adca53d
--- /dev/null
+++ b/pkgs/tools/graphics/epstool/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  version = "3.08";
+  name = "epstool-${version}";
+
+  src = fetchurl {
+    url = "http://ftp.de.debian.org/debian/pool/main/e/epstool/epstool_${version}+repack.orig.tar.gz";
+    sha256 = "1pfgqbipwk36clhma2k365jkpvyy75ahswn8jczzys382jalpwgk";
+  };
+
+  installPhase = ''
+    make EPSTOOL_ROOT=$out install
+  '';
+
+  patches = [ ./gcc43.patch ];
+
+  meta = with stdenv.lib; {
+    description = "A utility to create or extract preview images in EPS files, fix bounding boxes and convert to bitmaps";
+    homepage = http://pages.cs.wisc.edu/~ghost/gsview/epstool.htm;
+    license = licenses.gpl2;
+    maintainers = [ maintainers.asppsa ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/tools/graphics/epstool/gcc43.patch b/pkgs/tools/graphics/epstool/gcc43.patch
new file mode 100644
index 00000000000..398ce08c518
--- /dev/null
+++ b/pkgs/tools/graphics/epstool/gcc43.patch
@@ -0,0 +1,20 @@
+--- epstool-3.08.orig/src/epstool.c	2005-06-10 04:41:00.000000000 -0500
++++ epstool-3.08/src/epstool.c	2009-02-16 20:55:43.186140029 -0600
+@@ -2824,7 +2824,7 @@
+ 		code = -1;
+ 	}
+ 	if ((code==0) && stdout_name && (hChildStdoutWr == -1)) {
+-	    handle = open(stdout_name, O_WRONLY | O_CREAT);
++	    handle = open(stdout_name, O_WRONLY | O_CREAT, 0644);
+ 	    hChildStdoutWr = dup2(handle, 1);
+ 	    if (handle != -1)
+ 		close(handle);
+@@ -2832,7 +2832,7 @@
+ 		code = -1;
+ 	}
+ 	if ((code==0) && stderr_name && (hChildStderrWr == -1)) {
+-	    handle = open(stderr_name, O_WRONLY | O_CREAT);
++	    handle = open(stderr_name, O_WRONLY | O_CREAT, 0644);
+ 	    hChildStderrWr = dup2(handle, 2);
+ 	    if (handle != -1)
+ 		close(handle);