From 4579f217834b2e5d67595f187506f3e4b4e7f3a0 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sat, 28 Dec 2024 18:06:26 +0100 Subject: [PATCH] distant: init at 0.20.0 --- pkgs/by-name/di/distant/package.nix | 81 +++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 pkgs/by-name/di/distant/package.nix diff --git a/pkgs/by-name/di/distant/package.nix b/pkgs/by-name/di/distant/package.nix new file mode 100644 index 000000000000..f9e1f8947b03 --- /dev/null +++ b/pkgs/by-name/di/distant/package.nix @@ -0,0 +1,81 @@ +{ + lib, + stdenv, + rustPlatform, + fetchFromGitHub, + pkg-config, + openssl, + zlib, + versionCheckHook, + nix-update-script, +}: + +rustPlatform.buildRustPackage rec { + pname = "distant"; + version = "0.20.0"; + + src = fetchFromGitHub { + owner = "chipsenkbeil"; + repo = "distant"; + tag = "v${version}"; + hash = "sha256-DcnleJUAeYg3GSLZljC3gO9ihiFz04dzT/ddMnypr48="; + }; + + cargoHash = "sha256-7MNNdm4b9u5YNX04nBtKcrw+phUlpzIXo0tJVfcgb40="; + + nativeBuildInputs = [ + pkg-config + ]; + + buildInputs = [ + openssl + zlib + ]; + + env = { + OPENSSL_NO_VENDOR = true; + }; + + preCheck = '' + export HOME=$(mktemp -d) + ''; + + checkFlags = + [ + # Requires network access: + # failed to lookup address information: Temporary failure in name resolution + "--skip=options::common::address::tests::resolve_should_properly_resolve_bind_address" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Timeout on darwin + # Custom { kind: TimedOut, error: "" } + "--skip=cli::api::watch::should_support_json_reporting_changes_using_correct_request_id" + "--skip=cli::api::watch::should_support_json_watching_directory_recursively" + "--skip=cli::api::watch::should_support_json_watching_single_file" + "--skip=cli::client::fs_watch::should_support_watching_a_directory_recursively" + "--skip=cli::client::fs_watch::should_support_watching_a_single_file" + ]; + + __darwinAllowLocalNetworking = true; + + nativeInstallCheckInputs = [ + versionCheckHook + ]; + versionCheckProgramArg = [ "--version" ]; + doInstallCheck = true; + + passthru = { + updateScript = nix-update-script { }; + }; + + 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"; + # 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"; + }; +}