2019-02-03 15:33:22 +00:00
|
|
|
{ config, stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, 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
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
stdenv.mkDerivation rec {
|
2020-08-14 21:09:18 +01:00
|
|
|
pname = "lxcfs";
|
2020-11-03 04:17:33 +00:00
|
|
|
version = "4.0.6";
|
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 21:09:18 +01:00
|
|
|
rev = "lxcfs-${version}";
|
2020-11-03 04:17:33 +00:00
|
|
|
sha256 = "1fp2q4y3ql4xd2lp4bpcl8s6xryr5xbb56da9d20w2cdr2d0lwyv";
|
2016-11-21 13:11:40 +00:00
|
|
|
};
|
|
|
|
|
2017-03-01 22:02:53 +00:00
|
|
|
nativeBuildInputs = [ pkgconfig help2man autoreconfHook ];
|
2020-06-05 13:37:14 +01:00
|
|
|
buildInputs = [ fuse makeWrapper ];
|
2016-11-21 13:11:40 +00:00
|
|
|
|
2017-11-07 11:01:42 +00:00
|
|
|
preConfigure = stdenv.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 13:37:14 +01:00
|
|
|
postInstall = ''
|
2020-11-24 15:29:28 +00:00
|
|
|
# `mount` hook requires access to the `mount` command from `util-linux`:
|
2020-06-05 13:37:14 +01:00
|
|
|
wrapProgram "$out/share/lxcfs/lxc.mount.hook" \
|
2020-11-24 15:29:28 +00:00
|
|
|
--prefix PATH : "${util-linux}/bin"
|
2020-06-05 13:37:14 +01: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 21:09:18 +01: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;
|
2017-06-20 01:01:53 +01:00
|
|
|
maintainers = with maintainers; [ mic92 fpletz ];
|
2016-11-21 13:11:40 +00:00
|
|
|
};
|
|
|
|
}
|