Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, fetchFromGitHub, libusb1, pkg-config }:
2
3stdenv.mkDerivation rec {
4 pname = "stm8flash";
5 version = "2022-03-27";
6
7 src = fetchFromGitHub {
8 owner = "vdudouyt";
9 repo = "stm8flash";
10 rev = "23305ce5adbb509c5cb668df31b0fd6c8759639c";
11 sha256 = "sha256-fFoC2EKSmYyW2lqrdAh5A2WEtUMCenKse2ySJdNHu6w=";
12 };
13
14 strictDeps = true;
15 enableParallelBuilding = true;
16
17 # NOTE: _FORTIFY_SOURCE requires compiling with optimization (-O)
18 env.NIX_CFLAGS_COMPILE = "-O";
19
20 preBuild = ''
21 export DESTDIR=$out;
22 '';
23
24 nativeBuildInputs = [ pkg-config ];
25 buildInputs = [ libusb1 ];
26
27 meta = with lib; {
28 homepage = "https://github.com/vdudouyt/stm8flash";
29 description = "A tool for flashing STM8 MCUs via ST-LINK (V1 and V2)";
30 maintainers = with maintainers; [ pkharvey ];
31 license = licenses.gpl2;
32 platforms = platforms.all;
33 };
34}