pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

devel/gprbuild: Update to 24.0.0nb2



Module Name:	pkgsrc-wip
Committed By:	Dmytro Kazankov <dmytro.kazankov%gmail.com@localhost>
Pushed By:	dkazankov
Date:		Tue May 21 12:16:27 2024 +0300
Changeset:	b166e55fb5b0135d2a1122047248fe51d1f37814

Added Files:
	gprbuild/DESCR
	gprbuild/Makefile
	gprbuild/PLIST
	gprbuild/buildlink3.mk
	gprbuild/distinfo
	gprbuild/files/buildlink.cgpr
	gprbuild/gprbuild.mk
	gprbuild/patches/patch-Makefile
	gprbuild/patches/patch-bootstrap.sh
	gprbuild/patches/patch-deps_xmlada_Makefile.in
	gprbuild/patches/patch-gpr_gpr.gpr
	gprbuild/patches/patch-gpr_src_gpr-util-put__resource__usage____unix.adb
	gprbuild/patches/patch-gpr_src_gpr-version.ads
	gprbuild/patches/patch-gpr_src_gpr_imports.c
	gprbuild/patches/patch-gprbuild.gpr
	gprbuild/version.mk

Log Message:
devel/gprbuild: Update to 24.0.0nb2

* The package made more buildlink friendly, the list of buildlinked files
  has been corrected so as not to interfere with installed Ada library packages.
* For those packages that use GPRbuild as main (or the only) build system
  (currently alire only) gprbuild.mk was added.
* Patches unified with new devel/gprlib package.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=b166e55fb5b0135d2a1122047248fe51d1f37814

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 gprbuild/DESCR                                     |   4 +
 gprbuild/Makefile                                  |  96 ++++++++++++
 gprbuild/PLIST                                     | 174 +++++++++++++++++++++
 gprbuild/buildlink3.mk                             |  31 ++++
 gprbuild/distinfo                                  |  19 +++
 gprbuild/files/buildlink.cgpr                      | 144 +++++++++++++++++
 gprbuild/gprbuild.mk                               |  73 +++++++++
 gprbuild/patches/patch-Makefile                    |  70 +++++++++
 gprbuild/patches/patch-bootstrap.sh                |  23 +++
 gprbuild/patches/patch-deps_xmlada_Makefile.in     |  16 ++
 gprbuild/patches/patch-gpr_gpr.gpr                 |  15 ++
 ...r_src_gpr-util-put__resource__usage____unix.adb |  15 ++
 gprbuild/patches/patch-gpr_src_gpr-version.ads     |  28 ++++
 gprbuild/patches/patch-gpr_src_gpr_imports.c       |  22 +++
 gprbuild/patches/patch-gprbuild.gpr                |  15 ++
 gprbuild/version.mk                                |   3 +
 16 files changed, 748 insertions(+)

diffs:
diff --git a/gprbuild/DESCR b/gprbuild/DESCR
new file mode 100644
index 0000000000..cb2756c313
--- /dev/null
+++ b/gprbuild/DESCR
@@ -0,0 +1,4 @@
+GPRbuild build system
+
+GPRbuild is an advanced build system designed to help automate the construction
+of multi-language systems.
diff --git a/gprbuild/Makefile b/gprbuild/Makefile
new file mode 100644
index 0000000000..d8fdbd3b5b
--- /dev/null
+++ b/gprbuild/Makefile
@@ -0,0 +1,96 @@
+# $NetBSD: Makefile,v 1.2 2024/03/19 13:20:35 wiz Exp $
+
+.include "version.mk"
+
+DISTNAME=	gprbuild-${GPRBUILD_VERSION}
+PKGREVISION=	2
+CATEGORIES=	devel
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+MASTER_SITES=	${MASTER_SITE_GITHUB:=AdaCore/}
+GITHUB_TAG=	v${PKGVERSION_NOREV}
+
+HOMEPAGE=	https://github.com/AdaCore/gprbuild
+COMMENT=	GPRbuild build system for Ada
+LICENSE=	gnu-gpl-v3
+
+USE_LANGUAGES=	c ada
+
+GITHUB_SUBMODULES+=	AdaCore	xmlada	${GITHUB_TAG}	deps/xmlada
+GITHUB_SUBMODULES+=	AdaCore	gprconfig_kb	${GITHUB_TAG}	deps/gprconfig_kb
+
+USE_TOOLS+=	gmake
+
+HAS_CONFIGURE=	yes
+
+GCC_REQD+=	13
+
+OBJDIR=		${WRKDIR}/build
+BOOTSTRAPDIR=	${WRKDIR}/bootstrap
+
+CONFIG_PROJECT=		${WRKDIR}/buildlink.cgpr
+GPR_PROJECT_PATH=	${WRKDIR}/.buildlink/share/gpr
+
+# environment for bootstrap build
+PREBUILD_ENV=	${CONFIGURE_ENV}
+PREBUILD_ENV+=	CC=${CC}
+PREBUILD_ENV+=	CFLAGS=${CFLAGS:M:Q}
+PREBUILD_ENV+=	GNATMAKE=${GMKPATH}
+
+CONFIGURE_DIRS=		${OBJDIR}
+CONFIG_SHELL=		${MAKE_PROGRAM} -f
+CONFIGURE_SCRIPT=	${WRKSRC}/Makefile
+CONFIGURE_ARGS=		setup
+CONFIGURE_ARGS+=	prefix=${DESTDIR}${PREFIX}
+CONFIGURE_ARGS+=	SOURCE_DIR=${WRKSRC}
+
+BUILD_DIRS=		${OBJDIR}
+MAKE_FILE=		${WRKSRC}/Makefile
+BUILD_MAKE_FLAGS=	GPRBUILD_OPTIONS='--config=${CONFIG_PROJECT} -aP ${GPR_PROJECT_PATH}'
+
+INSTALL_DIRS=		${OBJDIR}
+INSTALL_MAKE_FLAGS+=	GPRINSTALL_OPTIONS='--config=${CONFIG_PROJECT} -aP ${GPR_PROJECT_PATH}'
+
+SUBST_CLASSES+=			buildlink
+SUBST_STAGE.buildlink=		post-configure
+SUBST_FILES.buildlink=		${CONFIG_PROJECT}
+SUBST_MESSAGE.buildlink=	Set work directory path in config project
+SUBST_VARS.buildlink=		WRKDIR
+
+SUBST_CLASSES+=			fixver
+SUBST_STAGE.fixver=		pre-configure
+SUBST_FILES.fixver=		deps/xmlada/configure
+SUBST_MESSAGE.fixver=		Fix version in configure
+SUBST_SED.fixver=		-e 's,18.0w,24.0,g'
+
+GENERATE_PLIST+= \
+	cd ${DESTDIR}${PREFIX} && \
+	${FIND} bin libexec share \( -type f -or -type l \) -print | ${SORT};
+
+.include "../../mk/bsd.prefs.mk"
+
+pre-configure:
+	${RUN} ${CP} ${PKGDIR}/files/buildlink.cgpr ${WRKDIR}/
+	${RUN} ${MKDIR} ${OBJDIR}
+
+post-configure:
+	${RUN} cd ${WRKSRC}/deps/xmlada \
+	&& set -x ; env ${CONFIGURE_ENV} \
+	./configure \
+	    --prefix=${WRKDIR}/.buildlink
+
+pre-build:
+# Bootstrap build
+	${RUN} ${MKDIR} ${BOOTSTRAPDIR}
+	${RUN} cd ${BOOTSTRAPDIR} \
+	&& set -x ; env ${PREBUILD_ENV} \
+	${SHELL} ${WRKSRC}/bootstrap.sh \
+	    --prefix=${WRKDIR}/.buildlink \
+	    --srcdir=${WRKSRC} \
+	    --with-xmlada=${WRKSRC}/deps/xmlada \
+	    --with-kb=${WRKSRC}/deps/gprconfig_kb
+# Build xmlada with bootstrapped gprbuild. It then will be used in normal build.
+	${RUN} cd ${WRKSRC}/deps/xmlada \
+	&& set -x ; env ${MAKE_ENV} \
+	${MAKE_PROGRAM} all install GPROPTS='--config=${CONFIG_PROJECT}'
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/gprbuild/PLIST b/gprbuild/PLIST
new file mode 100644
index 0000000000..4c73c27738
--- /dev/null
+++ b/gprbuild/PLIST
@@ -0,0 +1,174 @@
+@comment $NetBSD: PLIST,v 1.1 2024/03/12 17:50:12 wiz Exp $
+bin/gprbuild
+bin/gprclean
+bin/gprconfig
+bin/gprinstall
+bin/gprls
+bin/gprname
+bin/gprslave
+libexec/gprbuild/gprbind
+libexec/gprbuild/gprlib
+share/examples/gprbuild/Makefile
+share/examples/gprbuild/ada_cpp/Makefile
+share/examples/gprbuild/ada_cpp/animals.gpr
+share/examples/gprbuild/ada_cpp/except.gpr
+share/examples/gprbuild/ada_cpp/src1/ada_main.adb
+share/examples/gprbuild/ada_cpp/src1/call_cpp.adb
+share/examples/gprbuild/ada_cpp/src1/call_cpp.ads
+share/examples/gprbuild/ada_cpp/src1/cpp_main.cpp
+share/examples/gprbuild/ada_cpp/src1/cpp_routine.cpp
+share/examples/gprbuild/ada_cpp/src1/cpp_routine.h
+share/examples/gprbuild/ada_cpp/src2/animals.adb
+share/examples/gprbuild/ada_cpp/src2/animals.ads
+share/examples/gprbuild/ada_cpp/src2/animals.h
+share/examples/gprbuild/ada_cpp/src2/animals_c.cc
+share/examples/gprbuild/ada_cpp/src2/animals_interfaces.ads
+share/examples/gprbuild/ada_cpp/src2/main.adb
+share/examples/gprbuild/ada_f77/Makefile
+share/examples/gprbuild/ada_f77/ess.f
+share/examples/gprbuild/ada_f77/fm.gpr
+share/examples/gprbuild/ada_f77/ft.gpr
+share/examples/gprbuild/ada_f77/src/fm-interfac.adb
+share/examples/gprbuild/ada_f77/src/fm-interfac.ads
+share/examples/gprbuild/ada_f77/src/fm-locks.adb
+share/examples/gprbuild/ada_f77/src/fm-locks.ads
+share/examples/gprbuild/ada_f77/src/fm-protected_queue.adb
+share/examples/gprbuild/ada_f77/src/fm-protected_queue.ads
+share/examples/gprbuild/ada_f77/src/fm-system_dependant.adb
+share/examples/gprbuild/ada_f77/src/fm-system_dependant.ads
+share/examples/gprbuild/ada_f77/src/fm-tuple_manager.adb
+share/examples/gprbuild/ada_f77/src/fm-tuple_manager.ads
+share/examples/gprbuild/ada_f77/src/fm-types.ads
+share/examples/gprbuild/ada_f77/src/fm.adb
+share/examples/gprbuild/ada_f77/src/fm.ads
+share/examples/gprbuild/extended_projects/Makefile
+share/examples/gprbuild/extended_projects/new_ada_main.gpr
+share/examples/gprbuild/extended_projects/new_ada_src/ada_main.adb
+share/examples/gprbuild/extended_projects/new_common_subsystem.gpr
+share/examples/gprbuild/extended_projects/new_util_src/c_lib.ads
+share/examples/gprbuild/extended_projects/new_util_src/lib2.c
+share/examples/gprbuild/first_steps/Makefile
+share/examples/gprbuild/first_steps/ada_main.gpr
+share/examples/gprbuild/first_steps/ada_src/ada_main.adb
+share/examples/gprbuild/first_steps/c_main.gpr
+share/examples/gprbuild/first_steps/c_src/c_main.c
+share/examples/gprbuild/first_steps/util_src/ada_lib.adb
+share/examples/gprbuild/first_steps/util_src/ada_lib.ads
+share/examples/gprbuild/first_steps/util_src/c_lib.ads
+share/examples/gprbuild/first_steps/util_src/lib.c
+share/examples/gprbuild/first_steps/util_src/lib.h
+share/examples/gprbuild/libraries/Makefile
+share/examples/gprbuild/libraries/ada_main.adb
+share/examples/gprbuild/libraries/c_main.c
+share/examples/gprbuild/libraries/dynamic_lib.gpr
+share/examples/gprbuild/libraries/extern_lib.gpr
+share/examples/gprbuild/libraries/lib_src/ada_lib.adb
+share/examples/gprbuild/libraries/lib_src/ada_lib.ads
+share/examples/gprbuild/libraries/lib_src/c_lib.ads
+share/examples/gprbuild/libraries/lib_src/lib.c
+share/examples/gprbuild/libraries/lib_src/lib.h
+share/examples/gprbuild/libraries/main0.gpr
+share/examples/gprbuild/libraries/main1.gpr
+share/examples/gprbuild/libraries/main2.gpr
+share/examples/gprbuild/libraries/main3.gpr
+share/examples/gprbuild/libraries/main4.gpr
+share/examples/gprbuild/libraries/sa_lib.gpr
+share/examples/gprbuild/libraries/static_lib.gpr
+share/examples/gprbuild/matrix/Makefile
+share/examples/gprbuild/matrix/matrix.gpr
+share/examples/gprbuild/matrix/src/initmat.c
+share/examples/gprbuild/matrix/src/main.adb
+share/examples/gprbuild/matrix/src/multmat.f
+share/examples/gprbuild/namings/Makefile
+share/examples/gprbuild/namings/_print2.ada
+share/examples/gprbuild/namings/_print3.adb
+share/examples/gprbuild/namings/main.adb
+share/examples/gprbuild/namings/my_routine.c1
+share/examples/gprbuild/namings/my_routine2.c1
+share/examples/gprbuild/namings/namings.gpr
+share/examples/gprbuild/namings/src1/main.adb
+share/examples/gprbuild/namings/util-case1.ada
+share/examples/gprbuild/namings/util-case2.ada
+share/examples/gprbuild/namings/util.ads
+share/examples/gprbuild/scenarios/Makefile
+share/examples/gprbuild/scenarios/general_lib.gpr
+share/examples/gprbuild/scenarios/main.gpr
+share/examples/gprbuild/subsystems/Makefile
+share/examples/gprbuild/subsystems/ada_main.gpr
+share/examples/gprbuild/subsystems/ada_src/ada_main.adb
+share/examples/gprbuild/subsystems/attribute_sharing.gpr
+share/examples/gprbuild/subsystems/c_main.gpr
+share/examples/gprbuild/subsystems/c_src/c_main.c
+share/examples/gprbuild/subsystems/common_subsystem.gpr
+share/examples/gprbuild/subsystems/util_src/ada_lib.adb
+share/examples/gprbuild/subsystems/util_src/ada_lib.ads
+share/examples/gprbuild/subsystems/util_src/c_lib.ads
+share/examples/gprbuild/subsystems/util_src/lib.c
+share/examples/gprbuild/subsystems/util_src/lib.h
+share/gpr/_default.gpr
+share/gpr/manifests/gprbuild
+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/gprconfig.xsd
+share/gprconfig/linker.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
diff --git a/gprbuild/buildlink3.mk b/gprbuild/buildlink3.mk
new file mode 100644
index 0000000000..83de98cf54
--- /dev/null
+++ b/gprbuild/buildlink3.mk
@@ -0,0 +1,31 @@
+# $NetBSD: buildlink3.mk,v 1.3 2024/05/19 10:30:00 dkazankov Exp $
+
+BUILDLINK_TREE+=	gprbuild
+
+.if !defined(GPRBUILD_BUILDLINK3_MK)
+GPRBUILD_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.gprbuild+=	gprbuild>=24.0.0
+BUILDLINK_PKGSRCDIR.gprbuild=		../../wip/gprbuild
+BUILDLINK_DEPMETHOD.gprbuild?=		build
+
+# GPRbuild does similar things in its own way
+BUILDLINK_AUTO_VARS.gprbuild=	no
+BUILDLINK_AUTO_DIRS.gprbuild=	no
+
+BUILDLINK_FILES.gprbuild=	bin/gpr* libexec/gprbuild/*
+BUILDLINK_FILES.gprbuild+=	share/gpr/_default.gpr share/gpr/manifests/gprbuild
+BUILDLINK_FILES.gprbuild+=	share/gprconfig/*
+
+BUILDLINK_CONTENTS_FILTER.gprbuild=	\
+	${EGREP} '(bin/gpr.*|libexec/gprbuild/gpr.*|share/gpr/.*\.gpr$$|share/gpr/manifests/.*|share/gprconfig/.*)'
+
+# Buildlinked libraries search path
+GPR_PROJECT_PATH?=	${BUILDLINK_DIR}/share/gpr
+
+MAKE_ENV+=	GPR_PROJECT_PATH=${GPR_PROJECT_PATH:Q}
+INSTALL_ENV+=	GPR_PROJECT_PATH=${GPR_PROJECT_PATH:Q}
+
+.endif
+
+BUILDLINK_TREE+=	-gprbuild
diff --git a/gprbuild/distinfo b/gprbuild/distinfo
new file mode 100644
index 0000000000..52dcc4e0ab
--- /dev/null
+++ b/gprbuild/distinfo
@@ -0,0 +1,19 @@
+$NetBSD: distinfo,v 1.2 2024/03/19 13:20:35 wiz Exp $
+
+BLAKE2s (AdaCore-gprconfig_kb-v24.0.0.tar.gz) = e39c1e70b80923db53f0e6c4687536fcbfdc951209a34dc039423f9cc31319fa
+SHA512 (AdaCore-gprconfig_kb-v24.0.0.tar.gz) = 1bd28b7eba57a8952635f3fb61e06278935c31ed196182e19e9e8c2ffa3edbccea5a9b97b3f5a3c820e7c3f5b6878d87f7b42d66a7f57e083d0b56cb91a6eb84
+Size (AdaCore-gprconfig_kb-v24.0.0.tar.gz) = 43010 bytes
+BLAKE2s (AdaCore-xmlada-v24.0.0.tar.gz) = a02dae17a91d326f06fc85e9b69ee5bfe181ab97ca3f7e3a846b71bc5928b643
+SHA512 (AdaCore-xmlada-v24.0.0.tar.gz) = 4e6773a5fdf9b6ebb5afca913d77aba9f697768f28ef9b23b9277aa4ea4ce09de4e53655dd5559e2326ff847327adb53fa6b776775aa923100a2624df415c97d
+Size (AdaCore-xmlada-v24.0.0.tar.gz) = 1053363 bytes
+BLAKE2s (gprbuild-24.0.0.tar.gz) = d8279a6ae9f2df9fa76fa5eccb9d58a39f0a71cf27773ed140f2e20f93778e12
+SHA512 (gprbuild-24.0.0.tar.gz) = 09da4d54f2f151e9f9453e1a459533e2373eb5d4c51831be2bf90964ebcf653752de2f8b271c77f7b599f62146516fc60258ec3c96779fa2b52cd52979c6bd03
+Size (gprbuild-24.0.0.tar.gz) = 959615 bytes
+SHA1 (patch-Makefile) = a6fad4177b6537675ca5775c317ad05dbae63c95
+SHA1 (patch-bootstrap.sh) = b76b0694d33c0e099151b96260ad957a07ebb206
+SHA1 (patch-deps_xmlada_Makefile.in) = 98632303e6829b0540abeca6a5a7cd427b455adf
+SHA1 (patch-gpr_gpr.gpr) = 321bce32cb8af1821e2e6b6b8d6ca75194410a0b
+SHA1 (patch-gpr_src_gpr-util-put__resource__usage____unix.adb) = c134d5aad0b90da41eef03cd2e5d98e2f14611fb
+SHA1 (patch-gpr_src_gpr-version.ads) = 9321ae482f2f36b9d5a6c96225ae3a7a5e16a7e1
+SHA1 (patch-gpr_src_gpr_imports.c) = 945eefee50b198695ade7a4b88d4f87dd50f7925
+SHA1 (patch-gprbuild.gpr) = e943f95bd4681e3cfde3e1782e9ec2efd9cdf181
diff --git a/gprbuild/files/buildlink.cgpr b/gprbuild/files/buildlink.cgpr
new file mode 100644
index 0000000000..b7b9f9fb83
--- /dev/null
+++ b/gprbuild/files/buildlink.cgpr
@@ -0,0 +1,144 @@
+configuration project default is
+   for Target use "x86_64-netbsd";
+   for Canonical_Target use "x86_64-netbsd";
+   for Inherit_Source_Path ("C++") use ("C");
+   for Inherit_Source_Path ("Asm_Cpp") use ("Asm");
+   for Default_Language use "Ada";
+   
+   for Archive_Builder  use ("ar", "cr");
+   for Archive_Builder_Append_Option use ("q");
+   for Archive_Indexer  use ("ranlib");
+   for Archive_Suffix   use ".a";
+   
+   for Symbolic_Link_Supported use "true";
+   for Library_Major_Minor_Id_Supported use "true";
+   for Library_Builder  use "@WRKDIR@/.buildlink/libexec/gprbuild/gprlib";
+   for Library_Support  use "full";
+   for Shared_Library_Prefix use "lib";
+   for Shared_Library_Minimum_Switches use ("-shared");
+   for Library_Version_Switches use ("-Wl,-soname,");
+
+   for Shared_Library_Suffix use ".so";
+   for Library_Auto_Init_Supported use "true";
+   for Run_Path_Option  use ("-Wl,-z,origin,-rpath,");
+   for Run_Path_Origin use "$ORIGIN";
+   for Library_Encapsulated_Supported use "true";
+   for Library_Encapsulated_Options use ("-shared", "-static-libgcc");
+   
+   for Toolchain_Version ("Ada") use "GNAT 13.2.0";
+   for Runtime_Dir       ("Ada") use "@WRKDIR@/.buildlink/gcc13-gnat/lib/gcc/x86_64--netbsd/13.2.0";
+
+   package Builder is
+      for Executable_Suffix use "";
+   end Builder;
+
+   package Compiler is
+      for Driver                   ("Ada") use "@WRKDIR@/.gcc/bin/gcc";
+      for Driver              ("C") use "@WRKDIR@/.gcc/bin/gcc";
+      for Driver              ("C++") use "@WRKDIR@/.gcc/bin/g++";
+      for Language_Kind            ("Ada") use "unit_based";
+      for Dependency_Kind          ("Ada") use "ALI_File";
+      for Leading_Required_Switches        ("Ada") use
+      ("-c", "-x", "ada", "-gnatA")
+             & Compiler'Leading_Required_Switches ("Ada");
+
+      for Mapping_File_Switches    ("Ada") use ("-gnatem=");
+      for Mapping_Spec_Suffix      ("Ada") use "%s";
+      for Mapping_Body_Suffix      ("Ada") use "%b";
+      for Config_File_Switches     ("Ada") use ("-gnatec=");
+      for Include_Path_File     ("Ada") use "ADA_PRJ_INCLUDE_FILE";
+      
+      for Multi_Unit_Switches ("Ada") use ("-gnateI");
+      for Multi_Unit_Object_Separator ("Ada") use "~";
+      for Config_Body_File_Name ("Ada") use
+           "pragma Source_File_Name_Project (%u, Body_File_Name => ""%f"");";
+      for Config_Spec_File_Name ("Ada") use
+           "pragma Source_File_Name_Project (%u, Spec_File_Name => ""%f"");";
+      for Config_Body_File_Name_Index ("Ada") use
+           "pragma Source_File_Name_Project (%u, Body_File_Name => ""%f"", Index => %i);";
+      for Config_Spec_File_Name_Index ("Ada") use
+           "pragma Source_File_Name_Project (%u, Spec_File_Name => ""%f"", Index => %i);";
+      for Config_Body_File_Name_Pattern ("Ada") use
+           "pragma Source_File_Name_Project " &
+           "  (Body_File_Name  => ""*%b""," &
+           "   Casing          => %c," &
+           "   Dot_Replacement => ""%d"");";
+      for Config_Spec_File_Name_Pattern ("Ada") use
+           "pragma Source_File_Name_Project " &
+           "  (Spec_File_Name  => ""*%s""," &
+           "   Casing          => %c," &
+           "   Dot_Replacement => ""%d"");";
+      for Config_File_Unique    ("Ada") use "False";
+      for Leading_Required_Switches ("Ada") use
+        Compiler'Leading_Required_Switches ("Ada") & ("--RTS=@WRKDIR@/.buildlink/gcc13-gnat/lib/gcc/x86_64--netbsd/13.2.0");
+      for PIC_Option ("Ada") use ("-fPIC");
+        
+      for Leading_Required_Switches   ("C") use
+         ("-c", "-x", "c") & Compiler'Leading_Required_Switches ("C");
+      for Include_Switches_Via_Spec   ("C") use ("cc1", "-I");
+      for Max_Command_Line_Length use "8192";
+      for Response_File_Format    ("C") use "GCC_GNU";
+      for Dependency_Switches ("C") use ("-MMD", "-MF", "");
+      for PIC_Option ("C") use ("-fPIC");
+      
+      for Leading_Required_Switches   ("C++") use
+        ("-c", "-x", "c++") &
+        Compiler'Leading_Required_Switches ("C++");
+      for Dependency_Switches ("C++") use ("-MMD", "-MF", "");
+      for Include_Switches_Via_Spec ("C++") use ("cc1plus", "-I");
+      for Max_Command_Line_Length use "8192";
+      for Response_File_Format    ("C++") use "GCC_GNU";
+      for PIC_Option      ("C++") use ("-fPIC");
+   end Compiler;
+
+   package Naming is
+      for Spec_Suffix ("Ada") use ".ads";
+      for Body_Suffix ("Ada") use ".adb";
+
+      for Body_Suffix ("Asm") use ".s";
+      for Body_Suffix ("Asm2") use ".asm";
+      for Body_Suffix ("Asm_Cpp") use ".S";
+
+      for Body_Suffix ("C") use ".c";
+      for Spec_Suffix ("C") use ".h";
+
+      for Spec_Suffix ("C++") use ".hh";
+      for Body_Suffix ("C++") use ".cpp";
+
+      for Body_Suffix ("Fortran") use ".f";
+
+      for Casing use "lowercase";
+      for Dot_Replacement use "-";
+   end Naming;
+
+   package Binder is
+      for Objects_Path_File     ("Ada") use "ADA_PRJ_OBJECTS_FILE";
+      for Driver         ("Ada") use
+          "@WRKDIR@/.buildlink/libexec/gprbuild/gprbind";
+      for Required_Switches ("Ada") use
+        Binder'Required_Switches ("Ada") & ("--RTS=@WRKDIR@/.buildlink/gcc13-gnat/lib/gcc/x86_64--netbsd/13.2.0");
+   end Binder;
+   
+   package Linker is
+      for Map_File_Option         use "-Wl,-Map,";
+      for Driver use Compiler'Driver ("Ada");
+      for Driver use Compiler'Driver ("C++");
+      for Response_File_Format use "GNU";
+      for Max_Command_Line_Length use "8192";
+   end Linker;
+
+   package Clean is
+      for Source_Artifact_Extensions ("Ada") use (".dg", ".rep");
+      for Object_Artifact_Extensions ("Ada") use (".s", ".ci", ".gcno", ".su");
+
+      for Source_Artifact_Extensions ("C")   use (".gli");
+      for Object_Artifact_Extensions ("C")   use (".s", "ci", ".gcno", ".su");
+
+      for Source_Artifact_Extensions ("C++") use (".gli");
+      for Object_Artifact_Extensions ("C++") use (".s", "ci", ".gcno", ".su");
+      --  Remove the files generated by gnatinspect (in the context of GPS)
+      for Artifacts_In_Object_Dir use Clean'Artifacts_In_Object_Dir
+         & ("gnatinspect.*");
+   end Clean;
+   
+end default;
diff --git a/gprbuild/gprbuild.mk b/gprbuild/gprbuild.mk
new file mode 100644
index 0000000000..68ff76a14d
--- /dev/null
+++ b/gprbuild/gprbuild.mk
@@ -0,0 +1,73 @@
+# $NetBSD: gprbuild.mk,v 1.0 2024/05/19 10:30:00 dkazankov Exp $
+#
+# This Makefile fragment supports building using the GPRbuild tool.
+#
+# Package-settable variables:
+#
+# GPRBUILD_PROJECT_FILE
+#	The path to the project file that is processed by GPRbuild and GPRInstall executables.
+#	Default: MAKE_FILE
+#
+# GPRBUILD_ENV
+#	The shell environment that is exported to the GPRbuild process.
+#	Default: MAKE_ENV
+#
+# GPRBUILD_ARGS
+#	Arguments to pass to GPRbuild during build.
+#	Default: -j0 -p
+#
+# BUILD_DIRS
+#	Directories in which to build.
+#	Default: WRKSRC
+#
+# GPRINSTALL_ENV
+#	The shell environment that is exported to the GPRinstall process.
+#	Default: INSTALL_ENV
+#
+# GPRINSTALL_ARGS
+#	Arguments to pass to GPRinstall during installation:
+#	Default: --mode=usage -p --prefix=${DESTDIR}${PREFIX}
+#
+# INSTALL_DIRS
+#	Directories relative in which to run the 'install' step.
+#	Default: WRKSRC
+
+.include "../../wip/gprbuild/buildlink3.mk"
+
+GPRBUILD_PROJECT_FILE?=	${MAKE_FILE}
+GPRBUILD_ENV?=		${MAKE_ENV}
+GPRINSTALL_ENV?=	${INSTALL_ENV}
+GPRINSTALL_ENV+=	${GPRBUILD_ENV}
+
+GPRBUILD_ARGS?=		-j0 -p
+GPRINSTALL_ARGS?=	--mode=usage -p --prefix=${DESTDIR}${PREFIX}
+
+GPRBUILD_TOOL=		gprbuild
+GPRINSTALL_TOOL=	gprinstall
+
+do-build: gprbuild-build
+do-install: gprbuild-install
+
+.if !target(gprbuild-build)
+.PHONY: gprbuild-build
+gprbuild-build:
+	@for dir in ${BUILD_DIRS}; do \
+	    set -e; \
+	    cd $$dir && \
+		${PKGSRC_SETENV} ${GPRBUILD_ENV} \
+		${GPRBUILD_TOOL} ${GPRBUILD_ARGS} -P ${GPRBUILD_PROJECT_FILE}; \
+	done
+.endif
+
+.if !target(gprbuild-install)
+.PHONY: gprbuild-install
+gprbuild-install:
+	@for dir in ${INSTALL_DIRS}; do \
+	    set -e; \
+	    cd $$dir && \
+		${PKGSRC_SETENV} ${GPRINSTALL_ENV} \
+		${GPRINSTALL_TOOL} ${GPRINSTALL_ARGS} ${GPRBUILD_PROJECT_FILE}; \
+	done
+.endif
+
+#.endif
diff --git a/gprbuild/patches/patch-Makefile b/gprbuild/patches/patch-Makefile
new file mode 100644
index 0000000000..ab26c9f32d
--- /dev/null
+++ b/gprbuild/patches/patch-Makefile
@@ -0,0 +1,70 @@
+$NetBSD: patch-Makefile,v 1.2 2024/05/08 18:00:00 dkazankov Exp $
+
+Make it possible to set install parameters, fix install parameters, ENABLE_SHARED
+
+--- Makefile.orig	2023-10-09 21:31:11.000000000 +0300
++++ Makefile	2024-05-08 22:24:58.865354615 +0300
+@@ -34,6 +34,9 @@
+ SOURCE_DIR    := $(shell dirname "$(MAKEFILE_LIST)")
+ LIB_DIR       = lib/
+ 
++ENABLE_SHARED := $(shell gprbuild $(GTARGET) -c -q -p \
++	-P$(MAKEPREFIX)config/test_shared 2>/dev/null && echo "yes")
++
+ # Load current setup if any
+ -include makefile.setup
+ 
+@@ -45,6 +48,7 @@
+ GTARGET=--target=$(TARGET)
+ endif
+ 
++GPRINSTALL_OPTIONS=
+ INSTALLER=$(LIB_INSTALLER)
+ EXEC_INSTALLER=$(INSTALLER) -XBUILD=${BUILD}
+ 
+@@ -61,24 +65,21 @@
+ MAKEPREFIX=$(SOURCE_DIR)/
+ endif
+ 
+-ENABLE_SHARED := $(shell gprbuild $(GTARGET) -c -q -p \
+-	-P$(MAKEPREFIX)config/test_shared 2>/dev/null && echo "yes")
+-
+ ifeq ($(ENABLE_SHARED), yes)
+    LIBGPR_TYPES=static shared static-pic
+ else
+-   LIBGPR_TYPES=static
++   LIBGPR_TYPES=static static-pic
+ endif
+ 
+ # Make sure Windows's "OS" environment variable does not cause
+ # confusion for cross-Linux builds.
+-LIBGPR_OS = $(if $(findstring linux,$(TARGET)),-XOS=UNIX)
++LIBGPR_OS = $(if $(or $(findstring linux,$(TARGET)),$(findstring bsd,$(TARGET))),-XOS=UNIX)
+ 
+ # Used to pass extra options to GPRBUILD, like -d for instance
+ GPRBUILD_OPTIONS=
+ 
+ BUILDER=gprbuild -p -m $(GTARGET) $(RBD) -j${PROCESSORS} -XBUILD=${BUILD} ${GPRBUILD_OPTIONS}
+-LIB_INSTALLER=gprinstall -p -f --target=$(TARGET) $(RBD) "--prefix=${prefix}"
++LIB_INSTALLER=gprinstall -p -f $(GTARGET) $(RBD) "--prefix=${prefix}" ${GPRINSTALL_OPTIONS}
+ CLEANER=gprclean -q $(RBD)
+ 
+ GPRBUILD_BUILDER=$(BUILDER) $(GPRBUILD_GPR) \
+@@ -86,7 +87,7 @@
+ LIBGPR_BUILDER=$(BUILDER) $(GPR_GPR) $(LIBGPR_OS)
+ LIBGPR_INSTALLER=$(LIB_INSTALLER) $(GPR_GPR) $(LIBGPR_OS) -XBUILD=${BUILD} \
+ 	--install-name=gpr \
+-	--build-var=LIBRARY_TYPE --build-var=GPR_BUILD $(GTARGET)
++	--build-var=LIBRARY_TYPE --build-var=GPR_BUILD
+ LIBGPR_UNINSTALLER=$(LIB_INSTALLER) $(GPR_GPR) $(LIBGPR_OS) --install-name=gpr --uninstall
+ 
+ #########
+@@ -127,7 +128,7 @@
+ install:
+ 	$(EXEC_INSTALLER) --mode=usage --install-name=gprbuild \
+ 		-XINSTALL_MODE=nointernal $(GPRBUILD_GPR)
+-	$(EXEC_INSTALLER) --target=$(TARGET) --mode=usage  --install-name=gprbuild \
++	$(EXEC_INSTALLER) --mode=usage  --install-name=gprbuild \
+ 		-XINSTALL_MODE=internal $(GPRBUILD_GPR)
+ 
+ complete: all install libgpr.install.static
diff --git a/gprbuild/patches/patch-bootstrap.sh b/gprbuild/patches/patch-bootstrap.sh
new file mode 100644
index 0000000000..2f14aeb45d
--- /dev/null
+++ b/gprbuild/patches/patch-bootstrap.sh
@@ -0,0 +1,23 @@
+$NetBSD: patch-bootstrap.sh,v 1.2 2024/05/07 15:30:00 dkazankov Exp $
+
+Fix out-of-tree bootstrap build
+
+--- bootstrap.sh.orig	2023-10-09 21:31:11.000000000 +0300
++++ bootstrap.sh	2024-05-07 15:49:52.531377055 +0300
+@@ -90,13 +90,13 @@
+ UName=`uname | cut -b -5`
+ PutUsage=gpr/src/gpr-util-put_resource_usage
+ 
+-rm -f ${PutUsage}.adb
++rm -f ${srcdir}/${PutUsage}.adb
+ 
+ if [ "$UName" = "CYGWI" ] || [ "$UName" = "MINGW" ]
+ then
+-	cp ${PutUsage}__null.adb ${PutUsage}.adb
++	cp ${srcdir}/${PutUsage}__null.adb ${srcdir}/${PutUsage}.adb
+ else
+-	ln -s $PWD/${PutUsage}__unix.adb ${PutUsage}.adb
++	ln -s ${srcdir}/${PutUsage}__unix.adb ${srcdir}/${PutUsage}.adb
+ fi
+ 
+ # Build
diff --git a/gprbuild/patches/patch-deps_xmlada_Makefile.in b/gprbuild/patches/patch-deps_xmlada_Makefile.in
new file mode 100644
index 0000000000..cb49e05638
--- /dev/null
+++ b/gprbuild/patches/patch-deps_xmlada_Makefile.in
@@ -0,0 +1,16 @@
+$NetBSD: patch-deps_xmlada_Makefile.in,v 1.1 2024/03/12 17:50:13 wiz Exp $
+
+Make possible install params
+
+--- deps/xmlada/Makefile.in.orig	2023-09-07 14:33:41.000000000 +0300
++++ deps/xmlada/Makefile.in	2023-12-26 11:37:39.332465731 +0200
+@@ -34,7 +34,8 @@
+ MODULES=unicode input_sources sax dom schema
+ MODULE_INSTALL=${MODULES:%=%_inst}
+ 
+-GPROPTS=-XXMLADA_BUILD_MODE=${MODE} -XPROCESSORS=${PROCESSORS}
++GPROPTS=
++GPROPTS+=-XXMLADA_BUILD_MODE=${MODE} -XPROCESSORS=${PROCESSORS}
+ 
+ ifeq (${HOST},${TARGET})
+ IPREFIX=${DESTDIR}${prefix}
diff --git a/gprbuild/patches/patch-gpr_gpr.gpr b/gprbuild/patches/patch-gpr_gpr.gpr
new file mode 100644
index 0000000000..426f07a8f1
--- /dev/null
+++ b/gprbuild/patches/patch-gpr_gpr.gpr
@@ -0,0 +1,15 @@
+$NetBSD: patch-gpr_gpr.gpr,v 1.3 2024/05/07 11:00:00 dkazankov Exp $
+
+Fix name conflict with grpc - same as linux distros
+
+--- gpr/gpr.gpr.orig	2023-10-09 21:31:11.000000000 +0300
++++ gpr/gpr.gpr	2024-05-07 16:34:34.759672549 +0300
+@@ -38,7 +38,7 @@
+ 
+    for Source_Dirs use ("src");
+ 
+-   for Library_Name use "gpr";
++   for Library_Name use "gnatprj";
+    for Object_Dir use "libobj/" & Bld & "/" & Gnat_Lib_Type;
+    for Library_Dir use "lib/" & Bld & "/" & Gnat_Lib_Type;
+ 
diff --git a/gprbuild/patches/patch-gpr_src_gpr-util-put__resource__usage____unix.adb b/gprbuild/patches/patch-gpr_src_gpr-util-put__resource__usage____unix.adb
new file mode 100644
index 0000000000..ffe988f0ff
--- /dev/null
+++ b/gprbuild/patches/patch-gpr_src_gpr-util-put__resource__usage____unix.adb
@@ -0,0 +1,15 @@
+$NetBSD: patch-gpr_src_gpr-util-put__resource__usage____unix.adb,v 1.1 2024/05/07 11:00:00 dkazankov Exp $
+
+Fix warning at link stage on NetBSD
+
+--- gpr/src/gpr-util-put_resource_usage__unix.adb.orig	2023-10-09 21:31:11.000000000 +0300
++++ gpr/src/gpr-util-put_resource_usage__unix.adb	2024-05-07 10:36:42.700699231 +0300
+@@ -69,7 +69,7 @@
+       procedure Print (This : STC.Timeval);
+ 
+       function Getrusage (Who : Integer; usage : out Rusage) return Integer
+-        with Import, Convention => C;
++        with Import, Convention => C, External_Name => "__netbsd_getrusage";
+ 
+       -----------
+       -- Print --
diff --git a/gprbuild/patches/patch-gpr_src_gpr-version.ads b/gprbuild/patches/patch-gpr_src_gpr-version.ads
new file mode 100644
index 0000000000..5ea2f3ca1f
--- /dev/null
+++ b/gprbuild/patches/patch-gpr_src_gpr-version.ads
@@ -0,0 +1,28 @@
+$NetBSD: patch-gpr_src_gpr-version.ads,v 1.1 2024/03/19 13:20:35 wiz Exp $
+
+Fix incorrect version reporting
+
+--- gpr/src/gpr-version.ads.orig	2023-10-09 21:31:11.000000000 +0300
++++ gpr/src/gpr-version.ads	2024-03-19 14:10:13.533689309 +0200
+@@ -30,17 +30,17 @@
+ 
+ package GPR.Version is
+ 
+-   Gpr_Version : constant String := "18.0w";
++   Gpr_Version : constant String := "24.0.0";
+    --  Static string identifying this version
+ 
+-   Date : constant String := "19940713";
++   Date : constant String := "20231113";
+ 
+-   Current_Year : constant String := "2016";
++   Current_Year : constant String := "2023";
+ 
+    type Gnat_Build_Type is (Gnatpro, FSF, GPL);
+    --  See Get_Gnat_Build_Type below for the meaning of these values
+ 
+-   Build_Type : constant Gnat_Build_Type := Gnatpro;
++   Build_Type : constant Gnat_Build_Type := FSF;
+    --  Kind of GNAT Build:
+    --
+    --    FSF
diff --git a/gprbuild/patches/patch-gpr_src_gpr_imports.c b/gprbuild/patches/patch-gpr_src_gpr_imports.c
new file mode 100644
index 0000000000..a50d7d7791
--- /dev/null
+++ b/gprbuild/patches/patch-gpr_src_gpr_imports.c
@@ -0,0 +1,22 @@
+$NetBSD: patch-gpr_src_gpr_imports.c,v 1.1 2024/03/12 17:50:13 wiz Exp $
+
+Add support for NetBSD (same as for FreeBSD) and fix getrusage() warning at linking stage
+
+--- gpr/src/gpr_imports.c.orig	2023-10-09 21:31:11.000000000 +0300
++++ gpr/src/gpr_imports.c	2023-12-21 19:52:58.220771312 +0200
+@@ -64,6 +64,15 @@
+ char __gnat_shared_libgcc_default = STATIC;
+ const char *__gnat_default_libgcc_subdir = "lib";
+ 
++#elif defined(__NetBSD__)
++int __gnat_link_max = 8192;
++char __gnat_shared_libgcc_default = STATIC;
++const char *__gnat_default_libgcc_subdir = "lib";
++#include "sys/resource.h"
++int __netbsd_getrusage(int who, struct rusage *rusage) {
++    return getrusage(who, rusage);
++}
++
+ #elif defined (__APPLE__)
+ int __gnat_link_max = 262144;
+ char __gnat_shared_libgcc_default = SHARED;
diff --git a/gprbuild/patches/patch-gprbuild.gpr b/gprbuild/patches/patch-gprbuild.gpr
new file mode 100644
index 0000000000..5983fea56e
--- /dev/null
+++ b/gprbuild/patches/patch-gprbuild.gpr
@@ -0,0 +1,15 @@
+$NetBSD: patch-gprbuild.gpr,v 1.2 2024/05/07 15:30:00 dkazankov Exp $
+
+Remove redundant file from install list
+
+--- gprbuild.gpr.orig	2023-10-09 21:31:11.000000000 +0300
++++ gprbuild.gpr	2024-05-07 15:26:53.971304204 +0300
+@@ -165,7 +165,7 @@
+                when "Windows_NT" =>
+                   for Artifacts ("bin") use ("src/gprinstall.exe.manifest");
+                when "UNIX" =>
+-                  for Artifacts (".") use ("doinstall");
++                  null;
+             end case;
+ 
+          when "internal" =>
diff --git a/gprbuild/version.mk b/gprbuild/version.mk
new file mode 100644
index 0000000000..a41ca980a5
--- /dev/null
+++ b/gprbuild/version.mk
@@ -0,0 +1,3 @@
+# $NetBSD: version.mk,v 1.1 2024/03/12 17:50:12 wiz Exp $
+
+GPRBUILD_VERSION:=	24.0.0


Home | Main Index | Thread Index | Old Index