Fix imake on darwin.

Taken from joelteon/nixpkgs@6b3f7e6fb0

Original author Mike Sperber <sperber@deinprogramm.de>
This commit is contained in:
Shea Levy 2015-02-04 10:00:50 +00:00
parent b611e3fb61
commit df430ab2ea
4 changed files with 19 additions and 12 deletions

View File

@ -0,0 +1 @@
export IMAKECPP="@tradcpp@/bin/tradcpp"

View File

@ -1,15 +1,15 @@
diff -ru -x '*~' imake-1.0.3-orig/imake.c imake-1.0.3/imake.c diff -Naur imake-1.0.7-orig/imake.c imake-1.0.7/imake.c
--- imake-1.0.3-orig/imake.c 2009-10-16 23:45:43.000000000 +0200 --- imake-1.0.7-orig/imake.c 2013-08-17 10:11:50.000000000 +0000
+++ imake-1.0.3/imake.c 2010-07-19 12:17:12.000000000 +0200 +++ imake-1.0.7/imake.c 2015-02-04 09:41:59.000000000 +0000
@@ -1035,6 +1035,7 @@ @@ -1045,6 +1045,7 @@
static void static void
get_distrib(FILE *inFile) get_distrib(FILE *inFile)
{ {
+#if 0 +#if 0
struct stat sb; struct stat sb;
static char* suse = "/etc/SuSE-release"; static const char* suse = "/etc/SuSE-release";
@@ -1080,6 +1081,7 @@ @@ -1090,6 +1091,7 @@
* at the content of /etc/debian_version */ * at the content of /etc/debian_version */
return; return;
} }
@ -17,21 +17,21 @@ diff -ru -x '*~' imake-1.0.3-orig/imake.c imake-1.0.3/imake.c
/* what's the definitive way to tell what any particular distribution is? */ /* what's the definitive way to tell what any particular distribution is? */
fprintf (inFile, "%s\n", "#define DefaultLinuxDistribution LinuxUnknown"); fprintf (inFile, "%s\n", "#define DefaultLinuxDistribution LinuxUnknown");
@@ -1328,6 +1330,7 @@ @@ -1337,6 +1339,7 @@
static boolean static boolean
get_gcc(char *cmd) get_gcc(char *cmd)
{ {
+#if 0 +#if 0
struct stat sb; struct stat sb;
static char* gcc_path[] = { static const char* gcc_path[] = {
#if defined(linux) || \ #if defined(linux) || \
@@ -1376,6 +1379,9 @@ @@ -1385,6 +1388,9 @@
} }
} }
return FALSE; return FALSE;
+#endif +#endif
+ strcpy (cmd, "gcc"); + strcpy (cmd, IMAKE_COMPILETIME_CPP);
+ return TRUE; + return TRUE;
} }
#if defined CROSSCOMPILE || !defined __UNIXOS2__ #ifdef CROSSCOMPILE

View File

@ -49,6 +49,12 @@ in
inherit (xorg) xorgcffiles; inherit (xorg) xorgcffiles;
x11BuildHook = ./imake.sh; x11BuildHook = ./imake.sh;
patches = [./imake.patch]; patches = [./imake.patch];
setupHook = if stdenv.isDarwin then ./darwin-imake-setup-hook.sh else null;
CFLAGS = [ "-DIMAKE_COMPILETIME_CPP=\\\"${if stdenv.isDarwin
then "${args.tradcpp}/bin/cpp"
else "gcc"}\\\""
];
tradcpp = if stdenv.isDarwin then args.tradcpp else null;
}; };
mkfontdir = attrs: attrs // { mkfontdir = attrs: attrs // {

View File

@ -8191,7 +8191,7 @@ let
xorg = recurseIntoAttrs (import ../servers/x11/xorg/default.nix { xorg = recurseIntoAttrs (import ../servers/x11/xorg/default.nix {
inherit clangStdenv fetchurl fetchgit fetchpatch stdenv pkgconfig intltool freetype fontconfig inherit clangStdenv fetchurl fetchgit fetchpatch stdenv pkgconfig intltool freetype fontconfig
libxslt expat libpng zlib perl mesa_drivers spice_protocol libxslt expat libpng zlib perl mesa_drivers spice_protocol
dbus libuuid openssl gperf m4 libevdev dbus libuuid openssl gperf m4 libevdev tradcpp
autoconf automake libtool xmlto asciidoc flex bison python mtdev pixman; autoconf automake libtool xmlto asciidoc flex bison python mtdev pixman;
mesa = mesa_noglu; mesa = mesa_noglu;
udev = if stdenv.isLinux then udev else null; udev = if stdenv.isLinux then udev else null;