2021-01-19 06:50:56 +00:00
|
|
|
{ config, lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, help2man, fuse
|
2020-11-24 15:29:28 +00:00
|
|
|
, util-linux, makeWrapper
|
2019-02-03 15:33:22 +00:00
|
|
|
, enableDebugBuild ? config.lxcfs.enableDebugBuild or false }:
|
2016-11-21 13:11:40 +00:00
|
|
|
|
2021-01-15 14:45:37 +00:00
|
|
|
with lib;
|
2016-11-21 13:11:40 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-08-14 20:09:18 +00:00
|
|
|
pname = "lxcfs";
|
2022-02-12 12:45:03 +00:00
|
|
|
version = "4.0.12";
|
2016-11-21 13:11:40 +00:00
|
|
|
|
2017-03-01 22:02:53 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lxc";
|
|
|
|
repo = "lxcfs";
|
2020-08-14 20:09:18 +00:00
|
|
|
rev = "lxcfs-${version}";
|
2022-02-12 12:45:03 +00:00
|
|
|
sha256 = "sha256-+wp29GD+toXGfQbPGYbDJ7/P+FY1uQY4uK3OQxTE9GM=";
|
2016-11-21 13:11:40 +00:00
|
|
|
};
|
|
|
|
|
2022-10-09 09:04:02 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i -e '1i #include <sys/pidfd.h>' src/bindings.c
|
|
|
|
'';
|
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ pkg-config help2man autoreconfHook makeWrapper ];
|
|
|
|
buildInputs = [ fuse ];
|
2016-11-21 13:11:40 +00:00
|
|
|
|
2021-01-15 14:45:37 +00:00
|
|
|
preConfigure = lib.optionalString enableDebugBuild ''
|
2017-11-02 01:38:39 +00:00
|
|
|
sed -i 's,#AM_CFLAGS += -DDEBUG,AM_CFLAGS += -DDEBUG,' Makefile.am
|
|
|
|
'';
|
|
|
|
|
2016-11-21 13:11:40 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--with-init-script=systemd"
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
|
|
|
];
|
|
|
|
|
|
|
|
installFlags = [ "SYSTEMD_UNIT_DIR=\${out}/lib/systemd" ];
|
|
|
|
|
2020-06-05 12:37:14 +00:00
|
|
|
postInstall = ''
|
2020-11-24 15:29:28 +00:00
|
|
|
# `mount` hook requires access to the `mount` command from `util-linux`:
|
2020-06-05 12:37:14 +00:00
|
|
|
wrapProgram "$out/share/lxcfs/lxc.mount.hook" \
|
2020-11-24 15:29:28 +00:00
|
|
|
--prefix PATH : "${util-linux}/bin"
|
2020-06-05 12:37:14 +00:00
|
|
|
'';
|
|
|
|
|
2016-11-21 13:11:40 +00:00
|
|
|
postFixup = ''
|
|
|
|
# liblxcfs.so is reloaded with dlopen()
|
|
|
|
patchelf --set-rpath "$(patchelf --print-rpath "$out/bin/lxcfs"):$out/lib" "$out/bin/lxcfs"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "FUSE filesystem for LXC";
|
2020-08-14 20:09:18 +00:00
|
|
|
homepage = "https://linuxcontainers.org/lxcfs";
|
|
|
|
changelog = "https://linuxcontainers.org/lxcfs/news/";
|
2016-11-21 13:11:40 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.linux;
|
2022-08-03 12:13:56 +00:00
|
|
|
maintainers = with maintainers; [ mic92 ];
|
2016-11-21 13:11:40 +00:00
|
|
|
};
|
|
|
|
}
|