passt: support cross compilation (#334097)

This commit is contained in:
Nick Cao 2024-11-13 09:03:18 -05:00 committed by GitHub
commit 8ee63a651d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,8 @@
{ lib { lib
, stdenv , stdenv
, buildPackages
, fetchurl , fetchurl
, getconf
, gitUpdater , gitUpdater
, testers , testers
}: }:
@ -14,6 +16,12 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-Qf1neJOkYXR5p9Owk60qtc22A+au4EY45Qt9PfJ+Lrs="; hash = "sha256-Qf1neJOkYXR5p9Owk60qtc22A+au4EY45Qt9PfJ+Lrs=";
}; };
postPatch = ''
substituteInPlace Makefile --replace-fail \
'PAGE_SIZE=$(shell getconf PAGE_SIZE)' \
"PAGE_SIZE=$(${stdenv.hostPlatform.emulator buildPackages} ${lib.getExe getconf} PAGE_SIZE)"
'';
makeFlags = [ makeFlags = [
"prefix=${placeholder "out"}" "prefix=${placeholder "out"}"
"VERSION=${finalAttrs.version}" "VERSION=${finalAttrs.version}"