lol
1{ stdenv, fetchurl, autoconf, automake, libtool, pkgconfig, libusb1 }:
2
3# IMPORTANT: You need permissions to access the stlink usb devices. Here are
4# example udev rules for stlink v1 and v2 so you don't need to have root
5# permissions (copied from <stlink>/49-stlink*.rules):
6#
7# SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3744", MODE:="0666", SYMLINK+="stlinkv1_%n"
8# SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748", MODE:="0666", SYMLINK+="stlinkv2_%n"
9
10let
11 version = "1.1.0";
12in
13stdenv.mkDerivation {
14 name = "stlink-${version}";
15
16 src = fetchurl {
17 url = "https://github.com/texane/stlink/archive/${version}.tar.gz";
18 sha256 = "0b38a32ids9dpnz5h892l279fz8y1zzqk1qsnyhl1nm03p7xzi1s";
19 };
20
21 buildInputs = [ autoconf automake libtool pkgconfig libusb1 ];
22 preConfigure = "./autogen.sh";
23
24 meta = with stdenv.lib; {
25 description = "In-circuit debug and programming for ST-Link devices";
26 license = licenses.bsd3;
27 platforms = platforms.linux;
28 maintainers = [ maintainers.bjornfor ];
29 };
30}