diff options
author | William A. Kennington III <william@wkennington.com> | 2015-03-26 17:54:25 -0700 |
---|---|---|
committer | William A. Kennington III <william@wkennington.com> | 2015-03-26 18:16:43 -0700 |
commit | 26c7e2605ed7d8b9bcff55d7311ec7f3a4d427a7 (patch) | |
tree | b2c7d6974d6336b6e164e0b1fea9bf5dac886cd9 /pkgs/os-specific/linux/lxc | |
parent | 702590081b67a2f0dfc2744150741466eddd4344 (diff) |
lxc: 1.0.7 -> 1.1.1
Diffstat (limited to 'pkgs/os-specific/linux/lxc')
-rw-r--r-- | pkgs/os-specific/linux/lxc/default.nix | 61 | ||||
-rw-r--r-- | pkgs/os-specific/linux/lxc/install-localstatedir-in-store.patch | 15 |
2 files changed, 43 insertions, 33 deletions
diff --git a/pkgs/os-specific/linux/lxc/default.nix b/pkgs/os-specific/linux/lxc/default.nix index 97f80b53032b4..9939a55257479 100644 --- a/pkgs/os-specific/linux/lxc/default.nix +++ b/pkgs/os-specific/linux/lxc/default.nix @@ -1,38 +1,63 @@ -{ stdenv, autoreconfHook, fetchurl, libcap, libapparmor, perl, docbook2x -, docbook_xml_dtd_45, gnutls, pkgconfig +{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, perl, docbook2x +, docbook_xml_dtd_45, systemd +, libapparmor ? null, gnutls ? null, libseccomp ? null, cgmanager ? null +, libnih ? null, dbus ? null, libcap ? null }: +let + enableCgmanager = cgmanager != null && libnih != null && dbus != null; +in +with stdenv.lib; stdenv.mkDerivation rec { - name = "lxc-1.0.7"; + name = "lxc-1.1.1"; - src = fetchurl { - url = "http://github.com/lxc/lxc/archive/${name}.tar.gz"; - sha256 = "1wm8n1b8j3x37757h2yyz53k3b6r2r301fmkviqf4xp0jaav1cd0"; + src = fetchFromGitHub { + owner = "lxc"; + repo = "lxc"; + rev = name; + sha256 = "04zpznd364862y3dwn97klvwfw9i2b6n1lh4fkci0z74c6z9svql"; }; - buildInputs = [ libcap libapparmor perl docbook2x gnutls autoreconfHook pkgconfig ]; + buildInputs = [ + autoreconfHook pkgconfig perl docbook2x systemd + libapparmor gnutls libseccomp cgmanager libnih dbus libcap + ]; - patches = [ ./install-localstatedir-in-store.patch ./support-db2x.patch ]; + patches = [ ./support-db2x.patch ]; - preConfigure = '' - export XML_CATALOG_FILES=${docbook_xml_dtd_45}/xml/dtd/docbook/catalog.xml - substituteInPlace doc/rootfs/Makefile.am --replace '@LXCROOTFSMOUNT@' '$out/lib/lxc/rootfs' - substituteInPlace configure.ac --replace '$sysconfdir/' '/etc/' - substituteInPlace configure.ac --replace '$${sysconfdir}/' '/etc/' - ''; + XML_CATALOG_FILES = "${docbook_xml_dtd_45}/xml/dtd/docbook/catalog.xml"; configureFlags = [ "--localstatedir=/var" + "--sysconfdir=/etc" "--with-rootfs-path=/var/lib/lxc/rootfs" + ] ++ optional (libapparmor != null) "--enable-apparmor" + ++ optional (gnutls != null) "--enable-gnutls" + ++ optional (libseccomp != null) "--enable-seccomp" + ++ optional (enableCgmanager) "--enable-cgmanager" + ++ optional (libcap != null) "--enable-capabilities" + ++ [ "--enable-doc" "--enable-tests" - "--enable-apparmor" ]; + installFlags = [ "DESTDIR=\${out}" ]; + + postInstall = '' + mv $out/$out/* $out + DIR=$out/$out + while rmdir $DIR 2>/dev/null; do + DIR="$(dirname "$DIR")" + done + + # Remove the unneeded var/lib directories + rm -rf $out/var + ''; + meta = { homepage = "http://lxc.sourceforge.net"; description = "userspace tools for Linux Containers, a lightweight virtualization system"; - license = stdenv.lib.licenses.lgpl21Plus; + license = licenses.lgpl21Plus; longDescription = '' LXC is the userspace control package for Linux Containers, a @@ -42,7 +67,7 @@ stdenv.mkDerivation rec { mechanisms to Linux’s existing process management infrastructure. ''; - platforms = stdenv.lib.platforms.linux; - maintainers = [ stdenv.lib.maintainers.simons ]; + platforms = platforms.linux; + maintainers = with maintainers; [ simons wkennington ]; }; } diff --git a/pkgs/os-specific/linux/lxc/install-localstatedir-in-store.patch b/pkgs/os-specific/linux/lxc/install-localstatedir-in-store.patch deleted file mode 100644 index d45335a02324d..0000000000000 --- a/pkgs/os-specific/linux/lxc/install-localstatedir-in-store.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/Makefile.am b/Makefile.am -index eac2bfd..8f040d3 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -25,8 +25,8 @@ pcdatadir = $(libdir)/pkgconfig - pcdata_DATA = lxc.pc - - install-data-local: -- $(MKDIR_P) $(DESTDIR)$(LXCPATH) -- $(MKDIR_P) $(DESTDIR)$(localstatedir)/cache/lxc -+ $(MKDIR_P) $(out)$(LXCPATH) -+ $(MKDIR_P) $(out)$(localstatedir)/cache/lxc - - ChangeLog:: - @touch ChangeLog |