3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/tools/misc/stlink/default.nix

36 lines
1 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, cmake, libusb1 }:
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.packages = [ pkgs.stlink ] to your configuration.nix
in stdenv.mkDerivation rec {
2019-08-13 22:52:01 +01:00
pname = "stlink";
2020-08-12 20:16:20 +01:00
version = "1.7.0";
src = fetchFromGitHub {
2020-08-12 20:16:20 +01:00
owner = "stlink-org";
repo = "stlink";
2020-02-27 16:40:28 +00:00
rev = "v${version}";
2020-08-12 20:16:20 +01:00
sha256 = "03xypffpbp4imrczbxmq69vgkr7mbp0ps9dk815br5wwlz6vgygl";
};
2020-04-24 22:56:39 +01:00
buildInputs = [ libusb1' ];
nativeBuildInputs = [ cmake ];
2020-08-12 20:16:20 +01:00
cmakeFlags = [
"-DSTLINK_MODPROBED_DIR=${placeholder "out"}/etc/modprobe.d"
"-DSTLINK_UDEV_RULES_DIR=${placeholder "out"}/lib/udev/rules.d"
];
meta = with lib; {
description = "In-circuit debug and programming for ST-Link devices";
license = licenses.bsd3;
platforms = platforms.unix;
maintainers = [ maintainers.bjornfor maintainers.rongcuid ];
};
}