Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nodejs: Use more pure symlink builds #195

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@

# a dev shell for working on dream2nix
# use via 'nix develop . -c $SHELL'
# TODO only for the current system?
devShells = forAllSystems (system: pkgs: let
makeDevshell = import "${inp.devshell}/modules" pkgs;
mkShell = config:
Expand Down
25 changes: 25 additions & 0 deletions overrides/nodejs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,12 @@ in
};
};

# Teach node-gyp to use nodejs headers locally
# rather that download them from https://nodejs.org.
node-gyp.build.postInstall = ''
wrapProgram "$out/bin/node-gyp" --set npm_config_nodedir $nodeSources
'';

node-hid = {
build = {
nativeBuildInputs = old:
Expand All @@ -589,6 +595,10 @@ in
};
};

nodegit.build.buildInputs = with pkgs;
old:
old ++ [pkg-config libkrb5 e2fsprogs];

npm = {
dont-install-deps = {
installDeps = "";
Expand Down Expand Up @@ -642,6 +652,10 @@ in
};
};

sharp.build.buildInputs = with pkgs;
old:
old ++ [vips.dev glib.dev pkg-config];

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

sqlite3 = {
build = {
# See its README for build instructions
# TODO It needs different flags for electron, use $electronHeaders
buildScript = ''
node-pre-gyp install --build-from-source --nodedir=$nodeSources --offline --runtime=node --sqlite=${pkgs.sqlite}
'';
nativeBuildInputs = old: old ++ [pkgs.sqlite];
};
};

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 @@ -284,7 +284,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