From 681d02ba5f86f0593950c28cacfb138bd7afb553 Mon Sep 17 00:00:00 2001 From: Jake Waksbaum Date: Mon, 13 Aug 2018 23:14:57 -0400 Subject: [PATCH] tachyon: Add darwin support --- .../libraries/tachyon/darwin.patch | 31 +++++++++++++++++++ .../development/libraries/tachyon/default.nix | 7 +++-- 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 pkgs/development/libraries/tachyon/darwin.patch diff --git a/pkgs/development/libraries/tachyon/darwin.patch b/pkgs/development/libraries/tachyon/darwin.patch new file mode 100644 index 000000000000..dbede586f073 --- /dev/null +++ b/pkgs/development/libraries/tachyon/darwin.patch @@ -0,0 +1,31 @@ +diff --git a/unix/Make-arch b/unix/Make-arch +index 08afb85..822c4fc 100644 +--- a/unix/Make-arch ++++ b/unix/Make-arch +@@ -924,7 +924,7 @@ macosx-thr: + $(MAKE) all \ + "ARCH = macosx-thr" \ + "CC = cc" \ +- "CFLAGS = -Os -ffast-math -DBsd -DTHR -F/System/Library/Frameworks $(MISCFLAGS)" \ ++ "CFLAGS = -Os -ffast-math -DBsd -DTHR $(MISCFLAGS)" \ + "AR = ar" \ + "ARFLAGS = r" \ + "STRIP = strip" \ +@@ -946,7 +946,7 @@ macosx-x86-thr: + $(MAKE) all \ + "ARCH = macosx-x86-thr" \ + "CC = cc" \ +- "CFLAGS = -O2 -ffast-math -DBsd -DTHR -F/System/Library/Frameworks $(MISCFLAGS)" \ ++ "CFLAGS = -O2 -ffast-math -DBsd -DTHR $(MISCFLAGS)" \ + "AR = ar" \ + "ARFLAGS = r" \ + "STRIP = strip" \ +@@ -957,7 +957,7 @@ macosx-x86-thr-ogl: + $(MAKE) all \ + "ARCH = macosx-x86-thr-ogl" \ + "CC = cc" \ +- "CFLAGS = -O2 -ffast-math -DBsd -DTHR -I/usr/X11R6/include -F/System/Library/Frameworks $(MISCFLAGS) -DUSEOPENGL" \ ++ "CFLAGS = -O2 -ffast-math -DBsd -DTHR -I/usr/X11R6/include $(MISCFLAGS) -DUSEOPENGL" \ + "AR = ar" \ + "ARFLAGS = r" \ + "STRIP = strip" \ diff --git a/pkgs/development/libraries/tachyon/default.nix b/pkgs/development/libraries/tachyon/default.nix index 4f711a639f73..d5d12e44df0a 100644 --- a/pkgs/development/libraries/tachyon/default.nix +++ b/pkgs/development/libraries/tachyon/default.nix @@ -50,7 +50,9 @@ stdenv.mkDerivation rec { ./no-absolute-paths.patch # Include new targets (like arm) ./make-archs.patch - ]; + ] ++ + # Ensure looks for nix-provided Carbon, not system frameworks + stdenv.lib.optional stdenv.isDarwin ./darwin.patch; installPhase = '' cd ../compile/${arch} @@ -66,8 +68,7 @@ stdenv.mkDerivation rec { description = ''A Parallel / Multiprocessor Ray Tracing System''; license = stdenv.lib.licenses.bsd3; maintainers = [stdenv.lib.maintainers.raskin]; - # darwin fails due to missing Carbon.h, even though Carbon is a build input - platforms = with stdenv.lib.platforms; linux ++ cygwin; + platforms = with stdenv.lib.platforms; linux ++ cygwin ++ darwin; homepage = http://jedi.ks.uiuc.edu/~johns/tachyon/; }; }