summary refs log tree commit diff
path: root/pkgs/os-specific/linux/kmod
diff options
context:
space:
mode:
authorAlexander Bantyev <balsoft75@gmail.com>2019-11-08 21:14:31 +0300
committerAlexander Bantyev <balsoft75@gmail.com>2019-11-11 11:10:59 +0300
commit8983cac44c3e9f499e6c79e2366105d5e9cb3479 (patch)
treed124b2e4471a70447fd261a14bf62c478d2d859b /pkgs/os-specific/linux/kmod
parent3df718e7c3caca1bfbd0d24d7f778be0e52f62ba (diff)
downloadnixpkgs-8983cac44c3e9f499e6c79e2366105d5e9cb3479.tar
nixpkgs-8983cac44c3e9f499e6c79e2366105d5e9cb3479.tar.gz
nixpkgs-8983cac44c3e9f499e6c79e2366105d5e9cb3479.tar.bz2
nixpkgs-8983cac44c3e9f499e6c79e2366105d5e9cb3479.tar.lz
nixpkgs-8983cac44c3e9f499e6c79e2366105d5e9cb3479.tar.xz
nixpkgs-8983cac44c3e9f499e6c79e2366105d5e9cb3479.tar.zst
nixpkgs-8983cac44c3e9f499e6c79e2366105d5e9cb3479.zip
kmod: fix --enable-static
Diffstat (limited to 'pkgs/os-specific/linux/kmod')
-rw-r--r--pkgs/os-specific/linux/kmod/default.nix8
-rw-r--r--pkgs/os-specific/linux/kmod/enable-static.patch12
2 files changed, 17 insertions, 3 deletions
diff --git a/pkgs/os-specific/linux/kmod/default.nix b/pkgs/os-specific/linux/kmod/default.nix
index 433506e5c39..052ab3061c1 100644
--- a/pkgs/os-specific/linux/kmod/default.nix
+++ b/pkgs/os-specific/linux/kmod/default.nix
@@ -1,5 +1,6 @@
 { stdenv, lib, fetchurl, autoreconfHook, pkgconfig
-, libxslt, xz, elf-header }:
+, libxslt, xz, elf-header
+, withStatic ? false }:
 
 let
   systems = [ "/run/current-system/kernel-modules" "/run/booted-system/kernel-modules" "" ];
@@ -21,10 +22,11 @@ in stdenv.mkDerivation rec {
     "--sysconfdir=/etc"
     "--with-xz"
     "--with-modulesdirs=${modulesDirs}"
-  ];
+  ] ++ lib.optional withStatic "--enable-static";
 
   patches = [ ./module-dir.patch ]
-    ++ lib.optional stdenv.isDarwin ./darwin.patch;
+    ++ lib.optional stdenv.isDarwin ./darwin.patch
+    ++ lib.optional withStatic ./enable-static.patch;
 
   postInstall = ''
     for prog in rmmod insmod lsmod modinfo modprobe depmod; do
diff --git a/pkgs/os-specific/linux/kmod/enable-static.patch b/pkgs/os-specific/linux/kmod/enable-static.patch
new file mode 100644
index 00000000000..8308c655792
--- /dev/null
+++ b/pkgs/os-specific/linux/kmod/enable-static.patch
@@ -0,0 +1,12 @@
+diff --git a/configure.ac b/configure.ac
+index ee72283..b42c42a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -19,7 +19,6 @@ AM_SILENT_RULES([yes])
+ LT_INIT([disable-static pic-only])
+ DOLT
+ 
+-AS_IF([test "x$enable_static" = "xyes"], [AC_MSG_ERROR([--enable-static is not supported by kmod])])
+ AS_IF([test "x$enable_largefile" = "xno"], [AC_MSG_ERROR([--disable-largefile is not supported by kmod])])
+ 
+ #####################################################################