depot/third_party/nixpkgs/pkgs/by-name/co/composefs/package.nix
Default email 7e47f3658e Project import generated by Copybara.
GitOrigin-RevId: 1925c603f17fc89f4c8f6bf6f631a802ad85d784
2024-09-26 11:04:55 +00:00

84 lines
2.2 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, meson
, ninja
, go-md2man
, pkg-config
, openssl
, fuse3
, libcap
, python3
, which
, valgrind
, erofs-utils
, fsverity-utils
, nix-update-script
, testers
, nixosTests
, fuseSupport ? lib.meta.availableOn stdenv.hostPlatform fuse3
, enableValgrindCheck ? false
, installExperimentalTools ? false
}:
stdenv.mkDerivation (finalAttrs: {
pname = "composefs";
version = "1.0.6";
src = fetchFromGitHub {
owner = "containers";
repo = "composefs";
rev = "v${finalAttrs.version}";
hash = "sha256-9YEY7oTjWwVT2KbzTOOc6sJIGEAkdLSKDf1noF1cYuA=";
};
strictDeps = true;
outputs = [ "out" "lib" "dev" ];
postPatch = lib.optionalString installExperimentalTools ''
substituteInPlace tools/meson.build \
--replace-fail "install : false" "install : true"
'';
nativeBuildInputs = [ meson ninja go-md2man pkg-config ];
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 ];
mesonCheckFlags = lib.optionals enableValgrindCheck "--setup=valgrind";
preCheck = ''
patchShebangs --build ../tests/*dir ../tests/*.sh
'';
passthru = {
updateScript = nix-update-script { };
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;
};
};
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}";
license = with lib.licenses; [ gpl3Plus lgpl21Plus ];
maintainers = with lib.maintainers; [ kiskae ];
mainProgram = "mkcomposefs";
pkgConfigModules = [ "composefs" ];
platforms = lib.platforms.unix;
badPlatforms = lib.platforms.darwin;
};
})