From 03916a2f78286bfe2868cf844f154ce4893feffe Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sat, 1 Mar 2025 22:21:33 +0100 Subject: [PATCH 1/2] distant: fix on aarch64-linux --- pkgs/by-name/di/distant/package.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/by-name/di/distant/package.nix b/pkgs/by-name/di/distant/package.nix index b6e1d8452b0f..520668646021 100644 --- a/pkgs/by-name/di/distant/package.nix +++ b/pkgs/by-name/di/distant/package.nix @@ -21,6 +21,11 @@ rustPlatform.buildRustPackage rec { hash = "sha256-DcnleJUAeYg3GSLZljC3gO9ihiFz04dzT/ddMnypr48="; }; + # error: linker `aarch64-linux-gnu-gcc` not found + postPatch = '' + rm .cargo/config.toml + ''; + useFetchCargoVendor = true; cargoHash = "sha256-HEyPfkusgk8JEYAzIS8Zj5EU0MK4wt4amlsJqBEG/Kc="; From 749492758866630de7f228d9d4496ba3c38f64e5 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sat, 1 Mar 2025 22:21:39 +0100 Subject: [PATCH 2/2] distant: modernize --- pkgs/by-name/di/distant/package.nix | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/di/distant/package.nix b/pkgs/by-name/di/distant/package.nix index 520668646021..23a9a02d7863 100644 --- a/pkgs/by-name/di/distant/package.nix +++ b/pkgs/by-name/di/distant/package.nix @@ -6,18 +6,19 @@ pkg-config, openssl, zlib, + writableTmpDirAsHomeHook, versionCheckHook, nix-update-script, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "distant"; version = "0.20.0"; src = fetchFromGitHub { owner = "chipsenkbeil"; repo = "distant"; - tag = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-DcnleJUAeYg3GSLZljC3gO9ihiFz04dzT/ddMnypr48="; }; @@ -42,9 +43,9 @@ rustPlatform.buildRustPackage rec { OPENSSL_NO_VENDOR = true; }; - preCheck = '' - export HOME=$(mktemp -d) - ''; + nativeCheckInputs = [ + writableTmpDirAsHomeHook + ]; checkFlags = [ @@ -77,11 +78,11 @@ rustPlatform.buildRustPackage rec { meta = { description = "Library and tooling that supports remote filesystem and process operations"; homepage = "https://github.com/chipsenkbeil/distant"; - changelog = "https://github.com/chipsenkbeil/distant/blob/${version}/CHANGELOG.md"; + changelog = "https://github.com/chipsenkbeil/distant/blob/${finalAttrs.version}/CHANGELOG.md"; # From the README: # "This project is licensed under either of Apache License, Version 2.0, MIT license at your option." license = lib.licenses.mit; maintainers = with lib.maintainers; [ GaetanLepage ]; mainProgram = "distant"; }; -} +})