pcmcia-utils:

- Fix udev rules.
- Accept multiple firmwares.
- Allow redefinition of arguments.

svn path=/nixpkgs/trunk/; revision=12741
This commit is contained in:
Nicolas Pierron 2008-08-27 13:59:33 +00:00
parent ae163f596e
commit 6a9944cdd9
2 changed files with 15 additions and 10 deletions

View File

@ -3,6 +3,7 @@
, sysfsutils, module_init_tools, udev
, firmware # Special pcmcia cards.
, config # Special hardware (map memory & port & irq)
, lib # used to generate postInstall script.
}:
# FIXME: should add an option to choose between hotplug and udev.
@ -18,7 +19,7 @@ stdenv.mkDerivation rec {
patchPhase = ''
sed -i "
s,/sbin/modprobe,$module_init_tools/sbin/modprobe,;
s,/sbin/modprobe,${module_init_tools}&,;
s,/lib/udev/,$out/sbin/,;
" udev/* # fix-color */
sed -i "
@ -26,18 +27,21 @@ stdenv.mkDerivation rec {
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 firmware == [] then ''sed -i "s,STARTUP = true,STARTUP = false," Makefile'' else "")
+ (if config == null then "" else ''
ln -sf ${config}/config.opts ./config/config.opts'')
ln -sf ${config} ./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'')
;
lib.concatMapStrings (path: ''
for f in : $(find ${path} -type f); do
test "$f" == ":" && continue;
ensureDir $(dirname $out/lib/firmware/$\{f#${path}});
ln -s $f $out/lib/firmware/$\{f#${path}};
done;
'') firmware;
meta = {
homepage = http://kernel.org/pub/linux/utils/kernel/pcmcia/pcmcia.html;

View File

@ -5419,12 +5419,13 @@ let
inherit stdenv fetchurl pam libxcrypt;
};
pcmciaUtils = (import ../os-specific/linux/pcmciautils) {
pcmciaUtils = composedArgsAndFun (import ../os-specific/linux/pcmciautils) {
inherit stdenv fetchurl udev yacc flex;
inherit sysfsutils module_init_tools;
firmware = getConfig ["pcmciaUtils" "firmware"] null;
firmware = getConfig ["pcmciaUtils" "firmware"] [];
config = getConfig ["pcmciaUtils" "config"] null;
inherit lib;
};
powertop = import ../os-specific/linux/powertop {