| 15 Apr 2023 |
Jan Tojnar | COMPOSER_BIN_DIR should work | 19:18:47 |
Jan Tojnar | or is that just for dependencies? | 19:19:23 |
Pol | Wait, I don't understand what you're trying to explain here | 19:24:31 |
Pol | I don't think this is a good idea | 19:35:47 |
Pol | For example, if we take PHPUnit, | 19:36:02 |
Pol | The binary is not inside bin/ | 19:36:14 |
Pol | https://github.com/sebastianbergmann/phpunit/blob/main/composer.json | 19:36:34 |
Pol | That said, there is a bin attribute in the composer.json. | 19:37:09 |
Pol | I guess it would be possible to automatize the creation of the symbolic link, but I'm not sure yet. | 19:37:41 |
Pol | I guess we should loop over composer.json.bin and create the symlink. | 19:40:57 |
Pol | * I guess we should loop over composer.json.bin and create the symlinks. | 19:41:01 |
Pol | But I have no clue how we should do that yet. | 19:41:45 |
Pol | Should I use jq ? | 19:41:55 |
Pol | for bin in $(cat composer.json | jq -r '.bin'); do
ln -s $out/share/php/${finalAttrs.pname}/$bin $out/bin/$(basename $bin)
done
| 19:47:23 |
Pol | Something like that? | 19:47:27 |
Pol | I'll try | 19:47:29 |
Pol | Oh it works! | 19:48:20 |
Jan Tojnar | yeah, that's what I would do | 19:48:53 |
Pol | It's not so simple. | 19:50:27 |
Pol | It works for phpunit, not for grumphp... investigating. | 19:50:35 |
Pol | Jan Tojnar: Pushed everything. | 20:30:35 |
Pol | enough for tonight, I'll continue tomorrow if needed | 20:38:37 |
Jan Tojnar | Pol: Nice, now if only we could split it to separate functions so that it can be used in projects using stdenv.mkDerivation (e.g. when using other languages than just PHP( | 20:46:57 |
Jan Tojnar | * Pol: Nice, now if only we could split it to separate functions so that it can be used in projects using stdenv.mkDerivation (e.g. when using other languages than just PHP | 20:46:59 |
Pol | Right, how am I supposed to do that? | 20:47:37 |
Jan Tojnar | look at cargoSetupHook for an example: https://nixos.org/manual/nixpkgs/stable/#python-package-using-setuptools-rust | 20:47:59 |
Jan Tojnar | buildPhpProject would basically become stdenv.mkDerivation wrapper with composerSetupHook in nativeBuildInputs and setting composerDeps to the result of buildComposerVendorDir function, which the setup hook would then use | 20:49:54 |
Pol | Ok I will try | 20:50:13 |
Pol | I guess the hardest part is done ? | 20:51:03 |
Jan Tojnar | probably | 20:52:31 |