From owner-freebsd-ports@freebsd.org Mon May 25 02:50:39 2020 Return-Path: Delivered-To: freebsd-ports@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 653AE2F155C for ; Mon, 25 May 2020 02:50:39 +0000 (UTC) (envelope-from stephen@missouri.edu) Received: from esa7.hc3631-84.iphmx.com (esa7.hc3631-84.iphmx.com [139.138.38.165]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "esa7.hc3631-84.iphmx.com", Issuer "HydrantID SSL ICA G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49VhRL342Pz48BS; Mon, 25 May 2020 02:50:38 +0000 (UTC) (envelope-from stephen@missouri.edu) X-IronPort-RemoteIP: 198.209.56.19 X-IronPort-MID: 12589073 X-IronPort-Reputation: 5.2 X-IronPort-Listener: IncomingMail X-IronPort-SenderGroup: ExchangeServers X-IronPort-MailFlowPolicy: $RELAYED X-SBRS: 5.2 IronPort-PHdr: =?us-ascii?q?9a23=3AobqM4hegiUk6pHi/nRSsM21klGMj5ufYGycvwc?= =?us-ascii?q?N/1OAWNoim9o7pBkHU4u9h3hfRCIPc7f8Aw/Ldr/W5ATREqY2Z5TRKeZBPVh?= =?us-ascii?q?pQk4Felhc4DpufTQXhMfe/XGx1GdlOUVZ/9DShPFBSAtrlT1jTuWa18CQTXB?= =?us-ascii?q?jzKEUxbr2tRt6P0JrvltX2/ZrVbl8S1hOgfbN/Kgm3pgzNt84QxLFvMbs11g?= =?us-ascii?q?CQ+ycadv9fmiVoLgnNxE+5tpv2/YZj9jQWsPUkpIZbSauvR60jVvRDCSg+dW?= =?us-ascii?q?U85cnlrx7GGBCT62McX2M+lxtTGA/Y9hC8U5vs4WP2s+Nn03yCNNbtBfAsDD?= =?us-ascii?q?Kl6aojRB7z3SEAMTN4uG2Cj81rl6VGuhPnqhBizg=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2FMAwCBMctemBM40cZmHQEBAQEJARI?= =?us-ascii?q?BBQUBggcCgiN2VzA2hBuRCINzlzY9AhUEASMKAgQBAQKEQgKCHiQ5BQ0CAwE?= =?us-ascii?q?BAQMCBQEBBgEBAQEBBQQCAhABAQEBAQgLCwYphV0MgnZffgEBAQEBAQEBAQE?= =?us-ascii?q?BAQEBAQEBAQEBAQEBEgINVGkBAQEDEhFmAgEIGCoCAjIlAgQBDAgBAQoUgwQ?= =?us-ascii?q?BgnwPnh0BgSg+AiMBPwEMgQWIPBk1doEyhVGDOQEJgT0KBoE4gVOKcRqCAIE?= =?us-ascii?q?4gmk+gmcChHmCYASzJgqCVIQZglKBPpAtI54CkE6IL4E/k3QCAgICCQIVgWp?= =?us-ascii?q?lgRNyEzuCak8YDZBag1iKVkNoAgYIAQEDCXyLZwGBDwEB?= X-IPAS-Result: =?us-ascii?q?A2FMAwCBMctemBM40cZmHQEBAQEJARIBBQUBggcCgiN2V?= =?us-ascii?q?zA2hBuRCINzlzY9AhUEASMKAgQBAQKEQgKCHiQ5BQ0CAwEBAQMCBQEBBgEBA?= =?us-ascii?q?QEBBQQCAhABAQEBAQgLCwYphV0MgnZffgEBAQEBAQEBAQEBAQEBAQEBAQEBA?= =?us-ascii?q?QEBEgINVGkBAQEDEhFmAgEIGCoCAjIlAgQBDAgBAQoUgwQBgnwPnh0BgSg+A?= =?us-ascii?q?iMBPwEMgQWIPBk1doEyhVGDOQEJgT0KBoE4gVOKcRqCAIE4gmk+gmcChHmCY?= =?us-ascii?q?ASzJgqCVIQZglKBPpAtI54CkE6IL4E/k3QCAgICCQIVgWplgRNyEzuCak8YD?= =?us-ascii?q?ZBag1iKVkNoAgYIAQEDCXyLZwGBDwEB?= X-IronPort-AV: E=Sophos;i="5.73,431,1583215200"; d="asc'?scan'208";a="12589073" Received: from ex2-t13.um.umsystem.edu ([198.209.56.19]) by esa7.hc3631-84.iphmx.com with ESMTP/TLS/AES256-GCM-SHA384; 24 May 2020 21:50:36 -0500 Received: from EX2-N14.um.umsystem.edu (198.209.56.22) by EX2-T13.um.umsystem.edu (198.209.56.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Sun, 24 May 2020 21:50:34 -0500 Received: from EX2-N14.um.umsystem.edu ([198.209.56.22]) by EX2-N14.um.umsystem.edu ([198.209.56.22]) with mapi id 15.01.1979.003; Sun, 24 May 2020 21:50:34 -0500 From: "Montgomery-Smith, Stephen" To: Matthew Seaman , "freebsd-ports@freebsd.org" Subject: Re: Ports from github Thread-Topic: Ports from github Thread-Index: AQHWMXSe5X7Xm3Ydhkq774Aul+6Sxai3QT+AgAEuGIA= Date: Mon, 25 May 2020 02:50:34 +0000 Message-ID: <9694e545-167b-404f-fbd7-2e97f7cd9482@missouri.edu> References: <3c6205ea-e589-769b-7b12-ee7e6d3fa8ff@missouri.edu> <5bb5cc69-ef90-2285-324f-58e09399d3ef@FreeBSD.org> In-Reply-To: <5bb5cc69-ef90-2285-324f-58e09399d3ef@FreeBSD.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 x-originating-ip: [128.206.49.160] Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="gXxJw8cLIty7ucupn13wVAteitqUafq2w" MIME-Version: 1.0 X-Rspamd-Queue-Id: 49VhRL342Pz48BS X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:16417, ipnet:139.138.38.0/24, country:US]; REPLY(-4.00)[] X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 May 2020 02:50:39 -0000 --gXxJw8cLIty7ucupn13wVAteitqUafq2w Content-Type: multipart/mixed; boundary="2SmAL9rxqlkkEl4LlpKsrXmfwrWtzsU7a" --2SmAL9rxqlkkEl4LlpKsrXmfwrWtzsU7a Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 5/24/20 3:49 AM, Matthew Seaman wrote: > On 24/05/2020 03:39, Montgomery-Smith, Stephen wrote: >> Is there a "howto" that explains how to build a port from a project th= at >> is on github? The FreeBSD porters handbook seems to assume a lot of >> knowledge is already understood. >=20 > Well, the only thing "different" about porting something from Github, a= s > opposed to any other distfile location, occurs in the 'fetch' phase -- > actually pulling down the distfiles. Once you've got past that, the > rest of building the port is exactly the same as it would be if you got= > the distfiles from anywhere else. >=20 > So, minimally a Github using port will set the following variables: >=20 > PORTNAME=3D someport > PORTVERSION=3D 1.2.3 > DISTVERSIONPREFIX=3D v > USE_GITHUB=3D yes > GH_ACCOUNT=3D someone >=20 > and it won't set: >=20 > MASTER_SITES > DISTFILES >=20 > An example from amongst the ports I maintain is database/pg_citus: >=20 > PORTNAME=3D citus > PORTVERSION=3D 9.3.0 > DISTVERSIONPREFIX=3D v >=20 > USE_GITHUB=3D yes > GH_ACCOUNT=3D citusdata >=20 > From this, the ports can work out that the Github project is: >=20 > https://github.com/citusdata/citus/ > ^^^^^^^^^ > GH_ACCOUNT > ^^^^^ > PORTNAME >=20 > If you go to that project URL and look at their releases page: >=20 > https://github.com/citusdata/citus/releases >=20 > you'll see the list of versions like so: >=20 > v9.3.0 > ^ ^^^^ > | PORTVERSION > DISTVERSIONPREFIX >=20 > That's all that is needed for this port to be able to download a tarbal= l > of the project's sources. >=20 > Now, this is about the simplest possible example of what you might need= > when pulling sources from Github, and this pattern probably accounts fo= r > the largest fraction of the Github-using ports in the tree. >=20 > Beyond that, the next largest fraction will be projects where the > PORTNAME doesn't quite match the GH project URL, or their release tags > specify the version as (eg.) v1_2_3 rather than v1.2.3 -- all just mino= r > tweaks so the ports can put together the right URL to pull the distfile= s > from. >=20 > Beyond that is where it can start to get pretty complicated though. > Sometimes a project doesn't create formal releases, or you want to pull= > down a code base a few commits beyond the latest release, or the projec= t > uses a lot of different sub-projects linked into its tree from other > github repositories. Certain programs written in go are pretty > notorious for this, and can end up with huge lists of distfiles. See > www/gitlab-pages for an example. >=20 > Finally, and only if you really want to blow your mind: throw in an > unreasonable number of port options to the mix. www/nginx is the > pinnacle (or is it nadir?) here. >=20 > In general I'd offer the following three pieces of advice when trying t= o > get to grips with a new area in porting: >=20 > * Find a good example of a port that does something similar and > blatantly copy it[*]. > * Keep things as simple as possible (but no simpler). > * Work iteratively: start with something close, and make simple > minimal changes, one at a time and testing as you go, to get it spo= t > on. >=20 > [*] The trick here is not to copy a port that does things sub-optimally= =2E > Sods law has it that if there's a dozen good examples you might copy, > and one bad one, it's the bad one that will seem like the most enticing= > prospect. >=20 > If in doubt, ask. It helps if you can provide a concrete example or a > specific context for your questions, and indeed, trying to formulate > such a question will often lead you directly to the answer yourself. >=20 > Cheers, >=20 > Matthew Thank you. That really helped a lot. I was able to figure it out from this point. --2SmAL9rxqlkkEl4LlpKsrXmfwrWtzsU7a-- --gXxJw8cLIty7ucupn13wVAteitqUafq2w Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEcCMd3cXf2WTGWYmWK5cnauCP2YIFAl7LMnkACgkQK5cnauCP 2YLeqQf8CfHzyClOoYAd9hX3plrQ+Z9xiDP2mu/NXSh5JKaz0K7BtJoie4WIC145 YzDdc6+aFDnaZTuF1WqeSJtnNFFZCTGqs8PKQrzyxq/BQACWxf9sBeu83bZam4Ks qWZXUvPOu1AyX+GcRiQC1hSZzhGnBQ2BeF/rZcr+yxCzhKjygzE1NZLC+4KqKZJh svmI2NAS8T/C67Md8YLPm05UQ6gOGFEmFkGuJuBQFTISDicoN9YbbPnJT4PSlXUw tX0uEW6vr4ib+MNVZT7kvjlOjoghJv57g9BE4gIdel6wMEZkHnRS/1Zfik2MY7BN KBUsaaJ8/7VUOLbvqgmuOQJPYhpgTw== =UViT -----END PGP SIGNATURE----- --gXxJw8cLIty7ucupn13wVAteitqUafq2w--