2023-08-04 22:07:22 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
2024-09-19 14:19:46 +00:00
|
|
|
, fetchurl
|
2023-08-04 22:07:22 +00:00
|
|
|
, pkg-config
|
|
|
|
, bzip2
|
|
|
|
, openssl
|
|
|
|
, zstd
|
|
|
|
, stdenv
|
|
|
|
, darwin
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "rtz";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "0.7.0";
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "twitchax";
|
|
|
|
repo = "rtz";
|
|
|
|
rev = "v${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-Wfb3FEZHjWYUtRI4Qn3QNunIXuzW1AIEZkIvtVrjBPs=";
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
|
|
|
"bincode-2.0.0-rc.3" = "sha256-YCoTnIKqRObeyfTanjptTYeD9U2b2c+d4CJFWIiGckI=";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
swagger-ui = fetchurl {
|
|
|
|
url = "https://github.com/juhaku/utoipa/raw/master/utoipa-swagger-ui-vendored/res/v5.17.12.zip";
|
|
|
|
hash = "sha256-HK4z/JI+1yq8BTBJveYXv9bpN/sXru7bn/8g5mf2B/I=";
|
|
|
|
};
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
bzip2
|
|
|
|
openssl
|
|
|
|
zstd
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
darwin.apple_sdk.frameworks.Security
|
2024-09-19 14:19:46 +00:00
|
|
|
darwin.apple_sdk.frameworks.SystemConfiguration
|
2023-08-04 22:07:22 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildFeatures = [ "web" ];
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
# ${swagger-ui} is read-only and the copy made by the build script
|
|
|
|
# is as well. Remove it so that checks can copy it again.
|
|
|
|
preCheck = ''
|
|
|
|
find target -name $(basename ${swagger-ui}) -delete
|
|
|
|
'';
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
env = {
|
2024-09-19 14:19:46 +00:00
|
|
|
# use local data file instead of requiring network access
|
|
|
|
SWAGGER_UI_DOWNLOAD_URL = "file://${swagger-ui}";
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Tool to easily work with timezone lookups via a binary, a library, or a server";
|
2023-08-04 22:07:22 +00:00
|
|
|
homepage = "https://github.com/twitchax/rtz";
|
|
|
|
changelog = "https://github.com/twitchax/rtz/releases/tag/${src.rev}";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ figsoda ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "rtz";
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
}
|