2021-02-05 17:12:51 +00:00
|
|
|
{ config, lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, help2man, fuse
|
2020-11-24 20:58:05 +00:00
|
|
|
, util-linux, makeWrapper
|
2020-04-24 23:36:52 +00:00
|
|
|
, enableDebugBuild ? config.lxcfs.enableDebugBuild or false }:
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
with lib;
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-08-20 17:08:02 +00:00
|
|
|
pname = "lxcfs";
|
2021-02-05 17:12:51 +00:00
|
|
|
version = "4.0.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lxc";
|
|
|
|
repo = "lxcfs";
|
2020-08-20 17:08:02 +00:00
|
|
|
rev = "lxcfs-${version}";
|
2021-02-05 17:12:51 +00:00
|
|
|
sha256 = "sha256-gC1Q+kG/oKfYvuHVKstpRWfL/thsemULrimPrV/eeaI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config help2man autoreconfHook ];
|
2020-06-18 07:06:33 +00:00
|
|
|
buildInputs = [ fuse makeWrapper ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
preConfigure = lib.optionalString enableDebugBuild ''
|
2020-04-24 23:36:52 +00:00
|
|
|
sed -i 's,#AM_CFLAGS += -DDEBUG,AM_CFLAGS += -DDEBUG,' Makefile.am
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--with-init-script=systemd"
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
|
|
|
];
|
|
|
|
|
|
|
|
installFlags = [ "SYSTEMD_UNIT_DIR=\${out}/lib/systemd" ];
|
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
postInstall = ''
|
2020-11-24 20:58:05 +00:00
|
|
|
# `mount` hook requires access to the `mount` command from `util-linux`:
|
2020-06-18 07:06:33 +00:00
|
|
|
wrapProgram "$out/share/lxcfs/lxc.mount.hook" \
|
2020-11-24 20:58:05 +00:00
|
|
|
--prefix PATH : "${util-linux}/bin"
|
2020-06-18 07:06:33 +00:00
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +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-20 17:08:02 +00:00
|
|
|
homepage = "https://linuxcontainers.org/lxcfs";
|
|
|
|
changelog = "https://linuxcontainers.org/lxcfs/news/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ mic92 fpletz ];
|
|
|
|
};
|
|
|
|
}
|