571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
54 lines
1.4 KiB
Nix
54 lines
1.4 KiB
Nix
{ lib
|
|
, rustPlatform
|
|
, fetchFromGitHub
|
|
, openssl
|
|
, pkg-config
|
|
, stdenv
|
|
, darwin
|
|
, nix-update-script
|
|
, testers
|
|
, speedtest-rs
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "speedtest-rs";
|
|
version = "0.2.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "nelsonjchen";
|
|
repo = "speedtest-rs";
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-1FAFYiWDD/KG/7/UTv/EW6Nj2GnU0GZFFq6ouMc0URA=";
|
|
};
|
|
|
|
buildInputs = [ openssl ] ++
|
|
lib.optionals stdenv.hostPlatform.isDarwin [
|
|
darwin.apple_sdk.frameworks.Security
|
|
darwin.apple_sdk.frameworks.SystemConfiguration
|
|
];
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
cargoHash = "sha256-0YPCBzidE1+LgIYk457eSoerLvQuuZs9cTd7uUt1Lr8=";
|
|
|
|
# Fail for unclear reasons (only on darwin)
|
|
checkFlags = lib.optionals stdenv.hostPlatform.isDarwin [
|
|
"--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 = {
|
|
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";
|
|
license = with lib.licenses; [ mit asl20 ];
|
|
maintainers = with lib.maintainers; [ GaetanLepage ];
|
|
mainProgram = "speedtest-rs";
|
|
};
|
|
}
|