acr-cli: init at 0.14 (#359508)
[NixPkgs.git] / pkgs / by-name / st / stm8flash / package.nix
blobee049d3758a2075eb7009339f3e5b91ad88f5efc
1 { lib, stdenv, fetchFromGitHub, libusb1, pkg-config }:
3 stdenv.mkDerivation {
4   pname = "stm8flash";
5   version = "2022-03-27";
7   src = fetchFromGitHub {
8     owner = "vdudouyt";
9     repo = "stm8flash";
10     rev = "23305ce5adbb509c5cb668df31b0fd6c8759639c";
11     sha256 = "sha256-fFoC2EKSmYyW2lqrdAh5A2WEtUMCenKse2ySJdNHu6w=";
12   };
14   strictDeps = true;
15   enableParallelBuilding = true;
17   # NOTE: _FORTIFY_SOURCE requires compiling with optimization (-O)
18   env.NIX_CFLAGS_COMPILE = "-O";
20   makeFlags = [
21     "DESTDIR=${placeholder "out"}"
22   ];
24   postPatch = ''
25     substituteInPlace Makefile \
26       --replace 'pkg-config' '$(PKG_CONFIG)'
27   '';
29   nativeBuildInputs = [ pkg-config ];
30   buildInputs = [ libusb1 ];
32   meta = with lib; {
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;
39   };