summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2017-05-18 11:24:18 +0200
committerVladimír Čunát <vcunat@gmail.com>2017-05-18 11:24:18 +0200
commite9aeb55f3bc5206606ca22db8ad01bcabb8118a4 (patch)
tree48b3c280de3eb20282b583276eaf49b6fd511f23 /pkgs/os-specific
parent71a7e221d8f0def852f3a692daa3904a50523b30 (diff)
parent0eff1d9f2af05353a827a3896ebcc2bce20d2fdd (diff)
downloadnixlib-e9aeb55f3bc5206606ca22db8ad01bcabb8118a4.tar
nixlib-e9aeb55f3bc5206606ca22db8ad01bcabb8118a4.tar.gz
nixlib-e9aeb55f3bc5206606ca22db8ad01bcabb8118a4.tar.bz2
nixlib-e9aeb55f3bc5206606ca22db8ad01bcabb8118a4.tar.lz
nixlib-e9aeb55f3bc5206606ca22db8ad01bcabb8118a4.tar.xz
nixlib-e9aeb55f3bc5206606ca22db8ad01bcabb8118a4.tar.zst
nixlib-e9aeb55f3bc5206606ca22db8ad01bcabb8118a4.zip
Merge branch 'master' into staging
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/darwin/binutils/default.nix24
-rw-r--r--pkgs/os-specific/darwin/cctools/port.nix70
-rw-r--r--pkgs/os-specific/linux/kernel/common-config.nix8
-rw-r--r--pkgs/os-specific/linux/kernel/linux-testing.nix10
-rw-r--r--pkgs/os-specific/linux/wireguard/default.nix4
5 files changed, 74 insertions, 42 deletions
diff --git a/pkgs/os-specific/darwin/binutils/default.nix b/pkgs/os-specific/darwin/binutils/default.nix
index c4ccdb94b812..f88f761f65a3 100644
--- a/pkgs/os-specific/darwin/binutils/default.nix
+++ b/pkgs/os-specific/darwin/binutils/default.nix
@@ -1,11 +1,25 @@
-{ stdenv, binutils-raw, cctools }:
+{ stdenv, binutils-raw, cctools
+, hostPlatform, targetPlatform
+}:
 
+let
+  prefix = stdenv.lib.optionalString
+    (targetPlatform != hostPlatform)
+    "${targetPlatform.config}-";
+
+  cmds = [
+    "ar" "ranlib" "as" "dsymutil" "install_name_tool"
+    "ld" "strip" "otool" "lipo" "nm" "strings" "size"
+  ];
+in
+
+# TODO loop over prefixed binaries too
 stdenv.mkDerivation {
-  name = "cctools-binutils-darwin";
+  name = "${prefix}cctools-binutils-darwin";
   buildCommand = ''
     mkdir -p $out/bin $out/include
 
-    ln -s ${binutils-raw.out}/bin/c++filt $out/bin/c++filt
+    ln -s ${binutils-raw.out}/bin/${prefix}c++filt $out/bin/${prefix}c++filt
 
     # We specifically need:
     # - ld: binutils doesn't provide it on darwin
@@ -18,11 +32,11 @@ stdenv.mkDerivation {
     # - strip: the binutils one seems to break mach-o files
     # - lipo: gcc build assumes it exists
     # - nm: the gnu one doesn't understand many new load commands
-    for i in ar ranlib as dsymutil install_name_tool ld strip otool lipo nm strings size; do
+    for i in ${stdenv.lib.concatStringsSep " " (builtins.map (e: prefix + e) cmds)}; do
       ln -sf "${cctools}/bin/$i" "$out/bin/$i"
     done
 
-    for i in ${binutils-raw.dev}/include/*.h; do
+    for i in ${binutils-raw.dev or binutils-raw.out}/include/*.h; do
       ln -s "$i" "$out/include/$(basename $i)"
     done
 
diff --git a/pkgs/os-specific/darwin/cctools/port.nix b/pkgs/os-specific/darwin/cctools/port.nix
index 0154d395216f..14c4c6e99739 100644
--- a/pkgs/os-specific/darwin/cctools/port.nix
+++ b/pkgs/os-specific/darwin/cctools/port.nix
@@ -1,11 +1,25 @@
-{ stdenv, fetchFromGitHub, autoconf, automake, libtool_2
+{ stdenv, fetchFromGitHub, makeWrapper, autoconf, automake, libtool_2
 , llvm, libcxx, libcxxabi, clang, libuuid
-, libobjc ? null
+, libobjc ? null, maloader ? null, xctoolchain ? null
+, buildPlatform, hostPlatform, targetPlatform
 }:
 
 let
+  inherit (stdenv.lib.systems.parse) isDarwin;
+
+  prefix = stdenv.lib.optionalString
+    (targetPlatform != hostPlatform)
+    "${targetPlatform.config}-";
+in
+
+assert isDarwin targetPlatform.parsed;
+
+# Non-Darwin alternatives
+assert (!isDarwin hostPlatform.parsed) -> (maloader != null && xctoolchain != null);
+
+let
   baseParams = rec {
-    name = "cctools-port-${version}";
+    name = "${prefix}cctools-port-${version}";
     version = "895";
 
     src = fetchFromGitHub {
@@ -26,7 +40,14 @@ let
 
     enableParallelBuilding = true;
 
-    configureFlags = stdenv.lib.optionals (!stdenv.isDarwin) [ "CXXFLAGS=-I${libcxx}/include/c++/v1" ];
+    configureFlags = stdenv.lib.optionals (!stdenv.isDarwin) [
+      "CXXFLAGS=-I${libcxx}/include/c++/v1"
+    ] ++ stdenv.lib.optionals (targetPlatform != buildPlatform) [
+      # TODO make unconditional next hash break
+      "--build=${buildPlatform.config}"
+      "--host=${hostPlatform.config}"
+      "--target=${targetPlatform.config}"
+    ];
 
     postPatch = ''
       sed -i -e 's/addStandardLibraryDirectories = true/addStandardLibraryDirectories = false/' cctools/ld64/src/ld/Options.cpp
@@ -69,33 +90,26 @@ let
       popd
     '';
 
+    postInstall =
+      if isDarwin hostPlatform.parsed
+      then ''
+        cat >$out/bin/dsymutil << EOF
+        #!${stdenv.shell}
+        EOF
+        chmod +x $out/bin/dsymutil
+      ''
+      else ''
+        for tool in dyldinfo dwarfdump dsymutil; do
+          ${makeWrapper}/bin/makeWrapper "${maloader}/bin/ld-mac" "$out/bin/${targetPlatform.config}-$tool" \
+            --add-flags "${xctoolchain}/bin/$tool"
+          ln -s "$out/bin/${targetPlatform.config}-$tool" "$out/bin/$tool"
+        done
+      '';
+
     meta = {
       homepage = "http://www.opensource.apple.com/source/cctools/";
       description = "Mac OS X Compiler Tools (cross-platform port)";
       license = stdenv.lib.licenses.apsl20;
     };
   };
-in {
-  native = stdenv.mkDerivation (baseParams // {
-    # A hack for now...
-    postInstall = ''
-      cat >$out/bin/dsymutil << EOF
-      #!${stdenv.shell}
-      EOF
-      chmod +x $out/bin/dsymutil
-    '';
-  });
-
-  cross =
-    { cross, maloader, makeWrapper, xctoolchain}: stdenv.mkDerivation (baseParams // {
-      configureFlags = baseParams.configureFlags ++ [ "--target=${cross.config}" ];
-
-      postInstall = ''
-        for tool in dyldinfo dwarfdump dsymutil; do
-          ${makeWrapper}/bin/makeWrapper "${maloader}/bin/ld-mac" "$out/bin/${cross.config}-$tool" \
-            --add-flags "${xctoolchain}/bin/$tool"
-          ln -s "$out/bin/${cross.config}-$tool" "$out/bin/$tool"
-        done
-      '';
-    });
-}
+in stdenv.mkDerivation baseParams
diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix
index 2c4dbc7d20fa..cd71d563a2fd 100644
--- a/pkgs/os-specific/linux/kernel/common-config.nix
+++ b/pkgs/os-specific/linux/kernel/common-config.nix
@@ -214,7 +214,9 @@ with stdenv.lib;
   SND_AC97_POWER_SAVE y # AC97 Power-Saving Mode
   SND_HDA_INPUT_BEEP y # Support digital beep via input layer
   SND_USB_CAIAQ_INPUT y
-  PSS_MIXER y # Enable PSS mixer (Beethoven ADSP-16 and other compatible)
+  ${optionalString (versionOlder version "4.12") ''
+    PSS_MIXER y # Enable PSS mixer (Beethoven ADSP-16 and other compatible)
+  ''}
 
   # USB serial devices.
   USB_SERIAL_GENERIC y # USB Generic Serial Driver
@@ -495,7 +497,9 @@ with stdenv.lib;
   ${optionalString (versionAtLeast version "4.0") ''
     KVM_COMPAT? y
   ''}
-  KVM_DEVICE_ASSIGNMENT? y
+  ${optionalString (versionOlder version "4.12") ''
+    KVM_DEVICE_ASSIGNMENT? y
+  ''}
   ${optionalString (versionAtLeast version "4.0") ''
     KVM_GENERIC_DIRTYLOG_READ_PROTECT y
   ''}
diff --git a/pkgs/os-specific/linux/kernel/linux-testing.nix b/pkgs/os-specific/linux/kernel/linux-testing.nix
index 932c6602842e..2321187c96be 100644
--- a/pkgs/os-specific/linux/kernel/linux-testing.nix
+++ b/pkgs/os-specific/linux/kernel/linux-testing.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchurl, perl, buildLinux, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "4.11-rc7";
-  modDirVersion = "4.11.0-rc7";
-  extraMeta.branch = "4.11";
+  version = "4.12-rc1";
+  modDirVersion = "4.12.0-rc1";
+  extraMeta.branch = "4.12";
 
   src = fetchurl {
-    url = "mirror://kernel/linux/kernel/v4.x/testing/linux-${version}.tar.xz";
-    sha256 = "0zifawlrc62gsqmg91858wxx7vbpz0drjbhzmmbpplj3j7pdlly5";
+    url = "https://git.kernel.org/torvalds/t/linux-${version}.tar.gz";
+    sha256 = "13xyiqn7xv8ryqrfsx8b18qm1zj0qkfz92mdh611nqhhdlw7gcpk";
   };
 
   features.iwlwifi = true;
diff --git a/pkgs/os-specific/linux/wireguard/default.nix b/pkgs/os-specific/linux/wireguard/default.nix
index fbff511db7c3..10c84948a495 100644
--- a/pkgs/os-specific/linux/wireguard/default.nix
+++ b/pkgs/os-specific/linux/wireguard/default.nix
@@ -6,11 +6,11 @@ assert kernel != null -> stdenv.lib.versionAtLeast kernel.version "3.10";
 let
   name = "wireguard-${version}";
 
-  version = "0.0.20170421";
+  version = "0.0.20170517";
 
   src = fetchurl {
     url    = "https://git.zx2c4.com/WireGuard/snapshot/WireGuard-${version}.tar.xz";
-    sha256 = "03c82af774224cd171d000ee4a519b5e474cc6842ac04967773cf77b26750000";
+    sha256 = "7303e973654a3585039f4789e89a562f807f0d6010c7787b9b69ca72aa7a6908";
   };
 
   meta = with stdenv.lib; {