diff --git a/pkgs/development/tools/misc/stlink/default.nix b/pkgs/development/tools/misc/stlink/default.nix index 27e5437d9517f..b88b06393fed5 100644 --- a/pkgs/development/tools/misc/stlink/default.nix +++ b/pkgs/development/tools/misc/stlink/default.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + fetchpatch, cmake, libusb1, gtk3, @@ -30,6 +31,15 @@ stdenv.mkDerivation rec { sha256 = "sha256-hlFI2xpZ4ldMcxZbg/T5/4JuFFdO9THLcU0DQKSFqrw="; }; + patches = [ + (fetchpatch { + name = "calloc-argument-order.patch"; + url = "https://github.com/stlink-org/stlink/commit/6a6718b3342b6c5e282a4e33325b9f97908a0692.patch"; + includes = [ "src/stlink-lib/chipid.c" ]; + sha256 = "sha256-sAfcrDdoKy5Gl1o/PHEUr8uL9OBq0g1nfRe7Y0ijWAM="; + }) + ]; + buildInputs = [ libusb1'