diff --git a/pkgs/development/libraries/glew/1.10.nix b/pkgs/development/libraries/glew/1.10.nix index 9d5ded5be15e..8500a54f970c 100644 --- a/pkgs/development/libraries/glew/1.10.nix +++ b/pkgs/development/libraries/glew/1.10.nix @@ -1,5 +1,7 @@ { stdenv, fetchurl, mesa_glu, x11, libXmu, libXi -, AGL ? null }: +, buildPlatform, hostPlatform +, AGL ? null +}: with stdenv.lib; @@ -36,13 +38,9 @@ stdenv.mkDerivation rec { cp -r README.txt LICENSE.txt doc $out/share/doc/glew ''; - crossAttrs.makeFlags = [ - "CC=${stdenv.cross.config}-gcc" - "LD=${stdenv.cross.config}-gcc" - "AR=${stdenv.cross.config}-ar" - "STRIP=" - ] ++ optional (stdenv.cross.libc == "msvcrt") "SYSTEM=mingw" - ++ optional (stdenv.cross.libc == "libSystem") "SYSTEM=darwin"; + makeFlags = if hostPlatform == buildPlatform then null else [ + "SYSTEM=${if hostPlatform.isMinGW then "mingw" else hostPlatform.parsed.kernel}" + ]; meta = with stdenv.lib; { description = "An OpenGL extension loading library for C(++)"; diff --git a/pkgs/development/libraries/glew/default.nix b/pkgs/development/libraries/glew/default.nix index 02c87cf709a7..f8df5d5baf0d 100644 --- a/pkgs/development/libraries/glew/default.nix +++ b/pkgs/development/libraries/glew/default.nix @@ -1,4 +1,6 @@ -{ stdenv, fetchurl, mesa_glu, xlibsWrapper, libXmu, libXi }: +{ stdenv, fetchurl, mesa_glu, xlibsWrapper, libXmu, libXi +, buildPlatform, hostPlatform +}: with stdenv.lib; @@ -37,13 +39,9 @@ stdenv.mkDerivation rec { rm $out/lib/*.a ''; - crossAttrs.makeFlags = [ - "CC=${stdenv.cross.config}-gcc" - "LD=${stdenv.cross.config}-gcc" - "AR=${stdenv.cross.config}-ar" - "STRIP=" - ] ++ optional (stdenv.cross.libc == "msvcrt") "SYSTEM=mingw" - ++ optional (stdenv.cross.libc == "libSystem") "SYSTEM=darwin"; + makeFlags = if hostPlatform == buildPlatform then null else [ + "SYSTEM=${if hostPlatform.isMinGW then "mingw" else hostPlatform.parsed.kernel}" + ]; meta = with stdenv.lib; { description = "An OpenGL extension loading library for C(++)";