stm8flash: fix cross compilation (#351900)

This commit is contained in:
Colin 2024-11-18 20:57:54 +00:00 committed by GitHub
commit d05bd77a7a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,6 @@
{ lib, stdenv, fetchFromGitHub, libusb1, pkg-config }: { lib, stdenv, fetchFromGitHub, libusb1, pkg-config }:
stdenv.mkDerivation rec { stdenv.mkDerivation {
pname = "stm8flash"; pname = "stm8flash";
version = "2022-03-27"; version = "2022-03-27";
@ -17,8 +17,13 @@ stdenv.mkDerivation rec {
# NOTE: _FORTIFY_SOURCE requires compiling with optimization (-O) # NOTE: _FORTIFY_SOURCE requires compiling with optimization (-O)
env.NIX_CFLAGS_COMPILE = "-O"; env.NIX_CFLAGS_COMPILE = "-O";
preBuild = '' makeFlags = [
export DESTDIR=$out; "DESTDIR=${placeholder "out"}"
];
postPatch = ''
substituteInPlace Makefile \
--replace 'pkg-config' '$(PKG_CONFIG)'
''; '';
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [ pkg-config ];