1 { lib, stdenv, fetchFromGitHub, libusb1, pkg-config }:
5 version = "2022-03-27";
7 src = fetchFromGitHub {
10 rev = "23305ce5adbb509c5cb668df31b0fd6c8759639c";
11 sha256 = "sha256-fFoC2EKSmYyW2lqrdAh5A2WEtUMCenKse2ySJdNHu6w=";
15 enableParallelBuilding = true;
17 # NOTE: _FORTIFY_SOURCE requires compiling with optimization (-O)
18 env.NIX_CFLAGS_COMPILE = "-O";
21 "DESTDIR=${placeholder "out"}"
25 substituteInPlace Makefile \
26 --replace 'pkg-config' '$(PKG_CONFIG)'
29 nativeBuildInputs = [ pkg-config ];
30 buildInputs = [ libusb1 ];
33 homepage = "https://github.com/vdudouyt/stm8flash";
34 description = "Tool for flashing STM8 MCUs via ST-LINK (V1 and V2)";
35 mainProgram = "stm8flash";
36 maintainers = with maintainers; [ pkharvey ];
37 license = licenses.gpl2;
38 platforms = platforms.all;