Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Dec 2023 03:09:12 -0800
From:      list_freebsd@bluerosetech.com
To:        Alexander Leidinger <Alexander@Leidinger.net>, Freebsd Ports <freebsd-ports@freebsd.org>
Subject:   Re: Example for port which needs to run php-composer?
Message-ID:  <f3d860ca-6e82-c7df-71e6-fe79991c1e69@bluerosetech.com>
In-Reply-To: <43086cf9d76027a50a0b6d2329601a30@Leidinger.net>
References:  <43086cf9d76027a50a0b6d2329601a30@Leidinger.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?f3d860ca-6e82-c7df-71e6-fe79991c1e69>