2021-01-19 07:50:56 +01:00
|
|
|
{ config, lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, help2man, fuse
|
2020-11-24 16:29:28 +01:00
|
|
|
, util-linux, makeWrapper
|
2019-02-03 16:33:22 +01:00
|
|
|
, enableDebugBuild ? config.lxcfs.enableDebugBuild or false }:
|
2016-11-21 14:11:40 +01:00
|
|
|
|
2021-01-15 15:45:37 +01:00
|
|
|
with lib;
|
2016-11-21 14:11:40 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2020-08-14 22:09:18 +02:00
|
|
|
pname = "lxcfs";
|
2021-05-02 00:46:06 +02:00
|
|
|
version = "4.0.8";
|
2016-11-21 14:11:40 +01:00
|
|
|
|
2017-03-01 23:02:53 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lxc";
|
|
|
|
repo = "lxcfs";
|
2020-08-14 22:09:18 +02:00
|
|
|
rev = "lxcfs-${version}";
|
2021-05-02 00:46:06 +02:00
|
|
|
sha256 = "sha256-8Tack2gM3AU3coGXs5hEbAaBCo5ss1sGUFFEjZDn5Lg=";
|
2016-11-21 14:11:40 +01:00
|
|
|
};
|
|
|
|
|
2021-02-07 10:17:39 +01:00
|
|
|
nativeBuildInputs = [ pkg-config help2man autoreconfHook makeWrapper ];
|
|
|
|
buildInputs = [ fuse ];
|
2016-11-21 14:11:40 +01:00
|
|
|
|
2021-01-15 15:45:37 +01:00
|
|
|
preConfigure = lib.optionalString enableDebugBuild ''
|
2017-11-02 02:38:39 +01:00
|
|
|
sed -i 's,#AM_CFLAGS += -DDEBUG,AM_CFLAGS += -DDEBUG,' Makefile.am
|
|
|
|
'';
|
|
|
|
|
2016-11-21 14:11:40 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--with-init-script=systemd"
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
|
|
|
];
|
|
|
|
|
|
|
|
installFlags = [ "SYSTEMD_UNIT_DIR=\${out}/lib/systemd" ];
|
|
|
|
|
2020-06-05 14:37:14 +02:00
|
|
|
postInstall = ''
|
2020-11-24 16:29:28 +01:00
|
|
|
# `mount` hook requires access to the `mount` command from `util-linux`:
|
2020-06-05 14:37:14 +02:00
|
|
|
wrapProgram "$out/share/lxcfs/lxc.mount.hook" \
|
2020-11-24 16:29:28 +01:00
|
|
|
--prefix PATH : "${util-linux}/bin"
|
2020-06-05 14:37:14 +02:00
|
|
|
'';
|
|
|
|
|
2016-11-21 14:11:40 +01: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 22:09:18 +02:00
|
|
|
homepage = "https://linuxcontainers.org/lxcfs";
|
|
|
|
changelog = "https://linuxcontainers.org/lxcfs/news/";
|
2016-11-21 14:11:40 +01:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.linux;
|
2017-06-20 02:01:53 +02:00
|
|
|
maintainers = with maintainers; [ mic92 fpletz ];
|
2016-11-21 14:11:40 +01:00
|
|
|
};
|
|
|
|
}
|