From e96e07ac218e6d57fbb4ac481fed25524942c47c Mon Sep 17 00:00:00 2001 From: Colin Date: Tue, 19 Dec 2023 19:39:11 +0000 Subject: [PATCH] lemoa: todo: fold --- overlays/cross.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/overlays/cross.nix b/overlays/cross.nix index 29cbdeda4..e6e01aef2 100644 --- a/overlays/cross.nix +++ b/overlays/cross.nix @@ -1253,6 +1253,24 @@ in with final; { # ``` # koreader-from-src = needsBinfmt prev.koreader-from-src; + lemoa = prev.lemoa.overrideAttrs (upstream: + let + rustTargetPlatform = rust.toRustTarget stdenv.hostPlatform; + in { + # nixpkgs sets CARGO_BUILD_TARGET to the build platform target, so correct that. + buildPhase = '' + runHook preBuild + + mkdir -p target/release + ln -s ../${rustTargetPlatform}/release/lemoa target/release/lemoa + + ${rust.envVars.setEnv} "CARGO_BUILD_TARGET=${rustTargetPlatform}" ninja -j$NIX_BUILD_CORES + + runHook postBuild + ''; + } + ); + # libgweather = rmNativeInputs [ glib ] (prev.libgweather.override { # # alternative to emulating python3 is to specify it in `buildInputs` instead of `nativeBuildInputs` (upstream), # # but presumably that's just a different way to emulate it.