svanderburg / composer2nix

Generate Nix expressions to build PHP composer packages
MIT License
88 stars 25 forks source link

composerEnv.buildPackage does not link some dependencies at the right location #1

Closed Nadrieril closed 6 years ago

Nadrieril commented 7 years ago

I've been trying to package wallabag using your amazing tool. Unfortunately, composer install --optimize-autoloader fails because of the following dependency:

"friendsofsymfony/rest-bundle" = composerEnv.buildZipPackage {
  name = "friendsofsymfony-rest-bundle-c79b7e5df96e5581591ceb6a026bd4e5f9346de0";
  src = fetchurl {
    url = "https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/zipball/c79b7e5df96e5581591ceb6a026bd4e5f9346de0";
    sha256 = "1f1kq5sly10pzsfwnd62kksz63qd3r5k9s6bjkzrldc21cvv0iy1";
  };
};

(github link: https://github.com/FriendsOfSymfony/FOSRestBundle)

The problem is that it wants the dependency to be at vendor/friendsofsymfony/rest-bundle/FOS/RestBundle instead of vendor/friendsofsymfony/rest-bundle (where your script linked it). I don't really know why this package would be at a different location than the others. I suspect it is because of the "autoload" entry in its composer.json but I'm not at all familiar with composer.

Have you encountered this problem before ? Would you have an idea how to fix it ?

Nadrieril commented 7 years ago

Yeah it looks like it comes from this https://getcomposer.org/doc/04-schema.md#autoload

Nadrieril commented 7 years ago

Sorry, actually there was a mismatch. The version of the dependency I had is actually https://github.com/FriendsOfSymfony/FOSRestBundle/blob/c79b7e5df96e5581591ceb6a026bd4e5f9346de0/composer.json , which has a quite explicit "target-dir" entry. This seems quite easier to fix.

svanderburg commented 6 years ago

I believe with the latest version, this should no longer be a problem.