summary refs log tree commit diff
path: root/pkgs/os-specific/linux/lxc
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/linux/lxc')
-rw-r--r--pkgs/os-specific/linux/lxc/default.nix9
-rw-r--r--pkgs/os-specific/linux/lxc/fix-glibc-2.25.patch36
2 files changed, 45 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/lxc/default.nix b/pkgs/os-specific/linux/lxc/default.nix
index ccee2a18a90..1f0cd69e594 100644
--- a/pkgs/os-specific/linux/lxc/default.nix
+++ b/pkgs/os-specific/linux/lxc/default.nix
@@ -29,10 +29,19 @@ stdenv.mkDerivation rec {
 
   patches = [
     ./support-db2x.patch
+    ./fix-glibc-2.25.patch
   ];
 
   XML_CATALOG_FILES = "${docbook_xml_dtd_45}/xml/dtd/docbook/catalog.xml";
 
+  # FIXME
+  # glibc 2.25 moved major()/minor() to <sys/sysmacros.h>.
+  # this commit should detect this: https://github.com/lxc/lxc/pull/1388/commits/af6824fce9c9536fbcabef8d5547f6c486f55fdf
+  # However autotools checks if mkdev is still defined in <sys/types.h> runs before
+  # checking if major()/minor() is defined there. The mkdev check succeeds with
+  # a warning and the check which should set MAJOR_IN_SYSMACROS is skipped.
+  NIX_CFLAGS_COMPILE = [ "-DMAJOR_IN_SYSMACROS" ];
+
   configureFlags = [
     "--localstatedir=/var"
     "--sysconfdir=/etc"
diff --git a/pkgs/os-specific/linux/lxc/fix-glibc-2.25.patch b/pkgs/os-specific/linux/lxc/fix-glibc-2.25.patch
new file mode 100644
index 00000000000..3896813a58e
--- /dev/null
+++ b/pkgs/os-specific/linux/lxc/fix-glibc-2.25.patch
@@ -0,0 +1,36 @@
+diff --git a/src/lxc/bdev/lxclvm.c b/src/lxc/bdev/lxclvm.c
+index 75de17f..d6d98e4 100644
+--- a/src/lxc/bdev/lxclvm.c
++++ b/src/lxc/bdev/lxclvm.c
+@@ -30,6 +30,7 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <sys/wait.h>
++#include <sys/sysmacros.h>
+ 
+ #include "bdev.h"
+ #include "config.h"
+diff --git a/src/lxc/conf.c b/src/lxc/conf.c
+index a93124b..948d716 100644
+--- a/src/lxc/conf.c
++++ b/src/lxc/conf.c
+@@ -48,6 +48,7 @@
+ #include <sys/stat.h>
+ #include <sys/socket.h>
+ #include <sys/syscall.h>
++#include <sys/sysmacros.h>
+ #include <sys/types.h>
+ #include <sys/utsname.h>
+ #include <sys/wait.h>
+diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c
+index 0dbbf2c..7135222 100644
+--- a/src/lxc/lxccontainer.c
++++ b/src/lxc/lxccontainer.c
+@@ -34,6 +34,7 @@
+ #include <sys/mman.h>
+ #include <sys/mount.h>
+ #include <sys/syscall.h>
++#include <sys/sysmacros.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+