Skip to content

Commit d9edbbf

Browse files
committed
Merge node-pkg-v2 into devShells
2 parents 512d54b + c393bbd commit d9edbbf

File tree

18 files changed

+752
-495
lines changed

18 files changed

+752
-495
lines changed

overrides/nodejs/default.nix

+33
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,18 @@ in
578578
};
579579
};
580580

581+
node-gyp = {
582+
build = {
583+
nativeBuildInputs = [pkgs.makeWrapper];
584+
# Teach node-gyp to use nodejs headers locally rather that download them from https://nodejs.org.
585+
# TODO inherit the nodejs version from the translator somehow
586+
postInstall = ''
587+
wrapProgram "$out/bin/node-gyp" \
588+
--set npm_config_nodedir ${pkgs.nodejs-16_x}
589+
'';
590+
};
591+
};
592+
581593
node-hid = {
582594
build = {
583595
nativeBuildInputs = old:
@@ -642,6 +654,13 @@ in
642654
};
643655
};
644656

657+
sharp = {
658+
# TODO inject node-gyp
659+
build = {
660+
buildInputs = old: old ++ (with pkgs; [vips.dev glib.dev pkg-config]);
661+
};
662+
};
663+
645664
simple-git-hooks = {
646665
dont-postinstall = {
647666
buildScript = "true";
@@ -660,6 +679,20 @@ in
660679
};
661680
};
662681

682+
sqlite3 = {
683+
build = {
684+
# See its README for build instructions
685+
# It needs different flags for electron, not sure how to do that
686+
buildScript = ''
687+
node-pre-gyp install --build-from-source --nodedir=$nodeSources --offline --runtime=node --sqlite=${pkgs.sqlite}
688+
'';
689+
nativeBuildInputs = old: old ++ [pkgs.sqlite];
690+
# # TODO overrides should get correct nodejs version
691+
# pkgs.nodejs-16_x.pkgs.node-gyp]
692+
# ;
693+
};
694+
};
695+
663696
tabby = {
664697
inherit cntr;
665698
fix-build = {

src/default.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ in let
282282
getSourceSpec
283283
getRoot
284284
getDependencies
285-
getCyclicDependencies
285+
getCyclicHelpers
286286
defaultPackageName
287287
defaultPackageVersion
288288
packages

src/subsystems/haskell/builders/default/default.nix

+14-7
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,22 @@ in {
1414
}: {
1515
### FUNCTIONS
1616
# AttrSet -> Bool) -> AttrSet -> [x]
17-
getCyclicDependencies, # name: version: -> [ {name=; version=; } ]
18-
getDependencies, # name: version: -> [ {name=; version=; } ]
19-
getSource, # name: version: -> store-path
17+
# name: version: -> helpers
18+
getCyclicHelpers,
19+
# name: version: -> [ {name=; version=; } ]
20+
getDependencies,
21+
# name: version: -> store-path
22+
getSource,
2023
# to get information about the original source spec
21-
getSourceSpec, # name: version: -> {type="git"; url=""; hash="";}
24+
# name: version: -> {type="git"; url=""; hash="";}
25+
getSourceSpec,
2226
### ATTRIBUTES
23-
subsystemAttrs, # attrset
24-
defaultPackageName, # string
25-
defaultPackageVersion, # string
27+
# attrset
28+
subsystemAttrs,
29+
# string
30+
defaultPackageName,
31+
# string
32+
defaultPackageVersion,
2633
# all exported (top-level) package names and versions
2734
# attrset of pname -> version,
2835
packages,

0 commit comments

Comments
 (0)