memstream: cross-compilation fixes

- Use `$(CC)` to pick up the prefixed compiler automatically; and
- Only run check phase when the builder can execute host binaries.
This commit is contained in:
Randy Eckenrode 2024-09-22 22:52:46 -04:00
parent 7306ea41bd
commit 5709115ac9
No known key found for this signature in database
GPG Key ID: 64C1CD4EC2A600D9

View File

@ -9,13 +9,18 @@ stdenv.mkDerivation rec {
sha256 = "0kvdb897g7nyviaz72arbqijk2g2wa61cmi3l5yh48rzr49r3a3a";
};
postPatch = ''
substituteInPlace Makefile \
--replace-fail 'cc' '$(CC)'
'';
dontConfigure = true;
postBuild = ''
$AR rcs libmemstream.a memstream.o
'';
doCheck = true;
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
checkPhase = ''
runHook preCheck