From nobody Tue Dec 12 11:09:12 2023 X-Original-To: freebsd-ports@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SqG8Z4d13z53nyf for ; Tue, 12 Dec 2023 11:09:18 +0000 (UTC) (envelope-from list_freebsd@bluerosetech.com) Received: from echo.brtsvcs.net (echo.brtsvcs.net [208.111.40.118]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4SqG8Z1F7pz3RM7 for ; Tue, 12 Dec 2023 11:09:18 +0000 (UTC) (envelope-from list_freebsd@bluerosetech.com) Authentication-Results: mx1.freebsd.org; none Received: from chombo.houseloki.net (65-100-43-2.dia.static.qwest.net [65.100.43.2]) by echo.brtsvcs.net (Postfix) with ESMTPS id 922BD38D86; Tue, 12 Dec 2023 11:09:11 +0000 (UTC) Received: from [10.26.25.100] (ivy.pas.ds.pilgrimaccounting.com [10.26.25.100]) by chombo.houseloki.net (Postfix) with ESMTPSA id 58B7174D92; Tue, 12 Dec 2023 03:09:10 -0800 (PST) Message-ID: Date: Tue, 12 Dec 2023 03:09:12 -0800 List-Id: Porting software to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-ports List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: Example for port which needs to run php-composer? To: Alexander Leidinger , Freebsd Ports References: <43086cf9d76027a50a0b6d2329601a30@Leidinger.net> Content-Language: en-US From: list_freebsd@bluerosetech.com In-Reply-To: <43086cf9d76027a50a0b6d2329601a30@Leidinger.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36236, ipnet:208.111.40.0/24, country:US] X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4SqG8Z1F7pz3RM7 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.