Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util-linux: 2.40.1 -> 2.39.4 (finishing the downgrade) #314237

Merged
merged 5 commits into from
May 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 6 additions & 15 deletions pkgs/os-specific/linux/util-linux/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{ lib, stdenv, fetchurl, fetchpatch, autoreconfHook, gtk-doc, pkg-config
, zlib, shadow
{ lib, stdenv, fetchurl, pkg-config, zlib, shadow
, capabilitiesSupport ? stdenv.isLinux
, libcap_ng
, libxcrypt
, sqlite
, ncursesSupport ? true
, ncurses
, pamSupport ? true
Expand All @@ -19,20 +17,14 @@
, memstreamHook
, gitUpdater
}:
let
# Temporarily avoid applying the patches on systems where already we have binaries
# (in particular x86_64-linux and aarch64-linux) as the package is a huge rebuild there.
avoidRebuild = with stdenv.hostPlatform; isLinux && is64bit && !isStatic;
in

stdenv.mkDerivation rec {
pname = "util-linux" + lib.optionalString (!nlsSupport && !ncursesSupport && !systemdSupport) "-minimal";
version = if avoidRebuild then "2.40.1" else "2.39.4";
version = "2.39.4";

src = fetchurl {
url = "mirror://kernel/linux/utils/util-linux/v${lib.versions.majorMinor version}/util-linux-${version}.tar.xz";
hash = if avoidRebuild
then "sha256-WeZ2qlPMtEtsOfD/4BqPonSJHJG+8UdHUvrZJGHe8k8="
else "sha256-bE+HI9r9QcOdk+y/FlCfyIwzzVvTJ3iArlodl6AU/Q4=";
hash = "sha256-bE+HI9r9QcOdk+y/FlCfyIwzzVvTJ3iArlodl6AU/Q4=";
};

patches = [
Expand All @@ -48,7 +40,7 @@ stdenv.mkDerivation rec {
separateDebugInfo = true;

postPatch = ''
patchShebangs tests/run.sh tools/all_syscalls
patchShebangs tests/run.sh

substituteInPlace sys-utils/eject.c \
--replace "/bin/umount" "$bin/bin/umount"
Expand All @@ -67,7 +59,6 @@ stdenv.mkDerivation rec {
"--enable-fs-paths-default=/run/wrappers/bin:/run/current-system/sw/bin:/sbin"
"--disable-makeinstall-setuid" "--disable-makeinstall-chown"
"--disable-su" # provided by shadow
"--with-tmpfilesdir=${placeholder "out"}/lib/tmpfiles.d"
(lib.enableFeature writeSupport "write")
(lib.enableFeature nlsSupport "nls")
(lib.withFeature ncursesSupport "ncursesw")
Expand All @@ -89,7 +80,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkg-config installShellFiles ]
++ lib.optionals translateManpages [ po4a ];

buildInputs = [ zlib libxcrypt sqlite ]
buildInputs = [ zlib libxcrypt ]
++ lib.optionals pamSupport [ pam ]
++ lib.optionals capabilitiesSupport [ libcap_ng ]
++ lib.optionals ncursesSupport [ ncurses ]
Expand Down