Index | Thread | Search

From:
Thomas Dettbarn <dettus@dettus.net>
Subject:
Re: New port cad/nextpnr (Attempt 2)
To:
ports@openbsd.org
Date:
Thu, 11 Jun 2026 08:53:48 +0200

Download raw body.

Thread
Hello!

You can find the second attempt of my port attached to this email. I have
applied the changes, suggested by Stu (Thank you, btw).

In this particular port, I have decided to keep the "Warning" about the
memory as a comment inside the Makefile, albeit as a less-severe "Note".

I also adopted the new sub-subdirectory from my other prjpeppercorn port.
Before, it was reading files from /usr/local/share/prjpeppercorn-1.13, 
now it
is reading from /usr/local/share/prjpeppercorn/1.13.


In addition to that: Using ldd(1), I noticed that the resulting binaries had
some implicit library dependencies. They are now explicitly stated 
inside the
Makefile.

Please have another look, hopefully, this time around, it meets your 
standards
a little bit better.

Thomas

On 6/9/26 08:26, Thomas Dettbarn wrote:
> Hello Stu!
>
> Thank you for your review. I will update the port and send it to
> ports@ again later.
> Please find my answers inline
>
>
> Thomas
>
>
> On 6/9/26 01:20, Stuart Henderson wrote:
>> On 2026/06/09 00:53, Thomas Dettbarn wrote:
>>> +###############################################
>>> +## WARNING: This build requires a lot of RAM ##
>>> +## Please update /etc/login.conf and set     ##
>>> +## daemon:datasize=16384M                    ##
>>> +###############################################
>> erk. don't suppose it's possible to track down which compilation uses
>> so much ram and see if a lower optimisation level for that file would
>> help?
>
> Unfortunately, it is a python script which is eating RAM. :(
>
> BUT...
>
>
>> port builds are normally done with class 'pbuild' which on amd64 has
>> default ":datasize-cur=12G:" ...
> I just ran it again, this time with daemon:datasize=8192M, and it
> compiled. So 12G might be okay... I just normally run my builds
> as root, since I am lazy....
>>
>> do you really need the version number in the prjpeppercorn dir?
>> apart from being a pain because you'll need to touch multiple ports
>> after an update, there will also be churn in the PLIST files, and
>> pkg_add will need to remove/reinstall files even if there was no
>> change to the contents.
>
> The answer here is: Yes, the version number is important for the
> build of nextpnr.
>
> There is even a check inside the hungry hungry python script:
> prjpeppercorn is less about the applications it installs (which are
> also important for FPGA design), but more about the data it installs
> along with it.
>
> Which is required for the build of nextpnr, and needs to be in a
> highly specific format.
>
> So one port's update requires the other one to be updated as well.
>
> In other words: If ports were a family, those two are married. (And in
> a toxic relationship...)
>
>
diff --git a/cad/nextpnr/Makefile b/cad/nextpnr/Makefile
new file mode 100644
index 00000000000..077af6ce84f
--- /dev/null
+++ b/cad/nextpnr/Makefile
@@ -0,0 +1,45 @@
+######################################################
+## NOTE: Though not recommended, building this port ##
+##       as root requires the available datasize to ##
+##       be increased in /etc/login.conf. Without   ##
+##       setting daemon:datasize=8192M, the build   ##
+##       process will fail with a MemoryError.      ##
+######################################################
+
+COMMENT=	portable FPGA place and route tool
+CATEGORIES=	cad
+V=		0.10pl20260605
+DISTNAME=	nextpnr-${V}
+
+GH_ACCOUNT=	YosysHQ
+GH_PROJECT=	nextpnr
+GH_COMMIT=	32324500c4ae33670df429d2e8e2a83b51b062ab
+
+HOMEPAGE=	https://github.com/YosysHQ/nextpnr
+MAINTAINER=	Thomas Dettbarn <dettus@dettus.net>
+
+# ISC License
+PERMIT_PACKAGE=	yes
+
+WANTLIB=	c c++ c++abi m util pthread z
+MODULES=	devel/cmake
+MODULES+=	lang/python
+
+LIB_DEPENDS=	archivers/bzip2
+LIB_DEPENDS+=	converters/libiconv
+LIB_DEPENDS+=	devel/boost
+LIB_DEPENDS+=	devel/gettext
+LIB_DEPENDS+=	lang/python/3
+LIB_DEPENDS+=	textproc/icu4c
+
+BUILD_DEPENDS=	cad/prjpeppercorn
+BUILD_DEPENDS+=	math/eigen3
+
+CONFIGURE_ARGS=	-DARCH="generic;himbaechel" \
+		-DHIMBAECHEL_UARCH="gatemate" \
+		-DHIMBAECHEL_PEPPERCORN_PATH=/usr/local/share/prjpeppercorn/1.13
+
+NO_TEST=	Yes
+
+.include <bsd.port.mk>
+
diff --git a/cad/nextpnr/distinfo b/cad/nextpnr/distinfo
new file mode 100644
index 00000000000..d91719d9e18
--- /dev/null
+++ b/cad/nextpnr/distinfo
@@ -0,0 +1,2 @@
+SHA256 (nextpnr-0.10pl20260605-32324500.tar.gz) = Qu2EnnbMXCyPFmAJs+q1HF0lUCMNG7jmNbT3FB/TGGs=
+SIZE (nextpnr-0.10pl20260605-32324500.tar.gz) = 3524943
diff --git a/cad/nextpnr/pkg/DESCR b/cad/nextpnr/pkg/DESCR
new file mode 100644
index 00000000000..217791fd790
--- /dev/null
+++ b/cad/nextpnr/pkg/DESCR
@@ -0,0 +1,2 @@
+nextpnr aims to be a vendor neutral, timing driven, FOSS FPGA place and
+route tool.
diff --git a/cad/nextpnr/pkg/PLIST b/cad/nextpnr/pkg/PLIST
new file mode 100644
index 00000000000..63fd94f8a9c
--- /dev/null
+++ b/cad/nextpnr/pkg/PLIST
@@ -0,0 +1,7 @@
+@bin bin/nextpnr-generic
+@bin bin/nextpnr-himbaechel
+share/nextpnr/
+share/nextpnr/himbaechel/
+share/nextpnr/himbaechel/gatemate/
+share/nextpnr/himbaechel/gatemate/chipdb-CCGM1A1.bin
+share/nextpnr/himbaechel/gatemate/chipdb-CCGM1A2.bin