From nobody Sat Jan 14 16:22:55 2023 X-Original-To: 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 4NvNqm0vmTz2rBHw for ; Sat, 14 Jan 2023 16:23:00 +0000 (UTC) (envelope-from njqashat@gmail.com) Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NvNqk3Ys9z3pyt for ; Sat, 14 Jan 2023 16:22:58 +0000 (UTC) (envelope-from njqashat@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b="CyB4sYB/"; spf=pass (mx1.freebsd.org: domain of njqashat@gmail.com designates 2607:f8b0:4864:20::d33 as permitted sender) smtp.mailfrom=njqashat@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-io1-xd33.google.com with SMTP id r71so2803125iod.2 for ; Sat, 14 Jan 2023 08:22:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:message-id:references:in-reply-to:subject :to:date:mime-version:from:from:to:cc:subject:date:message-id :reply-to; bh=XIZKSFkvGJQSzqstF+tsl9blJqBtNy4n2zQCKaMAkFk=; b=CyB4sYB/QDK8uqRjNp+RZmCn1jIfKT1wgT86t0dzHuWy8HJ8ukUizYprBoY+iRVIjP 1oDWEBJYo0jekvrdGKPBpY03xk6vYSYwwlVfxdHLq/3I1Sy1sHLNIZngf3DEB4kpIGTe llJcmUhBLtInDVYss6k8EVoPwqBwkE/iYCmjvSVG0ljurOScNfeX++YmhK/MiGSlqj1O 2e7e12Jl5oj9YcA1OveleUfqdjY2k8GjYByhuASWU8Bgi56XDAPMxt1jHk/+a4LR96mJ C8NMXyvif94YTdEqDJ3HEtIpZo1RhwhuPu81YoEZnnz75KVCvkKCHdV2ZqKdP+o+gRD+ ul8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:message-id:references:in-reply-to:subject :to:date:mime-version:from:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=XIZKSFkvGJQSzqstF+tsl9blJqBtNy4n2zQCKaMAkFk=; b=wWOKixGRwyAa3I6NYsu7k/xa2b3iEl6IJxAkssm2ExMvBOaMF4/B56Bsmz21rSXM1g kFV4/foKUMrS2sZeCKpNMbOKNJSnSbzMWawUADs+q+jT84ZWgQezUk4ZCNxkkjaSyLVs A9tIPmAm2qS0tm7+cc9kvsL4kKGPXSH/aNxfjc2D2tL1SIebQvjWLB9bLNLfMSJClOzr 3BfW6Q13jg6bLRWzESSap+8bEjwL+nVXexEWofztZbZpDi4zl1WmEvuFsVgDdpKPTHxl MA6REWcPNisW3RULGBuv56HWPYOwNwtxrh1AaD8Zo0G2vjVwRyVtrMEjDyP1qnTWgS+Y 18GQ== X-Gm-Message-State: AFqh2kovQeeHC5Gt6Gg/HukPZit/VAnI9nRCaXhm/TpK2ReI3K7R4DYc W8OWHa63Xo4mdavHiZIVSVBZgeACMPXSQQ== X-Google-Smtp-Source: AMrXdXtXxfxXZCFmLnWDSKAjFZf12jn+ZPKO0qtylaJVzRxZH8v5XrvNs6nGd0tB+Dv2+/qeUy7fow== X-Received: by 2002:a6b:3bcd:0:b0:704:67aa:57b0 with SMTP id i196-20020a6b3bcd000000b0070467aa57b0mr9763765ioa.2.1673713377329; Sat, 14 Jan 2023 08:22:57 -0800 (PST) Received: from www.cyberbotx.com (c-68-62-69-238.hsd1.mi.comcast.net. [68.62.69.238]) by smtp.gmail.com with ESMTPSA id w11-20020a056602034b00b006f8ee49c22dsm8107195iou.10.2023.01.14.08.22.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Jan 2023 08:22:56 -0800 (PST) From: Naram Qashat X-Google-Original-From: Naram Qashat 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 Date: Sat, 14 Jan 2023 11:22:55 -0500 To: ports@freebsd.org Subject: Re: How to port PHP projects which require composer In-Reply-To: <03f61e5f-64e4-4a82-be9c-f0e43342a703@app.fastmail.com> References: <20230113161256.Horde.AmUkrCrrKfqxlkTgPPSzF6q@graf.pompo.net> <03f61e5f-64e4-4a82-be9c-f0e43342a703@app.fastmail.com> Message-ID: <44be927738f223ea21d6e5ccff399bac@cyberbotx.com> X-Sender: cyberbotx@cyberbotx.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-3.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.96)[-0.964]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; PREVIOUSLY_DELIVERED(0.00)[ports@freebsd.org]; BLOCKLISTDE_FAIL(0.00)[68.62.69.238:server fail,2607:f8b0:4864:20::d33:server fail]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::d33:from]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; DKIM_TRACE(0.00)[gmail.com:+]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MLMMJ_DEST(0.00)[ports@freebsd.org] X-Rspamd-Queue-Id: 4NvNqk3Ys9z3pyt X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N On 2023-01-13 11:25, Dan Langille wrote: > On Fri, Jan 13, 2023, at 10:12 AM, thierry@freebsd.org wrote: >> Selon Dan Langille le ven. 13 janv. 11:20:25 2023 : >> >>> Hello, >>> >>> I'm looking at porting https://github.com/vstelmakh/url-highlight >>> for use by FreshPorts. >>> >>> My current solution: >>> >>> % sudo pkg install php81-composer >>> % fetch -o url-highlight-v3.0.1.tar.gz >>> https://github.com/vstelmakh/url-highlight/archive/refs/tags/v3.0.1.tar.gz >>> % tar -xzf url-highlight-v3.0.1.tar.gz >>> % composer require vstelmakh/url-highlight >>> >>> At this point, everything I need is in the newly-created vendor >>> directory. >>> >>> If I copy that vendor directory to /usr/local/www/freshports/, I can >>> use it like this: >>> >>> >> >>> require_once($_SERVER['DOCUMENT_ROOT'] .  '/../vendor/autoload.php'); >>> use VStelmakh\UrlHighlight\Encoder\HtmlSpecialcharsEncoder; >>> use VStelmakh\UrlHighlight\UrlHighlight; >>> >>> ... etc >>> >>> >>> What is the proper way to port code like this? >> >> It would be very interesting to have a Mk/Uses/composer.mk, like we >> have Mk/Uses/pear.mk. >> >> Adding cyberbotx@cyberbotx.com to the list: do you think it is >> possible? I don't know enough about how Mk/Uses/pear.mk to say for sure, but what little I've skimmed over makes it look like port using PEAR is for a single PEAR extension, which isn't the same as a PHP application using Composer. And I think a port using Composer would need some way to do its downloading since that couldn't be done outside of the fetch stage if I recall right? Thanks, Naram "CyberBotX" Qashat > > FYI, what I do with net-mgmt/librenms[1] is manually build the vendor > directory > and upload it as a separate DISTFILE. It works, but it is a manual > process[2]. > > 1 - https://cgit.freebsd.org/ports/tree/net-mgmt/librenms/Makefile#n6 > 2 - https://gist.github.com/dlangille/e91b77ca4a32dfcbcdd7515ffb263e74 > -- > Dan Langille > dan@langille.org