diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/tachyon')
4 files changed, 199 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/tachyon/darwin.patch b/nixpkgs/pkgs/development/libraries/tachyon/darwin.patch new file mode 100644 index 000000000000..dbede586f073 --- /dev/null +++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/tachyon/default.nix b/nixpkgs/pkgs/development/libraries/tachyon/default.nix new file mode 100644 index 000000000000..993cf6631217 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/tachyon/default.nix @@ -0,0 +1,74 @@ +{ stdenv +, fetchurl +, Carbon ? null +, libjpeg ? null +, libpng ? null +, withJpegSupport ? true # support jpeg output +, withPngSupport ? true # support png output +}: + +assert withJpegSupport -> libjpeg != null; +assert withPngSupport -> libpng != null; +assert stdenv.isDarwin -> Carbon != null; + +stdenv.mkDerivation rec { + pname = "tachyon"; + version = "0.99b2"; + src = fetchurl { + url = "http://jedi.ks.uiuc.edu/~johns/tachyon/files/${version}/${pname}-${version}.tar.gz"; + sha256 = "04m0bniszyg7ryknj8laj3rl5sspacw5nr45x59j2swcsxmdvn1v"; + }; + buildInputs = stdenv.lib.optionals stdenv.isDarwin [ + Carbon + ] ++ stdenv.lib.optionals withJpegSupport [ + libjpeg + ] ++ stdenv.lib.optionals withPngSupport [ + libpng + ]; + preBuild = '' + cd unix + '' + stdenv.lib.optionalString withJpegSupport '' + export USEJPEG=" -DUSEJPEG" + export JPEGLIB=" -ljpeg" + '' + stdenv.lib.optionalString withPngSupport '' + export USEPNG=" -DUSEPNG" + export PNGLIB=" -lpng -lz" + ''; + arch = if stdenv.hostPlatform.system == "x86_64-linux" then "linux-64-thr" else + if stdenv.hostPlatform.system == "i686-linux" then "linux-thr" else + if stdenv.hostPlatform.system == "aarch64-linux" then "linux-arm-thr" else + if stdenv.hostPlatform.system == "armv7l-linux" then "linux-arm-thr" else + if stdenv.hostPlatform.system == "x86_64-darwin" then "macosx-thr" else + if stdenv.hostPlatform.system == "i686-darwin" then "macosx-64-thr" else + if stdenv.hostPlatform.system == "i686-cygwin" then "win32" else + if stdenv.hostPlatform.system == "x86_64-freebsd" then "bsd" else + if stdenv.hostPlatform.system == "x686-freebsd" then "bsd" else + throw "Don't know what arch to select for tachyon build"; + makeFlags = [ arch ]; + patches = [ + # Remove absolute paths in Make-config (and unset variables so they can be set in preBuild) + ./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} + mkdir -p "$out"/{bin,lib,include,share/doc/tachyon,share/tachyon} + cp tachyon "$out"/bin + cp libtachyon.* "$out/lib" + cd ../.. + cp Changes Copyright README "$out/share/doc/tachyon" + cp -r scenes "$out/share/tachyon/scenes" + ''; + meta = { + inherit version; + description = ''A Parallel / Multiprocessor Ray Tracing System''; + license = stdenv.lib.licenses.bsd3; + maintainers = [stdenv.lib.maintainers.raskin]; + platforms = with stdenv.lib.platforms; linux ++ cygwin ++ darwin; + homepage = "http://jedi.ks.uiuc.edu/~johns/tachyon/"; + }; +} diff --git a/nixpkgs/pkgs/development/libraries/tachyon/make-archs.patch b/nixpkgs/pkgs/development/libraries/tachyon/make-archs.patch new file mode 100644 index 000000000000..cf83f8c8c31c --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/tachyon/make-archs.patch @@ -0,0 +1,37 @@ +diff --git a/unix/Make-arch b/unix/Make-arch +index 08afb85..dbeb691 100644 +--- a/unix/Make-arch ++++ b/unix/Make-arch +@@ -920,6 +920,15 @@ macosx: + "RANLIB = ranlib" \ + "LIBS = -L. -ltachyon $(MISCLIB)" + ++macosx-64: ++ $(MAKE) all \ ++ "ARCH = macosx" \ ++ "CFLAGS = -Os -m64 -ffast-math -DBsd $(MISCFLAGS)" \ ++ "ARFLAGS = r" \ ++ "STRIP = strip" \ ++ "RANLIB = ranlib" \ ++ "LIBS = -L. -ltachyon $(MISCLIB)" ++ + macosx-thr: + $(MAKE) all \ + "ARCH = macosx-thr" \ +@@ -1209,6 +1218,16 @@ linux-thr: + "RANLIB = ranlib" \ + "LIBS = -L. -ltachyon $(MISCLIB) -lm -lpthread" + ++# Linux Arm using gcc, with threads ++linux-arm-thr: ++ $(MAKE) all \ ++ "ARCH = linux-arm-thr" \ ++ "CFLAGS = -Wall -O3 -fomit-frame-pointer -ffast-math -DLinux -DTHR -D_REENTRANT $(MISCFLAGS)" \ ++ "ARFLAGS = r" \ ++ "STRIP = strip" \ ++ "RANLIB = ranlib" \ ++ "LIBS = -L. -ltachyon $(MISCLIB) -lm -lpthread" ++ + # Linux x86 using gcc, threads, and OpenGL + linux-thr-ogl: + $(MAKE) all \ diff --git a/nixpkgs/pkgs/development/libraries/tachyon/no-absolute-paths.patch b/nixpkgs/pkgs/development/libraries/tachyon/no-absolute-paths.patch new file mode 100644 index 000000000000..faa3810fb5c6 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/tachyon/no-absolute-paths.patch @@ -0,0 +1,57 @@ +diff --git a/unix/Make-config b/unix/Make-config +index ee4f388..c1d51d4 100644 +--- a/unix/Make-config ++++ b/unix/Make-config +@@ -18,7 +18,7 @@ + # Bourne Shell Configuration: + # set SHELL=/bin/sh or wherever your bourne shell is + ########################################################################## +-SHELL=/bin/sh ++# SHELL=/bin/sh + + + +@@ -30,7 +30,7 @@ SHELL=/bin/sh + + # The following line should be set to -Ixxx where xxx is your X11 include path + # Sun puts X11 in /usr/openwin/xxx +-X11INC= -I/usr/openwin/include ++# X11INC= -I/usr/openwin/include + + # Others typically use /usr/X11 or /usr/X11R6 + #X11INC= -I/usr/X11 +@@ -57,7 +57,7 @@ X11LIB= -lX11 + ########################################################################## + + # Standard MPICH installation location +-MPIDIR=/usr/local/mpi ++# MPIDIR=/usr/local/mpi + + # UMR CS Dept + #MPIDIR=/software/all/mpi +@@ -108,9 +108,9 @@ MBOX= + # http://www.ijg.org/files/ + ########################################################################## + # Uncomment the following lines to disable JPEG support +-USEJPEG= +-JPEGINC= +-JPEGLIB= ++# USEJPEG= ++# JPEGINC= ++# JPEGLIB= + + # Uncomment the following lines to enable JPEG support + #USEJPEG= -DUSEJPEG +@@ -128,9 +128,9 @@ JPEGLIB= + # http://www.libpng.org/ + ########################################################################## + # Uncomment the following lines to disable PNG support +-USEPNG= +-PNGINC= +-PNGLIB= ++# USEPNG= ++# PNGINC= ++# PNGLIB= + + # Uncomment the following lines to enable PNG support + #USEPNG= -DUSEPNG |