Skip to content

Commit

Permalink
Merge node-pkg-v2 into devShells
Browse files Browse the repository at this point in the history
  • Loading branch information
wmertens committed Aug 11, 2022
2 parents 512d54b + c393bbd commit d9edbbf
Show file tree
Hide file tree
Showing 18 changed files with 752 additions and 495 deletions.
33 changes: 33 additions & 0 deletions overrides/nodejs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,18 @@ in
};
};

node-gyp = {
build = {
nativeBuildInputs = [pkgs.makeWrapper];
# Teach node-gyp to use nodejs headers locally rather that download them from https://nodejs.org.
# TODO inherit the nodejs version from the translator somehow
postInstall = ''
wrapProgram "$out/bin/node-gyp" \
--set npm_config_nodedir ${pkgs.nodejs-16_x}
'';
};
};

node-hid = {
build = {
nativeBuildInputs = old:
Expand Down Expand Up @@ -642,6 +654,13 @@ in
};
};

sharp = {
# TODO inject node-gyp
build = {
buildInputs = old: old ++ (with pkgs; [vips.dev glib.dev pkg-config]);
};
};

simple-git-hooks = {
dont-postinstall = {
buildScript = "true";
Expand All @@ -660,6 +679,20 @@ in
};
};

sqlite3 = {
build = {
# See its README for build instructions
# It needs different flags for electron, not sure how to do that
buildScript = ''
node-pre-gyp install --build-from-source --nodedir=$nodeSources --offline --runtime=node --sqlite=${pkgs.sqlite}
'';
nativeBuildInputs = old: old ++ [pkgs.sqlite];
# # TODO overrides should get correct nodejs version
# pkgs.nodejs-16_x.pkgs.node-gyp]
# ;
};
};

tabby = {
inherit cntr;
fix-build = {
Expand Down
2 changes: 1 addition & 1 deletion src/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ in let
getSourceSpec
getRoot
getDependencies
getCyclicDependencies
getCyclicHelpers
defaultPackageName
defaultPackageVersion
packages
Expand Down
21 changes: 14 additions & 7 deletions src/subsystems/haskell/builders/default/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,22 @@ in {
}: {
### FUNCTIONS
# AttrSet -> Bool) -> AttrSet -> [x]
getCyclicDependencies, # name: version: -> [ {name=; version=; } ]
getDependencies, # name: version: -> [ {name=; version=; } ]
getSource, # name: version: -> store-path
# name: version: -> helpers
getCyclicHelpers,
# name: version: -> [ {name=; version=; } ]
getDependencies,
# name: version: -> store-path
getSource,
# to get information about the original source spec
getSourceSpec, # name: version: -> {type="git"; url=""; hash="";}
# name: version: -> {type="git"; url=""; hash="";}
getSourceSpec,
### ATTRIBUTES
subsystemAttrs, # attrset
defaultPackageName, # string
defaultPackageVersion, # string
# attrset
subsystemAttrs,
# string
defaultPackageName,
# string
defaultPackageVersion,
# all exported (top-level) package names and versions
# attrset of pname -> version,
packages,
Expand Down
Loading

0 comments on commit d9edbbf

Please sign in to comment.