summary refs log tree commit diff
path: root/pkgs/development/libraries/libvpx
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2017-06-28 11:40:32 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2017-06-28 18:21:06 -0400
commit5c99b2f341572b025bf1c975e8604d55ecd9955d (patch)
tree39df14580a7ed9ecb9ecebcdd8073dda4eddf20a /pkgs/development/libraries/libvpx
parent38dbd4b1610362c67e6a17d0e103f459ff471002 (diff)
downloadnixpkgs-5c99b2f341572b025bf1c975e8604d55ecd9955d.tar
nixpkgs-5c99b2f341572b025bf1c975e8604d55ecd9955d.tar.gz
nixpkgs-5c99b2f341572b025bf1c975e8604d55ecd9955d.tar.bz2
nixpkgs-5c99b2f341572b025bf1c975e8604d55ecd9955d.tar.lz
nixpkgs-5c99b2f341572b025bf1c975e8604d55ecd9955d.tar.xz
nixpkgs-5c99b2f341572b025bf1c975e8604d55ecd9955d.tar.zst
nixpkgs-5c99b2f341572b025bf1c975e8604d55ecd9955d.zip
libvpx: Don't use stdenv.cross
Diffstat (limited to 'pkgs/development/libraries/libvpx')
-rw-r--r--pkgs/development/libraries/libvpx/default.nix30
-rw-r--r--pkgs/development/libraries/libvpx/git.nix30
2 files changed, 28 insertions, 32 deletions
diff --git a/pkgs/development/libraries/libvpx/default.nix b/pkgs/development/libraries/libvpx/default.nix
index 09fc3a2a9da..4b50fe090e3 100644
--- a/pkgs/development/libraries/libvpx/default.nix
+++ b/pkgs/development/libraries/libvpx/default.nix
@@ -1,4 +1,5 @@
-{stdenv, fetchFromGitHub, perl, yasm
+{ stdenv, fetchFromGitHub, perl, yasm
+, hostPlatform
 , vp8DecoderSupport ? true # VP8 decoder
 , vp8EncoderSupport ? true # VP8 encoder
 , vp9DecoderSupport ? true # VP9 decoder
@@ -144,10 +145,7 @@ stdenv.mkDerivation rec {
 
   postInstall = ''moveToOutput bin "$bin" '';
 
-  crossAttrs = let
-    isCygwin = stdenv.cross.libc == "msvcrt";
-    isDarwin = stdenv.cross.libc == "libSystem";
-  in {
+  crossAttrs = {
     configurePlatforms = [];
     configureFlags = configureFlags ++ [
       #"--extra-cflags="
@@ -159,17 +157,17 @@ stdenv.mkDerivation rec {
       # libvpx darwin targets include darwin version (ie. ARCH-darwinXX-gcc, XX being the darwin version)
       # See all_platforms: https://github.com/webmproject/libvpx/blob/master/configure
       # Darwin versions: 10.4=8, 10.5=9, 10.6=10, 10.7=11, 10.8=12, 10.9=13, 10.10=14
-      "--force-target=${stdenv.cross.config}${(
-              if isDarwin then (
-                if      stdenv.cross.osxMinVersion == "10.10" then "14"
-                else if stdenv.cross.osxMinVersion == "10.9"  then "13"
-                else if stdenv.cross.osxMinVersion == "10.8"  then "12"
-                else if stdenv.cross.osxMinVersion == "10.7"  then "11"
-                else if stdenv.cross.osxMinVersion == "10.6"  then "10"
-                else if stdenv.cross.osxMinVersion == "10.5"  then "9"
-                else "8")
-              else "")}-gcc"
-      (if isCygwin then "--enable-static-msvcrt" else "")
+      "--force-target=${hostPlatform.config}${
+              if hostPlatform.isDarwin then
+                if      hostPlatform.osxMinVersion == "10.10" then "14"
+                else if hostPlatform.osxMinVersion == "10.9"  then "13"
+                else if hostPlatform.osxMinVersion == "10.8"  then "12"
+                else if hostPlatform.osxMinVersion == "10.7"  then "11"
+                else if hostPlatform.osxMinVersion == "10.6"  then "10"
+                else if hostPlatform.osxMinVersion == "10.5"  then "9"
+                else "8"
+              else ""}-gcc"
+      (if hostPlatform.isCygwin then "--enable-static-msvcrt" else "")
     ];
   };
 
diff --git a/pkgs/development/libraries/libvpx/git.nix b/pkgs/development/libraries/libvpx/git.nix
index ceda1c26389..824449a347a 100644
--- a/pkgs/development/libraries/libvpx/git.nix
+++ b/pkgs/development/libraries/libvpx/git.nix
@@ -1,4 +1,5 @@
-{stdenv, fetchgit, perl, yasm
+{ stdenv, fetchgit, perl, yasm
+, hostPlatform
 , vp8DecoderSupport ? true # VP8 decoder
 , vp8EncoderSupport ? true # VP8 encoder
 , vp9DecoderSupport ? true # VP9 decoder
@@ -152,10 +153,7 @@ stdenv.mkDerivation rec {
 
   postInstall = ''moveToOutput bin "$bin" '';
 
-  crossAttrs = let
-    isCygwin = stdenv.cross.libc == "msvcrt";
-    isDarwin = stdenv.cross.libc == "libSystem";
-  in {
+  crossAttrs = {
     configurePlatforms = [];
     configureFlags = configureFlags ++ [
       #"--extra-cflags="
@@ -166,17 +164,17 @@ stdenv.mkDerivation rec {
       # libvpx darwin targets include darwin version (ie. ARCH-darwinXX-gcc, XX being the darwin version)
       # See all_platforms: https://github.com/webmproject/libvpx/blob/master/configure
       # Darwin versions: 10.4=8, 10.5=9, 10.6=10, 10.7=11, 10.8=12, 10.9=13, 10.10=14
-      "--force-target=${stdenv.cross.config}${(
-              if isDarwin then (
-                if      stdenv.cross.osxMinVersion == "10.10" then "14"
-                else if stdenv.cross.osxMinVersion == "10.9"  then "13"
-                else if stdenv.cross.osxMinVersion == "10.8"  then "12"
-                else if stdenv.cross.osxMinVersion == "10.7"  then "11"
-                else if stdenv.cross.osxMinVersion == "10.6"  then "10"
-                else if stdenv.cross.osxMinVersion == "10.5"  then "9"
-                else "8")
-              else "")}-gcc"
-      (if isCygwin then "--enable-static-msvcrt" else "")
+      "--force-target=${hostPlatform.config}${
+              if hostPlatform.isDarwin then
+                if      hostPlatform.osxMinVersion == "10.10" then "14"
+                else if hostPlatform.osxMinVersion == "10.9"  then "13"
+                else if hostPlatform.osxMinVersion == "10.8"  then "12"
+                else if hostPlatform.osxMinVersion == "10.7"  then "11"
+                else if hostPlatform.osxMinVersion == "10.6"  then "10"
+                else if hostPlatform.osxMinVersion == "10.5"  then "9"
+                else "8"
+              else ""}-gcc"
+      (if hostPlatform.isCygwin then "--enable-static-msvcrt" else "")
     ];
   };