nixpkgs/pkgs/by-name/co/composefs/package.nix

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

112 lines
2.7 KiB
Nix
Raw Normal View History

2023-09-23 12:27:04 +00:00
{
lib,
stdenv,
fetchFromGitHub,
2024-08-17 14:31:09 +00:00
meson,
ninja,
2023-12-13 12:34:25 +00:00
go-md2man,
2023-09-23 12:27:04 +00:00
pkg-config,
openssl,
fuse3,
libcap,
python3,
which,
valgrind,
erofs-utils,
fsverity-utils,
nix-update-script,
testers,
2024-01-29 16:05:55 +00:00
nixosTests,
2023-09-23 12:27:04 +00:00
fuseSupport ? lib.meta.availableOn stdenv.hostPlatform fuse3,
enableValgrindCheck ? false,
installExperimentalTools ? false,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "composefs";
2024-11-01 16:28:46 +00:00
version = "1.0.7";
2023-09-23 12:27:04 +00:00
src = fetchFromGitHub {
owner = "containers";
repo = "composefs";
rev = "v${finalAttrs.version}";
2024-11-01 16:28:46 +00:00
hash = "sha256-kbXmDdyRrtsERkUomjZUWP3QC2q27AWUTc/J2jCSXg4=";
2023-09-23 12:27:04 +00:00
};
strictDeps = true;
outputs = [
"out"
"lib"
"dev"
];
postPatch =
# 'both_libraries' as an install target always builds both versions.
# This results in double disk usage for normal builds and broken static builds,
# so we replace it with the regular library target.
''
substituteInPlace libcomposefs/meson.build \
--replace-fail "both_libraries" "library"
''
+ lib.optionalString installExperimentalTools ''
substituteInPlace tools/meson.build \
--replace-fail "install : false" "install : true"
'';
2023-09-23 12:27:04 +00:00
2024-08-17 14:31:09 +00:00
nativeBuildInputs = [
meson
ninja
go-md2man
pkg-config
];
2023-09-23 12:27:04 +00:00
buildInputs =
[ openssl ]
++ lib.optional fuseSupport fuse3
++ lib.filter (lib.meta.availableOn stdenv.hostPlatform) ([
libcap
]);
doCheck = true;
nativeCheckInputs =
[
python3
which
]
++ lib.optional enableValgrindCheck valgrind
++ lib.optional fuseSupport fuse3
++ lib.filter (lib.meta.availableOn stdenv.buildPlatform) [
erofs-utils
fsverity-utils
];
2024-08-17 14:31:09 +00:00
mesonCheckFlags = lib.optionals enableValgrindCheck "--setup=valgrind";
2023-09-23 12:27:04 +00:00
preCheck = ''
2024-08-17 14:31:09 +00:00
patchShebangs --build ../tests/*dir ../tests/*.sh
2023-09-23 12:27:04 +00:00
'';
passthru = {
updateScript = nix-update-script { };
2024-01-29 16:05:55 +00:00
tests = {
# Broken on aarch64 unrelated to this package: https://github.com/NixOS/nixpkgs/issues/291398
inherit (nixosTests) activation-etc-overlay-immutable activation-etc-overlay-mutable;
pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
};
2023-09-23 12:27:04 +00:00
};
meta = {
description = "File system for mounting container images";
homepage = "https://github.com/containers/composefs";
changelog = "https://github.com/containers/composefs/releases/tag/v${finalAttrs.version}";
2024-11-01 16:28:46 +00:00
license = with lib.licenses; [
gpl2Only
asl20
];
2023-09-23 12:27:04 +00:00
maintainers = with lib.maintainers; [ kiskae ];
mainProgram = "mkcomposefs";
pkgConfigModules = [ "composefs" ];
platforms = lib.platforms.unix;
badPlatforms = lib.platforms.darwin;
};
})