Skip to content

Commit

Permalink
Propagated libtool as a dependency on darwin to make modules with nat…
Browse files Browse the repository at this point in the history
…ive dependencies work again
  • Loading branch information
svanderburg committed Mar 12, 2018
1 parent bf87412 commit 2bae204
Show file tree
Hide file tree
Showing 15 changed files with 341 additions and 163 deletions.
3 changes: 2 additions & 1 deletion default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file has been generated by node2nix 1.5.2. Do not edit!
# This file has been generated by node2nix 1.5.3. Do not edit!

{pkgs ? import <nixpkgs> {
inherit system;
Expand All @@ -8,6 +8,7 @@ let
nodeEnv = import ./nix/node-env.nix {
inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile;
inherit nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
in
import ./node-packages.nix {
Expand Down
17 changes: 17 additions & 0 deletions lib/expressions/CompositionExpression.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,23 @@ CompositionExpression.prototype.toNixAST = function() {
stdenv: new nijs.NixInherit("pkgs"),
python2: new nijs.NixInherit("pkgs"),
utillinux: new nijs.NixInherit("pkgs"),
libtool: new nijs.NixIf({
ifExpr: new nijs.NixAttrReference({
attrSetExpr: new nijs.NixExpression("pkgs"),
refExpr: new nijs.NixAttrReference({
attrSetExpr: new nijs.NixExpression("stdenv"),
refExpr: new nijs.NixExpression("isDarwin")
}),
}),
thenExpr: new nijs.NixAttrReference({
attrSetExpr: new nijs.NixExpression("pkgs"),
refExpr: new nijs.NixAttrReference({
attrSetExpr: new nijs.NixExpression("darwin"),
refExpr: new nijs.NixExpression("cctools")
}),
}),
elseExpr: null
}),
runCommand: new nijs.NixInherit("pkgs"),
writeTextFile: new nijs.NixInherit("pkgs"),
nodejs: new nijs.NixInherit()
Expand Down
12 changes: 9 additions & 3 deletions nix/node-env.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file originates from node2nix

{stdenv, nodejs, python2, utillinux, runCommand, writeTextFile}:
{stdenv, nodejs, python2, utillinux, libtool, runCommand, writeTextFile}:

let
python = if nodejs ? python then nodejs.python else python2;
Expand Down Expand Up @@ -316,7 +316,10 @@ let
in
stdenv.lib.makeOverridable stdenv.mkDerivation (builtins.removeAttrs args [ "dependencies" ] // {
name = "node-${name}-${version}";
buildInputs = [ tarWrapper python nodejs ] ++ stdenv.lib.optional (stdenv.isLinux) utillinux ++ args.buildInputs or [];
buildInputs = [ tarWrapper python nodejs ]
++ stdenv.lib.optional (stdenv.isLinux) utillinux
++ stdenv.lib.optional (stdenv.isDarwin) libtool
++ args.buildInputs or [];
dontStrip = args.dontStrip or true; # Striping may fail a build for some package deployments

inherit dontNpmInstall preRebuild;
Expand Down Expand Up @@ -413,7 +416,10 @@ let
nodeDependencies = stdenv.mkDerivation {
name = "node-dependencies-${name}-${version}";

buildInputs = [ tarWrapper python nodejs ] ++ stdenv.lib.optional (stdenv.isLinux) utillinux ++ args.buildInputs or [];
buildInputs = [ tarWrapper python nodejs ]
++ stdenv.lib.optional (stdenv.isLinux) utillinux
++ stdenv.lib.optional (stdenv.isDarwin) libtool
++ args.buildInputs or [];

includeScript = includeDependencies { inherit dependencies; };
pinpointDependenciesScript = pinpointDependenciesOfPackage args;
Expand Down
74 changes: 37 additions & 37 deletions node-packages.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file has been generated by node2nix 1.5.2. Do not edit!
# This file has been generated by node2nix 1.5.3. Do not edit!

{nodeEnv, fetchurl, fetchgit, globalBuildInputs ? []}:

Expand Down Expand Up @@ -211,13 +211,13 @@ let
sha1 = "723e7df6e801ac5613113a7e445a9b69cb632818";
};
};
"concat-stream-1.6.0" = {
"concat-stream-1.6.1" = {
name = "concat-stream";
packageName = "concat-stream";
version = "1.6.0";
version = "1.6.1";
src = fetchurl {
url = "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz";
sha1 = "0aac662fd52be78964d5532f694784e70110acf7";
url = "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.1.tgz";
sha512 = "1gyp2id8ifqdpzk81qz5q7200wf8m66ammg6cz8cxv4blmqh7rf761fxd1536ib4kcdp8jccvyx1l9vi6kjl26pwyd05pblki455jc2";
};
};
"config-chain-1.1.11" = {
Expand Down Expand Up @@ -463,13 +463,13 @@ let
sha512 = "1y8kprb3qldxqj31zai5n8dvhydsl9nn5w4rskhnbzzhldn6pm6n5lcyam3sfkb61a62d5m58k8im7z6ngwbd9cw9zp4zm4y7ckrf20";
};
};
"hosted-git-info-2.5.0" = {
"hosted-git-info-2.6.0" = {
name = "hosted-git-info";
packageName = "hosted-git-info";
version = "2.5.0";
version = "2.6.0";
src = fetchurl {
url = "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz";
sha512 = "355g980qsk8k9hkv60z58llbvpscjl5yqkh4wx719s8jcq2swzn4ynzinj8azmvdgs10r22wb297rmixh9vvsml55sbysdf2i8ipn54";
url = "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz";
sha512 = "1vi4baj130s7mladvb4rad9ka8nqzcwws9i1zaaplp0fdrmnfwjfbpq01cghha2c2frd2f900f07awglhbbyym0bpwmrph0hhhf11ll";
};
};
"http-signature-1.2.0" = {
Expand Down Expand Up @@ -733,22 +733,22 @@ let
sha512 = "01wzws79ps84ylshjb7rfpjykgiqxnpr89s52p2yyzfx8nfvyh5flvf1almiiavsi75xgi8g3s5davc1mmgz7gn8yvlqz6gnhax8f7n";
};
};
"npm-package-arg-5.1.2" = {
"npm-package-arg-6.0.0" = {
name = "npm-package-arg";
packageName = "npm-package-arg";
version = "5.1.2";
version = "6.0.0";
src = fetchurl {
url = "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-5.1.2.tgz";
sha512 = "36g1gm57qcvdgb4lm6ibl9pgma8lgx8l8i2jzap6w3v36wfzsqa7vb411zd26yp9rgcq23951vl5j6pac22qd5h9x7jm9raznnnr460";
url = "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.0.0.tgz";
sha512 = "15a1x3fjip5waxap8dbjkm88j0c2bcnay8pw14p74h1499wznynw2if91shrqlrbzwia09x4xiphp6wkxga5z8vf9k08bjarn1vn047";
};
};
"npm-registry-client-8.5.0" = {
"npm-registry-client-8.5.1" = {
name = "npm-registry-client";
packageName = "npm-registry-client";
version = "8.5.0";
version = "8.5.1";
src = fetchurl {
url = "https://registry.npmjs.org/npm-registry-client/-/npm-registry-client-8.5.0.tgz";
sha512 = "1nwp5cfjmy4k14g6ziz7zpia8f66ximhrdhw49cj2w173bibq1sgc4d5w951ql5dqf0hcmia956ld9y7qs2q1fx6s2j446zhvdk0irn";
url = "https://registry.npmjs.org/npm-registry-client/-/npm-registry-client-8.5.1.tgz";
sha512 = "0g7abpykfqb1x17pajm1ndsh61n3ydyimv5npsjrn9hd1s72csxh7fzdn28gldz30n00wgb8rg9y8jfhxli3cnii61i5vl0cwbwdf7f";
};
};
"npmconf-2.1.2" = {
Expand Down Expand Up @@ -895,22 +895,22 @@ let
sha512 = "3waqapyj1k4g135sgj636rmswiaixq19is1rw0rpv4qp6k7dl0a9nwy06m7yl5lbdk9p6xpwwngnggbzlzaz6rh11c86j2nvnnf273r";
};
};
"readable-stream-2.3.4" = {
"readable-stream-2.3.5" = {
name = "readable-stream";
packageName = "readable-stream";
version = "2.3.4";
version = "2.3.5";
src = fetchurl {
url = "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.4.tgz";
sha512 = "1jpffi1v0l7pkzrhh8i9c6cbswa9npyx114cbfncfnzl9d7w9p08k9n703hq5xr2c3rg86qiq023sl1x8y6mawgsxgggy8ccrwk3rmy";
url = "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.5.tgz";
sha512 = "09n3j4jsfl2lq3gj65qwn5b3lvzb624lrb8m14h81ls9cw59vvm8436gm5zwaqxf6y1zrfwbrsmizsq48jw1s3qj9zhpjp438735bdl";
};
};
"request-2.83.0" = {
"request-2.85.0" = {
name = "request";
packageName = "request";
version = "2.83.0";
version = "2.85.0";
src = fetchurl {
url = "https://registry.npmjs.org/request/-/request-2.83.0.tgz";
sha512 = "0by1djkn836sqd9pk2c777wcjvp34qbk1plx7s4lmykljrblpjc64dvn6ni2vyxsbyk33wnl6avym8vgw0ggr4226xakck8mw7y07cm";
url = "https://registry.npmjs.org/request/-/request-2.85.0.tgz";
sha512 = "2d3hg10zs5ycnr8prmiwdhacf88fl0x0bi6szs0z2r07zcbk419laixwpjp8sqapbc2ifyyih7p3r60wgr58bmcncz3pqnx523c8zph";
};
};
"requizzle-0.2.1" = {
Expand Down Expand Up @@ -1057,13 +1057,13 @@ let
sha1 = "512df6da6287144316dc4c18fe1cf1d940739be3";
};
};
"ssri-4.1.6" = {
"ssri-5.2.4" = {
name = "ssri";
packageName = "ssri";
version = "4.1.6";
version = "5.2.4";
src = fetchurl {
url = "https://registry.npmjs.org/ssri/-/ssri-4.1.6.tgz";
sha512 = "283n1p781cl2pj3jk32blcvwjdlaixng0v5x2f9qi3ndxrmyg3hk4clsjpcfsszkymy40q426yz5skax4ivsmll2p9hhcc00ivc4ijr";
url = "https://registry.npmjs.org/ssri/-/ssri-5.2.4.tgz";
sha512 = "2si1dr4dwg0bkvsn38d6rk5raw5lbn2m9giwf8pnhy55wqgxsvv7b1pn252wj166cd8j302a2gwjy00ni473yr1vrxrzmssqs000waj";
};
};
"string-width-1.0.2" = {
Expand Down Expand Up @@ -1304,7 +1304,7 @@ let
args = {
name = "node2nix";
packageName = "node2nix";
version = "1.5.2";
version = "1.5.3";
src = ./.;
dependencies = [
sources."abbrev-1.1.1"
Expand Down Expand Up @@ -1333,7 +1333,7 @@ let
sources."co-4.6.0"
sources."code-point-at-1.1.0"
sources."combined-stream-1.0.6"
sources."concat-stream-1.6.0"
sources."concat-stream-1.6.1"
sources."config-chain-1.1.11"
sources."console-control-strings-1.1.0"
sources."core-util-is-1.0.2"
Expand Down Expand Up @@ -1369,7 +1369,7 @@ let
sources."has-unicode-2.0.1"
sources."hawk-6.0.2"
sources."hoek-4.2.1"
sources."hosted-git-info-2.5.0"
sources."hosted-git-info-2.6.0"
sources."http-signature-1.2.0"
sources."inherits-2.0.3"
sources."ini-1.3.5"
Expand Down Expand Up @@ -1398,8 +1398,8 @@ let
sources."nijs-0.0.25"
sources."nopt-3.0.6"
sources."normalize-package-data-2.4.0"
sources."npm-package-arg-5.1.2"
sources."npm-registry-client-8.5.0"
sources."npm-package-arg-6.0.0"
sources."npm-registry-client-8.5.1"
(sources."npmconf-2.1.2" // {
dependencies = [
sources."once-1.3.3"
Expand All @@ -1420,8 +1420,8 @@ let
sources."proto-list-1.2.4"
sources."punycode-1.4.1"
sources."qs-6.5.1"
sources."readable-stream-2.3.4"
sources."request-2.83.0"
sources."readable-stream-2.3.5"
sources."request-2.85.0"
(sources."requizzle-0.2.1" // {
dependencies = [
sources."underscore-1.6.0"
Expand All @@ -1441,7 +1441,7 @@ let
sources."spdx-expression-parse-3.0.0"
sources."spdx-license-ids-3.0.0"
sources."sshpk-1.13.1"
sources."ssri-4.1.6"
sources."ssri-5.2.4"
sources."string-width-1.0.2"
sources."string_decoder-1.0.3"
sources."stringstream-0.0.5"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node2nix",
"version": "1.5.2",
"version": "1.5.3",
"description": "Generate Nix expressions to build NPM packages",
"homepage": "https://github.com/svanderburg/node2nix",
"author": {
Expand Down
3 changes: 2 additions & 1 deletion tests/default-v4.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file has been generated by node2nix 1.5.2. Do not edit!
# This file has been generated by node2nix 1.5.3. Do not edit!

{pkgs ? import <nixpkgs> {
inherit system;
Expand All @@ -8,6 +8,7 @@ let
nodeEnv = import ../nix/node-env.nix {
inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile;
inherit nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
in
import ./node-packages-v4.nix {
Expand Down
3 changes: 2 additions & 1 deletion tests/default-v6.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file has been generated by node2nix 1.5.2. Do not edit!
# This file has been generated by node2nix 1.5.3. Do not edit!

{pkgs ? import <nixpkgs> {
inherit system;
Expand All @@ -8,6 +8,7 @@ let
nodeEnv = import ../nix/node-env.nix {
inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile;
inherit nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
in
import ./node-packages-v6.nix {
Expand Down
3 changes: 2 additions & 1 deletion tests/default-v8.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file has been generated by node2nix 1.5.2. Do not edit!
# This file has been generated by node2nix 1.5.3. Do not edit!

{pkgs ? import <nixpkgs> {
inherit system;
Expand All @@ -8,6 +8,7 @@ let
nodeEnv = import ../nix/node-env.nix {
inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile;
inherit nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
in
import ./node-packages-v8.nix {
Expand Down
3 changes: 2 additions & 1 deletion tests/grunt/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file has been generated by node2nix 1.5.2. Do not edit!
# This file has been generated by node2nix 1.5.3. Do not edit!

{pkgs ? import <nixpkgs> {
inherit system;
Expand All @@ -12,6 +12,7 @@ let
nodeEnv = import ../../nix/node-env.nix {
inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile;
inherit nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
in
import ./node-packages.nix {
Expand Down
Loading

0 comments on commit 2bae204

Please sign in to comment.