From b0960b5a9793140217686ad866160a1a1ae9d4d6 Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Thu, 16 May 2024 15:31:24 -0300 Subject: [PATCH] haredo: enable cross compilation --- pkgs/by-name/ha/haredo/package.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/ha/haredo/package.nix b/pkgs/by-name/ha/haredo/package.nix index a6db89149eb8..e722d11eafd5 100644 --- a/pkgs/by-name/ha/haredo/package.nix +++ b/pkgs/by-name/ha/haredo/package.nix @@ -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 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 '';