Re: Example for port which needs to run php-composer?
- In reply to: Alexander Leidinger : "Example for port which needs to run php-composer?"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 12 Dec 2023 11:09:12 UTC
On 2023-12-11 3:55, Alexander Leidinger wrote: > is someone aware of a port which needs to run php-composer during the > port building? I tried to find one with grep, but either I didn't search > for the right keywords, or there is none... Composer can't be used directly by the Ports System. It requires internet access, which is only available during fetch. However, composer can't run earlier than post-extract. Despite its caching feature, composer does not have an offline install option. First, sanity-check composer.json and create a release-engineering version of it. If it wants to install extensions, you'll need to remove those and manage them with the Port System's PHP framework. Some projects don't respect require vs require-dev or autoload vs autoload-dev, and put dev tools in the run-time sections. Once you have a reasonable composer.json, run composer on a copy of the extracted source and generate an additional distfile containing what composer installed/modified. Be sure to check for modified files, not just new ones, as composer can overwrite source files. The port should also delete the composer config and state files and any mention of composer in the install docs to avoid the user breaking the installed pkg.