summary refs log tree commit diff
path: root/pkgs/misc/ghostscript
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2006-09-04 11:01:37 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2006-09-04 11:01:37 +0000
commit51ca4a6a91c43b843ee54a1541d64c87aa942e1e (patch)
treec7774ec7446103b4307bf07f7fae8946aace7ca9 /pkgs/misc/ghostscript
parent059b3f06690642852c7deaef2cc5740c5ed18ee7 (diff)
downloadnixlib-51ca4a6a91c43b843ee54a1541d64c87aa942e1e.tar
nixlib-51ca4a6a91c43b843ee54a1541d64c87aa942e1e.tar.gz
nixlib-51ca4a6a91c43b843ee54a1541d64c87aa942e1e.tar.bz2
nixlib-51ca4a6a91c43b843ee54a1541d64c87aa942e1e.tar.lz
nixlib-51ca4a6a91c43b843ee54a1541d64c87aa942e1e.tar.xz
nixlib-51ca4a6a91c43b843ee54a1541d64c87aa942e1e.tar.zst
nixlib-51ca4a6a91c43b843ee54a1541d64c87aa942e1e.zip
* Various purity fixes for Ghostscript.
svn path=/nixpkgs/trunk/; revision=6452
Diffstat (limited to 'pkgs/misc/ghostscript')
-rw-r--r--pkgs/misc/ghostscript/builder.sh8
-rw-r--r--pkgs/misc/ghostscript/default.nix9
-rw-r--r--pkgs/misc/ghostscript/purity.patch32
3 files changed, 47 insertions, 2 deletions
diff --git a/pkgs/misc/ghostscript/builder.sh b/pkgs/misc/ghostscript/builder.sh
index 1a2f51b9f9ad..734738140d8a 100644
--- a/pkgs/misc/ghostscript/builder.sh
+++ b/pkgs/misc/ghostscript/builder.sh
@@ -1,5 +1,11 @@
 source $stdenv/setup
 
+preConfigure=preConfigure
+preConfigure() {
+    # "ijs" is impure: it contains symlinks to /usr/share/automake etc.!
+    rm -rf ijs/ltmain.sh
+}
+
 postInstall=postInstall
 postInstall() {
     for i in $fonts; do
@@ -7,4 +13,4 @@ postInstall() {
     done
 }
 
-genericBuild
\ No newline at end of file
+genericBuild
diff --git a/pkgs/misc/ghostscript/default.nix b/pkgs/misc/ghostscript/default.nix
index 9d02a2a01e83..372cd568f4e0 100644
--- a/pkgs/misc/ghostscript/default.nix
+++ b/pkgs/misc/ghostscript/default.nix
@@ -26,5 +26,12 @@ stdenv.mkDerivation {
     (if x11Support then x11 else null)
   ];
 
-  configureFlags = if x11Support then "--with-x" else "--without-x";
+  configureFlags = "
+    ${if x11Support then "--with-x" else "--without-x"}
+  ";
+
+  # This patch is required to make Ghostscript at least build in a pure 
+  # environment (like NixOS).  Ghostscript's build process performs 
+  # various tests for the existence of files in /usr/include.
+  patches = [ ./purity.patch ];
 }
diff --git a/pkgs/misc/ghostscript/purity.patch b/pkgs/misc/ghostscript/purity.patch
new file mode 100644
index 000000000000..bc41867dc3f6
--- /dev/null
+++ b/pkgs/misc/ghostscript/purity.patch
@@ -0,0 +1,32 @@
+diff -rc ghostscript-8.54-gpl-orig/src/unix-aux.mak ghostscript-8.54-gpl/src/unix-aux.mak
+*** ghostscript-8.54-gpl-orig/src/unix-aux.mak	Tue Apr 18 17:32:25 2006
+--- ghostscript-8.54-gpl/src/unix-aux.mak	Mon Sep  4 12:46:11 2006
+***************
+*** 88,100 ****
+  # The "else true;" is required because Ultrix's implementation of sh -e
+  # terminates execution of a command if any error occurs, even if the command
+  # traps the error with ||.
+! INCLUDE=/usr/include
+  $(gconfig__h): $(UNIX_AUX_MAK) $(ECHOGS_XE)
+  	$(ECHOGS_XE) -w $(gconfig__h) -x 2f2a -s This file was generated automatically by unix-aux.mak. -s -x 2a2f
+! 	if ( test -f $(INCLUDE)/dirent.h ); then $(ECHOGS_XE) -a $(gconfig__h) -x 23 define HAVE_DIRENT_H; else true; fi
+  	if ( test -f $(INCLUDE)/ndir.h ); then $(ECHOGS_XE) -a $(gconfig__h) -x 23 define HAVE_NDIR_H; else true; fi
+! 	if ( test -f $(INCLUDE)/sys/dir.h ); then $(ECHOGS_XE) -a $(gconfig__h) -x 23 define HAVE_SYS_DIR_H; else true; fi
+  	if ( test -f $(INCLUDE)/sys/ndir.h ); then $(ECHOGS_XE) -a $(gconfig__h) -x 23 define HAVE_SYS_NDIR_H; else true; fi
+! 	if ( test -f $(INCLUDE)/sys/time.h ); then $(ECHOGS_XE) -a $(gconfig__h) -x 23 define HAVE_SYS_TIME_H; else true; fi
+! 	if ( test -f $(INCLUDE)/sys/times.h ); then $(ECHOGS_XE) -a $(gconfig__h) -x 23 define HAVE_SYS_TIMES_H; else true; fi
+  	if ( test -f $(JSRCDIR)/jmemsys.h); then true; else $(ECHOGS_XE) -a $(gconfig__h) -x 23 define DONT_HAVE_JMEMSYS_H; fi
+--- 88,100 ----
+  # The "else true;" is required because Ultrix's implementation of sh -e
+  # terminates execution of a command if any error occurs, even if the command
+  # traps the error with ||.
+! INCLUDE=/no-such-path
+  $(gconfig__h): $(UNIX_AUX_MAK) $(ECHOGS_XE)
+  	$(ECHOGS_XE) -w $(gconfig__h) -x 2f2a -s This file was generated automatically by unix-aux.mak. -s -x 2a2f
+! 	if ( true ); then $(ECHOGS_XE) -a $(gconfig__h) -x 23 define HAVE_DIRENT_H; else true; fi
+  	if ( test -f $(INCLUDE)/ndir.h ); then $(ECHOGS_XE) -a $(gconfig__h) -x 23 define HAVE_NDIR_H; else true; fi
+! 	if ( true ); then $(ECHOGS_XE) -a $(gconfig__h) -x 23 define HAVE_SYS_DIR_H; else true; fi
+  	if ( test -f $(INCLUDE)/sys/ndir.h ); then $(ECHOGS_XE) -a $(gconfig__h) -x 23 define HAVE_SYS_NDIR_H; else true; fi
+! 	if ( true ); then $(ECHOGS_XE) -a $(gconfig__h) -x 23 define HAVE_SYS_TIME_H; else true; fi
+! 	if ( true ); then $(ECHOGS_XE) -a $(gconfig__h) -x 23 define HAVE_SYS_TIMES_H; else true; fi
+  	if ( test -f $(JSRCDIR)/jmemsys.h); then true; else $(ECHOGS_XE) -a $(gconfig__h) -x 23 define DONT_HAVE_JMEMSYS_H; fi