Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bullet: fix darwin build #46422

Merged
merged 1 commit into from
Sep 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions pkgs/development/libraries/bullet/default.nix
Original file line number Diff line number Diff line change
@@ -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}";
Expand All @@ -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 ];

Expand All @@ -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;
};
}
4 changes: 3 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22213,7 +22213,9 @@ with pkgs;
inherit (gnome2) gtksourceview;
};

bullet = callPackage ../development/libraries/bullet {};
bullet = callPackage ../development/libraries/bullet {
inherit (darwin.apple_sdk.frameworks) Cocoa OpenGL;
};

spdlog = callPackage ../development/libraries/spdlog { };

Expand Down