1{ lib
2, rustPlatform
3, fetchFromGitHub
4, installShellFiles
5, pkg-config
6, openssl
7, stdenv
8, Libsystem
9, SystemConfiguration
10}:
11
12rustPlatform.buildRustPackage rec {
13 pname = "rye";
14 version = "0.15.2";
15
16 src = fetchFromGitHub {
17 owner = "mitsuhiko";
18 repo = "rye";
19 rev = "refs/tags/${version}";
20 hash = "sha256-q7/obBE16aKb8BHf5ycXSgXTMLWAFwxSnJ3qV35TdL8=";
21 };
22
23 cargoLock = {
24 lockFile = ./Cargo.lock;
25 outputHashes = {
26 "dialoguer-0.10.4" = "sha256-WDqUKOu7Y0HElpPxf2T8EpzAY3mY8sSn9lf0V0jyAFc=";
27 "monotrail-utils-0.0.1" = "sha256-4x5jnXczXnToU0QXpFalpG5A+7jeyaEBt8vBwxbFCKQ=";
28 };
29 };
30
31 env = {
32 OPENSSL_NO_VENDOR = 1;
33 };
34
35 nativeBuildInputs = [ installShellFiles pkg-config ];
36
37 buildInputs = [
38 openssl
39 ]
40 ++ lib.optionals stdenv.isDarwin [
41 Libsystem
42 SystemConfiguration
43 ];
44
45 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
46 installShellCompletion --cmd rye \
47 --bash <($out/bin/rye self completion -s bash) \
48 --fish <($out/bin/rye self completion -s fish) \
49 --zsh <($out/bin/rye self completion -s zsh)
50 '';
51
52 checkFlags = [
53 "--skip=utils::test_is_inside_git_work_tree"
54 ];
55
56 meta = with lib; {
57 description = "A tool to easily manage python dependencies and environments";
58 homepage = "https://github.com/mitsuhiko/rye";
59 license = licenses.mit;
60 maintainers = with maintainers; [ GaetanLepage ];
61 };
62}