summary refs log tree commit diff
path: root/pkgs/os-specific/linux/spl
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/linux/spl')
-rw-r--r--pkgs/os-specific/linux/spl/default.nix39
-rw-r--r--pkgs/os-specific/linux/spl/install_prefix.patch19
-rw-r--r--pkgs/os-specific/linux/spl/install_prefix_2.patch32
-rw-r--r--pkgs/os-specific/linux/spl/module_prefix.patch33
-rw-r--r--pkgs/os-specific/linux/spl/spl-0.6.0.nix24
5 files changed, 147 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/spl/default.nix b/pkgs/os-specific/linux/spl/default.nix
new file mode 100644
index 000000000000..96565fffa0ee
--- /dev/null
+++ b/pkgs/os-specific/linux/spl/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, kernel, perl, autoconf, automake, libtool, coreutils, gawk }:
+
+stdenv.mkDerivation {
+  name = "spl-0.6.0-rc11";
+  src = fetchurl {
+    url = http://github.com/downloads/zfsonlinux/spl/spl-0.6.0-rc11.tar.gz;
+    sha256 = "0brsrr9hvzlpx7a26nn8rw9k2kh9s75hmxp6h087hi64hzxysf8g";
+  };
+
+  patches = [ ./install_prefix.patch ./install_prefix_2.patch ./module_prefix.patch ];
+
+  buildInputs = [ perl kernel autoconf automake libtool ];
+
+  NIX_CFLAGS_COMPILE = "-I${kernel}/lib/modules/${kernel.modDirVersion}/build/include/generated";
+
+  preConfigure = ''
+    ./autogen.sh
+
+    substituteInPlace ./module/spl/spl-generic.c --replace /usr/bin/hostid   hostid
+    substituteInPlace ./module/spl/spl-module.c  --replace /bin/mknod        mknod 
+
+    substituteInPlace ./module/spl/spl-generic.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:${gawk}:/bin"
+    substituteInPlace ./module/spl/spl-module.c  --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:/bin"
+    substituteInPlace ./module/splat/splat-vnode.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:/bin"
+  '';
+
+  configureFlags = ''
+     --with-linux=${kernel}/lib/modules/${kernel.version}/build
+     --with-linux-obj=${kernel}/lib/modules/${kernel.version}/build
+  '';
+
+  meta = {
+    description = "Kernel module driver for solaris porting layer (needed by in-kernel zfs)";
+    homepage = http://zfsonlinux.org/;
+    platforms = stdenv.lib.platforms.linux;
+    license = stdenv.lib.licenses.cddl;
+    maintainers = with stdenv.lib.maintainers; [ jcumming ];
+  };
+}
diff --git a/pkgs/os-specific/linux/spl/install_prefix.patch b/pkgs/os-specific/linux/spl/install_prefix.patch
new file mode 100644
index 000000000000..9a7393b7170c
--- /dev/null
+++ b/pkgs/os-specific/linux/spl/install_prefix.patch
@@ -0,0 +1,19 @@
+*** spl-0.6.0-rc10/Makefile.am.old	Fri Aug 17 14:49:16 2012
+--- spl-0.6.0-rc10/Makefile.am	Fri Aug 17 14:51:06 2012
+***************
+*** 32,38 ****
+  if CONFIG_KERNEL
+  install-data-local:
+  	release=$(SPL_META_VERSION)-$(SPL_META_RELEASE); \
+! 	instdest=$(DESTDIR)/usr/src/spl-$$release/$(LINUX_VERSION); \
+  	for instfile in $(noinst_HEADERS) module/$(LINUX_SYMBOLS); do \
+  		$(INSTALL) -D $$instfile $$instdest/$$instfile; \
+  	done
+--- 32,38 ----
+  if CONFIG_KERNEL
+  install-data-local:
+  	release=$(SPL_META_VERSION)-$(SPL_META_RELEASE); \
+! 	instdest=$(DESTDIR)/@libexecdir@/spl/$(LINUX_VERSION); \
+  	for instfile in $(noinst_HEADERS) module/$(LINUX_SYMBOLS); do \
+  		$(INSTALL) -D $$instfile $$instdest/$$instfile; \
+  	done
diff --git a/pkgs/os-specific/linux/spl/install_prefix_2.patch b/pkgs/os-specific/linux/spl/install_prefix_2.patch
new file mode 100644
index 000000000000..6068ad1d69c2
--- /dev/null
+++ b/pkgs/os-specific/linux/spl/install_prefix_2.patch
@@ -0,0 +1,32 @@
+*** git-export/include/Makefile.am	Tue Mar  6 00:05:28 2012
+--- git-export/include/Makefile.am.new	Tue Mar  6 00:04:46 2012
+***************
+*** 16,22 ****
+  
+  install-data-local:
+  	release=$(SPL_META_VERSION)-$(SPL_META_RELEASE); \
+! 	instdest=$(DESTDIR)/usr/src/spl-$$release/$(LINUX_VERSION); \
+  	instfiles=`find . -name '*.h'`; \
+          for instfile in $$instfiles; do \
+  		$(INSTALL) -D $$instfile $$instdest/$$instfile; \
+--- 16,22 ----
+  
+  install-data-local:
+  	release=$(SPL_META_VERSION)-$(SPL_META_RELEASE); \
+! 	instdest=$(DESTDIR)/@libexecdir@/spl/$(LINUX_VERSION); \
+  	instfiles=`find . -name '*.h'`; \
+          for instfile in $$instfiles; do \
+  		$(INSTALL) -D $$instfile $$instdest/$$instfile; \
+***************
+*** 24,28 ****
+  
+  uninstall-local:
+  	release=$(SPL_META_VERSION)-$(SPL_META_RELEASE); \
+! 	instdest=$(DESTDIR)/usr/src/spl-$$release/$(LINUX_VERSION); \
+  	$(RM) -R $$instdest
+--- 24,28 ----
+  
+  uninstall-local:
+  	release=$(SPL_META_VERSION)-$(SPL_META_RELEASE); \
+! 	instdest=$(DESTDIR)/@libexecdir@/spl/$(LINUX_VERSION); \
+  	$(RM) -R $$instdest
diff --git a/pkgs/os-specific/linux/spl/module_prefix.patch b/pkgs/os-specific/linux/spl/module_prefix.patch
new file mode 100644
index 000000000000..dd40711ccdb8
--- /dev/null
+++ b/pkgs/os-specific/linux/spl/module_prefix.patch
@@ -0,0 +1,33 @@
+*** git-export/module/Makefile.in	Wed Dec 31 16:00:01 1969
+--- git-export/module/Makefile.in.new	Sat Jan 28 21:42:06 2012
+***************
+*** 17,30 ****
+  modules_install:
+  	@# Install the kernel modules
+  	$(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` \
+! 		INSTALL_MOD_PATH=$(DESTDIR) \
+  		INSTALL_MOD_DIR=addon/spl $@
+  	@# Remove extraneous build products when packaging
+! 	if [ -n "$(DESTDIR)" ]; then \
+! 		find $(DESTDIR)/lib/modules/@LINUX_VERSION@ \
+  			-name 'modules.*' | xargs $(RM); \
+  	fi
+! 	sysmap=$(DESTDIR)/boot/System.map-@LINUX_VERSION@; \
+  	if [ -f $$sysmap ]; then \
+  		depmod -ae -F $$sysmap @LINUX_VERSION@; \
+  	fi
+--- 17,30 ----
+  modules_install:
+  	@# Install the kernel modules
+  	$(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` \
+! 		INSTALL_MOD_PATH=@prefix@ \
+  		INSTALL_MOD_DIR=addon/spl $@
+  	@# Remove extraneous build products when packaging
+! 	if [ -n "@prefix@" ]; then \
+! 		find @prefix@/lib/modules/@LINUX_VERSION@ \
+  			-name 'modules.*' | xargs $(RM); \
+  	fi
+! 	sysmap=@prefix@/boot/System.map-@LINUX_VERSION@; \
+  	if [ -f $$sysmap ]; then \
+  		depmod -ae -F $$sysmap @LINUX_VERSION@; \
+  	fi
diff --git a/pkgs/os-specific/linux/spl/spl-0.6.0.nix b/pkgs/os-specific/linux/spl/spl-0.6.0.nix
new file mode 100644
index 000000000000..c174daad26b5
--- /dev/null
+++ b/pkgs/os-specific/linux/spl/spl-0.6.0.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchgit, kernel, linuxHeaders, perl }:
+
+stdenv.mkDerivation {
+  name = "spl-0.6.0-rc4";
+  src = fetchgit {
+    url = git://github.com/behlendorf/spl.git;
+    rev = "dde6b7b137f56894a457";
+    sha256 = "c402517a647de0c22a69588219aa214f96d1cf9d2f8751b99c5a2795898c726b";
+  };
+
+  patches = [ ./install_prefix.patch ./module_prefix.patch ];
+
+  buildInputs = [ perl kernel linuxHeaders ];
+
+  configureFlags = [ "--with-linux=${kernel}/lib/modules/${kernel.version}/build" 
+                     "--with-linux-obj=${kernel}/lib/modules/${kernel.version}/build" ];
+
+  meta = {
+    description = "Kernel module driver for solaris porting layer (needed by in-kernel zfs)";
+    homepage = http://zfsonlinux.org/;
+    license = "CDDL";
+    platforms = stdenv.lib.platforms.linux;
+  };
+}