2024-06-05 15:53:02 +00:00
|
|
|
{ callPackage
|
|
|
|
, lib
|
2022-08-12 12:06:08 +00:00
|
|
|
, stdenv
|
2021-03-23 19:22:30 +00:00
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
|
|
|
, openssl
|
2022-08-12 12:06:08 +00:00
|
|
|
, Security
|
2024-02-29 20:09:43 +00:00
|
|
|
, SystemConfiguration
|
2024-06-05 15:53:02 +00:00
|
|
|
, testers
|
2021-03-23 19:22:30 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "lychee";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "0.15.1";
|
2021-03-23 19:22:30 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lycheeverse";
|
|
|
|
repo = pname;
|
2021-12-06 16:07:01 +00:00
|
|
|
rev = "v${version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-L1tvP2lZsFD2swhP1MetQFxxxA+EbrI4aDYTJwbpkVI=";
|
2021-03-23 19:22:30 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
cargoHash = "sha256-SQ9Dgtg3TKAaj9XkpEzA13U8CumGOlpwiW+Lv6leQW4=";
|
2021-03-23 19:22:30 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
buildInputs = [ openssl ]
|
2024-02-29 20:09:43 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ Security SystemConfiguration ];
|
2021-03-23 19:22:30 +00:00
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
checkFlags = [
|
|
|
|
# Network errors for all of these tests
|
|
|
|
# "error reading DNS system conf: No such file or directory (os error 2)" } }
|
|
|
|
"--skip=archive::wayback::tests::wayback_suggestion"
|
|
|
|
"--skip=archive::wayback::tests::wayback_suggestion_unknown_url"
|
|
|
|
"--skip=cli::test_dont_dump_data_uris_by_default"
|
|
|
|
"--skip=cli::test_dump_data_uris_in_verbose_mode"
|
|
|
|
"--skip=cli::test_exclude_example_domains"
|
|
|
|
"--skip=cli::test_local_dir"
|
|
|
|
"--skip=cli::test_local_file"
|
|
|
|
"--skip=client::tests"
|
|
|
|
"--skip=collector::tests"
|
|
|
|
"--skip=src/lib.rs"
|
|
|
|
];
|
2021-03-23 19:22:30 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
passthru.tests = {
|
|
|
|
# NOTE: These assume that testers.lycheeLinkCheck uses this exact derivation.
|
|
|
|
# Which is true most of the time, but not necessarily after overriding.
|
|
|
|
ok = callPackage ./tests/ok.nix { };
|
|
|
|
fail = callPackage ./tests/fail.nix { };
|
|
|
|
fail-emptyDirectory = callPackage ./tests/fail-emptyDirectory.nix { };
|
|
|
|
network = testers.runNixOSTest ./tests/network.nix;
|
|
|
|
};
|
|
|
|
|
2021-03-23 19:22:30 +00:00
|
|
|
meta = with lib; {
|
2024-01-13 08:15:51 +00:00
|
|
|
description = "A fast, async, stream-based link checker written in Rust";
|
2021-03-23 19:22:30 +00:00
|
|
|
homepage = "https://github.com/lycheeverse/lychee";
|
2023-08-10 07:59:29 +00:00
|
|
|
downloadPage = "https://github.com/lycheeverse/lychee/releases/tag/v${version}";
|
2021-03-23 19:22:30 +00:00
|
|
|
license = with licenses; [ asl20 mit ];
|
2023-08-10 07:59:29 +00:00
|
|
|
maintainers = with maintainers; [ totoroot tuxinaut ];
|
2024-02-29 20:09:43 +00:00
|
|
|
mainProgram = "lychee";
|
2021-03-23 19:22:30 +00:00
|
|
|
};
|
|
|
|
}
|