at 22.05-pre 75 lines 2.7 kB view raw
1{ lib, stdenv, fetchurl, pkg-config, zlib, shadow, libcap_ng 2, ncurses ? null, pam, systemd ? null 3, nlsSupport ? true 4}: 5 6stdenv.mkDerivation rec { 7 pname = "util-linux"; 8 version = "2.37.2"; 9 10 src = fetchurl { 11 url = "mirror://kernel/linux/utils/util-linux/v${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; 12 sha256 = "sha256-agdkwarn+2B++KbdLA9sR9Xl/SeqCIIKuq2ewU4o6dk="; 13 }; 14 15 patches = [ 16 ./rtcwake-search-PATH-for-shutdown.patch 17 ]; 18 19 outputs = [ "bin" "dev" "out" "lib" "man" ]; 20 21 postPatch = '' 22 patchShebangs tests/run.sh 23 24 substituteInPlace include/pathnames.h \ 25 --replace "/bin/login" "${shadow}/bin/login" 26 substituteInPlace sys-utils/eject.c \ 27 --replace "/bin/umount" "$bin/bin/umount" 28 ''; 29 30 # !!! It would be better to obtain the path to the mount helpers 31 # (/sbin/mount.*) through an environment variable, but that's 32 # somewhat risky because we have to consider that mount can setuid 33 # root... 34 configureFlags = [ 35 "--localstatedir=/var" 36 "--enable-write" 37 "--disable-use-tty-group" 38 "--enable-fs-paths-default=/run/wrappers/bin:/run/current-system/sw/bin:/sbin" 39 "--disable-makeinstall-setuid" "--disable-makeinstall-chown" 40 "--disable-su" # provided by shadow 41 (lib.enableFeature nlsSupport "nls") 42 (lib.withFeature (ncurses != null) "ncursesw") 43 (lib.withFeature (systemd != null) "systemd") 44 (lib.withFeatureAs (systemd != null) 45 "systemdsystemunitdir" "${placeholder "bin"}/lib/systemd/system/") 46 "SYSCONFSTATICDIR=${placeholder "lib"}/lib" 47 ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) 48 "scanf_cv_type_modifier=ms" 49 ; 50 51 makeFlags = [ 52 "usrbin_execdir=${placeholder "bin"}/bin" 53 "usrlib_execdir=${placeholder "lib"}/lib" 54 "usrsbin_execdir=${placeholder "bin"}/sbin" 55 ]; 56 57 nativeBuildInputs = [ pkg-config ]; 58 buildInputs = 59 [ zlib pam libcap_ng ] 60 ++ lib.filter (p: p != null) [ ncurses systemd ]; 61 62 doCheck = false; # "For development purpose only. Don't execute on production system!" 63 64 enableParallelBuilding = true; 65 66 meta = with lib; { 67 homepage = "https://www.kernel.org/pub/linux/utils/util-linux/"; 68 description = "A set of system utilities for Linux"; 69 changelog = "https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v${lib.versions.majorMinor version}/v${version}-ReleaseNotes"; 70 # https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/tree/README.licensing 71 license = with licenses; [ gpl2Only gpl2Plus gpl3Plus lgpl21Plus bsd3 bsdOriginalUC publicDomain ]; 72 platforms = platforms.linux; 73 priority = 6; # lower priority than coreutils ("kill") and shadow ("login" etc.) packages 74 }; 75}