2024-04-21 15:54:59 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, cacert
|
|
|
|
, nixosTests
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, darwin
|
|
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "redlib";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "0.34.0";
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "redlib-org";
|
|
|
|
repo = "redlib";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-06-05 15:53:02 +00:00
|
|
|
hash = "sha256-JpuCX2ae9me+zHxQj5jqQlgDci2NV+TEVUAqnuTn3cA=";
|
2024-04-21 15:54:59 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
cargoHash = "sha256-gkRblCHUFiprZeYtu43GIGBZqCq5l/HEGaQN91XbfSs=";
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
|
|
|
darwin.apple_sdk.frameworks.Security
|
|
|
|
];
|
|
|
|
|
|
|
|
checkFlags = [
|
|
|
|
# All these test try to connect to Reddit.
|
|
|
|
"--skip=test_fetching_subreddit_quarantined"
|
|
|
|
"--skip=test_fetching_nsfw_subreddit"
|
|
|
|
"--skip=test_fetching_ws"
|
|
|
|
|
|
|
|
"--skip=test_obfuscated_share_link"
|
|
|
|
"--skip=test_share_link_strip_json"
|
|
|
|
|
|
|
|
"--skip=test_localization_popular"
|
|
|
|
"--skip=test_fetching_subreddit"
|
|
|
|
"--skip=test_fetching_user"
|
|
|
|
|
|
|
|
# These try to connect to the oauth client
|
|
|
|
"--skip=test_oauth_client"
|
|
|
|
"--skip=test_oauth_client_refresh"
|
|
|
|
"--skip=test_oauth_token_exists"
|
|
|
|
];
|
|
|
|
|
|
|
|
env = {
|
|
|
|
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
|
|
|
|
};
|
|
|
|
|
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) redlib;
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
changelog = "https://github.com/redlib-org/redlib/releases/tag/v${version}";
|
|
|
|
description = "Private front-end for Reddit (Continued fork of Libreddit)";
|
|
|
|
homepage = "https://github.com/redlib-org/redlib";
|
|
|
|
license = lib.licenses.agpl3Only;
|
|
|
|
mainProgram = "redlib";
|
|
|
|
maintainers = with lib.maintainers; [ soispha ];
|
|
|
|
};
|
|
|
|
}
|