nixpkgs/pkgs/development/embedded/stm8/stm8flash/default.nix
Artturin f9fdf2d402 treewide: move NIX_CFLAGS_COMPILE to the env attrset
with structuredAttrs lists will be bash arrays which cannot be exported
which will be a issue with some patches and some wrappers like cc-wrapper

this makes it clearer that NIX_CFLAGS_COMPILE must be a string as lists
in env cause a eval failure
2023-02-22 21:23:04 +02:00

35 lines
876 B
Nix

{ lib, stdenv, fetchFromGitHub, libusb1, pkg-config }:
stdenv.mkDerivation rec {
pname = "stm8flash";
version = "2022-03-27";
src = fetchFromGitHub {
owner = "vdudouyt";
repo = "stm8flash";
rev = "23305ce5adbb509c5cb668df31b0fd6c8759639c";
sha256 = "sha256-fFoC2EKSmYyW2lqrdAh5A2WEtUMCenKse2ySJdNHu6w=";
};
strictDeps = true;
enableParallelBuilding = true;
# NOTE: _FORTIFY_SOURCE requires compiling with optimization (-O)
env.NIX_CFLAGS_COMPILE = "-O";
preBuild = ''
export DESTDIR=$out;
'';
nativeBuildInputs = [ pkg-config ];
buildInputs = [ libusb1 ];
meta = with lib; {
homepage = "https://github.com/vdudouyt/stm8flash";
description = "A tool for flashing STM8 MCUs via ST-LINK (V1 and V2)";
maintainers = with maintainers; [ pkharvey ];
license = licenses.gpl2;
platforms = platforms.all;
};
}