!jngDrdMgndWibPCYsR:nixos.org

Nix PHP

76 Members
A room for PHP developers running on Nix22 Servers

Load older messages


SenderMessageTime
15 Apr 2023
@jtojnar:matrix.orgJan Tojnar COMPOSER_BIN_DIR should work 19:18:47
@jtojnar:matrix.orgJan Tojnaror is that just for dependencies?19:19:23
@drupol:matrix.orgPolWait, I don't understand what you're trying to explain here19:24:31
@drupol:matrix.orgPolI don't think this is a good idea19:35:47
@drupol:matrix.orgPolFor example, if we take PHPUnit, 19:36:02
@drupol:matrix.orgPol The binary is not inside bin/ 19:36:14
@drupol:matrix.orgPolhttps://github.com/sebastianbergmann/phpunit/blob/main/composer.json19:36:34
@drupol:matrix.orgPol That said, there is a bin attribute in the composer.json. 19:37:09
@drupol:matrix.orgPolI guess it would be possible to automatize the creation of the symbolic link, but I'm not sure yet.19:37:41
@drupol:matrix.orgPol I guess we should loop over composer.json.bin and create the symlink. 19:40:57
@drupol:matrix.orgPol * I guess we should loop over composer.json.bin and create the symlinks. 19:41:01
@drupol:matrix.orgPolBut I have no clue how we should do that yet.19:41:45
@drupol:matrix.orgPol Should I use jq ? 19:41:55
@drupol:matrix.orgPol
      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
@drupol:matrix.orgPolSomething like that?19:47:27
@drupol:matrix.orgPolI'll try19:47:29
@drupol:matrix.orgPolOh it works!19:48:20
@jtojnar:matrix.orgJan Tojnaryeah, that's what I would do19:48:53
@drupol:matrix.orgPolIt's not so simple.19:50:27
@drupol:matrix.orgPolIt works for phpunit, not for grumphp... investigating.19:50:35
@drupol:matrix.orgPol Jan Tojnar: Pushed everything. 20:30:35
@drupol:matrix.orgPolenough for tonight, I'll continue tomorrow if needed20:38:37
@jtojnar:matrix.orgJan 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
@jtojnar:matrix.orgJan 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
@drupol:matrix.orgPolRight, how am I supposed to do that?20:47:37
@jtojnar:matrix.orgJan Tojnar look at cargoSetupHook for an example: https://nixos.org/manual/nixpkgs/stable/#python-package-using-setuptools-rust 20:47:59
@jtojnar:matrix.orgJan 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
@drupol:matrix.orgPolOk I will try20:50:13
@drupol:matrix.orgPolI guess the hardest part is done ?20:51:03
@jtojnar:matrix.orgJan Tojnarprobably20:52:31

Show newer messages


Back to Room ListRoom Version: 6