diff --git a/pkgs/development/tools/glslviewer/default.nix b/pkgs/development/tools/glslviewer/default.nix index 1cca6a096fe6..a971ae83e637 100644 --- a/pkgs/development/tools/glslviewer/default.nix +++ b/pkgs/development/tools/glslviewer/default.nix @@ -1,6 +1,7 @@ -{ stdenv, fetchFromGitHub, glfw, pkgconfig, libXrandr, libXdamage, - libXext, libXrender, libXinerama, libXcursor, libXxf86vm, libXi, - libX11, mesa_glu }: +{ stdenv, fetchFromGitHub, glfw, pkgconfig, libXrandr, libXdamage +, libXext, libXrender, libXinerama, libXcursor, libXxf86vm, libXi +, libX11, mesa_glu, Cocoa +}: stdenv.mkDerivation rec { name = "glslviewer-${version}"; @@ -15,17 +16,21 @@ stdenv.mkDerivation rec { # Makefile has /usr/local/bin hard-coded for 'make install' preConfigure = '' - sed s,/usr/local,$out, -i Makefile + substituteInPlace Makefile \ + --replace '/usr/local' "$out" \ + --replace '/usr/bin/clang++' 'clang++' ''; preInstall = '' mkdir -p $out/bin ''; - - buildInputs = [ glfw mesa_glu pkgconfig glfw libXrandr libXdamage - libXext libXrender libXinerama libXcursor libXxf86vm - libXi libX11 ]; - + + buildInputs = [ + glfw mesa_glu pkgconfig glfw libXrandr libXdamage + libXext libXrender libXinerama libXcursor libXxf86vm + libXi libX11 + ] ++ stdenv.lib.optional stdenv.isDarwin Cocoa; + meta = with stdenv.lib; { description = "Live GLSL coding renderer"; homepage = http://patriciogonzalezvivo.com/2015/glslViewer/; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f530b3feac2e..0ca1dff970b7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1075,7 +1075,9 @@ with pkgs; glock = callPackage ../development/tools/glock { }; - glslviewer = callPackage ../development/tools/glslviewer { }; + glslviewer = callPackage ../development/tools/glslviewer { + inherit (darwin.apple_sdk.frameworks) Cocoa; + }; gmic = callPackage ../tools/graphics/gmic { };