Packaging gprbuild on OpenBSD

Hello,

I have not written a single piece of ada code in my life, though I think I am going to start now.
I have started packaging gprbuild 25.0.0 for OpenBSD. For now I have this diff.
Anyone interested on testing it and/or giving new ideas, as well as reasons why this is not a good idea is welcome. I am just a nooby here.

If this goes well, I will try to package also Alire, which for now has compiled without issues.

Thanks.

Index: Makefile
===================================================================
RCS file: Makefile
diff -N Makefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ Makefile	23 Mar 2026 18:43:04 -0000
@@ -0,0 +1,44 @@
+
+COMMENT = build system designed to construct multi-language systems
+
+V = 25.0.0
+DISTNAME = gprbuild-${V}
+REVISION = 0
+
+CATEGORIES = devel
+
+HOMEPAGE = https://github.com/AdaCore/gprbuild
+
+MAINTAINER = ports@openbsd.org
+
+# GLPv3+
+PERMIT_PACKAGE = Probably Yes, this is GPLv3
+PERMIT_DISTFILES = Probably Yes, this is GPLv3
+
+WANTLIB += c pthread
+
+SITES = https://github.com/
+
+BUILD_DEPENDS = lang/gcc/15,-ada
+
+DISTFILES += gprbuild-${V}{AdaCore/gprbuild/archive/refs/tags/v${V}}.tar.gz
+DISTFILES += xmlada-${V}{AdaCore/xmlada/archive/refs/tags/v${V}}.tar.gz
+DISTFILES += gprconfig_kb-${V}{AdaCore/gprconfig_kb/archive/refs/tags/v${V}}.tar.gz
+
+# We use the bootstrap script because building gprbuild requires gprbuild
+do-build:
+	cd ${WRKDIR}/gprbuild-${V};		\
+	./bootstrap.sh				\
+		--with-xmlada=../xmlada-${V}	\
+ 		--with-kb=../gprconfig_kb-${V}	\
+ 		--build
+
+do-install:
+	cd ${WRKDIR}/gprbuild-${V};		\
+	./bootstrap.sh				\
+		--prefix=/usr/local		\
+		--with-xmlada=../xmlada-${V}	\
+ 		--with-kb=../gprconfig_kb-${V}	\
+ 		--install
+
+.include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: distinfo
diff -N distinfo
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ distinfo	23 Mar 2026 18:43:04 -0000
@@ -0,0 +1,6 @@
+SHA256 (gprbuild-25.0.0.tar.gz) = 0S+UwewLbiGfaxYvcfVxKdIkJud5gJL1+FuewsyBi/E=
+SHA256 (gprconfig_kb-25.0.0.tar.gz) = gC5tOKOxEIl5JKnBbhQ8uGNg8t3pS7W5FEx8OR43sSE=
+SHA256 (xmlada-25.0.0.tar.gz) = 27WYSgkxMRx6eHpnnvTPru7dNXR0pYXcFwFA7yJR3Mo=
+SIZE (gprbuild-25.0.0.tar.gz) = 940774
+SIZE (gprconfig_kb-25.0.0.tar.gz) = 44165
+SIZE (xmlada-25.0.0.tar.gz) = 1082553
Index: pkg/DESCR
===================================================================
RCS file: pkg/DESCR
diff -N pkg/DESCR
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ pkg/DESCR	23 Mar 2026 18:43:04 -0000
@@ -0,0 +1,4 @@
+GPRbuild is a generic build tool designed for the construction of large
+multi-language systems organized into subsystems and libraries. It is
+well-suited for compiled languages supporting separate compilation, such as
+Ada, C, C++ and Fortran.
Index: pkg/PLIST
===================================================================
RCS file: pkg/PLIST
diff -N pkg/PLIST
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ pkg/PLIST	23 Mar 2026 18:43:04 -0000
@@ -0,0 +1,77 @@
+@bin bin/gprbuild
+@bin bin/gprclean
+@bin bin/gprconfig
+@bin bin/gprinstall
+@bin bin/gprls
+@bin bin/gprname
+libexec/gprbuild/
+@bin libexec/gprbuild/gprbind
+@bin libexec/gprbuild/gprlib
+share/gpr/
+share/gpr/_default.gpr
+share/gprconfig/
+share/gprconfig/0_default.xml
+share/gprconfig/aamp.xml
+share/gprconfig/aamp_compilers.xml
+share/gprconfig/aarch64-vx7.xml
+share/gprconfig/aarch64-vx7r2.xml
+share/gprconfig/arm-vx6.xml
+share/gprconfig/arm-vx7.xml
+share/gprconfig/arm-vx7r2.xml
+share/gprconfig/asis.xml
+share/gprconfig/asm.xml
+share/gprconfig/baselined.xml
+share/gprconfig/bin_img.xml
+share/gprconfig/c.xml
+share/gprconfig/clean.xml
+share/gprconfig/compilers-arm-vx7.xml
+share/gprconfig/compilers-asis.xml
+share/gprconfig/compilers-baselined.xml
+share/gprconfig/compilers-e500v2-vx6.xml
+share/gprconfig/compilers-e500v2-vx653.xml
+share/gprconfig/compilers-e500v2-vx7.xml
+share/gprconfig/compilers-e500v2-vx7r2.xml
+share/gprconfig/compilers-ppc-vx653.xml
+share/gprconfig/compilers-ppc-vx7.xml
+share/gprconfig/compilers-ppc-vx7r2.xml
+share/gprconfig/compilers-ppc64-vx7.xml
+share/gprconfig/compilers-ppc64-vx7r2.xml
+share/gprconfig/compilers-vxworks.xml
+share/gprconfig/compilers-x86-vx7.xml
+share/gprconfig/compilers-x86_64-vx7.xml
+share/gprconfig/compilers.xml
+share/gprconfig/cpp.xml
+share/gprconfig/cross.xml
+share/gprconfig/e500v2-vx6.xml
+share/gprconfig/e500v2-vx653.xml
+share/gprconfig/e500v2-vx7.xml
+share/gprconfig/e500v2-vx7r2.xml
+share/gprconfig/env.ent
+share/gprconfig/fallback_targets.xml
+share/gprconfig/fortran.xml
+share/gprconfig/gnat.xml
+share/gprconfig/linker.xml
+share/gprconfig/morello-vx7r2.xml
+share/gprconfig/nocompiler.xml
+share/gprconfig/ppc-vx6.xml
+share/gprconfig/ppc-vx653.xml
+share/gprconfig/ppc-vx7.xml
+share/gprconfig/ppc-vx7r2.xml
+share/gprconfig/ppc64-vx7.xml
+share/gprconfig/ppc64-vx7r2.xml
+share/gprconfig/shortcuts.ent
+share/gprconfig/targetset.xml
+share/gprconfig/tricore-compilers.xml
+share/gprconfig/tricore-configuration.xml
+share/gprconfig/tricore-target.xml
+share/gprconfig/vx6.ent
+share/gprconfig/vx653.ent
+share/gprconfig/vx7.ent
+share/gprconfig/vxworks.ent
+share/gprconfig/vxworks.xml
+share/gprconfig/windres.xml
+share/gprconfig/x86-vx6.xml
+share/gprconfig/x86-vx7.xml
+share/gprconfig/x86-vx7r2.xml
+share/gprconfig/x86_64-vx7.xml
+share/gprconfig/x86_64-vx7r2.xml

1 Like

Hi @ZenitDS,

the Projects/Ideas category is generally reserved for projects/ideas that are looking to receive some funding from Ada Users/Awards. I think your post is misplaced, but… If you don’t mind, lets keep it here as this touches on a quite important topic that may need some funding! Maybe you would be interested in it :slight_smile:

Upstream support of Free/Net/OpenBSD/etc to GNAT!

A lot of OSes (Free/Net/OpenBSD, Illumos/Solaris, Ironclad/Gloire, Haiku…) do not have official support from the toolchain or compilers (GNAT). However, they are supported with external patches that live withing those OSes systems… I would like to propose a project to upstream to GCC/GNAT and GPRBuild those patches and have official support in them! Potentially also to Alire!

I think I do not have to explain why this would be helpful to the community or how that could benefit the outreach of Ada/SPARK to other communities and OSes that also present interesting environments (such as NetBSD with its plentiful set of architectures!).

Also, while the task seems challenging, most patches already exists and it would be an effort of upstreaming them, potentially with a cleanup, and testing them. I have done this in the past and it is not trivial, but once one understands the structure of GNAT, it is a very repetitive task!

I do not wish to be the one carrying this task.

Best regards,
Fer

Hi,

Yeah, my post is misplaced.
Although I appreciate the offer, I believe I am not qualified nor have the intent to request funding to take on the project you mention.
That said, I am interested in contributing to the support of OpenBSD, which is what I personally use.
I will keep it here if you so wish and guess it is General that this should be posted on, am I right?

Best,
zen

Yup, that would have been the preferred place :slight_smile: If you want to move it feel free and I will delete my post.

And regarding your original post. It may be necessary to patch GPRbuild itself so that it recognises OpenBSD as a supported OS Add FreeBSD support · AdaCore/gprconfig_kb@2f58b6b · GitHub GPRbuild will most likely build, but it wont do anything and just fail.

Best regards,
Fer

I have actually built gprbuild using the bootstrap script and then built alire using the just built gprbuild, which seems to be working. At least it executes and i can search for packages. Not sure what you mean by not doing anything and just failing. Maybe it is for cross-compilation that it is needed? Just guessing.

Best regards,
zen

Probably out of date and sounds like you’ve got gprbuild sorted but I put this together in my early Ada days. The ease with which I found you could use Gnat with OpenBSDs C source tree was astounding back then. I recently noticed Gnat 15 is now packaged for OpenBSD amd64 which is pretty cool. Perhaps gnat for OpenBSD Arm cpus will land one day too but just glad gnat 15 is there.