1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 installShellFiles,
6}:
7
8stdenv.mkDerivation rec {
9 pname = "pyenv";
10 version = "2.6.3";
11
12 src = fetchFromGitHub {
13 owner = "pyenv";
14 repo = "pyenv";
15 tag = "v${version}";
16 hash = "sha256-X4Gwjbgl7y/p/CEz1Z2wydP7ZBHD1i8lzmuYISVL/bo=";
17 };
18
19 nativeBuildInputs = [
20 installShellFiles
21 ];
22
23 configureScript = "src/configure";
24
25 makeFlags = [
26 "-C"
27 "src"
28 ];
29
30 installPhase = ''
31 runHook preInstall
32
33 mkdir -p "$out"
34 cp -R bin "$out/bin"
35 cp -R libexec "$out/libexec"
36 cp -R plugins "$out/plugins"
37
38 runHook postInstall
39 '';
40
41 postInstall = ''
42 installManPage man/man1/pyenv.1
43 installShellCompletion completions/pyenv.{bash,fish,zsh}
44 '';
45
46 meta = with lib; {
47 description = "Simple Python version management";
48 homepage = "https://github.com/pyenv/pyenv";
49 changelog = "https://github.com/pyenv/pyenv/blob/${src.rev}/CHANGELOG.md";
50 license = licenses.mit;
51 maintainers = with maintainers; [ tjni ];
52 platforms = platforms.all;
53 mainProgram = "pyenv";
54 };
55}