2023-10-09 19:29:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2024-06-05 15:53:02 +00:00
|
|
|
, fetchpatch
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
, autoreconfHook
|
2024-01-02 11:29:13 +00:00
|
|
|
, go-md2man
|
2023-10-09 19:29:22 +00:00
|
|
|
, pkg-config
|
|
|
|
, openssl
|
|
|
|
, fuse3
|
|
|
|
, libcap
|
|
|
|
, libseccomp
|
|
|
|
, python3
|
|
|
|
, which
|
|
|
|
, valgrind
|
|
|
|
, erofs-utils
|
|
|
|
, fsverity-utils
|
|
|
|
, nix-update-script
|
|
|
|
, testers
|
2024-04-21 15:54:59 +00:00
|
|
|
, nixosTests
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
, fuseSupport ? lib.meta.availableOn stdenv.hostPlatform fuse3
|
|
|
|
, enableValgrindCheck ? false
|
|
|
|
, installExperimentalTools ? false
|
|
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
|
|
pname = "composefs";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "1.0.4";
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "containers";
|
|
|
|
repo = "composefs";
|
|
|
|
rev = "v${finalAttrs.version}";
|
2024-06-05 15:53:02 +00:00
|
|
|
hash = "sha256-ekUFLZGWTsiJZFv3nHoxuV057zoOtWBIkt+VdtzlaU4=";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
strictDeps = true;
|
|
|
|
outputs = [ "out" "lib" "dev" ];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
patches = [
|
|
|
|
# fixes composefs-info tests, remove in next release
|
|
|
|
# https://github.com/containers/composefs/pull/291
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/containers/composefs/commit/f7465b3a57935d96451b392b07aa3a1dafb56e7b.patch";
|
|
|
|
hash = "sha256-OO3IfqLf3dQGjEgKx3Bo630KALmLAWwgdACuyZm2Ujc=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
postPatch = lib.optionalString installExperimentalTools ''
|
|
|
|
sed -i "s/noinst_PROGRAMS +\?=/bin_PROGRAMS +=/g" tools/Makefile.am
|
|
|
|
'';
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
configureFlags = [
|
|
|
|
(lib.enableFeature true "man")
|
|
|
|
(lib.enableFeature enableValgrindCheck "valgrind-test")
|
2023-10-09 19:29:22 +00:00
|
|
|
];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook go-md2man pkg-config ];
|
2023-10-09 19:29:22 +00:00
|
|
|
buildInputs = [ openssl ]
|
|
|
|
++ lib.optional fuseSupport fuse3
|
|
|
|
++ lib.filter (lib.meta.availableOn stdenv.hostPlatform) (
|
|
|
|
[
|
|
|
|
libcap
|
|
|
|
libseccomp
|
|
|
|
]
|
|
|
|
);
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
nativeCheckInputs = [ python3 which ]
|
|
|
|
++ lib.optional enableValgrindCheck valgrind
|
|
|
|
++ lib.optional fuseSupport fuse3
|
|
|
|
++ lib.filter (lib.meta.availableOn stdenv.buildPlatform) [ erofs-utils fsverity-utils ];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
patchShebangs --build tests/*dir tests/*.sh
|
|
|
|
substituteInPlace tests/*.sh \
|
2024-06-05 15:53:02 +00:00
|
|
|
--replace-quiet " /tmp" " $TMPDIR" \
|
|
|
|
--replace-quiet " /var/tmp" " $TMPDIR"
|
2023-10-09 19:29:22 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
updateScript = nix-update-script { };
|
2024-04-21 15:54:59 +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-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A 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;
|
|
|
|
};
|
|
|
|
})
|