diff --git a/pkgs/development/libraries/freeglut/default.nix b/pkgs/development/libraries/freeglut/default.nix index 368a1e274878..4135c451eebc 100644 --- a/pkgs/development/libraries/freeglut/default.nix +++ b/pkgs/development/libraries/freeglut/default.nix @@ -11,6 +11,14 @@ in stdenv.mkDerivation { buildInputs = [ libXi libXrandr libXxf86vm mesa xlibsWrapper cmake ]; + cmakeFlags = stdenv.lib.optionals stdenv.isDarwin [ + "-DOPENGL_INCLUDE_DIR=${mesa}/include" + "-DOPENGL_gl_LIBRARY:FILEPATH=${mesa}/lib/libGL.dylib" + "-DOPENGL_glu_LIBRARY:FILEPATH=${mesa}/lib/libGLU.dylib" + "-DFREEGLUT_BUILD_DEMOS:BOOL=OFF" + "-DFREEGLUT_BUILD_STATIC:BOOL=OFF" + ]; + meta = with stdenv.lib; { description = "Create and manage windows containing OpenGL contexts"; longDescription = '' diff --git a/pkgs/development/libraries/mesa-darwin/default.nix b/pkgs/development/libraries/mesa-darwin/default.nix index af8b4e1179ce..0ae17b4d3f61 100644 --- a/pkgs/development/libraries/mesa-darwin/default.nix +++ b/pkgs/development/libraries/mesa-darwin/default.nix @@ -25,6 +25,8 @@ let libffi libvdpau ] ++ stdenv.lib.optionals stdenv.isDarwin [ OpenGL apple_sdk.sdk Xplugin ]; + propagatedBuildInputs = stdenv.lib.optionals stdenv.isDarwin [ OpenGL ]; + postUnpack = '' ln -s darwin $sourceRoot/configs/current '';