pkgsrc-WIP-changes archive

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

devel/gprbuild: add gprbuild-24.0



Module Name:	pkgsrc-wip
Committed By:	Dmytro Kazankov <dmytro.kazankov%gmail.com@localhost>
Pushed By:	dkazankov
Date:		Tue Feb 13 17:28:58 2024 +0200
Changeset:	d7291b4805c76a1a559777b0cfd57a796aebaf25

Modified Files:
	Makefile
Added Files:
	gprbuild/DESCR
	gprbuild/Makefile
	gprbuild/PLIST
	gprbuild/buildlink3.mk
	gprbuild/distinfo
	gprbuild/files/buildlink.cgpr
	gprbuild/files/patch-Makefile.in
	gprbuild/files/patch-gpr_src_put_resource_usage__unix.adb
	gprbuild/patches/patch-Makefile
	gprbuild/patches/patch-bootstrap.sh
	gprbuild/patches/patch-gpr_src_gpr_imports.c
	gprbuild/patches/patch-gprbuild.gpr
	gprbuild/version.mk

Log Message:
devel/gprbuild: add gprbuild-24.0

GPRbuild build system

GPRbuild is an advanced build system designed to help automate the construction
of multi-language systems.

The package needs gcc13-gnat package to build and uses gcc.mk from gcc13-gnat directory
instead of pkgsrc's. Thus it reqires wip path replacement (also in files/ directory) if
moving to main pkgsrc.

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

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

diffstat:
 Makefile                                           |   1 +
 gprbuild/DESCR                                     |   4 +
 gprbuild/Makefile                                  |  89 +++++++++++
 gprbuild/PLIST                                     | 174 +++++++++++++++++++++
 gprbuild/buildlink3.mk                             |  17 ++
 gprbuild/distinfo                                  |  15 ++
 gprbuild/files/buildlink.cgpr                      | 143 +++++++++++++++++
 gprbuild/files/patch-Makefile.in                   |  16 ++
 .../patch-gpr_src_put_resource_usage__unix.adb     |  15 ++
 gprbuild/patches/patch-Makefile                    |  48 ++++++
 gprbuild/patches/patch-bootstrap.sh                |  23 +++
 gprbuild/patches/patch-gpr_src_gpr_imports.c       |  22 +++
 gprbuild/patches/patch-gprbuild.gpr                |  16 ++
 gprbuild/version.mk                                |   3 +
 14 files changed, 586 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index f351aabace..ba0901902b 100644
--- a/Makefile
+++ b/Makefile
@@ -1289,6 +1289,7 @@ SUBDIR+=	gpak
 SUBDIR+=	gpatch
 SUBDIR+=	gpick
 SUBDIR+=	gplbasic
+SUBDIR+=	gprbuild
 SUBDIR+=	gpsdrive
 SUBDIR+=	gptfdisk
 SUBDIR+=	gpx2shp
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..1f11de9763
--- /dev/null
+++ b/gprbuild/Makefile
@@ -0,0 +1,89 @@
+# $NetBSD: Makefile,v 1.0 2023/12/11 11:20:00 dkazankov Exp $
+
+.include "version.mk"
+PKGNAME=gprbuild-${GPRBUILD_VERSION}
+
+CATEGORIES=	devel
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://github.com/AdaCore/gprbuild
+COMMENT=	GPRbuild build system
+LICENSE=	gnu-gpl-v3
+
+USE_LANGUAGES=	c ada
+
+.include "../../mk/bsd.prefs.mk"
+
+DISTNAME=	${PKGNAME}
+DISTFILES=	${DISTNAME}${EXTRACT_SUFX}
+DISTFILES+=	xmlada-${GPRBUILD_VERSION}${EXTRACT_SUFX}
+DISTFILES+=	gprconfig_kb-${GPRBUILD_VERSION}${EXTRACT_SUFX}
+GITHUB_TAG=	v${GPRBUILD_VERSION}
+MASTER_SITES=	${MASTER_SITE_GITHUB:=AdaCore/}
+
+SITES.xmlada-${GPRBUILD_VERSION}${EXTRACT_SUFX}=	-${MASTER_SITE_GITHUB:=AdaCore/}xmlada/archive/${GITHUB_TAG}${EXTRACT_SUFX}
+SITES.gprconfig_kb-${GPRBUILD_VERSION}${EXTRACT_SUFX}=	-${MASTER_SITE_GITHUB:=AdaCore/}gprconfig_kb/archive/${GITHUB_TAG}${EXTRACT_SUFX}
+
+USE_TOOLS+=	gmake patch
+
+HAS_CONFIGURE=	yes
+
+GCC_REQD+=	13
+.include "../../wip/gcc13-gnat/gcc.mk"
+
+OBJDIR=		${WRKDIR}/build
+BOOTSTRAPDIR=	${WRKDIR}/bootstrap
+
+PRECONFIGURE_ENV=	${CONFIGURE_ENV}
+POSTCONFIGURE_ENV=	${CONFIGURE_ENV}
+
+PRECONFIGURE_ENV+=	CC=${CC}
+PRECONFIGURE_ENV+=	CFLAGS=${CFLAGS:M:Q}
+PRECONFIGURE_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=${PKGDIR}/files/buildlink.cgpr -aP ${WRKDIR}/.buildlink/share/gpr'
+
+INSTALL_DIRS=		${OBJDIR}
+INSTALL_MAKE_FLAGS=	GPRBUILD_OPTIONS='--config=${PKGDIR}/files/buildlink.cgpr -aP ${WRKDIR}/.buildlink/share/gpr'
+INSTALL_MAKE_FLAGS+=	GPRINSTALL_OPTIONS='--config=${PKGDIR}/files/buildlink.cgpr -aP ${WRKDIR}/.buildlink/share/gpr'
+
+GENERATE_PLIST+= \
+	cd ${DESTDIR}${PREFIX} && \
+	${FIND} bin libexec share \( -type f -or -type l \) -print | ${SORT};
+
+post-patch:
+	${RUN} cd ${PKGDIR} \
+	&& ${PATCH} -d ${WRKDIR}/xmlada-${GPRBUILD_VERSION} -E -p0 -F0 <files/patch-Makefile.in
+.if ${MACHINE_PLATFORM:MNetBSD-*-*}
+	${RUN} cd ${PKGDIR} \
+	&& ${PATCH} -d ${WRKSRC} -E -p0 -F0 <files/patch-gpr_src_put_resource_usage__unix.adb
+.endif
+
+pre-configure:
+	${RUN} ${MKDIR} ${BOOTSTRAPDIR}
+	${RUN} cd ${BOOTSTRAPDIR} \
+	&& env ${PRECONFIGURE_ENV} \
+	${SHELL} ${WRKSRC}/bootstrap.sh \
+	    --prefix=${WRKDIR}/.buildlink \
+	    --srcdir=${WRKSRC} \
+	    --with-xmlada=${WRKDIR}/xmlada-${GPRBUILD_VERSION} \
+	    --with-kb=${WRKDIR}/gprconfig_kb-${GPRBUILD_VERSION}
+	${RUN} ${MKDIR} ${OBJDIR}
+
+post-configure:
+	${RUN} cd ${WRKDIR}/xmlada-${GPRBUILD_VERSION} \
+	&& set -x ; env ${POSTCONFIGURE_ENV} \
+	./configure \
+	    --prefix=${WRKDIR}/.buildlink \
+	&& set -x ; env ${MAKE_ENV} \
+	${MAKE_PROGRAM} all install GPROPTS='--config=${PKGDIR}/files/buildlink.cgpr'
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/gprbuild/PLIST b/gprbuild/PLIST
new file mode 100644
index 0000000000..d5f43613a6
--- /dev/null
+++ b/gprbuild/PLIST
@@ -0,0 +1,174 @@
+@comment $NetBSD$
+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..413e4e6bd8
--- /dev/null
+++ b/gprbuild/buildlink3.mk
@@ -0,0 +1,17 @@
+# $NetBSD: buildlink3.mk,v 1.0 2023/12/11 12:00:00 dkazankov Exp $
+
+BUILDLINK_TREE+=	gprbuild
+
+.if !defined(GPRBUILD_BUILDLINK3_MK)
+GPRBUILD_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.gprbuild+=	gprbuild>=24
+BUILDLINK_ABI_DEPENDS.gprbuild+=	gprbuild>=24.0.0
+BUILDLINK_PKGSRCDIR.gprbuild=		../../wip/gprbuild
+BUILDLINK_DEPMETHOD.gprbuild?=		build
+
+BUILDLINK_FILES.gprbuild+=	bin/gpr* libexec/gprbuild/* share/gpr/* share/gprbuild/*
+
+.endif
+
+BUILDLINK_TREE+=	-gprbuild
diff --git a/gprbuild/distinfo b/gprbuild/distinfo
new file mode 100644
index 0000000000..297cc1110d
--- /dev/null
+++ b/gprbuild/distinfo
@@ -0,0 +1,15 @@
+$NetBSD: distinfo,v 1.0 2023/12/11 12:00:00 dkazankov Exp $
+
+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
+BLAKE2s (gprconfig_kb-24.0.0.tar.gz) = e39c1e70b80923db53f0e6c4687536fcbfdc951209a34dc039423f9cc31319fa
+SHA512 (gprconfig_kb-24.0.0.tar.gz) = 1bd28b7eba57a8952635f3fb61e06278935c31ed196182e19e9e8c2ffa3edbccea5a9b97b3f5a3c820e7c3f5b6878d87f7b42d66a7f57e083d0b56cb91a6eb84
+Size (gprconfig_kb-24.0.0.tar.gz) = 43010 bytes
+BLAKE2s (xmlada-24.0.0.tar.gz) = a02dae17a91d326f06fc85e9b69ee5bfe181ab97ca3f7e3a846b71bc5928b643
+SHA512 (xmlada-24.0.0.tar.gz) = 4e6773a5fdf9b6ebb5afca913d77aba9f697768f28ef9b23b9277aa4ea4ce09de4e53655dd5559e2326ff847327adb53fa6b776775aa923100a2624df415c97d
+Size (xmlada-24.0.0.tar.gz) = 1053363 bytes
+SHA1 (patch-Makefile) = f1e28cd16cdfa08d2780dcd3c8cd733a07b09e01
+SHA1 (patch-bootstrap.sh) = 4797fef547d62e10b0ed5b0f5bac6feedb5fc756
+SHA1 (patch-gpr_src_gpr_imports.c) = 874a482a153463310e9ebe76b287f301363c5802
+SHA1 (patch-gprbuild.gpr) = 557472a3b1fca73e14434b8ecd614e4fdfa726be
diff --git a/gprbuild/files/buildlink.cgpr b/gprbuild/files/buildlink.cgpr
new file mode 100644
index 0000000000..54a2344ef9
--- /dev/null
+++ b/gprbuild/files/buildlink.cgpr
@@ -0,0 +1,143 @@
+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 "/usr/pkgsrc/wip/gprbuild/work/.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 "/usr/pkgsrc/wip/gprbuild/work/.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 "/usr/pkgsrc/wip/gprbuild/work/.gcc/bin/gcc";
+      for Driver              ("C") use "/usr/pkgsrc/wip/gprbuild/work/.gcc/bin/gcc";
+      for Driver              ("C++") use "/usr/pkgsrc/wip/gprbuild/work/.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=/usr/pkgsrc/wip/gprbuild/work/.buildlink/gcc13-gnat/lib/gcc/x86_64--netbsd/13.2.0");
+        
+      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
+          "/usr/pkgsrc/wip/gprbuild/work/.buildlink/libexec/gprbuild/gprbind";
+      for Required_Switches ("Ada") use
+        Binder'Required_Switches ("Ada") & ("--RTS=/usr/pkgsrc/wip/gprbuild/work/.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/files/patch-Makefile.in b/gprbuild/files/patch-Makefile.in
new file mode 100644
index 0000000000..6549dda041
--- /dev/null
+++ b/gprbuild/files/patch-Makefile.in
@@ -0,0 +1,16 @@
+$NetBSD: patch-Makefile.in,v 1.0 2023/12/26 11:40:00 dkazankov Exp $
+
+Make possible install params
+
+--- Makefile.in.orig	2023-09-07 14:33:41.000000000 +0300
++++ 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/files/patch-gpr_src_put_resource_usage__unix.adb b/gprbuild/files/patch-gpr_src_put_resource_usage__unix.adb
new file mode 100644
index 0000000000..f07895d85e
--- /dev/null
+++ b/gprbuild/files/patch-gpr_src_put_resource_usage__unix.adb
@@ -0,0 +1,15 @@
+$NetBSD: patch-gpr_src_gpr-util-put_resource_usage__unix.adb,v 1.0 2023/12/22 12:40:00 dkazankov Exp $
+
+Correct warning at link stage
+
+--- 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	2023-12-22 12:36:20.531382047 +0200
+@@ -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-Makefile b/gprbuild/patches/patch-Makefile
new file mode 100644
index 0000000000..3af5098f4d
--- /dev/null
+++ b/gprbuild/patches/patch-Makefile
@@ -0,0 +1,48 @@
+$NetBSD: patch-Makefile,v 1.0 2023/12/26 13:25:00 dkazankov Exp $
+
+Make it possible to set install parameters, correct install parameters
+
+--- Makefile.orig	2023-10-09 21:31:11.000000000 +0300
++++ Makefile	2023-12-26 15:07:17.160442141 +0200
+@@ -45,6 +45,7 @@
+ GTARGET=--target=$(TARGET)
+ endif
+ 
++GPRINSTALL_OPTIONS=
+ INSTALLER=$(LIB_INSTALLER)
+ EXEC_INSTALLER=$(INSTALLER) -XBUILD=${BUILD}
+ 
+@@ -72,13 +73,13 @@
+ 
+ # 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..9f6bc02295
--- /dev/null
+++ b/gprbuild/patches/patch-bootstrap.sh
@@ -0,0 +1,23 @@
+$NetBSD: patch-bootstrap.sh,v 1.0 2023/12/22 12:25:00 dkazankov Exp $
+
+Correct out-of-tree bootstrap build
+
+--- bootstrap.sh.orig	2023-10-09 21:31:11.000000000 +0300
++++ bootstrap.sh	2023-12-22 12:31:00.399396853 +0200
+@@ -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-gpr_src_gpr_imports.c b/gprbuild/patches/patch-gpr_src_gpr_imports.c
new file mode 100644
index 0000000000..660777f7ef
--- /dev/null
+++ b/gprbuild/patches/patch-gpr_src_gpr_imports.c
@@ -0,0 +1,22 @@
+$NetBSD: patch-gpr_src_gpr_imports.c,v 1.0 2023/12/21 20:16:00 dkazankov Exp $
+
+Add support for NetBSD (same as for FreeBSD) and correct 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..8eb91f6555
--- /dev/null
+++ b/gprbuild/patches/patch-gprbuild.gpr
@@ -0,0 +1,16 @@
+$NetBSD: patch-gprbuild.gpr,v 1.0 2023/12/26 17:45:00 dkazankov Exp $
+
+Remove redundant file from install list
+
+--- gprbuild.gpr.orig	2023-10-09 21:31:11.000000000 +0300
++++ gprbuild.gpr	2023-12-26 17:54:25.847810172 +0200
+@@ -165,7 +165,8 @@
+                when "Windows_NT" =>
+                   for Artifacts ("bin") use ("src/gprinstall.exe.manifest");
+                when "UNIX" =>
+-                  for Artifacts (".") use ("doinstall");
++--                  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..72d4bc3fd6
--- /dev/null
+++ b/gprbuild/version.mk
@@ -0,0 +1,3 @@
+# $NetBSD: version.mk,v 1.0 2023/12/11 11:45:00 dkazankov Exp $
+
+GPRBUILD_VERSION:=	24.0.0


Home | Main Index | Thread Index | Old Index