nix-community / yarn2nix

Generate nix expressions from a yarn.lock file [maintainer=???]
GNU General Public License v3.0
123 stars 61 forks source link

sqlite3 bindings are not built #24

Open rimmington opened 7 years ago

rimmington commented 7 years ago

Usually they are built during the "Building fresh packages" step by yarn. They are not built because --ignore-scripts is passed to yarn in buildYarnPackageDeps.

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.

manveru commented 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}
        '';
      };
    };
  }