Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, fetchurl, tcl, usb-modeswitch }:
2
3stdenv.mkDerivation rec {
4 pname = "usb-modeswitch-data";
5 version = "20191128";
6
7 src = fetchurl {
8 url = "http://www.draisberghof.de/usb_modeswitch/${pname}-${version}.tar.bz2";
9 sha256 = "1ygahl3r26r38ai8yyblq9nhf3v5i6n6r6672p5wf88wg5h9n0rz";
10 };
11
12 makeFlags = [
13 "PREFIX=$(out)"
14 "DESTDIR=$(out)"
15 ];
16
17 prePatch = ''
18 sed -i 's@usb_modeswitch@${usb-modeswitch}/lib/udev/usb_modeswitch@g' 40-usb_modeswitch.rules
19 '';
20
21 # we add tcl here so we can patch in support for new devices by dropping config into
22 # the usb_modeswitch.d directory
23 nativeBuildInputs = [ tcl ];
24
25 meta = with lib; {
26 description = "Device database and the rules file for 'multi-mode' USB devices";
27 inherit (usb-modeswitch.meta) license maintainers platforms;
28 };
29}