Skip to content

Commit

Permalink
stm8flash: fix cross compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
NickCao committed Oct 28, 2024
1 parent 1864118 commit 5c94383
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkgs/development/embedded/stm8/stm8flash/default.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 5c94383

Please sign in to comment.