Merge pull request #262387 from wucke13/dev/add-stlink-tool

stlink-tool: init at 0-unstable-2020-06-10
This commit is contained in:
Weijia Wang 2024-04-26 12:11:44 +02:00 committed by GitHub
commit d6c124f0ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,41 @@
{ lib
, stdenv
, pkg-config
, fetchFromGitHub
, libusb1
}:
# IMPORTANT: You need permissions to access the stlink usb devices.
# Add services.udev.packages = [ pkgs.stlink ] to your configuration.nix
stdenv.mkDerivation {
pname = "stlink-tool";
version = "0-unstable-2020-06-10";
src = fetchFromGitHub {
owner = "jeanthom";
repo = "stlink-tool";
rev = "8cbdffee012d5a782dd67d1277ed22fa889b9ba9";
hash = "sha256-1Mk4rFyIviJ9hcJo1GyzRmlPIemBJtuj3PgvnNhche0=";
fetchSubmodules = true;
};
buildInputs = [ libusb1 ];
nativeBuildInputs = [ pkg-config ];
env.NIX_CFLAGS_COMPILE = "-Wno-uninitialized";
installPhase = ''
runHook preInstall
install -D stlink-tool $out/bin/stlink-tool
runHook postInstall
'';
meta = with lib; {
description = "libusb tool for flashing chinese ST-Link dongles";
homepage = "https://github.com/jeanthom/stlink-tool";
license = licenses.mit;
platforms = platforms.unix;
maintainers = [ maintainers.wucke13 ];
mainProgram = "stlink-tool";
};
}