From nobody Tue May 17 03:14:25 2022 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 6532A1AE6DE9 for ; Tue, 17 May 2022 03:14:32 +0000 (UTC) (envelope-from beckman@angryox.com) Received: from nog.angryox.com (nog.angryox.com [70.164.19.87]) (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 4L2Lng4G93z4rs1 for ; Tue, 17 May 2022 03:14:31 +0000 (UTC) (envelope-from beckman@angryox.com) Received: by nog.angryox.com (Postfix, from userid 1001) id 69D1C5EBEF; Tue, 17 May 2022 03:14:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=angryox.com; s=powerfulgood; t=1652757265; bh=DcigNZ7qB86EfK+NuyhW6KcB7iE4Bxyy1v7c5zJ9lMM=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=b9jTlHv0DsOMUCFy7MAvHEAD1EaHHqx5x59VcYgFN0MJyLWL7HI9j1xMP6Qg2nwH7 GXXVe2nWs5dZcr+H6UMoJ3c2dY1EbVREBkzAroWrxpUnKhR+qxTG91V05vdsB8S8dW bSOzDb+Z2sawMbFLFJzoF5pTF4gosGpBmf/1N6OE= Received: from localhost (localhost [127.0.0.1]) by nog.angryox.com (Postfix) with ESMTP id 60AA95EBEE; Mon, 16 May 2022 23:14:25 -0400 (EDT) Date: Mon, 16 May 2022 23:14:25 -0400 From: Peter Beckman To: Mel Pilgrim cc: freebsd-ports@freebsd.org Subject: Re: How to port a PHP application that uses Composer? In-Reply-To: <130ec10a-219a-ac8b-06d9-80d31261dd39@bluerosetech.com> Message-ID: <6eaa632a-c56-f1fa-3ae2-b66e14b26ab7@angryox.com> References: <130ec10a-219a-ac8b-06d9-80d31261dd39@bluerosetech.com> 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 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 4L2Lng4G93z4rs1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=angryox.com header.s=powerfulgood header.b=b9jTlHv0; dmarc=none; spf=pass (mx1.freebsd.org: domain of beckman@angryox.com designates 70.164.19.87 as permitted sender) smtp.mailfrom=beckman@angryox.com X-Spamd-Result: default: False [-2.44 / 15.00]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[angryox.com:s=powerfulgood]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:nog.angryox.com]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[angryox.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[angryox.com:+]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.94)[-0.942]; MLMMJ_DEST(0.00)[freebsd-ports]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:22773, ipnet:70.164.18.0/23, country:US]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N PHP is an interpreted language, Unless there are compiled portions, there is no porting necessary. You're just running 'php composer.phar install' yes? How does the "application" run? Is it just a directory that is configured as a root directory for a webserver? If so, look at www/wordpress or databases/mantisbt. https://www.freshports.org/www/wordpress/ Mantis BT includes all of their composer dependencies in their distro. Wordpress seems to include a lot of dependencies too. Consider that it is something the installer needs to do, or build the package as a deterministic set of packages already installed. Beckman On Mon, 16 May 2022, Mel Pilgrim wrote: > Composer is a github-centric dependency management tool for PHP applications. > It works very well on its own, but I'm having trouble figuring out how to > integrate it with pkg building. > > The composer workflow is: > > 1. Clone the PHP application repo, which has a composer.json file > 2. Download composer.phar and run `php composer.phar ...` > 3. Composer examines composer.json and downloads dependencies from other > github repos > 4. Composer creates an autoloader script that does all of the require calls > for the dependencies > > The problem is that download and autoloader script part. If I ran it as part > of the pkg building process, there's a fetch-extract race as it needs network > access, but also a file extracted from the distfile. > > If I left it to user config, the autoloader script creation will change a > file managed by pkg. > > So how do I do this? Can a composer-using PHP application be ported? > > --------------------------------------------------------------------------- Peter Beckman Internet Guy beckman@angryox.com https://www.angryox.com/ ---------------------------------------------------------------------------