NixOS / npm2nix

Generate nix expressions to build npm packages
MIT License
57 stars 32 forks source link

Problem of "postinstall" #40

Closed ThomasCrevoisier closed 6 years ago

ThomasCrevoisier commented 8 years ago

Hello !

I've been starting with Nix for few days now, and was particularly interested in using it to handle JS dependencies (I really like the philosophy behind it 😃).

IMHO, one of the major problem with npm is the existence of postinstall... I've encountered several packages (like jpegtran-bin or phantomjs if I remember well, which are simply wrappers to download the appropriate binary).

I just made the test with the jpegtran-bin package and the output concerning this package is :

  by-spec."jpegtran-bin"."^3.0.0" =
    self.by-version."jpegtran-bin"."3.0.6";
  by-version."jpegtran-bin"."3.0.6" = self.buildNodePackage {
    name = "jpegtran-bin-3.0.6";
    version = "3.0.6";
    bin = true;
    src = fetchurl {
      url = "https://registry.npmjs.org/jpegtran-bin/-/jpegtran-bin-3.0.6.tgz";
      name = "jpegtran-bin-3.0.6.tgz";
      sha1 = "d266af271a7603046984fd31c3c2503407b92323";
    };
    deps = {
      "bin-build-2.2.0" = self.by-version."bin-build"."2.2.0";
      "bin-wrapper-3.0.2" = self.by-version."bin-wrapper"."3.0.2";
      "logalot-2.1.0" = self.by-version."logalot"."2.1.0";
    };
    optionalDependencies = {
    };
    peerDependencies = [];
    os = [ ];
    cpu = [ ];
  };

It may be a naive question but do you think it would be feasible to support postinstall option ?