2018-03-30 13:21:15 +01:00
|
|
|
{ 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;
|
|
|
|
|
2016-10-10 17:43:16 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "tachyon";
|
2018-03-28 06:09:13 +01:00
|
|
|
version = "0.99b2";
|
2016-10-10 17:43:16 +01:00
|
|
|
src = fetchurl {
|
2019-08-15 13:41:18 +01:00
|
|
|
url = "http://jedi.ks.uiuc.edu/~johns/tachyon/files/${version}/${pname}-${version}.tar.gz";
|
2018-03-28 06:09:13 +01:00
|
|
|
sha256 = "04m0bniszyg7ryknj8laj3rl5sspacw5nr45x59j2swcsxmdvn1v";
|
2016-10-10 17:43:16 +01:00
|
|
|
};
|
2018-03-30 13:21:15 +01:00
|
|
|
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"
|
|
|
|
'';
|
2018-08-20 20:11:29 +01:00
|
|
|
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
|
2016-10-10 17:43:16 +01:00
|
|
|
throw "Don't know what arch to select for tachyon build";
|
2019-10-29 22:21:22 +00:00
|
|
|
makeFlags = [ arch ];
|
2018-03-30 13:21:15 +01:00
|
|
|
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
|
2018-08-14 04:14:57 +01:00
|
|
|
] ++
|
|
|
|
# Ensure looks for nix-provided Carbon, not system frameworks
|
|
|
|
stdenv.lib.optional stdenv.isDarwin ./darwin.patch;
|
2018-03-30 13:21:15 +01:00
|
|
|
|
2016-10-10 17:43:16 +01:00
|
|
|
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];
|
2018-08-14 04:14:57 +01:00
|
|
|
platforms = with stdenv.lib.platforms; linux ++ cygwin ++ darwin;
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = http://jedi.ks.uiuc.edu/~johns/tachyon/;
|
2016-10-10 17:43:16 +01:00
|
|
|
};
|
|
|
|
}
|