summary refs log tree commit diff
path: root/pkgs/servers
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2006-01-11 00:21:52 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2006-01-11 00:21:52 +0000
commit7dba8848ed4bcceb4187a754f221af26f10b2063 (patch)
treeee58ea34274790750375cfbc05f42d63031e44f3 /pkgs/servers
parent94517a614edd11f13ae8673549403123adc4a0be (diff)
downloadnixlib-7dba8848ed4bcceb4187a754f221af26f10b2063.tar
nixlib-7dba8848ed4bcceb4187a754f221af26f10b2063.tar.gz
nixlib-7dba8848ed4bcceb4187a754f221af26f10b2063.tar.bz2
nixlib-7dba8848ed4bcceb4187a754f221af26f10b2063.tar.lz
nixlib-7dba8848ed4bcceb4187a754f221af26f10b2063.tar.xz
nixlib-7dba8848ed4bcceb4187a754f221af26f10b2063.tar.zst
nixlib-7dba8848ed4bcceb4187a754f221af26f10b2063.zip
* Fix a horrible in imake: its results depend on whether a C compiler
  exists in one of a fixed set of paths (e.g., /usr/bin/cc).  For
  instance, on a system without /usr/bin/cc the variable DependCmd
  would evaluate to "makedepend", and on a system with it, to
  "gccmakedep".

  Solution: just use "gcc" always.  Also disabled some shitty code to
  detect the current Linux distribution (by probing for files like
  /etc/SuSE-release). 

svn path=/nixpkgs/trunk/; revision=4534
Diffstat (limited to 'pkgs/servers')
-rw-r--r--pkgs/servers/x11/xorg/default.nix2
-rwxr-xr-xpkgs/servers/x11/xorg/generate-expr-from-tarballs.pl2
-rw-r--r--pkgs/servers/x11/xorg/imake.patch88
3 files changed, 90 insertions, 2 deletions
diff --git a/pkgs/servers/x11/xorg/default.nix b/pkgs/servers/x11/xorg/default.nix
index c60de42b3f6b..63b43b8f0df6 100644
--- a/pkgs/servers/x11/xorg/default.nix
+++ b/pkgs/servers/x11/xorg/default.nix
@@ -602,7 +602,7 @@ rec {
       url = http://mirror.switch.ch/ftp/mirror/X11/pub/X11R7.0/src/everything/imake-X11R7.0-1.0.1.tar.bz2;
       md5 = "487b4b86b2bd0c09e6d220a85d94efae";
     };
-    buildInputs = [pkgconfig xproto ]; inherit xorgcffiles; x11BuildHook = ./imake.sh; 
+    buildInputs = [pkgconfig xproto ]; inherit xorgcffiles; x11BuildHook = ./imake.sh; patches = [./imake.patch]; 
   }) // {inherit xproto ;};
     
   inputproto = (stdenv.mkDerivation {
diff --git a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl
index c33e975d3baf..039a4cb79f55 100755
--- a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl
+++ b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl
@@ -31,7 +31,7 @@ $pcMap{"libdrm"} = "libdrm";
 $pcMap{"libXaw"} = "libXaw";
 
 
-$extraAttrs{"imake"} = " inherit xorgcffiles; x11BuildHook = ./imake.sh; ";
+$extraAttrs{"imake"} = " inherit xorgcffiles; x11BuildHook = ./imake.sh; patches = [./imake.patch]; ";
 
 
 if (-e "cache") {
diff --git a/pkgs/servers/x11/xorg/imake.patch b/pkgs/servers/x11/xorg/imake.patch
new file mode 100644
index 000000000000..56ab6334075e
--- /dev/null
+++ b/pkgs/servers/x11/xorg/imake.patch
@@ -0,0 +1,88 @@
+diff -rc imake-orig/imake.c imake-X11R7.0-1.0.1/imake.c
+*** imake-orig/imake.c	2005-11-08 07:33:24.000000000 +0100
+--- imake-X11R7.0-1.0.1/imake.c	2006-01-11 01:12:57.000000000 +0100
+***************
+*** 1056,1061 ****
+--- 1056,1062 ----
+  static void
+  get_distrib(FILE *inFile)
+  {
++ #if 0
+    struct stat sb;
+  
+    static char* suse = "/etc/SuSE-release";
+***************
+*** 1101,1106 ****
+--- 1102,1108 ----
+       * at the content of /etc/debian_version */
+      return;
+    }
++ #endif  
+    /* what's the definitive way to tell what any particular distribution is? */
+  
+    fprintf (inFile, "%s\n", "#define DefaultLinuxDistribution LinuxUnknown");
+***************
+*** 1349,1402 ****
+  static boolean
+  get_gcc(char *cmd)
+  {
+!   struct stat sb;
+!     static char* gcc_path[] = {
+! # if defined(linux) || \
+!      defined(__NetBSD__) || \
+!      defined(__OpenBSD__) || \
+!      defined(__FreeBSD__) || \
+!      defined(__DragonFly__) || \
+!      defined(__APPLE__) || \
+!      defined(__CYGWIN__) || \
+!      defined(__MINGW32__) || \
+!      defined(__GNU__) || \
+!      defined(__GLIBC__)
+! 	"/usr/bin/cc",	/* for Linux PostIncDir */
+! # endif
+! 	"/usr/local/bin/gcc",
+! 	"/opt/gnu/bin/gcc",
+! 	"/usr/pkg/bin/gcc"
+!     };
+! 
+! #ifdef CROSSCOMPILE
+!     static char* cross_cc_name[] = {
+! 	"cc",
+! 	"gcc"
+!     };
+! 
+!     if (CrossCompiling) {
+! 	int i;
+! 	for (i = 0; i < sizeof (cross_cc_name) / sizeof cross_cc_name[0]; i++){
+! 	    strcpy (cmd, CrossCompileDir);
+! 	    strcat (cmd, "/");
+! 	    strcat (cmd, cross_cc_name[i]);
+! 	    if (lstat (cmd, &sb) == 0) {
+! 		return TRUE;
+! 		break;
+! 	    }
+! 	}
+!     } else
+! #endif
+!       {
+! 	int i;
+! 	for (i = 0; i < sizeof (gcc_path) / sizeof gcc_path[0]; i++) {
+! 	    if (lstat (gcc_path[i], &sb) == 0) {
+! 		strcpy (cmd, gcc_path[i]);
+! 		return TRUE;
+! 	    }
+! 	}
+!       }
+!     return FALSE;
+  }
+  
+  #if defined CROSSCOMPILE || !defined __UNIXOS2__
+--- 1351,1358 ----
+  static boolean
+  get_gcc(char *cmd)
+  {
+!     strcpy (cmd, "gcc");
+!     return TRUE;
+  }
+  
+  #if defined CROSSCOMPILE || !defined __UNIXOS2__