-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnodejs.nix
65 lines (45 loc) · 1.59 KB
/
nodejs.nix
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{ lib, gcc11Stdenv, python, util-linux, bash
, pkg-config, which, buildPackages
# for `.pkgs` attribute
, callPackage
}:
{ version, src, patches ? [] } @args:
let
majorVersion = lib.versions.major version;
minorVersion = lib.versions.minor version;
pname = "libnode";
sharedConfigureFlags = [
"--shared"
];
extraConfigFlags = [ "--without-npm" "--without-corepack" ];
self = gcc11Stdenv.mkDerivation {
inherit pname version src;
strictDeps = true;
#CC_host = "cc";
#CXX_host = "c++";
# depsBuildBuild = [ buildPackages.stdenv.cc ];
# NB: technically, we do not need bash in build inputs since all scripts are
# wrappers over the corresponding JS scripts. There are some packages though
# that use bash wrappers, e.g. polaris-web.
buildInputs = [ bash ];
nativeBuildInputs = [ python which ];
outputs = [ "out" ];
setOutputFlags = false;
moveToDev = false;
configureFlags = sharedConfigureFlags ++ extraConfigFlags;
configurePlatforms = [];
dontDisableStatic = true;
enableParallelBuilding = true;
# Don't allow enabling content addressed conversion as `nodejs`
# checksums it's image before conversion happens and image loading
# breaks:
# $ nix build -f. nodejs --arg config '{ contentAddressedByDefault = true; }'
# $ ./result/bin/node
# Check failed: VerifyChecksum(blob).
__contentAddressed = false;
pos = builtins.unsafeGetAttrPos "version" args;
inherit patches;
doCheck = false;
passthru.python = python; # to ensure nodeEnv uses the same version
};
in self