2021-01-23 12:26:19 +00:00
|
|
|
{ lib, stdenv, fetchurl, tcl, usb-modeswitch }:
|
2016-03-23 00:53:33 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "usb-modeswitch-data";
|
2019-12-09 23:30:38 +00:00
|
|
|
version = "20191128";
|
2016-03-23 00:53:33 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 12:41:18 +00:00
|
|
|
url = "http://www.draisberghof.de/usb_modeswitch/${pname}-${version}.tar.bz2";
|
2019-12-09 23:30:38 +00:00
|
|
|
sha256 = "1ygahl3r26r38ai8yyblq9nhf3v5i6n6r6672p5wf88wg5h9n0rz";
|
2017-02-18 03:35:25 +00:00
|
|
|
};
|
|
|
|
|
2019-05-05 08:23:32 +00:00
|
|
|
makeFlags = [
|
|
|
|
"PREFIX=$(out)"
|
|
|
|
"DESTDIR=$(out)"
|
|
|
|
];
|
2016-03-23 00:53:33 +00:00
|
|
|
|
|
|
|
prePatch = ''
|
2019-05-05 08:23:32 +00:00
|
|
|
sed -i 's@usb_modeswitch@${usb-modeswitch}/lib/udev/usb_modeswitch@g' 40-usb_modeswitch.rules
|
2016-03-23 00:53:33 +00:00
|
|
|
'';
|
|
|
|
|
2017-02-18 03:35:25 +00:00
|
|
|
# we add tcl here so we can patch in support for new devices by dropping config into
|
|
|
|
# the usb_modeswitch.d directory
|
2017-05-11 05:45:00 +00:00
|
|
|
nativeBuildInputs = [ tcl ];
|
2016-03-23 00:53:33 +00:00
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
meta = with lib; {
|
2016-06-20 10:53:46 +00:00
|
|
|
description = "Device database and the rules file for 'multi-mode' USB devices";
|
2017-02-18 03:35:25 +00:00
|
|
|
inherit (usb-modeswitch.meta) license maintainers platforms;
|
2016-03-23 00:53:33 +00:00
|
|
|
};
|
|
|
|
}
|