From eaca7f368ccefab6d6fcdaf15570fd8c9dedb410 Mon Sep 17 00:00:00 2001 From: "Yury G. Kudryashov" <urkud.urkud@gmail.com> Date: Mon, 28 Jan 2008 19:34:00 +0000 Subject: [PATCH] Added prefix patch to ndiswrapper svn path=/nixpkgs/trunk/; revision=10323 --- .../os-specific/linux/ndiswrapper/default.nix | 10 ++- .../linux/ndiswrapper/prefix.patch | 78 +++++++++++++++++++ 2 files changed, 84 insertions(+), 4 deletions(-) create mode 100644 pkgs/os-specific/linux/ndiswrapper/prefix.patch diff --git a/pkgs/os-specific/linux/ndiswrapper/default.nix b/pkgs/os-specific/linux/ndiswrapper/default.nix index 0d8b351e58b4..5138ae4f9b8f 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 000000000000..7d44c4fe7571 --- /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