e2fsprogs: add withFuse option

This commit is contained in:
Nikolay Korotkiy 2023-11-27 22:19:42 +04:00
parent af7fe85a84
commit d8c8ccaeca
No known key found for this signature in database
GPG key ID: D1DE6D7F693663A5

View file

@ -1,5 +1,5 @@
{ lib, stdenv, buildPackages, fetchurl, fetchpatch, pkg-config, libuuid, gettext, texinfo
, fuse
, withFuse ? stdenv.isLinux, fuse
, shared ? !stdenv.hostPlatform.isStatic
, e2fsprogs, runCommand
}:
@ -15,12 +15,12 @@ stdenv.mkDerivation rec {
# fuse2fs adds 14mb of dependencies
outputs = [ "bin" "dev" "out" "man" "info" ]
++ lib.optionals stdenv.isLinux [ "fuse2fs" ];
++ lib.optionals withFuse [ "fuse2fs" ];
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ pkg-config texinfo ];
buildInputs = [ libuuid gettext ]
++ lib.optionals stdenv.isLinux [ fuse ];
++ lib.optionals withFuse [ fuse ];
patches = [
(fetchpatch { # avoid using missing __GNUC_PREREQ(X,Y)
@ -63,7 +63,7 @@ stdenv.mkDerivation rec {
if [ -f $out/lib/${pname}/e2scrub_all_cron ]; then
mv $out/lib/${pname}/e2scrub_all_cron $bin/bin/
fi
'' + lib.optionalString stdenv.isLinux ''
'' + lib.optionalString withFuse ''
mkdir -p $fuse2fs/bin
mv $bin/bin/fuse2fs $fuse2fs/bin/fuse2fs
'';