nixpkgs/pkgs/os-specific/linux/lxcfs/default.nix

52 lines
1.4 KiB
Nix
Raw Normal View History

2019-02-03 15:33:22 +00:00
{ config, stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, help2man, fuse
, utillinux, 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";
version = "4.0.5";
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}";
sha256 = "12mk9hgqzzh1874389lrpvldlp87qxxa1sxzk5zr0d0n1857am5y";
2016-11-21 13:11:40 +00:00
};
2017-03-01 22:02:53 +00:00
nativeBuildInputs = [ pkgconfig help2man autoreconfHook ];
buildInputs = [ fuse makeWrapper ];
2016-11-21 13:11:40 +00:00
preConfigure = stdenv.lib.optionalString enableDebugBuild ''
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" ];
postInstall = ''
# `mount` hook requires access to the `mount` command from `utillinux`:
wrapProgram "$out/share/lxcfs/lxc.mount.hook" \
--prefix PATH : "${utillinux}/bin"
'';
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
};
}