2023-03-04 12:14:45 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, openssl
|
|
|
|
, pkg-config
|
2023-03-24 00:07:29 +00:00
|
|
|
, stdenv
|
|
|
|
, darwin
|
2024-07-31 10:19:44 +00:00
|
|
|
, nix-update-script
|
|
|
|
, testers
|
|
|
|
, speedtest-rs
|
2023-03-04 12:14:45 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "speedtest-rs";
|
2024-07-31 10:19:44 +00:00
|
|
|
version = "0.2.0";
|
2023-03-04 12:14:45 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nelsonjchen";
|
2024-07-31 10:19:44 +00:00
|
|
|
repo = "speedtest-rs";
|
2023-03-04 12:14:45 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-07-31 10:19:44 +00:00
|
|
|
hash = "sha256-1FAFYiWDD/KG/7/UTv/EW6Nj2GnU0GZFFq6ouMc0URA=";
|
2023-03-04 12:14:45 +00:00
|
|
|
};
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
buildInputs = [ openssl ] ++
|
2024-09-26 11:04:55 +00:00
|
|
|
lib.optionals stdenv.hostPlatform.isDarwin [
|
2024-02-29 20:09:43 +00:00
|
|
|
darwin.apple_sdk.frameworks.Security
|
|
|
|
darwin.apple_sdk.frameworks.SystemConfiguration
|
|
|
|
];
|
2023-03-04 12:14:45 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
|
2024-07-31 10:19:44 +00:00
|
|
|
cargoHash = "sha256-0YPCBzidE1+LgIYk457eSoerLvQuuZs9cTd7uUt1Lr8=";
|
2023-03-04 12:14:45 +00:00
|
|
|
|
2024-07-31 10:19:44 +00:00
|
|
|
# Fail for unclear reasons (only on darwin)
|
2024-09-26 11:04:55 +00:00
|
|
|
checkFlags = lib.optionals stdenv.hostPlatform.isDarwin [
|
2024-07-31 10:19:44 +00:00
|
|
|
"--skip=speedtest::tests::test_get_configuration"
|
|
|
|
"--skip=speedtest::tests::test_get_server_list_with_config"
|
|
|
|
];
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
updateScript = nix-update-script { };
|
|
|
|
tests.version = testers.testVersion { package = speedtest-rs; };
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
2023-03-04 12:14:45 +00:00
|
|
|
description = "Command line internet speedtest tool written in rust";
|
|
|
|
homepage = "https://github.com/nelsonjchen/speedtest-rs";
|
|
|
|
changelog = "https://github.com/nelsonjchen/speedtest-rs/blob/v${version}/CHANGELOG.md";
|
2024-07-31 10:19:44 +00:00
|
|
|
license = with lib.licenses; [ mit asl20 ];
|
|
|
|
maintainers = with lib.maintainers; [ GaetanLepage ];
|
2024-02-29 20:09:43 +00:00
|
|
|
mainProgram = "speedtest-rs";
|
2023-03-04 12:14:45 +00:00
|
|
|
};
|
|
|
|
}
|