Merge pull request #218450 from konradmalik/rtx

This commit is contained in:
Sandro
2023-06-02 11:16:21 +02:00
committed by GitHub
2 changed files with 67 additions and 0 deletions
+63
View File
@@ -0,0 +1,63 @@
{ lib
, rustPlatform
, fetchFromGitHub
, installShellFiles
, stdenv
, coreutils
, bash
, direnv
, Security
}:
rustPlatform.buildRustPackage rec {
pname = "rtx";
version = "1.30.5";
src = fetchFromGitHub {
owner = "jdxcode";
repo = "rtx";
rev = "v${version}";
sha256 = "sha256-xJecTvhRMHyGOT1JJPSp+k5bI0FvIP2uySBt1R0YZ30=";
};
cargoSha256 = "sha256-29aGVKINVemppy+3nGDf5okvmJm72pVYUVbefuey0H8=";
nativeBuildInputs = [ installShellFiles ];
buildInputs = lib.optionals stdenv.isDarwin [ Security ];
postPatch = ''
patchShebangs --build ./test/data/plugins/**/bin/* ./src/fake_asdf.rs ./src/cli/reshim.rs
substituteInPlace ./src/env_diff.rs \
--replace '"bash"' '"${bash}/bin/bash"'
substituteInPlace ./src/cli/direnv/exec.rs \
--replace '"env"' '"${coreutils}/bin/env"' \
--replace 'cmd!("direnv"' 'cmd!("${direnv}/bin/direnv"'
'';
checkFlags = [
# Requires .git directory to be present
"--skip=cli::plugins::ls::tests::test_plugin_list_urls"
];
cargoTestFlags = [ "--all-features" ];
# some tests access the same folders, don't test in parallel to avoid race conditions
dontUseCargoParallelTests = true;
postInstall = ''
installManPage ./man/man1/rtx.1
installShellCompletion \
--bash ./completions/rtx.bash \
--fish ./completions/rtx.fish \
--zsh ./completions/_rtx
'';
meta = rec {
homepage = "https://github.com/jdxcode/rtx";
description = "Polyglot runtime manager (asdf rust clone)";
changelog = "https://github.com/jdxcode/rtx/releases/tag/v${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ konradmalik ];
};
}
+4
View File
@@ -17606,6 +17606,10 @@ with pkgs;
asdf-vm = callPackage ../tools/misc/asdf-vm { };
rtx = callPackage ../tools/misc/rtx {
inherit (darwin.apple_sdk.frameworks) Security;
};
### DEVELOPMENT / TOOLS
abi-compliance-checker = callPackage ../development/tools/misc/abi-compliance-checker { };