Commit bdade1b8 authored by Colin's avatar Colin
Browse files

passt: support cross compilation

parent 7370c678
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
{ lib
, stdenv
, buildPackages
, fetchurl
, getconf
, gitUpdater
, testers
}:
@@ -14,6 +16,12 @@ stdenv.mkDerivation (finalAttrs: {
    hash = "sha256-UK3Klpo3cp4EH42W16qh5WbZlCxb+ETQtWbpgatL/Dc=";
  };

  postPatch = ''
    substituteInPlace Makefile --replace-fail \
      'PAGE_SIZE=$(shell getconf PAGE_SIZE)' \
      "PAGE_SIZE=$(${stdenv.hostPlatform.emulator buildPackages} ${lib.getExe getconf} PAGE_SIZE)"
  '';

  makeFlags = [
    "prefix=${placeholder "out"}"
    "VERSION=${finalAttrs.version}"