depot/third_party/nixpkgs/pkgs/development/tools/rust/cargo-leptos/default.nix
Default email 2c76a4cb41 Project import generated by Copybara.
GitOrigin-RevId: c757e9bd77b16ca2e03c89bf8bc9ecb28e0c06ad
2023-11-16 04:20:00 +00:00

51 lines
1.2 KiB
Nix

{ darwin
, fetchFromGitHub
, lib
, openssl
, pkg-config
, rustPlatform
, stdenv
}:
let
inherit (darwin.apple_sdk.frameworks)
CoreServices
Security;
inherit (lib) optionals;
inherit (stdenv) isDarwin;
in
rustPlatform.buildRustPackage rec {
pname = "cargo-leptos";
version = "0.2.2";
src = fetchFromGitHub {
owner = "leptos-rs";
repo = pname;
rev = "${version}";
hash = "sha256-i2nKtQC63BbZsrYvg+HkdqQfK59f0LzZ9dfmFBaqn14=";
};
cargoLock = {
lockFile = ./Cargo.lock;
};
nativeBuildInputs = optionals (!isDarwin) [ pkg-config ];
buildInputs = optionals (!isDarwin) [
openssl
] ++ optionals isDarwin [
Security
CoreServices
];
# https://github.com/leptos-rs/cargo-leptos#dependencies
buildFeatures = [ "no_downloads" ]; # cargo-leptos will try to install missing dependencies on its own otherwise
doCheck = false; # Check phase tries to query crates.io
meta = with lib; {
description = "A build tool for the Leptos web framework";
homepage = "https://github.com/leptos-rs/cargo-leptos";
changelog = "https://github.com/leptos-rs/cargo-leptos/releases/tag/${version}";
license = with licenses; [ mit ];
maintainers = with maintainers; [ benwis ];
};
}