2018-02-24 14:12:44 +01:00
|
|
|
{stdenv, fetchurl, libGLU_combined, freeglut, glew, libXmu, libXext, libX11
|
2019-05-06 19:30:07 +02:00
|
|
|
, qmake, GLUT, fixDarwinDylibNames }:
|
2012-01-26 20:01:38 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2018-02-27 17:45:20 +01:00
|
|
|
version = "1.4.2";
|
2012-01-26 20:01:38 +01:00
|
|
|
name = "opencsg-${version}";
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://www.opencsg.org/OpenCSG-${version}.tar.gz";
|
2018-02-27 17:45:20 +01:00
|
|
|
sha256 = "1ysazynm759gnw1rdhn9xw9nixnzrlzrc462340a6iif79fyqlnr";
|
2012-01-26 20:01:38 +01:00
|
|
|
};
|
|
|
|
|
2019-05-06 19:30:07 +02:00
|
|
|
nativeBuildInputs = [ qmake ]
|
|
|
|
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
|
|
|
|
|
|
|
buildInputs = [ glew ]
|
|
|
|
++ stdenv.lib.optionals stdenv.isLinux [ libGLU_combined freeglut libXmu libXext libX11 ]
|
|
|
|
++ stdenv.lib.optional stdenv.isDarwin GLUT;
|
2012-01-26 20:01:38 +01:00
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
2019-05-06 19:30:07 +02:00
|
|
|
patches = [ ./fix-pro-files.patch ];
|
|
|
|
|
2016-03-16 12:37:35 +01:00
|
|
|
preConfigure = ''
|
2019-05-06 19:30:07 +02:00
|
|
|
rm example/Makefile src/Makefile
|
|
|
|
qmakeFlags="$qmakeFlags INSTALLDIR=$out"
|
2016-03-16 12:37:35 +01:00
|
|
|
'';
|
|
|
|
|
2019-05-06 19:30:07 +02:00
|
|
|
postInstall = ''
|
|
|
|
install -D license.txt "$out/share/doc/opencsg/license.txt"
|
|
|
|
'' + stdenv.lib.optionalString stdenv.isDarwin ''
|
|
|
|
mkdir -p $out/Applications
|
|
|
|
mv $out/bin/*.app $out/Applications
|
|
|
|
rmdir $out/bin || true
|
|
|
|
'';
|
2012-01-26 20:01:38 +01:00
|
|
|
|
2019-05-06 19:30:07 +02:00
|
|
|
postFixup = stdenv.lib.optionalString stdenv.isDarwin ''
|
|
|
|
app=$out/Applications/opencsgexample.app/Contents/MacOS/opencsgexample
|
|
|
|
install_name_tool -change \
|
|
|
|
$(otool -L $app | awk '/opencsg.+dylib/ { print $1 }') \
|
|
|
|
$(otool -D $out/lib/libopencsg.dylib | tail -n 1) \
|
|
|
|
$app
|
2012-01-26 20:01:38 +01:00
|
|
|
'';
|
|
|
|
|
2018-10-25 21:58:46 +02:00
|
|
|
meta = with stdenv.lib; {
|
2012-01-26 20:01:38 +01:00
|
|
|
description = "Constructive Solid Geometry library";
|
2017-08-01 22:03:30 +02:00
|
|
|
homepage = http://www.opencsg.org/;
|
2019-05-06 19:30:07 +02:00
|
|
|
platforms = platforms.unix;
|
2018-10-25 21:58:46 +02:00
|
|
|
maintainers = [ maintainers.raskin ];
|
|
|
|
license = licenses.gpl2;
|
2012-01-26 20:01:38 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|