haredo: enable cross compilation

This commit is contained in:
Coutinho de Souza 2024-05-16 15:31:24 -03:00
parent 0a644a5de9
commit b0960b5a97
No known key found for this signature in database
GPG Key ID: 59081FCB8F9AABB5

View File

@ -9,6 +9,9 @@
bash,
substituteAll,
}:
let
arch = stdenv.hostPlatform.uname.processor;
in
stdenv.mkDerivation (finalAttrs: {
pname = "haredo";
version = "1.0.5";
@ -41,12 +44,12 @@ stdenv.mkDerivation (finalAttrs: {
enableParallelChecking = true;
doCheck = true;
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
dontConfigure = true;
preBuild = ''
HARECACHE="$(mktemp -d --tmpdir harecache.XXXXXXXX)"
HARECACHE="$(mktemp -d)"
export HARECACHE
export PREFIX=${builtins.placeholder "out"}
'';
@ -54,7 +57,8 @@ stdenv.mkDerivation (finalAttrs: {
buildPhase = ''
runHook preBuild
./bootstrap.sh
hare build -o bin/haredo -qRa${arch} ./src
scdoc <doc/haredo.1.scd >doc/haredo.1
runHook postBuild
'';
@ -70,7 +74,10 @@ stdenv.mkDerivation (finalAttrs: {
installPhase = ''
runHook preInstall
./bootstrap.sh install
mkdir -p $out/bin
mkdir -p $out/share/man/man1
cp ./bin/haredo $out/bin
cp ./doc/haredo.1 $out/share/man/man1
runHook postInstall
'';