push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,123 @@
{
lib,
stdenv,
fetchFromGitHub,
rustPlatform,
cargo,
python3Packages,
versionCheckHook,
nix-update-script,
prefix ? "uutils-",
buildMulticallBinary ? true,
selinuxSupport ? false,
libselinux,
acl,
}:
assert selinuxSupport -> lib.meta.availableOn stdenv.hostPlatform libselinux;
stdenv.mkDerivation (finalAttrs: {
pname = "uutils-coreutils";
version = "0.2.2";
src = fetchFromGitHub {
owner = "uutils";
repo = "coreutils";
tag = finalAttrs.version;
hash = "sha256-VcwdCi40Tm8J3t0qFSFGvRwW6B5cCDj1wm+H3i20axo=";
};
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (finalAttrs) src;
name = "uutils-coreutils-${finalAttrs.version}";
hash = "sha256-/QNOrfqdMviOVP1Fzorc6RAsgLDSKtg/MXfXJEzxwMc=";
};
patches = [
./selinux_no_auto_detect.diff
];
buildInputs =
lib.optionals (lib.meta.availableOn stdenv.hostPlatform acl) [
acl
]
++ lib.optionals selinuxSupport [
libselinux
];
nativeBuildInputs = [
rustPlatform.bindgenHook
rustPlatform.cargoSetupHook
python3Packages.sphinx
];
makeFlags = [
"CARGO=${lib.getExe cargo}"
"PREFIX=${placeholder "out"}"
"PROFILE=release"
"SELINUX_ENABLED=${if selinuxSupport then "1" else "0"}"
"INSTALLDIR_MAN=${placeholder "out"}/share/man/man1"
# Explicitly enable acl, and if requested selinux.
# We cannot rely on SELINUX_ENABLED here since our explicit assignment
# overrides its effect in the makefile.
"BUILD_SPEC_FEATURE=${
lib.concatStringsSep "," (
# We can always enable acl, on non-Linux, libc provides the headers,
# only in Linux we need to add the acl lib to buildInputs.
[
"feat_acl"
]
++ (lib.optionals selinuxSupport [
"feat_selinux"
])
)
}"
]
++ lib.optionals (prefix != null) [ "PROG_PREFIX=${prefix}" ]
++ lib.optionals buildMulticallBinary [ "MULTICALL=y" ];
env = lib.optionalAttrs selinuxSupport {
SELINUX_INCLUDE_DIR = ''${libselinux.dev}/include'';
SELINUX_LIB_DIR = lib.makeLibraryPath [
libselinux
];
SELINUX_STATIC = "0";
};
# too many impure/platform-dependent tests
doCheck = false;
nativeInstallCheckInputs = [
versionCheckHook
];
versionCheckProgram =
let
prefix' = lib.optionalString (prefix != null) prefix;
in
"${placeholder "out"}/bin/${prefix'}ls";
versionCheckProgramArg = "--version";
doInstallCheck = true;
passthru = {
updateScript = nix-update-script { };
};
meta = {
description = "Cross-platform Rust rewrite of the GNU coreutils";
longDescription = ''
uutils is an attempt at writing universal (as in cross-platform)
CLI utils in Rust. This repo is to aggregate the GNU coreutils rewrites.
'';
homepage = "https://github.com/uutils/coreutils";
changelog = "https://github.com/uutils/coreutils/releases/tag/${finalAttrs.version}";
maintainers = with lib.maintainers; [
siraben
matthiasbeyer
];
license = lib.licenses.mit;
platforms = lib.platforms.unix;
};
})

View File

@@ -0,0 +1,36 @@
diff --git a/GNUmakefile b/GNUmakefile
index 20dc731d3..400e5b84f 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -69,19 +69,6 @@ TOYBOX_SRC := $(TOYBOX_ROOT)/toybox-$(TOYBOX_VER)
#------------------------------------------------------------------------
OS ?= $(shell uname -s)
-ifdef SELINUX_ENABLED
- override SELINUX_ENABLED := 0
-# Now check if we should enable it (only on non-Windows)
- ifneq ($(OS),Windows_NT)
- ifeq ($(shell if [ -x /sbin/selinuxenabled ] && /sbin/selinuxenabled 2>/dev/null; then echo 0; else echo 1; fi),0)
- override SELINUX_ENABLED := 1
-$(info /sbin/selinuxenabled successful)
- else
-$(info SELINUX_ENABLED=1 but /sbin/selinuxenabled failed)
- endif
- endif
-endif
-
# Possible programs
PROGS := \
base32 \
@@ -200,8 +187,10 @@ endif
ifneq ($(OS),Windows_NT)
PROGS := $(PROGS) $(UNIX_PROGS)
+ ifeq ($(SELINUX_ENABLED),1)
# Build the selinux command even if not on the system
- PROGS := $(PROGS) $(SELINUX_PROGS)
+ PROGS := $(PROGS) $(SELINUX_PROGS)
+ endif
# Always use external libstdbuf when building with make (Unix only)
CARGOFLAGS += --features feat_external_libstdbuf
endif