51 lines
1 KiB
Nix
51 lines
1 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchFromGitHub
|
|
, installShellFiles
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "pyenv";
|
|
version = "2.3.36";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "pyenv";
|
|
repo = "pyenv";
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-ZZb7fB9VWwpmW6Qrw65/zLUBqz7E4/Bg3A7DnTt+IbE=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
installShellFiles
|
|
];
|
|
|
|
configureScript = "src/configure";
|
|
|
|
makeFlags = ["-C" "src"];
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir -p "$out"
|
|
cp -R bin "$out/bin"
|
|
cp -R libexec "$out/libexec"
|
|
cp -R plugins "$out/plugins"
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
postInstall = ''
|
|
installManPage man/man1/pyenv.1
|
|
installShellCompletion completions/pyenv.{bash,fish,zsh}
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Simple Python version management";
|
|
homepage = "https://github.com/pyenv/pyenv";
|
|
changelog = "https://github.com/pyenv/pyenv/blob/${src.rev}/CHANGELOG.md";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ tjni ];
|
|
platforms = platforms.all;
|
|
mainProgram = "pyenv";
|
|
};
|
|
}
|