2019-08-05 17:58:22 +02:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, libusb1 }:
|
2013-02-23 12:05:22 +01:00
|
|
|
|
2017-02-12 03:44:29 +01:00
|
|
|
# IMPORTANT: You need permissions to access the stlink usb devices.
|
|
|
|
# Add services.udev.pkgs = [ pkgs.stlink ] to your configuration.nix
|
2013-02-23 12:05:22 +01:00
|
|
|
|
2020-02-27 17:40:28 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-13 23:52:01 +02:00
|
|
|
pname = "stlink";
|
2020-02-27 17:40:28 +01:00
|
|
|
version = "1.6.0";
|
2013-02-23 12:05:22 +01:00
|
|
|
|
2019-08-05 17:58:22 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "texane";
|
|
|
|
repo = "stlink";
|
2020-02-27 17:40:28 +01:00
|
|
|
rev = "v${version}";
|
2020-02-25 02:16:26 +01:00
|
|
|
sha256 = "1mlkrxjxg538335g59hjb0zc739dx4mhbspb26z5gz3lf7d4xv6x";
|
2013-02-23 12:05:22 +01:00
|
|
|
};
|
|
|
|
|
2017-02-12 03:44:29 +01:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -p $out/etc/udev/rules.d
|
|
|
|
mkdir -p $out/etc/modprobe.d
|
|
|
|
'';
|
2013-02-23 12:05:22 +01:00
|
|
|
|
2013-05-20 19:33:18 +02:00
|
|
|
meta = with stdenv.lib; {
|
2013-02-23 12:05:22 +01:00
|
|
|
description = "In-circuit debug and programming for ST-Link devices";
|
2013-05-20 19:33:18 +02:00
|
|
|
license = licenses.bsd3;
|
2019-05-01 18:15:33 +02:00
|
|
|
platforms = platforms.unix;
|
2017-02-12 03:44:29 +01:00
|
|
|
maintainers = [ maintainers.bjornfor maintainers.rongcuid ];
|
2013-02-23 12:05:22 +01:00
|
|
|
};
|
|
|
|
}
|