diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-05-17 10:56:54 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-05-17 10:56:54 +0000 |
commit | c1d22074139ab0d048a05b5e5116265d099114d6 (patch) | |
tree | 97977009422d675f8930f97c309b010481289e72 /nixpkgs/pkgs/development/libraries/opencsg/default.nix | |
parent | 4dc8afe4fd6b18437150129e0a1ecc23c6a1c0b9 (diff) | |
parent | bc9df0f66110039e495b6debe3a6cda4a1bb0fed (diff) | |
download | nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar.gz nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar.bz2 nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar.lz nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar.xz nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar.zst nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.zip |
Merge commit 'bc9df0f66110039e495b6debe3a6cda4a1bb0fed'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/opencsg/default.nix')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/opencsg/default.nix | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/nixpkgs/pkgs/development/libraries/opencsg/default.nix b/nixpkgs/pkgs/development/libraries/opencsg/default.nix index e0a6c6a5705e..11c66f0d497b 100644 --- a/nixpkgs/pkgs/development/libraries/opencsg/default.nix +++ b/nixpkgs/pkgs/development/libraries/opencsg/default.nix @@ -1,5 +1,5 @@ {stdenv, fetchurl, libGLU_combined, freeglut, glew, libXmu, libXext, libX11 - }: +, qmake, GLUT, fixDarwinDylibNames }: stdenv.mkDerivation rec { version = "1.4.2"; @@ -9,27 +9,42 @@ stdenv.mkDerivation rec { sha256 = "1ysazynm759gnw1rdhn9xw9nixnzrlzrc462340a6iif79fyqlnr"; }; - buildInputs = [libGLU_combined freeglut glew libXmu libXext libX11]; + 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; doCheck = false; + patches = [ ./fix-pro-files.patch ]; + preConfigure = '' - sed -i 's/^\(LIBS *=.*\)$/\1 -lX11/' example/Makefile + rm example/Makefile src/Makefile + qmakeFlags="$qmakeFlags INSTALLDIR=$out" ''; - installPhase = '' - mkdir -pv "$out/"{bin,share/doc/opencsg} - - cp example/opencsgexample "$out/bin" - cp -r include lib "$out" + 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 + ''; - cp license.txt "$out/share/doc/opencsg" + 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 ''; meta = with stdenv.lib; { description = "Constructive Solid Geometry library"; homepage = http://www.opencsg.org/; - platforms = platforms.linux; + platforms = platforms.unix; maintainers = [ maintainers.raskin ]; license = licenses.gpl2; }; |