2008-07-25 16:54:19 +01:00
|
|
|
{ stdenv, fetchurl
|
|
|
|
, yacc, flex
|
2016-04-22 08:40:57 +01:00
|
|
|
, sysfsutils, kmod, udev
|
2008-07-25 16:54:19 +01:00
|
|
|
, firmware # Special pcmcia cards.
|
|
|
|
, config # Special hardware (map memory & port & irq)
|
2008-08-27 14:59:33 +01:00
|
|
|
, lib # used to generate postInstall script.
|
2008-07-25 16:54:19 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
# FIXME: should add an option to choose between hotplug and udev.
|
|
|
|
stdenv.mkDerivation rec {
|
2015-02-05 14:13:05 +00:00
|
|
|
name = "pcmciautils-017";
|
2008-07-25 16:54:19 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-02-05 14:13:05 +00:00
|
|
|
url = "https://kernel.org/pub/linux/utils/kernel/pcmcia/${name}.tar.gz";
|
|
|
|
sha256 = "5d8e2efad8a7f692129610603da232f2144851753d8d49a70eeb8eb1be6f6bc3";
|
2008-07-25 16:54:19 +01:00
|
|
|
};
|
|
|
|
|
2016-04-22 08:40:57 +01:00
|
|
|
buildInputs = [udev yacc sysfsutils kmod flex];
|
2008-07-25 16:54:19 +01:00
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
sed -i "
|
2016-04-22 08:40:57 +01:00
|
|
|
s,/sbin/modprobe,${kmod}&,;
|
2008-07-25 16:54:19 +01:00
|
|
|
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 */
|
|
|
|
''
|
2008-08-27 14:59:33 +01:00
|
|
|
+ (if firmware == [] then ''sed -i "s,STARTUP = true,STARTUP = false," Makefile'' else "")
|
2008-07-25 16:54:19 +01:00
|
|
|
+ (if config == null then "" else ''
|
2008-08-27 14:59:33 +01:00
|
|
|
ln -sf ${config} ./config/config.opts'')
|
2008-07-25 16:54:19 +01:00
|
|
|
;
|
|
|
|
|
|
|
|
makeFlags = "LEX=flex";
|
|
|
|
installFlags = ''INSTALL=install DESTDIR=''${out}'';
|
2008-08-27 14:59:33 +01:00
|
|
|
postInstall =
|
|
|
|
lib.concatMapStrings (path: ''
|
|
|
|
for f in : $(find ${path} -type f); do
|
|
|
|
test "$f" == ":" && continue;
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $(dirname $out/lib/firmware/$\{f#${path}});
|
2008-08-27 14:59:33 +01:00
|
|
|
ln -s $f $out/lib/firmware/$\{f#${path}};
|
|
|
|
done;
|
|
|
|
'') firmware;
|
2008-07-25 16:54:19 +01:00
|
|
|
|
|
|
|
meta = {
|
2015-02-05 14:13:05 +00:00
|
|
|
homepage = https://www.kernel.org/pub/linux/utils/kernel/pcmcia/;
|
2008-07-25 16:54:19 +01:00
|
|
|
longDescription = "
|
|
|
|
PCMCIAutils contains the initialization tools necessary to allow
|
|
|
|
the PCMCIA subsystem to behave (almost) as every other
|
|
|
|
hotpluggable bus system.
|
|
|
|
";
|
2014-06-19 05:19:00 +01:00
|
|
|
license = stdenv.lib.licenses.gpl2;
|
2016-08-02 18:50:55 +01:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2008-07-25 16:54:19 +01:00
|
|
|
};
|
|
|
|
}
|