summary refs log tree commit diff
path: root/pkgs/development/libraries/bullet
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2018-09-09 15:16:24 +0200
committerDaiderd Jordan <daiderd@gmail.com>2018-09-09 15:34:03 +0200
commit939debc7a419b6924c0bc1460ed7debad0942e35 (patch)
tree8a9d59a71c03469815cc9ce63d8cd726508c8e55 /pkgs/development/libraries/bullet
parent293644c86bec9f61d4b65472d040900c12353b72 (diff)
downloadnixpkgs-939debc7a419b6924c0bc1460ed7debad0942e35.tar
nixpkgs-939debc7a419b6924c0bc1460ed7debad0942e35.tar.gz
nixpkgs-939debc7a419b6924c0bc1460ed7debad0942e35.tar.bz2
nixpkgs-939debc7a419b6924c0bc1460ed7debad0942e35.tar.lz
nixpkgs-939debc7a419b6924c0bc1460ed7debad0942e35.tar.xz
nixpkgs-939debc7a419b6924c0bc1460ed7debad0942e35.tar.zst
nixpkgs-939debc7a419b6924c0bc1460ed7debad0942e35.zip
bullet: fix darwin build
The examples fail with an opengl related issue:

    Undefined symbols for architecture x86_64:
      "SimpleOpenGL3App::SimpleOpenGL3App(char const*, int, int, bool)", referenced from:
          _main in main_opengl_single_example.o
      "_useShadowMap", referenced from:
          GL_ShapeDrawer::drawScene(btDiscreteDynamicsWorld const*, bool, int) in GL_ShapeDrawer.o
    ld: symbol(s) not found for architecture x86_64

And the tests need an extra dependencly, possibley related to
https://github.com/bulletphysics/bullet3/issues/819

    ld: library not found for -lBussIK

/cc ZHF #45961
Diffstat (limited to 'pkgs/development/libraries/bullet')
-rw-r--r--pkgs/development/libraries/bullet/default.nix30
1 files changed, 16 insertions, 14 deletions
diff --git a/pkgs/development/libraries/bullet/default.nix b/pkgs/development/libraries/bullet/default.nix
index 4d94faa9566..fca5e8d70a3 100644
--- a/pkgs/development/libraries/bullet/default.nix
+++ b/pkgs/development/libraries/bullet/default.nix
@@ -1,4 +1,6 @@
-{ stdenv, fetchFromGitHub, cmake, libGLU_combined, freeglut, darwin }:
+{ stdenv, fetchFromGitHub, cmake, libGLU_combined, freeglut
+, Cocoa,  OpenGL
+}:
 
 stdenv.mkDerivation rec {
   name = "bullet-${version}";
@@ -11,10 +13,9 @@ stdenv.mkDerivation rec {
     sha256 = "1msp7w3563vb43w70myjmqsdb97kna54dcfa7yvi9l3bvamb92w3";
   };
 
-  buildInputs = [ cmake ] ++
-    (if stdenv.isDarwin
-     then with darwin.apple_sdk.frameworks; [ Cocoa OpenGL ]
-     else [libGLU_combined freeglut]);
+  nativeBuildInputs = [ cmake ];
+  buildInputs = stdenv.lib.optionals stdenv.isLinux [ libGLU_combined freeglut ]
+    ++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa OpenGL ];
 
   patches = [ ./gwen-narrowing.patch ];
 
@@ -28,25 +29,26 @@ stdenv.mkDerivation rec {
     "-DBUILD_CPU_DEMOS=OFF"
     "-DINSTALL_EXTRA_LIBS=ON"
   ] ++ stdenv.lib.optionals stdenv.isDarwin [
-    "-DMACOSX_DEPLOYMENT_TARGET=\"10.9\""
     "-DOPENGL_FOUND=true"
-    "-DOPENGL_LIBRARIES=${darwin.apple_sdk.frameworks.OpenGL}/Library/Frameworks/OpenGL.framework"
-    "-DOPENGL_INCLUDE_DIR=${darwin.apple_sdk.frameworks.OpenGL}/Library/Frameworks/OpenGL.framework"
-    "-DOPENGL_gl_LIBRARY=${darwin.apple_sdk.frameworks.OpenGL}/Library/Frameworks/OpenGL.framework"
-    "-DCOCOA_LIBRARY=${darwin.apple_sdk.frameworks.Cocoa}/Library/Frameworks/Cocoa.framework"
+    "-DOPENGL_LIBRARIES=${OpenGL}/Library/Frameworks/OpenGL.framework"
+    "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks/OpenGL.framework"
+    "-DOPENGL_gl_LIBRARY=${OpenGL}/Library/Frameworks/OpenGL.framework"
+    "-DCOCOA_LIBRARY=${Cocoa}/Library/Frameworks/Cocoa.framework"
+    "-DBUILD_BULLET2_DEMOS=OFF"
+    "-DBUILD_UNIT_TESTS=OFF"
   ];
 
   enableParallelBuilding = true;
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "A professional free 3D Game Multiphysics Library";
     longDescription = ''
       Bullet 3D Game Multiphysics Library provides state of the art collision
       detection, soft body and rigid body dynamics.
     '';
     homepage = http://bulletphysics.org;
-    license = stdenv.lib.licenses.zlib;
-    maintainers = with stdenv.lib.maintainers; [ aforemny ];
-    platforms = with stdenv.lib.platforms; unix;
+    license = licenses.zlib;
+    maintainers = with maintainers; [ aforemny ];
+    platforms = platforms.unix;
   };
 }