summary refs log tree commit diff
path: root/pkgs/os-specific/linux/ndiswrapper
diff options
context:
space:
mode:
authorYury G. Kudryashov <urkud.urkud@gmail.com>2008-01-28 19:34:00 +0000
committerYury G. Kudryashov <urkud.urkud@gmail.com>2008-01-28 19:34:00 +0000
commiteaca7f368ccefab6d6fcdaf15570fd8c9dedb410 (patch)
tree911ec0492c921858e4449e9cc312945dfa98ab2b /pkgs/os-specific/linux/ndiswrapper
parentd969dfb08d52a17590853b6bbaefdf6eb159da93 (diff)
downloadnixpkgs-eaca7f368ccefab6d6fcdaf15570fd8c9dedb410.tar
nixpkgs-eaca7f368ccefab6d6fcdaf15570fd8c9dedb410.tar.gz
nixpkgs-eaca7f368ccefab6d6fcdaf15570fd8c9dedb410.tar.bz2
nixpkgs-eaca7f368ccefab6d6fcdaf15570fd8c9dedb410.tar.lz
nixpkgs-eaca7f368ccefab6d6fcdaf15570fd8c9dedb410.tar.xz
nixpkgs-eaca7f368ccefab6d6fcdaf15570fd8c9dedb410.tar.zst
nixpkgs-eaca7f368ccefab6d6fcdaf15570fd8c9dedb410.zip
Added prefix patch to ndiswrapper
svn path=/nixpkgs/trunk/; revision=10323
Diffstat (limited to 'pkgs/os-specific/linux/ndiswrapper')
-rw-r--r--pkgs/os-specific/linux/ndiswrapper/default.nix10
-rw-r--r--pkgs/os-specific/linux/ndiswrapper/prefix.patch78
2 files changed, 84 insertions, 4 deletions
diff --git a/pkgs/os-specific/linux/ndiswrapper/default.nix b/pkgs/os-specific/linux/ndiswrapper/default.nix
index 0d8b351e58b..5138ae4f9b8 100644
--- a/pkgs/os-specific/linux/ndiswrapper/default.nix
+++ b/pkgs/os-specific/linux/ndiswrapper/default.nix
@@ -1,6 +1,5 @@
-args:
-with args;
-args.stdenv.mkDerivation {
+args: with args;
+stdenv.mkDerivation {
   name = "ndiswrapper-1.49-stable";
 
   # need at least .config and include 
@@ -16,7 +15,10 @@ args.stdenv.mkDerivation {
     sha256 = "1b9nqkk7gv6gffzj9b8mjy5myxf2afwpyr2n5wbfsylf15dvvvjr";
   };
 
-  buildInputs =(with args; [kernelHeaders kernel]);
+  buildInputs =[kernelHeaders kernel];
+
+  # this is a patch against svn head, not stable version
+  patches = [./prefix.patch];
 
   meta = { 
       description = "Ndis driver wrapper for the Linux kernel";
diff --git a/pkgs/os-specific/linux/ndiswrapper/prefix.patch b/pkgs/os-specific/linux/ndiswrapper/prefix.patch
new file mode 100644
index 00000000000..7d44c4fe757
--- /dev/null
+++ b/pkgs/os-specific/linux/ndiswrapper/prefix.patch
@@ -0,0 +1,78 @@
+diff --git a/ndiswrapper/driver/Makefile b/ndiswrapper/driver/Makefile
+index b0c2a9d..8907a05 100644
+--- a/ndiswrapper/driver/Makefile
++++ b/ndiswrapper/driver/Makefile
+@@ -119,6 +119,10 @@ ifdef WRAP_PREEMPT
+ MOD_CFLAGS += -DWRAP_PREEMPT
+ endif
+ 
++ifdef DIST_DESTDIR
++MOD_CFLAGS += -DPREFIX=\"$(DIST_DESTDIR)\"
++endif
++
+ .PHONY: prereq_check gen_exports clean dist_clean install stack_check
+ 
+ all : prereq_check win2lin_stubs.h gen_exports compat.h default stack_check
+@@ -355,7 +359,7 @@ install: prereq_check win2lin_stubs.h gen_exports compat.h default stack_check
+ 	echo $(INST_DIR)
+ 	mkdir -p $(INST_DIR)
+ 	install -m 0644 $(MODULE) $(INST_DIR)
+-	-@/bin/rm -rf $(SRC_DIR)/.tmp_versions
++	-@rm -rf $(SRC_DIR)/.tmp_versions
+ ifndef DIST_DESTDIR
+ 	-/sbin/depmod -a $(KVERS) -b $(DESTDIR)
+ endif
+diff --git a/ndiswrapper/driver/loader.c b/ndiswrapper/driver/loader.c
+index 930606f..9a8e9f0 100644
+--- a/ndiswrapper/driver/loader.c
++++ b/ndiswrapper/driver/loader.c
+@@ -106,7 +106,7 @@ struct wrap_driver *load_wrap_driver(struct wrap_device *wd)
+ 			EXIT1(return NULL);
+ 		}
+ 		INIT_COMPLETION(loader_complete);
+-		ret = call_usermodehelper("/sbin/loadndisdriver", argv, env
++		ret = call_usermodehelper(USERMOD_HELPER, argv, env
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ 					  , 1
+ #endif
+@@ -272,7 +272,7 @@ struct wrap_bin_file *get_bin_file(char *bin_file_name)
+ 			EXIT1(return NULL);
+ 		}
+ 		INIT_COMPLETION(loader_complete);
+-		ret = call_usermodehelper("/sbin/loadndisdriver", argv, env
++		ret = call_usermodehelper(USERMOD_HELPER, argv, env
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ 					  , 1
+ #endif
+@@ -711,7 +711,7 @@ struct wrap_device *load_wrap_device(struct load_device *load_device)
+ 			EXIT1(return NULL);
+ 		}
+ 		INIT_COMPLETION(loader_complete);
+-		ret = call_usermodehelper("/sbin/loadndisdriver", argv, env
++		ret = call_usermodehelper(USERMOD_HELPER, argv, env
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ 					  , 1
+ #endif
+diff --git a/ndiswrapper/driver/ndiswrapper.h b/ndiswrapper/driver/ndiswrapper.h
+index 4a78dc6..c11a074 100644
+--- a/ndiswrapper/driver/ndiswrapper.h
++++ b/ndiswrapper/driver/ndiswrapper.h
+@@ -19,8 +19,17 @@
+ #define DRIVER_VERSION "1.50"
+ #define UTILS_VERSION "1.9"
+ 
++#ifndef PREFIX
++#define PREFIX
++#endif
++
+ #define DRIVER_NAME "ndiswrapper"
+-#define DRIVER_CONFIG_DIR "/etc/ndiswrapper"
++
++#ifndef DRIVER_CONFIG_DIR
++#  define DRIVER_CONFIG_DIR PREFIX "/etc/ndiswrapper"
++#endif
++
++#define USERMOD_HELPER PREFIX "/sbin/loadndisdriver"
+ 
+ #define SSID_MAX_WPA_IE_LEN 40
+ #define NDIS_ESSID_MAX_SIZE 32