2020-02-10 04:01:48 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, autoreconfHook
|
|
|
|
, go-md2man
|
2021-01-17 02:09:27 +00:00
|
|
|
, pkg-config
|
2020-02-10 04:01:48 +00:00
|
|
|
, libcap
|
|
|
|
, libseccomp
|
|
|
|
, python3
|
|
|
|
, systemd
|
|
|
|
, yajl
|
2020-05-19 00:41:00 +00:00
|
|
|
, nixosTests
|
2021-02-11 12:58:56 +00:00
|
|
|
, criu
|
2020-02-10 04:01:48 +00:00
|
|
|
}:
|
2019-09-12 09:23:14 +00:00
|
|
|
|
2020-02-10 04:01:48 +00:00
|
|
|
let
|
|
|
|
# these tests require additional permissions
|
|
|
|
disabledTests = [
|
|
|
|
"test_capabilities.py"
|
|
|
|
"test_cwd.py"
|
2022-03-03 10:53:53 +00:00
|
|
|
"test_delete.py"
|
2020-02-10 04:01:48 +00:00
|
|
|
"test_detach.py"
|
|
|
|
"test_exec.py"
|
|
|
|
"test_hooks.py"
|
|
|
|
"test_hostname.py"
|
|
|
|
"test_paths.py"
|
|
|
|
"test_pid.py"
|
|
|
|
"test_pid_file.py"
|
|
|
|
"test_preserve_fds.py"
|
2020-09-23 15:16:45 +00:00
|
|
|
"test_resources"
|
2021-04-02 19:44:57 +00:00
|
|
|
"test_seccomp"
|
2020-02-10 04:01:48 +00:00
|
|
|
"test_start.py"
|
|
|
|
"test_uid_gid.py"
|
|
|
|
"test_update.py"
|
|
|
|
"tests_libcrun_utils"
|
|
|
|
];
|
|
|
|
|
|
|
|
in
|
2019-09-12 09:23:14 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "crun";
|
2022-11-30 01:12:00 +00:00
|
|
|
version = "1.7.2";
|
2019-09-12 09:23:14 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "containers";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-11-30 01:12:00 +00:00
|
|
|
sha256 = "sha256-SNNy/oI3ZcMeRLEMS2nSCS/rRaen5WsDfhdlHQCdtP4=";
|
2019-09-12 09:23:14 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2021-01-17 02:09:27 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook go-md2man pkg-config python3 ];
|
2019-09-12 09:23:14 +00:00
|
|
|
|
2022-09-24 22:15:11 +00:00
|
|
|
buildInputs = [ criu libcap libseccomp systemd yajl ];
|
2019-09-12 09:23:14 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2022-07-05 01:17:03 +00:00
|
|
|
strictDeps = true;
|
2019-09-12 09:23:14 +00:00
|
|
|
|
2022-11-25 20:54:40 +00:00
|
|
|
NIX_LDFLAGS = "-lcriu";
|
|
|
|
|
2020-02-10 04:01:48 +00:00
|
|
|
# we need this before autoreconfHook does its thing in order to initialize
|
|
|
|
# config.h with the correct values
|
|
|
|
postPatch = ''
|
|
|
|
echo ${version} > .tarball-version
|
|
|
|
echo '#define GIT_VERSION "${src.rev}"' > git-version.h
|
|
|
|
|
|
|
|
${lib.concatMapStringsSep "\n" (e:
|
|
|
|
"substituteInPlace Makefile.am --replace 'tests/${e}' ''"
|
|
|
|
) disabledTests}
|
2020-01-16 05:45:59 +00:00
|
|
|
'';
|
|
|
|
|
2020-02-10 04:01:48 +00:00
|
|
|
doCheck = true;
|
2019-09-12 09:23:14 +00:00
|
|
|
|
2020-08-23 22:38:10 +00:00
|
|
|
passthru.tests = { inherit (nixosTests) podman; };
|
2020-05-19 00:41:00 +00:00
|
|
|
|
2019-09-12 09:23:14 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A fast and lightweight fully featured OCI runtime and C library for running containers";
|
2020-03-05 21:39:41 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2019-09-12 09:23:14 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
inherit (src.meta) homepage;
|
2020-04-03 10:11:24 +00:00
|
|
|
maintainers = with maintainers; [ ] ++ teams.podman.members;
|
2019-09-12 09:23:14 +00:00
|
|
|
};
|
|
|
|
}
|