Unverified Commit d05bd77a authored by Colin's avatar Colin Committed by GitHub
Browse files

stm8flash: fix cross compilation (#351900)

parents f18f4480 ebdcc360
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
{ lib, stdenv, fetchFromGitHub, libusb1, pkg-config }:

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

@@ -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 ];