From e58c9e7dd621a7d7216f8dd95be32840a46b18ec Mon Sep 17 00:00:00 2001 From: nikstur Date: Sun, 27 Jul 2025 21:19:00 +0200 Subject: [PATCH] e2fsprogs: move scripts to separate output This enables us to use the bin and out output without pulling in bash. - Enable structuredAttrs - Enable strictDeps - Add bash to disallowedRequisites --- pkgs/by-name/e2/e2fsprogs/package.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/pkgs/by-name/e2/e2fsprogs/package.nix b/pkgs/by-name/e2/e2fsprogs/package.nix index ab3649104b97..338bf3b58fcd 100644 --- a/pkgs/by-name/e2/e2fsprogs/package.nix +++ b/pkgs/by-name/e2/e2fsprogs/package.nix @@ -13,12 +13,16 @@ e2fsprogs, runCommand, libarchive, + bash, + bashNonInteractive, }: stdenv.mkDerivation rec { pname = "e2fsprogs"; version = "1.47.3"; + __structuredAttrs = true; + src = fetchurl { url = "mirror://kernel/linux/kernel/people/tytso/e2fsprogs/v${version}/e2fsprogs-${version}.tar.xz"; hash = "sha256-hX5u+AD+qiu0V4+8gQIUvl08iLBy6lPFOEczqWVzcyk="; @@ -31,9 +35,12 @@ stdenv.mkDerivation rec { "out" "man" "info" + "scripts" ] ++ lib.optionals withFuse [ "fuse2fs" ]; + strictDeps = true; + depsBuildBuild = [ buildPackages.stdenv.cc ]; nativeBuildInputs = [ pkg-config @@ -43,6 +50,7 @@ stdenv.mkDerivation rec { libuuid gettext libarchive + bash ] ++ lib.optionals withFuse [ fuse3 ]; @@ -75,6 +83,11 @@ stdenv.mkDerivation rec { if [ -f $out/lib/${pname}/e2scrub_all_cron ]; then mv $out/lib/${pname}/e2scrub_all_cron $bin/bin/ fi + + moveToOutput bin/mk_cmds "$scripts" + moveToOutput bin/compile_et "$scripts" + moveToOutput sbin/e2scrub "$scripts" + moveToOutput sbin/e2scrub_all "$scripts" '' + lib.optionalString withFuse '' mkdir -p $fuse2fs/bin @@ -83,6 +96,17 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; + outputChecks = { + bin.disallowedRequisites = [ + bash + bashNonInteractive + ]; + out.disallowedRequisites = [ + bash + bashNonInteractive + ]; + }; + passthru.tests = { simple-filesystem = runCommand "e2fsprogs-create-fs" { } '' mkdir -p $out