1{ darwin
2, fetchFromGitHub
3, lib
4, openssl
5, pkg-config
6, rustPlatform
7, stdenv
8}:
9let
10 inherit (darwin.apple_sdk.frameworks)
11 CoreServices
12 Security;
13 inherit (lib) optionals;
14 inherit (stdenv) isDarwin isLinux;
15in
16rustPlatform.buildRustPackage rec {
17 pname = "cargo-leptos";
18 version = "0.1.8";
19
20 src = fetchFromGitHub {
21 owner = "leptos-rs";
22 repo = pname;
23 rev = version;
24 hash = "sha256-z4AqxvKu9E8GGMj6jNUAAWeqoE/j+6NoAEZWeNZ+1BA=";
25 };
26
27 cargoHash = "sha256-w/9W4DXbh4G5DZ8IGUz4nN3LEjHhL7HgybHqODMFzHw=";
28 nativeBuildInputs = optionals (!isDarwin) [ pkg-config ];
29
30 buildInputs = optionals (!isDarwin) [
31 openssl
32 ] ++ optionals isDarwin [
33 Security
34 CoreServices
35 ];
36
37 # https://github.com/leptos-rs/cargo-leptos#dependencies
38 buildFeatures = [ "no_downloads" ]; # cargo-leptos will try to install missing dependencies on its own otherwise
39 doCheck = false; # Check phase tries to query crates.io
40
41 meta = with lib; {
42 description = "A build tool for the Leptos web framework";
43 homepage = "https://github.com/leptos-rs/cargo-leptos";
44 license = with licenses; [ mit ];
45 maintainers = with maintainers; [ benwis ];
46 };
47}