Skip to content

Commit

Permalink
stm8flash: fix cross compilation (#351900)
Browse files Browse the repository at this point in the history
  • Loading branch information
uninsane authored Nov 18, 2024
2 parents f18f448 + ebdcc36 commit d05bd77
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkgs/by-name/st/stm8flash/package.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ lib, stdenv, fetchFromGitHub, libusb1, pkg-config }:

stdenv.mkDerivation rec {
stdenv.mkDerivation {
pname = "stm8flash";
version = "2022-03-27";

Expand All @@ -17,8 +17,13 @@ stdenv.mkDerivation rec {
# NOTE: _FORTIFY_SOURCE requires compiling with optimization (-O)
env.NIX_CFLAGS_COMPILE = "-O";

preBuild = ''
export DESTDIR=$out;
makeFlags = [
"DESTDIR=${placeholder "out"}"
];

postPatch = ''
substituteInPlace Makefile \
--replace 'pkg-config' '$(PKG_CONFIG)'
'';

nativeBuildInputs = [ pkg-config ];
Expand Down

0 comments on commit d05bd77

Please sign in to comment.