nixpkgs/pkgs/tools/filesystems/e2fsprogs/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

102 lines
3.3 KiB
Nix
Raw Normal View History

{ lib, stdenv, buildPackages, fetchurl, fetchpatch, pkg-config, libuuid, gettext, texinfo
e2fsprogs: build fuse2fs and add output for fuse2fs it adds 14mb of dependencies which can be significant for initrd without a separate output $ du -sch $(nix-store -qR ./result-bin) | sort -h before fuse dep 618K /nix/store/w2id1hwv4vv7hvp4slgsyrydrjbfqdxc-libidn2-2.3.2 698K /nix/store/ki0x4wywp5b7rixwk1miq222wybdl3si-e2fsprogs-1.46.5-bin 732K /nix/store/4nmqxajzaf60yjribkgvj5j54x9yvr1r-bash-5.1-p12 747K /nix/store/8ckxc8biqqfdwyhr0w70jgrcb4h7a4y5-libunistring-0.9.10 853K /nix/store/kx41yd3yyr9bwrsk85fhhx6qhavfwql6-util-linux-2.37.3-lib 2,3M /nix/store/7nkr1kzrj5j6vzq952p35g0vzk747xjz-e2fsprogs-1.46.5 16M /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108 22M total after fuse dep 38K /nix/store/k15b817jqz4ckp8rp1mgpkvvx78xxp2n-shadow-4.8.1-su 112K /nix/store/bqjh8dc6m5plswxrmmn9x4cpxrrw94lv-zlib-1.2.11 277K /nix/store/nzw0c7ag22mbyc4xrqyy1q1azq9r8kis-audit-2.8.5 285K /nix/store/ka1xx3ldpliww27wmskc1yxlgcfisdyf-libcap-ng-0.8.2 371K /nix/store/mvgg2fk5wwrcmm3wbrjhjn034aivrik2-fuse-2.9.9 618K /nix/store/w2id1hwv4vv7hvp4slgsyrydrjbfqdxc-libidn2-2.3.2 732K /nix/store/4nmqxajzaf60yjribkgvj5j54x9yvr1r-bash-5.1-p12 738K /nix/store/7wi0dn50wgimvfi30i3d4mxz40vcal10-e2fsprogs-1.46.5-bin 747K /nix/store/8ckxc8biqqfdwyhr0w70jgrcb4h7a4y5-libunistring-0.9.10 853K /nix/store/kx41yd3yyr9bwrsk85fhhx6qhavfwql6-util-linux-2.37.3-lib 1,3M /nix/store/043lz8mvyx5vxl058c1i586yqc8ax4ig-glibc-2.33-108-bin 1,7M /nix/store/fpzbv79ak68sh2sh6mag6jym553wfxws-db-4.8.30 2,3M /nix/store/9w5l1zrdd21hjxgjp5jnxxr6jibpjxd4-shadow-4.8.1 2,3M /nix/store/hjmxalhkvvajs2n26b0ry7ns56bh9k9s-e2fsprogs-1.46.5 2,5M /nix/store/ndnqiz3nnifj1blhg9q626xlmkqq1nmh-gcc-10.3.0-lib 2,8M /nix/store/pnp5qkmj8m07jl8pghhglfdczz2840r9-linux-pam-1.5.2 2,9M /nix/store/h25q7c560bchn326363ms2001jjgf338-util-linux-2.37.3-bin 16M /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108 36M total e2fsprogs: build fuse2fs on linux only the fuse for macos might be broken
2022-03-12 18:20:22 +00:00
, fuse
, shared ? !stdenv.hostPlatform.isStatic
2022-01-24 20:54:32 +00:00
, e2fsprogs, runCommand
}:
stdenv.mkDerivation rec {
pname = "e2fsprogs";
2022-01-04 17:04:56 +00:00
version = "1.46.5";
src = fetchurl {
url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.gz";
2022-01-04 17:04:56 +00:00
sha256 = "1fgvwbj9ihz5svzrd2l0s18k16r4qg3wimrniv71fn3vdcg0shxp";
};
e2fsprogs: build fuse2fs and add output for fuse2fs it adds 14mb of dependencies which can be significant for initrd without a separate output $ du -sch $(nix-store -qR ./result-bin) | sort -h before fuse dep 618K /nix/store/w2id1hwv4vv7hvp4slgsyrydrjbfqdxc-libidn2-2.3.2 698K /nix/store/ki0x4wywp5b7rixwk1miq222wybdl3si-e2fsprogs-1.46.5-bin 732K /nix/store/4nmqxajzaf60yjribkgvj5j54x9yvr1r-bash-5.1-p12 747K /nix/store/8ckxc8biqqfdwyhr0w70jgrcb4h7a4y5-libunistring-0.9.10 853K /nix/store/kx41yd3yyr9bwrsk85fhhx6qhavfwql6-util-linux-2.37.3-lib 2,3M /nix/store/7nkr1kzrj5j6vzq952p35g0vzk747xjz-e2fsprogs-1.46.5 16M /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108 22M total after fuse dep 38K /nix/store/k15b817jqz4ckp8rp1mgpkvvx78xxp2n-shadow-4.8.1-su 112K /nix/store/bqjh8dc6m5plswxrmmn9x4cpxrrw94lv-zlib-1.2.11 277K /nix/store/nzw0c7ag22mbyc4xrqyy1q1azq9r8kis-audit-2.8.5 285K /nix/store/ka1xx3ldpliww27wmskc1yxlgcfisdyf-libcap-ng-0.8.2 371K /nix/store/mvgg2fk5wwrcmm3wbrjhjn034aivrik2-fuse-2.9.9 618K /nix/store/w2id1hwv4vv7hvp4slgsyrydrjbfqdxc-libidn2-2.3.2 732K /nix/store/4nmqxajzaf60yjribkgvj5j54x9yvr1r-bash-5.1-p12 738K /nix/store/7wi0dn50wgimvfi30i3d4mxz40vcal10-e2fsprogs-1.46.5-bin 747K /nix/store/8ckxc8biqqfdwyhr0w70jgrcb4h7a4y5-libunistring-0.9.10 853K /nix/store/kx41yd3yyr9bwrsk85fhhx6qhavfwql6-util-linux-2.37.3-lib 1,3M /nix/store/043lz8mvyx5vxl058c1i586yqc8ax4ig-glibc-2.33-108-bin 1,7M /nix/store/fpzbv79ak68sh2sh6mag6jym553wfxws-db-4.8.30 2,3M /nix/store/9w5l1zrdd21hjxgjp5jnxxr6jibpjxd4-shadow-4.8.1 2,3M /nix/store/hjmxalhkvvajs2n26b0ry7ns56bh9k9s-e2fsprogs-1.46.5 2,5M /nix/store/ndnqiz3nnifj1blhg9q626xlmkqq1nmh-gcc-10.3.0-lib 2,8M /nix/store/pnp5qkmj8m07jl8pghhglfdczz2840r9-linux-pam-1.5.2 2,9M /nix/store/h25q7c560bchn326363ms2001jjgf338-util-linux-2.37.3-bin 16M /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108 36M total e2fsprogs: build fuse2fs on linux only the fuse for macos might be broken
2022-03-12 18:20:22 +00:00
# fuse2fs adds 14mb of dependencies
outputs = [ "bin" "dev" "out" "man" "info" ]
++ lib.optionals stdenv.isLinux [ "fuse2fs" ];
2014-08-30 18:11:52 +01:00
2018-01-23 17:34:25 +00:00
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ pkg-config texinfo ];
e2fsprogs: build fuse2fs and add output for fuse2fs it adds 14mb of dependencies which can be significant for initrd without a separate output $ du -sch $(nix-store -qR ./result-bin) | sort -h before fuse dep 618K /nix/store/w2id1hwv4vv7hvp4slgsyrydrjbfqdxc-libidn2-2.3.2 698K /nix/store/ki0x4wywp5b7rixwk1miq222wybdl3si-e2fsprogs-1.46.5-bin 732K /nix/store/4nmqxajzaf60yjribkgvj5j54x9yvr1r-bash-5.1-p12 747K /nix/store/8ckxc8biqqfdwyhr0w70jgrcb4h7a4y5-libunistring-0.9.10 853K /nix/store/kx41yd3yyr9bwrsk85fhhx6qhavfwql6-util-linux-2.37.3-lib 2,3M /nix/store/7nkr1kzrj5j6vzq952p35g0vzk747xjz-e2fsprogs-1.46.5 16M /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108 22M total after fuse dep 38K /nix/store/k15b817jqz4ckp8rp1mgpkvvx78xxp2n-shadow-4.8.1-su 112K /nix/store/bqjh8dc6m5plswxrmmn9x4cpxrrw94lv-zlib-1.2.11 277K /nix/store/nzw0c7ag22mbyc4xrqyy1q1azq9r8kis-audit-2.8.5 285K /nix/store/ka1xx3ldpliww27wmskc1yxlgcfisdyf-libcap-ng-0.8.2 371K /nix/store/mvgg2fk5wwrcmm3wbrjhjn034aivrik2-fuse-2.9.9 618K /nix/store/w2id1hwv4vv7hvp4slgsyrydrjbfqdxc-libidn2-2.3.2 732K /nix/store/4nmqxajzaf60yjribkgvj5j54x9yvr1r-bash-5.1-p12 738K /nix/store/7wi0dn50wgimvfi30i3d4mxz40vcal10-e2fsprogs-1.46.5-bin 747K /nix/store/8ckxc8biqqfdwyhr0w70jgrcb4h7a4y5-libunistring-0.9.10 853K /nix/store/kx41yd3yyr9bwrsk85fhhx6qhavfwql6-util-linux-2.37.3-lib 1,3M /nix/store/043lz8mvyx5vxl058c1i586yqc8ax4ig-glibc-2.33-108-bin 1,7M /nix/store/fpzbv79ak68sh2sh6mag6jym553wfxws-db-4.8.30 2,3M /nix/store/9w5l1zrdd21hjxgjp5jnxxr6jibpjxd4-shadow-4.8.1 2,3M /nix/store/hjmxalhkvvajs2n26b0ry7ns56bh9k9s-e2fsprogs-1.46.5 2,5M /nix/store/ndnqiz3nnifj1blhg9q626xlmkqq1nmh-gcc-10.3.0-lib 2,8M /nix/store/pnp5qkmj8m07jl8pghhglfdczz2840r9-linux-pam-1.5.2 2,9M /nix/store/h25q7c560bchn326363ms2001jjgf338-util-linux-2.37.3-bin 16M /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108 36M total e2fsprogs: build fuse2fs on linux only the fuse for macos might be broken
2022-03-12 18:20:22 +00:00
buildInputs = [ libuuid gettext ]
++ lib.optionals stdenv.isLinux [ fuse ];
patches = [
(fetchpatch {
name = "CVE-2022-1304.patch";
url = "https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/patch/?id=ab51d587bb9b229b1fade1afd02e1574c1ba5c76";
sha256 = "sha256-YEEow34/81NBOc6F6FS6i505FCQ7GHeIz0a0qWNs7Fg=";
})
(fetchpatch { # avoid using missing __GNUC_PREREQ(X,Y)
url = "https://raw.githubusercontent.com/void-linux/void-packages/9583597eb3e6e6b33f61dbc615d511ce030bc443/srcpkgs/e2fsprogs/patches/fix-glibcism.patch";
2019-05-17 14:17:21 +01:00
sha256 = "1gfcsr0i3q8q2f0lqza8na0iy4l4p3cbii51ds6zmj0y4hz2dwhb";
excludes = [ "lib/ext2fs/hashmap.h" ];
extraPrefix = "";
})
];
postPatch = ''
# Remove six failing tests
# https://github.com/NixOS/nixpkgs/issues/65471
for test in m_image_mmp m_mmp m_mmp_bad_csum m_mmp_bad_magic t_mmp_1on t_mmp_2off; do
rm -r "tests/$test"
done
'';
configureFlags =
if stdenv.isLinux then [
2019-11-28 12:57:27 +00:00
# It seems that the e2fsprogs is one of the few packages that cannot be
# build with shared and static libs.
(if shared then "--enable-elf-shlibs" else "--disable-elf-shlibs")
2019-05-22 11:22:36 +01:00
"--enable-symlink-install"
"--enable-relative-symlinks"
"--with-crond-dir=no"
# fsck, libblkid, libuuid and uuidd are in util-linux-ng (the "libuuid" dependency)
"--disable-fsck"
"--disable-libblkid"
"--disable-libuuid"
"--disable-uuidd"
] else [
"--enable-libuuid --disable-e2initrd-helper"
2018-08-08 22:33:40 +01:00
];
checkInputs = [ buildPackages.perl ];
doCheck = true;
postInstall = ''
# avoid cycle between outputs
if [ -f $out/lib/${pname}/e2scrub_all_cron ]; then
mv $out/lib/${pname}/e2scrub_all_cron $bin/bin/
fi
e2fsprogs: build fuse2fs and add output for fuse2fs it adds 14mb of dependencies which can be significant for initrd without a separate output $ du -sch $(nix-store -qR ./result-bin) | sort -h before fuse dep 618K /nix/store/w2id1hwv4vv7hvp4slgsyrydrjbfqdxc-libidn2-2.3.2 698K /nix/store/ki0x4wywp5b7rixwk1miq222wybdl3si-e2fsprogs-1.46.5-bin 732K /nix/store/4nmqxajzaf60yjribkgvj5j54x9yvr1r-bash-5.1-p12 747K /nix/store/8ckxc8biqqfdwyhr0w70jgrcb4h7a4y5-libunistring-0.9.10 853K /nix/store/kx41yd3yyr9bwrsk85fhhx6qhavfwql6-util-linux-2.37.3-lib 2,3M /nix/store/7nkr1kzrj5j6vzq952p35g0vzk747xjz-e2fsprogs-1.46.5 16M /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108 22M total after fuse dep 38K /nix/store/k15b817jqz4ckp8rp1mgpkvvx78xxp2n-shadow-4.8.1-su 112K /nix/store/bqjh8dc6m5plswxrmmn9x4cpxrrw94lv-zlib-1.2.11 277K /nix/store/nzw0c7ag22mbyc4xrqyy1q1azq9r8kis-audit-2.8.5 285K /nix/store/ka1xx3ldpliww27wmskc1yxlgcfisdyf-libcap-ng-0.8.2 371K /nix/store/mvgg2fk5wwrcmm3wbrjhjn034aivrik2-fuse-2.9.9 618K /nix/store/w2id1hwv4vv7hvp4slgsyrydrjbfqdxc-libidn2-2.3.2 732K /nix/store/4nmqxajzaf60yjribkgvj5j54x9yvr1r-bash-5.1-p12 738K /nix/store/7wi0dn50wgimvfi30i3d4mxz40vcal10-e2fsprogs-1.46.5-bin 747K /nix/store/8ckxc8biqqfdwyhr0w70jgrcb4h7a4y5-libunistring-0.9.10 853K /nix/store/kx41yd3yyr9bwrsk85fhhx6qhavfwql6-util-linux-2.37.3-lib 1,3M /nix/store/043lz8mvyx5vxl058c1i586yqc8ax4ig-glibc-2.33-108-bin 1,7M /nix/store/fpzbv79ak68sh2sh6mag6jym553wfxws-db-4.8.30 2,3M /nix/store/9w5l1zrdd21hjxgjp5jnxxr6jibpjxd4-shadow-4.8.1 2,3M /nix/store/hjmxalhkvvajs2n26b0ry7ns56bh9k9s-e2fsprogs-1.46.5 2,5M /nix/store/ndnqiz3nnifj1blhg9q626xlmkqq1nmh-gcc-10.3.0-lib 2,8M /nix/store/pnp5qkmj8m07jl8pghhglfdczz2840r9-linux-pam-1.5.2 2,9M /nix/store/h25q7c560bchn326363ms2001jjgf338-util-linux-2.37.3-bin 16M /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108 36M total e2fsprogs: build fuse2fs on linux only the fuse for macos might be broken
2022-03-12 18:20:22 +00:00
'' + lib.optionalString stdenv.isLinux ''
mkdir -p $fuse2fs/bin
mv $bin/bin/fuse2fs $fuse2fs/bin/fuse2fs
'';
2012-09-05 00:04:14 +01:00
enableParallelBuilding = true;
2012-09-05 00:04:14 +01:00
2022-01-24 20:54:32 +00:00
passthru.tests = {
simple-filesystem = runCommand "e2fsprogs-create-fs" {} ''
mkdir -p $out
truncate -s10M $out/disc
${e2fsprogs}/bin/mkfs.ext4 $out/disc | tee $out/success
${e2fsprogs}/bin/e2fsck -n $out/disc | tee $out/success
[ -e $out/success ]
'';
};
meta = with lib; {
homepage = "http://e2fsprogs.sourceforge.net/";
2022-01-04 17:09:02 +00:00
changelog = "http://e2fsprogs.sourceforge.net/e2fsprogs-release.html#${version}";
description = "Tools for creating and checking ext2/ext3/ext4 filesystems";
2021-03-22 18:35:48 +00:00
license = with licenses; [
gpl2Plus
lgpl2Plus # lib/ext2fs, lib/e2p
bsd3 # lib/uuid
mit # lib/et, lib/ss
];
platforms = platforms.unix;
maintainers = [ maintainers.eelco ];
};
}