summary refs log tree commit diff
path: root/pkgs/development/tools/misc/stlink/default.nix
blob: 675f8f7f2af6d4e91bdbd3bfb30d89b240bb2ecf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{ stdenv, fetchgit, autoconf, automake, libtool, pkgconfig, libusb1 }:

# IMPORTANT: You need permissions to access the stlink usb devices. Here are
# example udev rules for stlink v1 and v2 so you don't need to have root
# permissions (copied from <stlink>/49-stlink*.rules):
#
# SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3744", MODE:="0666", SYMLINK+="stlinkv1_%n"
# SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748", MODE:="0666", SYMLINK+="stlinkv2_%n"

stdenv.mkDerivation {
  name = "stlink-git20130306";

  src = fetchgit {
    url = git://github.com/texane/stlink.git;
    rev = "5be889e3feb75fc7f594012c4855b4dc16940050";
  };

  buildInputs = [ autoconf automake libtool pkgconfig libusb1 ];
  preConfigure = "./autogen.sh";

  meta = with stdenv.lib; {
    description = "In-circuit debug and programming for ST-Link devices";
    license = licenses.bsd3;
    platforms = platforms.linux;
    maintainers = [maintainers.bjornfor];
  };
}