Open rimmington opened 7 years ago
Without this flag, I couldn't build node-zopfli
, node-sass
, and node-gyp
. However adding the postInstall
hook allowed me to patch node-sass
and pass the --tarball
like this:
{
nodeHeaders = pkgs.fetchurl {
url = "https://nodejs.org/download/release/v${nodejs.version}/node-v${nodejs.version}-headers.tar.gz";
sha256 = "01cq2lszd3lmgy2pshfji5117inr0j8vdqxv3cps551s9qyigik5";
};
pkgConfig = {
node-sass = {
buildInputs = [ pkgs.libsass pkgs.python ];
postInstall = ''
node scripts/build.js --tarball=${nodeHeaders}
'';
};
};
}
Usually they are built during the "Building fresh packages" step by yarn. They are not built because
--ignore-scripts
is passed to yarn inbuildYarnPackageDeps
.I removed this flag in my own clone of yarn2nix and things seem to work for now, but I'm not sure this is a good approach because it might introduce impurities. For example,
node-gyp
(used to create some bindings) apparently downloads the Node headers each time it runs.