1{ lib
2, rustPlatform
3, fetchFromGitHub
4, pkg-config
5, openssl
6, zlib
7, stdenv
8, darwin
9}:
10
11rustPlatform.buildRustPackage rec {
12 pname = "cargo-shuttle";
13 version = "0.45.0";
14
15 src = fetchFromGitHub {
16 owner = "shuttle-hq";
17 repo = "shuttle";
18 rev = "v${version}";
19 hash = "sha256-bjGyLfeo11Y55WqPwcUxnNkexozlxC61/rSa65gBGZ4=";
20 };
21
22 cargoLock = {
23 lockFile = ./Cargo.lock;
24 outputHashes = {
25 "async-posthog-0.2.3" = "sha256-V0f9+UKZkqh80p7UjINEbAW9y8cKBmJTRjAJZV3no1M=";
26 "hyper-reverse-proxy-0.5.2-dev" = "sha256-R1ZXGgWvwHWRHmKX823QLqM6ZJW+tzWUXigKkAyI5OE=";
27 "permit-client-rs-2.0.0" = "sha256-MxsgqPbvWDYDOb3oGuD1I6d3cdcGAhfoWsI7cwfhrb4=";
28 "permit-pdp-client-rs-0.2.0" = "sha256-F9wSvo3WzoRXjZb+We0Bvcwx3rRSG1QxXPsvrmtIN38=";
29 };
30 };
31
32 nativeBuildInputs = [
33 pkg-config
34 ];
35
36 buildInputs = [
37 openssl
38 zlib
39 ] ++ lib.optionals stdenv.isDarwin [
40 darwin.apple_sdk.frameworks.CoreServices
41 darwin.apple_sdk.frameworks.SystemConfiguration
42 ];
43
44 cargoBuildFlags = [ "-p" "cargo-shuttle" ];
45
46 cargoTestFlags = cargoBuildFlags ++ [
47 # other tests are failing for different reasons
48 "init::shuttle_init_tests::"
49 ];
50
51 meta = with lib; {
52 description = "Cargo command for the shuttle platform";
53 mainProgram = "cargo-shuttle";
54 homepage = "https://shuttle.rs";
55 changelog = "https://github.com/shuttle-hq/shuttle/releases/tag/${src.rev}";
56 license = licenses.asl20;
57 maintainers = with maintainers; [ figsoda ];
58 };
59}