summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2018-05-10 01:55:26 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2018-05-10 01:55:26 -0400
commit006422d08d7f0576d745baa23328e951e0f7b4c2 (patch)
treecc8c8d5c08feaa648003a01d2c5f692ee5b188c6 /pkgs
parentdf062e3f7be4724973e4bcfa65e304b6a7ef746a (diff)
parentfeb648ce59ffbed94c58133eb7aa2761992a35e1 (diff)
downloadnixlib-006422d08d7f0576d745baa23328e951e0f7b4c2.tar
nixlib-006422d08d7f0576d745baa23328e951e0f7b4c2.tar.gz
nixlib-006422d08d7f0576d745baa23328e951e0f7b4c2.tar.bz2
nixlib-006422d08d7f0576d745baa23328e951e0f7b4c2.tar.lz
nixlib-006422d08d7f0576d745baa23328e951e0f7b4c2.tar.xz
nixlib-006422d08d7f0576d745baa23328e951e0f7b4c2.tar.zst
nixlib-006422d08d7f0576d745baa23328e951e0f7b4c2.zip
Merge commit 'feb648ce59ffbed94c58133eb7aa2761992a35e1' into staging
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/video/omxplayer/default.nix2
-rw-r--r--pkgs/development/libraries/ffmpeg-full/default.nix2
-rw-r--r--pkgs/development/libraries/ffmpeg/generic.nix2
-rw-r--r--pkgs/development/libraries/fontconfig/2.10.nix4
-rw-r--r--pkgs/development/libraries/fontconfig/default.nix4
-rw-r--r--pkgs/development/libraries/libav/default.nix2
-rw-r--r--pkgs/os-specific/linux/uclibc/default.nix51
-rw-r--r--pkgs/tools/misc/xburst-tools/default.nix4
-rw-r--r--pkgs/top-level/all-packages.nix27
9 files changed, 44 insertions, 54 deletions
diff --git a/pkgs/applications/video/omxplayer/default.nix b/pkgs/applications/video/omxplayer/default.nix
index 825bfe7955a8..520451df400f 100644
--- a/pkgs/applications/video/omxplayer/default.nix
+++ b/pkgs/applications/video/omxplayer/default.nix
@@ -52,7 +52,7 @@ let
         "--cross-prefix=${stdenv.cc.targetPrefix}"
         "--enable-cross-compile"
         "--target_os=linux"
-        "--arch=${hostPlatform.arch}"
+        "--arch=${hostPlatform.parsed.cpu.name}"
         ];
     };
 
diff --git a/pkgs/development/libraries/ffmpeg-full/default.nix b/pkgs/development/libraries/ffmpeg-full/default.nix
index db39be465485..d2ef075beee1 100644
--- a/pkgs/development/libraries/ffmpeg-full/default.nix
+++ b/pkgs/development/libraries/ffmpeg-full/default.nix
@@ -443,7 +443,7 @@ stdenv.mkDerivation rec {
       "--cross-prefix=${stdenv.cc.targetPrefix}"
       "--enable-cross-compile"
       "--target_os=${hostPlatform.parsed.kernel.name}"
-      "--arch=${hostPlatform.arch}"
+      "--arch=${hostPlatform.parsed.cpu.name}"
     ];
   };
 
diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix
index 7226645381b6..0883e5dfd500 100644
--- a/pkgs/development/libraries/ffmpeg/generic.nix
+++ b/pkgs/development/libraries/ffmpeg/generic.nix
@@ -177,7 +177,7 @@ stdenv.mkDerivation rec {
       "--cross-prefix=${stdenv.cc.targetPrefix}"
       "--enable-cross-compile"
       "--target_os=${hostPlatform.parsed.kernel.name}"
-      "--arch=${hostPlatform.arch}"
+      "--arch=${hostPlatform.parsed.cpu.name}"
     ];
   };
 
diff --git a/pkgs/development/libraries/fontconfig/2.10.nix b/pkgs/development/libraries/fontconfig/2.10.nix
index 3f3c04b15a30..5fb0ea4429e7 100644
--- a/pkgs/development/libraries/fontconfig/2.10.nix
+++ b/pkgs/development/libraries/fontconfig/2.10.nix
@@ -24,7 +24,9 @@ stdenv.mkDerivation rec {
   ];
 
   # We should find a better way to access the arch reliably.
-  crossArch = hostPlatform.arch or null;
+  crossArch = if stdenv.hostPlatform != stdenv.buildPlatform
+    then hostPlatform.parsed.cpu.name
+    else null;
 
   preConfigure = ''
     if test -n "$crossConfig"; then
diff --git a/pkgs/development/libraries/fontconfig/default.nix b/pkgs/development/libraries/fontconfig/default.nix
index 29838fe1ffa1..a4f6fe007d06 100644
--- a/pkgs/development/libraries/fontconfig/default.nix
+++ b/pkgs/development/libraries/fontconfig/default.nix
@@ -47,7 +47,9 @@ stdenv.mkDerivation rec {
   ];
 
   # We should find a better way to access the arch reliably.
-  crossArch = hostPlatform.arch or null;
+  crossArch = if stdenv.hostPlatform != stdenv.buildPlatform
+    then hostPlatform.parsed.cpu.name
+    else null;
 
   preConfigure = ''
     if test -n "$crossConfig"; then
diff --git a/pkgs/development/libraries/libav/default.nix b/pkgs/development/libraries/libav/default.nix
index 317768518c39..85fe902dae06 100644
--- a/pkgs/development/libraries/libav/default.nix
+++ b/pkgs/development/libraries/libav/default.nix
@@ -118,7 +118,7 @@ let
         "--cross-prefix=${stdenv.cc.targetPrefix}"
         "--enable-cross-compile"
         "--target_os=linux"
-        "--arch=${hostPlatform.arch}"
+        "--arch=${hostPlatform.parsed.cpu.name}"
         ];
     };
 
diff --git a/pkgs/os-specific/linux/uclibc/default.nix b/pkgs/os-specific/linux/uclibc/default.nix
index ed3567ffdad3..3da12c41dc12 100644
--- a/pkgs/os-specific/linux/uclibc/default.nix
+++ b/pkgs/os-specific/linux/uclibc/default.nix
@@ -1,7 +1,8 @@
-{stdenv, fetchzip, linuxHeaders, libiconvReal, cross ? null, gccCross ? null,
-extraConfig ? ""}:
-
-assert cross != null -> gccCross != null;
+{ stdenv, buildPackages
+, fetchurl, linuxHeaders, libiconvReal
+, buildPlatform, hostPlatform
+, extraConfig ? ""
+}:
 
 let
   configParser = ''
@@ -27,9 +28,6 @@ let
     }
   '';
 
-  archMakeFlag = if cross != null then "ARCH=${cross.arch}" else "";
-  crossMakeFlag = if cross != null then "CROSS=${cross.config}-" else "";
-
   # UCLIBC_SUSV4_LEGACY defines 'tmpnam', needed for gcc libstdc++ builds.
   nixConfig = ''
     RUNTIME_PREFIX "/"
@@ -42,7 +40,7 @@ let
     UCLIBC_SUSV4_LEGACY y
     UCLIBC_HAS_THREADS_NATIVE y
     KERNEL_HEADERS "${linuxHeaders}/include"
-  '' + stdenv.lib.optionalString (stdenv.isAarch32 && cross == null) ''
+  '' + stdenv.lib.optionalString (stdenv.isAarch32 && buildPlatform != hostPlatform) ''
     CONFIG_ARM_EABI y
     ARCH_WANTS_BIG_ENDIAN n
     ARCH_BIG_ENDIAN n
@@ -51,29 +49,27 @@ let
     UCLIBC_HAS_FPU n
   '';
 
-  name = "uclibc-0.9.34-pre-20150131";
-  rev = "343f6b8f1f754e397632b0552e4afe586c8b392b";
-
+  version = "1.0.30";
 in
 
 stdenv.mkDerivation {
-  name = name + stdenv.lib.optionalString (cross != null) ("-" + cross.config);
+  name = "uclibc-ng-${version}";
+  inherit version;
 
-  src = fetchzip {
-    name = name + "-source";
-    url = "http://git.uclibc.org/uClibc/snapshot/uClibc-${rev}.tar.bz2";
-    sha256 = "1kgylzpid7da5i7wz7slh5q9rnq1m8bv5h9ilm76g0xwc2iwlhbw";
+  src = fetchurl {
+    url = "https://downloads.uclibc-ng.org/releases/${version}/uClibc-ng-${version}.tar.bz2";
+    # from "${url}.sha256";
+    sha256 = "3e0f057f24882823d697126015aa4d7d48fa2542be3939985cb3c26dcbcab5a8";
   };
 
   # 'ftw' needed to build acl, a coreutils dependency
   configurePhase = ''
-    make defconfig ${archMakeFlag}
+    make defconfig
     ${configParser}
     cat << EOF | parseconfig
     ${nixConfig}
     ${extraConfig}
-    ${if cross != null then stdenv.lib.attrByPath [ "uclibc" "extraConfig" ] "" cross else ""}
-    $extraCrossConfig
+    ${hostPlatform.platform.uclibc.extraConfig or ""}
     EOF
     ( set +o pipefail; yes "" | make oldconfig )
   '';
@@ -81,11 +77,16 @@ stdenv.mkDerivation {
   hardeningDisable = [ "stackprotector" ];
 
   # Cross stripping hurts.
-  dontStrip = cross != null;
+  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
 
-  makeFlags = [ crossMakeFlag "VERBOSE=1" ];
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
 
-  buildInputs = stdenv.lib.optional (gccCross != null) gccCross;
+  makeFlags = [
+    "ARCH=${hostPlatform.parsed.cpu.name}"
+    "VERBOSE=1"
+  ] ++ stdenv.lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
+    "CROSS=${stdenv.cc.targetPrefix}"
+  ];
 
   # `make libpthread/nptl/sysdeps/unix/sysv/linux/lowlevelrwlock.h`:
   # error: bits/sysnum.h: No such file or directory
@@ -93,7 +94,7 @@ stdenv.mkDerivation {
 
   installPhase = ''
     mkdir -p $out
-    make PREFIX=$out VERBOSE=1 install ${crossMakeFlag}
+    make PREFIX=$out VERBOSE=1 install
     (cd $out/include && ln -s $(ls -d ${linuxHeaders}/include/* | grep -v "scsi$") .)
     # libpthread.so may not exist, so I do || true
     sed -i s@/lib/@$out/lib/@g $out/lib/libc.so $out/lib/libpthread.so || true
@@ -105,10 +106,10 @@ stdenv.mkDerivation {
   };
 
   meta = with stdenv.lib; {
-    homepage = http://www.uclibc.org/;
+    homepage = "https://uclibc-ng.org";
     description = "A small implementation of the C library";
     maintainers = with maintainers; [ rasendubi ];
     license = licenses.lgpl2;
-    platforms = subtractLists ["aarch64-linux"] platforms.linux;
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/tools/misc/xburst-tools/default.nix b/pkgs/tools/misc/xburst-tools/default.nix
index 6b63e2f55a27..b25be6418976 100644
--- a/pkgs/tools/misc/xburst-tools/default.nix
+++ b/pkgs/tools/misc/xburst-tools/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchgit, libusb, libusb1, autoconf, automake, confuse, pkgconfig
-, gccCross ? null, crossPrefix
+, gccCross ? null
 }:
 
 let
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
   '';
 
   configureFlags = if gccCross != null then
-    "--enable-firmware CROSS_COMPILE=${crossPrefix}-"
+    "--enable-firmware CROSS_COMPILE=${gccCross.targetPrefix}"
     else "";
 
   hardeningDisable = [ "pic" "stackprotector" ];
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index abbbe90fdeda..a3fc2618667b 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -5708,28 +5708,14 @@ with pkgs;
 
   x11_ssh_askpass = callPackage ../tools/networking/x11-ssh-askpass { };
 
-  xbursttools = assert stdenv ? glibc; callPackage ../tools/misc/xburst-tools rec {
+  xbursttools = callPackage ../tools/misc/xburst-tools {
     # It needs a cross compiler for mipsel to build the firmware it will
     # load into the Ben Nanonote
-    crossPrefix = "mipsel-unknown-linux-gnu";
     gccCross =
       let
         pkgsCross = nixpkgsFun {
           # Ben Nanonote system
-          crossSystem = {
-            config = crossPrefix;
-            arch = "mips";
-            float = "soft";
-            libc = "uclibc";
-            platform = {
-              name = "ben_nanonote";
-              kernelMajor = "2.6";
-              kernelArch = "mips";
-            };
-            gcc = {
-              arch = "mips32";
-            };
-          };
+          crossSystem = lib.systems.examples.ben-nanonote;
         };
       in
         pkgsCross.buildPackages.gccCrossStageStatic;
@@ -9078,7 +9064,7 @@ with pkgs;
     # hack fixes the hack, *sigh*.
     /**/ if name == "glibc" then targetPackages.glibcCross or glibcCross
     else if name == "bionic" then targetPackages.bionic
-    else if name == "uclibc" then uclibcCross
+    else if name == "uclibc" then targetPackages.uclibcCross
     else if name == "musl" then targetPackages.muslCross or muslCross
     else if name == "msvcrt" then targetPackages.windows.mingw_w64 or windows.mingw_w64
     else if targetPlatform.useiOSPrebuilt then targetPackages.iosSdkPkgs.libraries
@@ -14070,10 +14056,9 @@ with pkgs;
 
   uclibc = callPackage ../os-specific/linux/uclibc { };
 
-  uclibcCross = lowPrio (callPackage ../os-specific/linux/uclibc {
-    gccCross = gccCrossStageStatic;
-    cross = assert targetPlatform != buildPlatform; targetPlatform;
-  });
+  uclibcCross = callPackage ../os-specific/linux/uclibc {
+    stdenv = crossLibcStdenv;
+  };
 
   eudev = callPackage ../os-specific/linux/eudev {};