Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Jun 2023 20:15:16 +0200
From:      Moin Rahman <bofh@freebsd.org>
To:        "Patrick M. Hausen" <hausen@punkt.de>
Cc:        Mark Millard via freebsd-ports <freebsd-ports@freebsd.org>
Subject:   Re: Guidance on creating a port for an npm installed tool
Message-ID:  <81CDD118-1475-4CF2-9180-54A8F1FEEAEF@freebsd.org>
In-Reply-To: <A87A6646-22EE-4371-ADC5-AA10B97AB043@punkt.de>
References:  <A87A6646-22EE-4371-ADC5-AA10B97AB043@punkt.de>

next in thread | previous in thread | raw e-mail | index | archive | help


> On Jun 9, 2023, at 8:11 PM, Patrick M. Hausen <hausen@punkt.de> wrote:
>=20
> Hi all,
>=20
> is there some general guide on how to go about creating a port
> for anything implemented in node.js and using npm to download
> all sorts of dependencies at build/install time?
>=20
> I'd like to see a port of this:
> https://github.com/louislam/uptime-kuma
>=20
> Similarly a port of mineos would be awesome.
>=20
> Cloning from Github and running npm works and delivers a
> functional installation in ${WRKSRC} ...
>=20
> What now?
>=20
> I did not find any detailled help in the handbook or by searching.
> There seems to be a general method if all modules are available
> in npm (they have a repository it seems).
>=20
> But what with products like these?
>=20
> For Go applications there are very convenient tools to get
> all the dependencies into the port Makefile and do it in a clean way.
>=20
> Section 6.5.8 here:
> https://docs.freebsd.org/en/books/porters-handbook/special/#building
>=20
> So any help with porting these would be greatly appreciated.
>=20
> Kind regards,
> Patrick
> --=20
> punkt.de GmbH
> Patrick M. Hausen
> .infrastructure
>=20
> Sophienstr. 187
> 76185 Karlsruhe
>=20
> Tel. +49 721 9109500
>=20
> https://infrastructure.punkt.de
> info@punkt.de
>=20
> AG Mannheim 108285
> Gesch=C3=A4ftsf=C3=BChrer: J=C3=BCrgen Egeling, Daniel Lienert, Fabian =
Stein
>=20
>=20

There is no specific guidelines but so far what have been most useful
is you install the package and then install the npm deps. After that
create a tarball of the npm deps installed and add it as a DISTFILE.

One another approach is just install the dist with node as a RUN_DEPEND
and ask user to install it through a pkg-message.

Kind regards,
Moin=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?81CDD118-1475-4CF2-9180-54A8F1FEEAEF>