From 7b61a60758f6b12ade200d015db79cb2a5be2d3c Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 18 May 2023 15:36:41 -0600 Subject: [PATCH 1/3] util-linux: 2.38.1 -> 2.39 --- pkgs/os-specific/linux/util-linux/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/util-linux/default.nix b/pkgs/os-specific/linux/util-linux/default.nix index 3c8b7f6663f1..fc98abcf0fd5 100644 --- a/pkgs/os-specific/linux/util-linux/default.nix +++ b/pkgs/os-specific/linux/util-linux/default.nix @@ -16,11 +16,11 @@ stdenv.mkDerivation rec { pname = "util-linux" + lib.optionalString (!nlsSupport && !ncursesSupport && !systemdSupport) "-minimal"; - version = "2.38.1"; + version = "2.39"; src = fetchurl { url = "mirror://kernel/linux/utils/util-linux/v${lib.versions.majorMinor version}/util-linux-${version}.tar.xz"; - hash = "sha256-YEkqGbRObPmj3f9oMlszO4tStsWc4+vWoOyqTFEX6E8="; + hash = "sha256-MrMKM2zakDGC7WH+s+m5CLdipeZv4U5D77iNNxYgdcs="; }; patches = [ From b1a49db9145f61ba299f4ac68e203822a15b1d96 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 18 May 2023 15:37:17 -0600 Subject: [PATCH 2/3] util-linux: add darwin support --- pkgs/os-specific/linux/util-linux/default.nix | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pkgs/os-specific/linux/util-linux/default.nix b/pkgs/os-specific/linux/util-linux/default.nix index fc98abcf0fd5..3b8d5f53e787 100644 --- a/pkgs/os-specific/linux/util-linux/default.nix +++ b/pkgs/os-specific/linux/util-linux/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchurl, pkg-config, zlib, shadow -, capabilitiesSupport ? true +, capabilitiesSupport ? stdenv.isLinux , libcap_ng , libxcrypt , ncursesSupport ? true @@ -12,6 +12,9 @@ , translateManpages ? true , po4a , installShellFiles +, writeSupport ? stdenv.isLinux +, shadowSupport ? stdenv.isLinux +, memstreamHook }: stdenv.mkDerivation rec { @@ -33,10 +36,11 @@ stdenv.mkDerivation rec { postPatch = '' patchShebangs tests/run.sh - substituteInPlace include/pathnames.h \ - --replace "/bin/login" "${shadow}/bin/login" substituteInPlace sys-utils/eject.c \ --replace "/bin/umount" "$bin/bin/umount" + '' + lib.optionalString shadowSupport '' + substituteInPlace include/pathnames.h \ + --replace "/bin/login" "${shadow}/bin/login" ''; # !!! It would be better to obtain the path to the mount helpers @@ -45,11 +49,11 @@ stdenv.mkDerivation rec { # root... configureFlags = [ "--localstatedir=/var" - "--enable-write" "--disable-use-tty-group" "--enable-fs-paths-default=/run/wrappers/bin:/run/current-system/sw/bin:/sbin" "--disable-makeinstall-setuid" "--disable-makeinstall-chown" "--disable-su" # provided by shadow + (lib.enableFeature writeSupport "write") (lib.enableFeature nlsSupport "nls") (lib.withFeature ncursesSupport "ncursesw") (lib.withFeature systemdSupport "systemd") @@ -74,7 +78,8 @@ stdenv.mkDerivation rec { ++ lib.optionals pamSupport [ pam ] ++ lib.optionals capabilitiesSupport [ libcap_ng ] ++ lib.optionals ncursesSupport [ ncurses ] - ++ lib.optionals systemdSupport [ systemd ]; + ++ lib.optionals systemdSupport [ systemd ] + ++ lib.optionals (stdenv.system == "x86_64-darwin") [ memstreamHook ]; doCheck = false; # "For development purpose only. Don't execute on production system!" @@ -90,7 +95,7 @@ stdenv.mkDerivation rec { changelog = "https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v${lib.versions.majorMinor version}/v${version}-ReleaseNotes"; # https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/tree/README.licensing license = with licenses; [ gpl2Only gpl2Plus gpl3Plus lgpl21Plus bsd3 bsdOriginalUC publicDomain ]; - platforms = platforms.linux; + platforms = platforms.unix; priority = 6; # lower priority than coreutils ("kill") and shadow ("login" etc.) packages }; } From e3ef6258965f14998455259603b5dd2e9d51f83e Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 18 May 2023 15:37:37 -0600 Subject: [PATCH 3/3] util-linux: use real util-linux package on darwin The util-linux on darwin is an alias for unixtools.util-linux which contains Apple's variants of the tools. However, the tools are not compatible with util-linux; for example the command line options differ. A previous change made util-linux buildable on darwin. This change removes the alias so util-linux is util-linux everywhere. To access the Apple tools, use unixtools (e.g unixtools.util-linux). --- pkgs/top-level/all-packages.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9c5c95f677b7..7419a12dae4c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -27722,15 +27722,14 @@ with pkgs; usermount = callPackage ../os-specific/linux/usermount { }; - util-linux = if stdenv.isLinux then callPackage ../os-specific/linux/util-linux { } - else unixtools.util-linux; + util-linux = callPackage ../os-specific/linux/util-linux { }; - util-linuxMinimal = if stdenv.isLinux then util-linux.override { + util-linuxMinimal = util-linux.override { nlsSupport = false; ncursesSupport = false; systemdSupport = false; translateManpages = false; - } else util-linux; + }; v4l-utils = qt5.callPackage ../os-specific/linux/v4l-utils { };