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-12-19 01:06:50 +00:00
|
|
|
version = "4.0.11";
|
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-12-19 01:06:50 +00:00
|
|
|
sha256 = "sha256-jWOmGV85uTYjBFQZKR3+TgPWZix2vuN8TLA/dhL8jwk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
nativeBuildInputs = [ pkg-config help2man autoreconfHook makeWrapper ];
|
|
|
|
buildInputs = [ fuse ];
|
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 ];
|
|
|
|
};
|
|
|
|
}
|