barebones usb_modeswitch package

This commit is contained in:
Daniel Barlow 2024-05-14 12:56:58 +01:00 committed by Raito Bezarius
parent fc9cb8e07d
commit 9cb73f3fec
3 changed files with 42 additions and 0 deletions

View file

@ -271,6 +271,8 @@ extraPkgs // {
'';
};
libusb1 = prev.libusb1.override { enableUdev = false; };
util-linux-small = prev.util-linux.override {
ncursesSupport = false;
pamSupport = false;

View file

@ -110,6 +110,7 @@ in {
systemconfig = callPackage ./systemconfig {};
tufted = callPackage ./tufted {};
uevent-watch = callPackage ./uevent-watch {};
usb-modeswitch = callPackage ./usb-modeswitch {};
writeAshScript = callPackage ./write-ash-script {};
writeFennel = callPackage ./write-fennel {};
writeFennelScript = callPackage ./write-fennel-script {};

View file

@ -0,0 +1,39 @@
# usb modeswitch without udev, tcl, coreutils, bash dependencies
{ stdenv
, lib
, fetchurl
, pkg-config
, libusb1
}:
let
pname = "usb-modeswitch";
version = "2.6.0";
in stdenv.mkDerivation {
inherit pname version;
src = fetchurl {
url = "http://www.draisberghof.de/usb_modeswitch/${pname}-${version}.tar.bz2";
sha256 = "18wbbxc5cfsmikba0msdvd5qlaga27b32nhrzicyd9mdddp265f2";
};
preBuild = ''
makeFlagsArray+=(LIBS="$($PKG_CONFIG --libs --cflags libusb-1.0)")
'';
makeFlags = [
"PREFIX=$(out)"
"usb_modeswitch"
];
buildInputs = [ libusb1 ];
nativeBuildInputs = [ pkg-config ];
installPhase = ''
mkdir -p $out/bin
cp usb_modeswitch $out/bin
'';
meta = {
license = lib.licenses.gpl2;
maintainers = [];
};
}