From 643c82b0140984a002414da5a1ef87ac25ae3870 Mon Sep 17 00:00:00 2001 From: pkharvey Date: Mon, 26 Sep 2022 23:49:58 +0100 Subject: [PATCH] stm8flash: init at 2022-03-27 --- .../embedded/stm8/stm8flash/default.nix | 34 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 pkgs/development/embedded/stm8/stm8flash/default.nix diff --git a/pkgs/development/embedded/stm8/stm8flash/default.nix b/pkgs/development/embedded/stm8/stm8flash/default.nix new file mode 100644 index 000000000000..eaf1a19c91bc --- /dev/null +++ b/pkgs/development/embedded/stm8/stm8flash/default.nix @@ -0,0 +1,34 @@ +{ 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) + 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; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1b7297191de4..63cd17e58ebc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17361,6 +17361,8 @@ with pkgs; stm32flash = callPackage ../development/embedded/stm32/stm32flash { }; + stm8flash = callPackage ../development/embedded/stm8/stm8flash { }; + strace = callPackage ../development/tools/misc/strace { }; stylua = callPackage ../development/tools/stylua { };