From a40ceb2782a0f2554f854628a3bd5d8d941677d4 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 28 Jun 2017 11:48:13 -0400 Subject: [PATCH] glew: Rely on cc-wrapper can to export these env vars --- pkgs/development/libraries/glew/1.10.nix | 14 ++++++-------- pkgs/development/libraries/glew/default.nix | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/pkgs/development/libraries/glew/1.10.nix b/pkgs/development/libraries/glew/1.10.nix index 9d5ded5be15..8500a54f970 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 02c87cf709a..f8df5d5baf0 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(++)";