summary refs log tree commit diff
path: root/pkgs/development/libraries/glew/default.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2014-03-10 22:22:21 +0100
committeraszlig <aszlig@redmoonstudios.org>2014-03-12 10:00:46 +0100
commit3d73bf6c57d9406accfdbe89a46f38c492364ec3 (patch)
tree193e21348d1fa17433bd4b01da113f591c5f5c0f /pkgs/development/libraries/glew/default.nix
parent745c4779305490816682bb95b319923d27c4a8fe (diff)
downloadnixpkgs-3d73bf6c57d9406accfdbe89a46f38c492364ec3.tar
nixpkgs-3d73bf6c57d9406accfdbe89a46f38c492364ec3.tar.gz
nixpkgs-3d73bf6c57d9406accfdbe89a46f38c492364ec3.tar.bz2
nixpkgs-3d73bf6c57d9406accfdbe89a46f38c492364ec3.tar.lz
nixpkgs-3d73bf6c57d9406accfdbe89a46f38c492364ec3.tar.xz
nixpkgs-3d73bf6c57d9406accfdbe89a46f38c492364ec3.tar.zst
nixpkgs-3d73bf6c57d9406accfdbe89a46f38c492364ec3.zip
glew/cross: Fix build for Darwin.
The Makefile still contained calls to install with the -s (strip)
option, which we don't want because it uses the native strip utility and
we're going to crossStrip in fixupPhase later anyway.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'pkgs/development/libraries/glew/default.nix')
-rw-r--r--pkgs/development/libraries/glew/default.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/pkgs/development/libraries/glew/default.nix b/pkgs/development/libraries/glew/default.nix
index ef81f210d39..1106a013949 100644
--- a/pkgs/development/libraries/glew/default.nix
+++ b/pkgs/development/libraries/glew/default.nix
@@ -1,5 +1,7 @@
 { stdenv, fetchurl, mesa_glu, x11, libXmu, libXi }:
 
+with stdenv.lib;
+
 stdenv.mkDerivation rec {
   name = "glew-1.10.0";
 
@@ -14,6 +16,9 @@ stdenv.mkDerivation rec {
 
   patchPhase = ''
     sed -i 's|lib64|lib|' config/Makefile.linux
+    ${optionalString (stdenv ? cross) ''
+    sed -i -e 's/\(INSTALL.*\)-s/\1/' Makefile
+    ''}
   '';
 
 buildPhase = "make all";
@@ -25,6 +30,13 @@ buildPhase = "make all";
     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 == "libSystem") "SYSTEM=darwin";
+
   meta = {
     description = "An OpenGL extension loading library for C(++)";
     homepage = http://glew.sourceforge.net/;