stlink: inline libusb-static

This is a stlink-specific detail, and doesn't need to be in
top-level.nix
This commit is contained in:
Florian Klink 2020-04-24 23:55:18 +02:00
parent d0e4ecb182
commit dd03e76f61
2 changed files with 8 additions and 7 deletions

View file

@ -1,9 +1,13 @@
{ stdenv, fetchFromGitHub, cmake, libusb1 }:
# IMPORTANT: You need permissions to access the stlink usb devices.
let
# The Darwin build of stlink explicitly refers to static libusb.
libusb1' = if stdenv.isDarwin then libusb1.override { withStatic = true; } else libusb1;
# IMPORTANT: You need permissions to access the stlink usb devices.
# Add services.udev.pkgs = [ pkgs.stlink ] to your configuration.nix
stdenv.mkDerivation rec {
in stdenv.mkDerivation rec {
pname = "stlink";
version = "1.6.0";
@ -14,7 +18,7 @@ stdenv.mkDerivation rec {
sha256 = "1mlkrxjxg538335g59hjb0zc739dx4mhbspb26z5gz3lf7d4xv6x";
};
buildInputs = [ cmake libusb1 ];
buildInputs = [ cmake libusb1' ];
patchPhase = ''
sed -i 's@/etc/udev/rules.d@$ENV{out}/etc/udev/rules.d@' CMakeLists.txt
sed -i 's@/etc/modprobe.d@$ENV{out}/etc/modprobe.d@' CMakeLists.txt

View file

@ -14614,10 +14614,7 @@ in
stfl = callPackage ../development/libraries/stfl { };
stlink = callPackage ../development/tools/misc/stlink {
# The Darwin build of stlink explicitly refers to static libusb.
libusb1 = if stdenv.isDarwin then libusb1.override { withStatic = true; } else libusb1;
};
stlink = callPackage ../development/tools/misc/stlink { };
steghide = callPackage ../tools/security/steghide {};