summary refs log tree commit diff
path: root/pkgs/os-specific/linux/pcmciautils
diff options
context:
space:
mode:
authorNicolas Pierron <nicolas.b.pierron@gmail.com>2008-07-25 15:54:19 +0000
committerNicolas Pierron <nicolas.b.pierron@gmail.com>2008-07-25 15:54:19 +0000
commit0abfffc0f28228e4029fbce032ec6c7881fc9a01 (patch)
tree2b6ac99c8b3d93d2c4f67d99ee426f874e4cc990 /pkgs/os-specific/linux/pcmciautils
parente2d94c740c165d49f73c68957809eeac8e31a025 (diff)
downloadnixpkgs-0abfffc0f28228e4029fbce032ec6c7881fc9a01.tar
nixpkgs-0abfffc0f28228e4029fbce032ec6c7881fc9a01.tar.gz
nixpkgs-0abfffc0f28228e4029fbce032ec6c7881fc9a01.tar.bz2
nixpkgs-0abfffc0f28228e4029fbce032ec6c7881fc9a01.tar.lz
nixpkgs-0abfffc0f28228e4029fbce032ec6c7881fc9a01.tar.xz
nixpkgs-0abfffc0f28228e4029fbce032ec6c7881fc9a01.tar.zst
nixpkgs-0abfffc0f28228e4029fbce032ec6c7881fc9a01.zip
Add pcmcia-utils.
Merge branch 'tmp' into tmp2

svn path=/nixpkgs/trunk/; revision=12432
Diffstat (limited to 'pkgs/os-specific/linux/pcmciautils')
-rw-r--r--pkgs/os-specific/linux/pcmciautils/default.nix51
1 files changed, 51 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/pcmciautils/default.nix b/pkgs/os-specific/linux/pcmciautils/default.nix
new file mode 100644
index 00000000000..e17d1135373
--- /dev/null
+++ b/pkgs/os-specific/linux/pcmciautils/default.nix
@@ -0,0 +1,51 @@
+{ stdenv, fetchurl
+, yacc, flex
+, sysfsutils, module_init_tools, udev
+, firmware # Special pcmcia cards.
+, config   # Special hardware (map memory & port & irq)
+}:
+
+# FIXME: should add an option to choose between hotplug and udev.
+stdenv.mkDerivation rec {
+  name = "pcmciautils-015";
+
+  src = fetchurl {
+    url = "http://kernel.org/pub/linux/utils/kernel/pcmcia/${name}.tar.bz2";
+    sha256 = "4847485c412b47e3d88fa83ef811229e0e7941217303bc8449c30a3dc2128b6e";
+  };
+
+  buildInputs = [udev yacc sysfsutils module_init_tools flex];
+
+  patchPhase = ''
+    sed -i "
+      s,/sbin/modprobe,$module_init_tools/sbin/modprobe,;
+      s,/lib/udev/,$out/sbin/,;
+    " udev/* # fix-color */
+    sed -i "
+      s,/lib/firmware,$out&,;
+      s,/etc/pcmcia,$out&,;
+    " src/{startup.c,pcmcia-check-broken-cis.c} # fix-color */
+  ''
+  + (if firmware == null then ''sed -i "s,STARTUP = true,STARTUP = false," Makefile'' else "")
+  + (if config == null then "" else ''
+    ln -sf ${config}/config.opts ./config/config.opts'')
+  ;
+
+  makeFlags = "LEX=flex";
+  installFlags = ''INSTALL=install DESTDIR=''${out}'';
+  postInstall = 
+    (if firmware == null then "" else ''
+    ensureDir $out/lib
+    ln -s ${firmware} $out/lib/firmware'')
+    ;
+
+  meta = {
+    homepage = http://kernel.org/pub/linux/utils/kernel/pcmcia/pcmcia.html;
+    longDescription = "
+      PCMCIAutils contains the initialization tools necessary to allow
+      the PCMCIA subsystem to behave (almost) as every other
+      hotpluggable bus system.
+    ";
+    license = "GPL2";
+  };
+}