about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/nodenv/default.nix
blob: cdda869aa16a7c1497ee4b03110ab06dbfdf1eb0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{ stdenv
, lib
, fetchFromGitHub
}:

stdenv.mkDerivation rec {
  pname = "nodenv";
  version = "1.4.1";

  src = fetchFromGitHub {
    owner = "nodenv";
    repo = "nodenv";
    rev = "v${version}";
    sha256 = "sha256-S7Uld7wiVJjwuvfupBodIAIOO2c/ywEmFfhEHVOCcCc=";
  };

  buildPhase = ''
    runHook preBuild

    bash src/configure
    make -C src

    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall

    mkdir -p $out
    cp -r libexec $out/
    cp -r bin $out/

    runHook postInstall
  '';

  meta = with lib; {
    description = "Manage multiple NodeJS versions";
    mainProgram = "nodenv";
    homepage = "https://github.com/nodenv/nodenv/";
    changelog = "https://github.com/nodenv/nodenv/releases/tag/v${version}";
    license = licenses.mit;
    maintainers = with maintainers; [ alexnortung ];
    platforms = platforms.unix;
  };
}