pkgsrc-WIP-changes archive

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

0ad: WiP update to 0.27.0



Module Name:	pkgsrc-wip
Committed By:	Frédéric Fauberteau <frederic%fauberteau.org@localhost>
Pushed By:	frederic
Date:		Thu May 15 08:00:56 2025 +0200
Changeset:	2537c871b1dab2a74473f7d50acd0e92604ff847

Added Files:
	0ad/COMMIT_MSG
	0ad/DESCR
	0ad/Makefile
	0ad/Makefile.common
	0ad/PLIST
	0ad/distinfo
	0ad/options.mk
	0ad/patches/patch-build_premake_extern__libs5.lua
	0ad/patches/patch-build_premake_premake5.lua
	0ad/patches/patch-build_workspaces_clean-workspaces.sh
	0ad/patches/patch-build_workspaces_update-workspaces.sh
	0ad/patches/patch-libraries_source_fcollada_include_FCDocument_FCDocument.h
	0ad/patches/patch-libraries_source_fcollada_include_FUtils_FUCriticalSection.h
	0ad/patches/patch-libraries_source_fcollada_include_FUtils_Platforms.h
	0ad/patches/patch-libraries_source_fcollada_src_FCollada_FCDocument_FCDocument.h
	0ad/patches/patch-libraries_source_fcollada_src_FCollada_FUtils_FUCriticalSection.h
	0ad/patches/patch-libraries_source_fcollada_src_FCollada_FUtils_FUStringBuilder.hpp
	0ad/patches/patch-libraries_source_fcollada_src_FCollada_FUtils_Platforms.h
	0ad/patches/patch-libraries_source_nvtt_src_CMakeLists.txt
	0ad/patches/patch-libraries_source_nvtt_src_src_nvtt_CMakeLists.txt
	0ad/patches/patch-libraries_source_spidermonkey_build.sh
	0ad/patches/patch-source_lib_allocators_page__aligned.cpp
	0ad/patches/patch-source_maths_tests_test__Bound.h
	0ad/patches/patch-source_network_StunClient.cpp
	0ad/patches/patch-source_scriptinterface_ScriptTypes.h
	0ad/patches/patch-source_scriptinterface_tests_test__ScriptConversions.h
	0ad/patches/patch-source_third__party_mikktspace_weldmesh.cpp
	0ad/patches/patch-source_third__party_tinygettext_include_tinygettext_iconv.hpp

Log Message:
0ad: WiP update to 0.27.0

Packaged in wip by Frédéric Fauberteau

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

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

diffstat:
 0ad/COMMIT_MSG                                     |   3 +
 0ad/DESCR                                          |  57 +++++++
 0ad/Makefile                                       | 165 +++++++++++++++++++++
 0ad/Makefile.common                                |  11 ++
 0ad/PLIST                                          |  61 ++++++++
 0ad/distinfo                                       |  26 ++++
 0ad/options.mk                                     |  26 ++++
 0ad/patches/patch-build_premake_extern__libs5.lua  |  35 +++++
 0ad/patches/patch-build_premake_premake5.lua       |  14 ++
 .../patch-build_workspaces_clean-workspaces.sh     |  23 +++
 .../patch-build_workspaces_update-workspaces.sh    |  40 +++++
 ...source_fcollada_include_FCDocument_FCDocument.h |  13 ++
 ...rce_fcollada_include_FUtils_FUCriticalSection.h |  13 ++
 ...ries_source_fcollada_include_FUtils_Platforms.h |  43 ++++++
 ...e_fcollada_src_FCollada_FCDocument_FCDocument.h |  13 ++
 ...collada_src_FCollada_FUtils_FUCriticalSection.h |  13 ++
 ...collada_src_FCollada_FUtils_FUStringBuilder.hpp |  85 +++++++++++
 ...source_fcollada_src_FCollada_FUtils_Platforms.h |  34 +++++
 .../patch-libraries_source_nvtt_src_CMakeLists.txt |  20 +++
 ...braries_source_nvtt_src_src_nvtt_CMakeLists.txt |  17 +++
 .../patch-libraries_source_spidermonkey_build.sh   |  20 +++
 .../patch-source_lib_allocators_page__aligned.cpp  |  23 +++
 0ad/patches/patch-source_maths_tests_test__Bound.h |  18 +++
 0ad/patches/patch-source_network_StunClient.cpp    |  14 ++
 .../patch-source_scriptinterface_ScriptTypes.h     |  20 +++
 ...scriptinterface_tests_test__ScriptConversions.h |  14 ++
 ...tch-source_third__party_mikktspace_weldmesh.cpp |  18 +++
 ...party_tinygettext_include_tinygettext_iconv.hpp |  20 +++
 28 files changed, 859 insertions(+)

diffs:
diff --git a/0ad/COMMIT_MSG b/0ad/COMMIT_MSG
new file mode 100644
index 0000000000..765dfc17b2
--- /dev/null
+++ b/0ad/COMMIT_MSG
@@ -0,0 +1,3 @@
+0ad: WiP update to 0.27.0
+
+Packaged in wip by Frédéric Fauberteau
diff --git a/0ad/DESCR b/0ad/DESCR
new file mode 100644
index 0000000000..98cc06750c
--- /dev/null
+++ b/0ad/DESCR
@@ -0,0 +1,57 @@
+0 A.D. (pronounced "zero-ey-dee") is a free, open-source, historical
+Real Time Strategy (RTS) game currently under development by
+Wildfire Games, a global group of volunteer game developers. As the
+leader of an ancient civilization, you must gather the resources you need
+to raise a military force and dominate your enemies.
+
+History is Yours for the Taking
+
+"0 A.D." is a time period that never actually existed: In the usual
+calendar, one goes from 1 B.C. to 1 A.D. and skips zero. This reflects
+the historical fiction in the game: Who would have won if all the
+factions were pitted against each other when each of them was at its
+prime?
+
+We intend to portray some of the major civilizations over the millennium
+of 500 B.C. to 500 A.D. (Hence the midpoint, zero.) That is an ambitious
+prospect, so in the first edition of 0 A.D. we focus on the last five
+centuries B.C. Perhaps in future expansion packs, more civilizations will
+be added, along with additional gameplay features.
+We put a strong emphasis on historical accuracy while developing 0 A.D.
+We plan all our units and all our buildings based on reconstructions of
+how the units and the buildings might have looked like in the ancient
+world. We even name them in the original languages, such as Greek and
+Latin. But it's worth remembering that any game should be fun to play,
+so, in many cases, we preferred playability over historical accuracy.
+
+0 A.D. is Free of Charge
+
+0 A.D. is completely downloadable at no cost and always will be. No
+"freemium" model, no in-game advertising, no catch. This is our iron-clad
+guarantee.
+Although you might find some people selling copies of 0 A.D. on physical
+media, remember, you will always have the option to download 0 A.D.
+gratis on the internet, directly from the developers.
+
+0 A.D. is Free as in "Freedom"
+
+0 A.D. is freely licensed software, because we believe everyone should
+have access to great games, and that everyone can learn from developing
+them. You can redistribute and modify the game as long as you abide by
+the GPL. And you can even use parts of the art and sound for your own
+projects as long as you abide by CC BY-SA.
+
+0 A.D. is Still Under Development
+
+Work on 0 A.D. began in 2001, first as a mod concept for
+Age of Empires II: The Age of Kings. In 2003 development moved to a
+standalone game with its own engine, Pyrogenesis. In 2009-2010, the game
+was released as free, open-source software and and much of the codebase
+was rewritten.
+Currently, 0 A.D. is still in alpha phase, which means an early
+experimental phase. It is playable, and you can already download and test
+the game, but some features are still missing. When will 0 A.D. be
+released? It is very hard to predict. Even after we are done implementing
+all the features, we will want to conduct extensive beta testing, which
+can take a while. Information about release dates will be released at the
+appropriate time.
diff --git a/0ad/Makefile b/0ad/Makefile
new file mode 100644
index 0000000000..01aa64a30e
--- /dev/null
+++ b/0ad/Makefile
@@ -0,0 +1,165 @@
+# $NetBSD: Makefile,v 1.41 2025/04/24 14:13:53 wiz Exp $
+
+.include "../../wip/0ad/Makefile.common"
+
+DISTNAME=	${DISTVERSION}-build
+PKGNAME=	${DISTNAME:S/-unix-build//}
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+COMMENT=	Historical real-time strategy game
+LICENSE=	gnu-gpl-v2 AND gnu-lgpl-v2.1
+
+WRKSRC=		${WRKDIR}/${DISTNAME:S/-unix-build//}
+USE_LANGUAGES=	c c++
+
+USE_TOOLS+=	cmake bash gmake pax perl pkg-config
+
+USE_CXX_FEATURES+=	c++17
+
+DEPENDS+=		0ad-data-${PKGVERSION_NOREV}{,nb*}:../../games/0ad-data
+TOOL_DEPENDS+=		premake5-[0-9]*:../../devel/premake5
+TOOL_DEPENDS+=		patchelf-[0-9]*:../../devel/patchelf
+
+SUBST_CLASSES+=			sysincludedir
+SUBST_MESSAGE.sysincludedir=	Fixing "/usr/local" path assumption
+SUBST_STAGE.sysincludedir=	pre-configure
+SUBST_FILES.sysincludedir=	build/premake/extern_libs5.lua
+SUBST_FILES.sysincludedir+=	build/premake/premake5.lua
+SUBST_SED.sysincludedir+=	-e "s,/usr/local/,${PREFIX}/,g"
+
+SUBST_CLASSES+=			rpath
+SUBST_MESSAGE.rpath=		Adjusting rpath
+SUBST_STAGE.rpath=		pre-configure
+SUBST_FILES.rpath+=		build/premake/premake5.lua
+SUBST_SED.rpath+=		-e "s,@@PREFIXLIB@@,${PREFIX}/lib,g"
+
+# thanks to Guix:
+# 0ad only builds fine with a specific version of mozjs
+# (version 78.6 for 0ad-0.0.25).
+# Here we change the error in case of version mismatch to a warning,
+# and add some minor compatibility fixes.
+SUBST_CLASSES+=		mozjs
+SUBST_MESSAGE.mozjs=	Fixing mozjs version error
+SUBST_STAGE.mozjs=	pre-configure
+SUBST_FILES.mozjs=	source/scriptinterface/ScriptTypes.h
+SUBST_SED.mozjs+=	-e "s,\#error Your compiler is trying to use,\#warning Your compiler is trying to use,g"
+
+SUBST_CLASSES+=		mozjs2
+SUBST_MESSAGE.mozjs2=	Fixing mozjs version error
+SUBST_STAGE.mozjs2=	pre-configure
+SUBST_FILES.mozjs2+=	source/scriptinterface/ScriptContext.cpp
+SUBST_SED.mozjs2+=	-e "s|JS::PrepareZoneForGC(|JS::PrepareZoneForGC(m_cx, |g"
+
+DATADIR=		${PREFIX}/share/${PKGBASE}
+
+INSTALLATION_DIRS+=	bin
+INSTALLATION_DIRS+=	lib/${PKGBASE}
+INSTALLATION_DIRS+=	${DATADIR}
+INSTALLATION_DIRS+=	${DATADIR}/mods/public
+INSTALLATION_DIRS+=	${DATADIR}/mods/mod
+INSTALLATION_DIRS+=	${DATADIR}/config
+INSTALLATION_DIRS+=	share/applications
+INSTALLATION_DIRS+=	share/pixmaps
+
+.if ${MACHINE_ARCH} == "i386"
+CFLAGS+=	-msse
+.endif
+
+MAKE_FLAGS+=	config=release
+MAKE_FLAGS+=	verbose=1
+MAKE_FLAGS+=	-j ${_MAKE_JOBS_N:U1}
+MAKE_ENV+=	JOBS=${_MAKE_JOBS_N:U1}
+# TODO: We build mozjs78 without debug, global debug option will make 0ad fail
+# due to the lack of debug in mozjs. Undefine NDEBUG in this case.
+BUILD_DIRS=	build/workspaces/gcc
+
+.include "options.mk"
+
+# currently fails to build with precompiled headers on
+# NetBSD with gcc.
+# .if ${PKGSRC_COMPILER:M} == "distcc"
+CONFIGURE_PCH?=		--without-pch
+# .else
+# CONFIGURE_PCH?=
+# .endif
+
+# nvtt, notes from gentoo:
+# Build bundled NVTT
+# nvtt is abandoned upstream and 0ad has forked it and added fixes.
+# Use their copy. bug #768930
+do-configure:
+	${RUN} cd ${WRKSRC}/build/workspaces && ./clean-workspaces.sh
+	${RUN} cd ${WRKSRC}/build/workspaces && ./update-workspaces.sh \
+		--bindir=${PREFIX}/bin \
+		--datadir=${DATADIR} \
+		--libdir=${PREFIX}/lib/${PKGBASE} \
+		--with-system-premake5 \
+		--with-system-mozjs \
+		${CONFIGURE_PCH} ${CONFIGURE_EDITOR} ${CONFIGURE_TESTS}
+
+do-install:
+	# TODO: currently ends up with ${PREFIX}/pkg/lib duplicate in the rpath
+	${INSTALL_PROGRAM} ${WRKSRC}/binaries/system/pyrogenesis ${DESTDIR}${PREFIX}/bin
+	${INSTALL_SCRIPT} ${WRKSRC}/build/resources/0ad.sh ${DESTDIR}${PREFIX}/bin/0ad
+.if !empty(PKG_OPTIONS:Meditor)
+	${INSTALL_PROGRAM} ${WRKSRC}/binaries/system/ActorEditor ${DESTDIR}${PREFIX}/bin
+	# TODO: prevent this in the build-system.
+	${PREFIX}/bin/patchelf --replace-needed \
+		"../../../binaries/system/libAtlasUI.so" libAtlasUI.so \
+		${DESTDIR}${PREFIX}/bin/ActorEditor
+	cd ${WRKSRC}/binaries/system && ${INSTALL_LIB} \
+		libAtlasUI.so libAtlasObject.a ${DESTDIR}${PREFIX}/lib/${PKGBASE}
+.endif
+	cd ${WRKSRC}/binaries/system && ${INSTALL_LIB} \
+		libCollada.so libatlas.a \
+		libengine.a libgladwrapper.a libglooxwrapper.a libgraphics.a \
+		libgui.a liblobby.a liblowlevel.a libmocks_real.a libmocks_test.a \
+		libmongoose.a libnetwork.a librlinterface.a libscriptinterface.a \
+		libsimulation2.a libtinygettext.a \
+		${DESTDIR}${PREFIX}/lib/${PKGBASE}
+	# TODO: second part of rpath is missing after build
+.for f in libnvcore libnvimage libnvmath libnvtt
+	cd ${WRKSRC}/binaries/system && ${INSTALL_LIB} \
+		${f}.so ${DESTDIR}${PREFIX}/lib/${PKGBASE}
+	${PREFIX}/bin/patchelf \
+		--force-rpath \
+		--set-rpath ${PREFIX}/lib/${PKGBASE}:${PREFIX}/lib \
+		${DESTDIR}${PREFIX}/lib/${PKGBASE}/${f}.so
+.endfor
+	${INSTALL_DATA} ${WRKSRC}/build/resources/0ad.desktop ${DESTDIR}${PREFIX}/share/applications
+	${INSTALL_DATA} ${WRKSRC}/build/resources/0ad.png ${DESTDIR}${PREFIX}/share/pixmaps
+	cd ${WRKSRC}/binaries/data && ${PAX} -rw l10n ${DESTDIR}${DATADIR}
+.if !empty(PKG_OPTIONS:Mtests)
+	cd ${WRKSRC}/binaries/data && ${PAX} -rw tests ${DESTDIR}${DATADIR}
+.endif
+
+.include "../../audio/libvorbis/buildlink3.mk"
+.include "../../audio/openal-soft/buildlink3.mk"
+.include "../../chat/gloox/buildlink3.mk"
+.include "../../devel/boost-headers/buildlink3.mk"
+.include "../../devel/boost-libs/buildlink3.mk"
+.include "../../devel/libidn2/buildlink3.mk"
+.include "../../devel/nspr/buildlink3.mk"
+.include "../../devel/SDL2/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../graphics/freetype2/buildlink3.mk"
+.include "../../graphics/MesaLib/buildlink3.mk"
+.include "../../graphics/openexr/buildlink3.mk"
+.include "../../graphics/png/buildlink3.mk"
+.include "../../graphics/tiff/buildlink3.mk"
+.include "../../lang/mozjs128/buildlink3.mk"
+.if !empty(PKG_OPTIONS:Mtests)
+.include "../../lang/python/tool.mk"
+.endif
+.include "../../multimedia/libogg/buildlink3.mk"
+.include "../../net/enet/buildlink3.mk"
+.include "../../net/miniupnpc/buildlink3.mk"
+.include "../../textproc/fmtlib/buildlink3.mk"
+.include "../../security/gnutls/buildlink3.mk"
+.include "../../textproc/icu/buildlink3.mk"
+.include "../../security/libsodium/buildlink3.mk"
+.include "../../textproc/libxml2/buildlink3.mk"
+.include "../../www/curl/buildlink3.mk"
+.include "../../x11/libX11/buildlink3.mk"
+.include "../../mk/jpeg.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/0ad/Makefile.common b/0ad/Makefile.common
new file mode 100644
index 0000000000..58fba6588d
--- /dev/null
+++ b/0ad/Makefile.common
@@ -0,0 +1,11 @@
+# $NetBSD: Makefile.common,v 1.3 2024/02/16 07:49:55 nia Exp $
+# used by wip/0ad-data/Makefile
+
+DISTVERSION=	0ad-0.27.0-unix
+CATEGORIES=	games
+MASTER_SITES=	http://releases.wildfiregames.com/
+EXTRACT_SUFX=	.tar.xz
+
+HOMEPAGE=	https://play0ad.com/
+
+#BROKEN+=	"Incompatible with latest fmtlib"
diff --git a/0ad/PLIST b/0ad/PLIST
new file mode 100644
index 0000000000..ba46cd0226
--- /dev/null
+++ b/0ad/PLIST
@@ -0,0 +1,61 @@
+@comment $NetBSD: PLIST,v 1.1 2023/05/04 15:20:52 nikita Exp $
+bin/0ad
+${PLIST.editor}bin/ActorEditor
+bin/pyrogenesis
+${PLIST.editor}lib/0ad/libAtlasObject.a
+${PLIST.editor}lib/0ad/libAtlasUI.so
+lib/0ad/libCollada.so
+lib/0ad/libatlas.a
+lib/0ad/libengine.a
+lib/0ad/libgladwrapper.a
+lib/0ad/libglooxwrapper.a
+lib/0ad/libgraphics.a
+lib/0ad/libgui.a
+lib/0ad/liblobby.a
+lib/0ad/liblowlevel.a
+lib/0ad/libmocks_real.a
+lib/0ad/libmocks_test.a
+lib/0ad/libmongoose.a
+lib/0ad/libnetwork.a
+lib/0ad/libnvcore.so
+lib/0ad/libnvimage.so
+lib/0ad/libnvmath.so
+lib/0ad/libnvtt.so
+lib/0ad/librlinterface.a
+lib/0ad/libscriptinterface.a
+lib/0ad/libsimulation2.a
+lib/0ad/libtinygettext.a
+share/0ad/l10n/.tx/config
+share/0ad/l10n/ast.engine.po
+share/0ad/l10n/ca.engine.po
+share/0ad/l10n/cs.engine.po
+share/0ad/l10n/de.engine.po
+share/0ad/l10n/el.engine.po
+share/0ad/l10n/en_GB.engine.po
+share/0ad/l10n/engine.pot
+share/0ad/l10n/es.engine.po
+share/0ad/l10n/eu.engine.po
+share/0ad/l10n/fi.engine.po
+share/0ad/l10n/fr.engine.po
+share/0ad/l10n/gd.engine.po
+share/0ad/l10n/hu.engine.po
+share/0ad/l10n/id.engine.po
+share/0ad/l10n/it.engine.po
+share/0ad/l10n/messages.json
+share/0ad/l10n/nl.engine.po
+share/0ad/l10n/pl.engine.po
+share/0ad/l10n/pt_BR.engine.po
+share/0ad/l10n/ru.engine.po
+share/0ad/l10n/sk.engine.po
+share/0ad/l10n/sv.engine.po
+share/0ad/l10n/tr.engine.po
+share/0ad/l10n/uk.engine.po
+${PLIST.tests}share/0ad/tests/collada/bogus_material_target.dae
+${PLIST.tests}share/0ad/tests/collada/skeletons.xml
+${PLIST.tests}share/0ad/tests/collada/sphere.dae
+${PLIST.tests}share/0ad/tests/collada/sphere.pmd
+${PLIST.tests}share/0ad/tests/test_setup.js
+share/applications/0ad.desktop
+share/pixmaps/0ad.png
+@pkgdir share/0ad/mods/public
+@pkgdir share/0ad/mods/mod
diff --git a/0ad/distinfo b/0ad/distinfo
new file mode 100644
index 0000000000..076b4214e4
--- /dev/null
+++ b/0ad/distinfo
@@ -0,0 +1,26 @@
+$NetBSD: distinfo,v 1.3 2023/05/05 14:55:18 nikita Exp $
+
+BLAKE2s (0ad-0.27.0-unix-build.tar.xz) = df3e78517dc2134794378ea8d2631952e8525b8adc5d3b02d2d4ec0889b35546
+SHA512 (0ad-0.27.0-unix-build.tar.xz) = c22dc99f873924dab21737a9ac2d85c5a250acd094d61e15ce1b196dbd2d9315f0d31712cc6056b1bfc32aebb4e6c5beaa60bde4e05cb70aa662dea28e47210e
+Size (0ad-0.27.0-unix-build.tar.xz) = 152170976 bytes
+SHA1 (patch-build_premake_extern__libs5.lua) = 5f7d96cb825eaf1de991f584643a36485c20be82
+SHA1 (patch-build_premake_premake5.lua) = 1cc910e3a836377d8b9638916dea2bd9556f24f2
+SHA1 (patch-build_workspaces_clean-workspaces.sh) = 6c48565a0463d6f9e3ab914e2923811b121935cc
+SHA1 (patch-build_workspaces_update-workspaces.sh) = 4a6ec008da64a98230173f3a242cea2503321631
+SHA1 (patch-libraries_source_fcollada_include_FCDocument_FCDocument.h) = 96aef76c02ae4a3f47fdb7c31bf7d11490ba5d09
+SHA1 (patch-libraries_source_fcollada_include_FUtils_FUCriticalSection.h) = 956ba6c19b0f3ea2a35f686bf1825efc07169b89
+SHA1 (patch-libraries_source_fcollada_include_FUtils_Platforms.h) = 32308e3fe673903b4b1a17c364840818136411b9
+SHA1 (patch-libraries_source_fcollada_src_FCollada_FCDocument_FCDocument.h) = ae1edd27218707be0ea77456569fcd262d9230d2
+SHA1 (patch-libraries_source_fcollada_src_FCollada_FUtils_FUCriticalSection.h) = fd181f746bba33ceb917a5de4794296c229213fc
+SHA1 (patch-libraries_source_fcollada_src_FCollada_FUtils_FUStringBuilder.hpp) = f71f1f361601b2ce561c00a811d33bce6735a06d
+SHA1 (patch-libraries_source_fcollada_src_FCollada_FUtils_Platforms.h) = 6887cca8e6ff1765a6b666bd595f8bcb41c2a90f
+SHA1 (patch-libraries_source_nvtt_src_CMakeLists.txt) = 396a5b06b588d7bff6cc751de074d71063de834d
+SHA1 (patch-libraries_source_nvtt_src_src_nvtt_CMakeLists.txt) = f42c1f4c57a3ef23a793a216f858b909dcf01e98
+SHA1 (patch-libraries_source_spidermonkey_build.sh) = 34225c82659cc236bff076301dd52adca9888f92
+SHA1 (patch-source_lib_allocators_page__aligned.cpp) = c25054afd543a1a90530964a63b2b692b1687765
+SHA1 (patch-source_maths_tests_test__Bound.h) = 8d6b79199d86dabdddf3dca68eed2d252ef9a649
+SHA1 (patch-source_network_StunClient.cpp) = 6267d44c3d0345d3e47c19746f105657ba984876
+SHA1 (patch-source_scriptinterface_ScriptTypes.h) = f2351c637ba7ed7a36b4399b6e89a0d8281c9ad4
+SHA1 (patch-source_scriptinterface_tests_test__ScriptConversions.h) = d415a86d59f50daa5acd594265f026e88b5a37b9
+SHA1 (patch-source_third__party_mikktspace_weldmesh.cpp) = 35df7dd5d5d2aa784ef03599a47cc69982ebe332
+SHA1 (patch-source_third__party_tinygettext_include_tinygettext_iconv.hpp) = 9778a9729202a95a5b5ec3f66419d31aa9b423b9
diff --git a/0ad/options.mk b/0ad/options.mk
new file mode 100644
index 0000000000..4967ac87ef
--- /dev/null
+++ b/0ad/options.mk
@@ -0,0 +1,26 @@
+# $NetBSD: options.mk,v 1.3 2023/05/05 00:08:13 nikita Exp $
+PKG_OPTIONS_VAR=	PKG_OPTIONS.0ad
+PKG_SUPPORTED_OPTIONS+=	tests editor
+
+PLIST_VARS+=		editor tests
+
+.include "../../mk/bsd.options.mk"
+
+.if ${PKG_OPTIONS:Mtests}
+CONFIGURE_TESTS?=
+PYTHON_VERSIONS_INCOMPATIBLE=	27
+TOOL_DEPENDS+=			python${PYTHON_VERSION_DEFAULT}-[0-9]*:../../lang/python${PYTHON_VERSION_DEFAULT}
+PLIST.tests=			yes
+.else
+CONFIGURE_TESTS?=		--without-tests
+.endif
+
+# TODO: not entirely working binary (loads, complains about files not found),
+# something is missing.
+.if ${PKG_OPTIONS:Meditor}
+CONFIGURE_EDITOR?=		--enable-atlas
+.include "../../x11/wxGTK32/buildlink3.mk"
+PLIST.editor=			yes
+.else
+CONFIGURE_EDITOR?=		--disable-atlas
+.endif
diff --git a/0ad/patches/patch-build_premake_extern__libs5.lua b/0ad/patches/patch-build_premake_extern__libs5.lua
new file mode 100644
index 0000000000..cae45ac311
--- /dev/null
+++ b/0ad/patches/patch-build_premake_extern__libs5.lua
@@ -0,0 +1,35 @@
+$NetBSD: patch-build_premake_extern__libs5.lua,v 1.2 2023/05/05 14:55:18 nikita Exp $
+
+pkgsrc miniupnpc is new enough to have pkg-config files.
+get iconv from libc on FreeBSD and NetBSD.
+
+--- build/premake/extern_libs5.lua.orig	2022-08-21 14:45:49.000000000 +0200
++++ build/premake/extern_libs5.lua	2023-05-05 14:04:01.320479087 +0200
+@@ -372,7 +372,7 @@
+ 			elseif os.istarget("macosx") then
+ 				add_default_include_paths("iconv")
+ 				defines { "LIBICONV_STATIC" }
+-			elseif os.getversion().description == "FreeBSD" then
++			elseif os.getversion().description == "NetBSD" or os.getversion().description == "FreeBSD" then
+ 				-- On FreeBSD you need this flag to tell it to use the BSD libc iconv
+ 				defines { "LIBICONV_PLUG" }
+ 			end
+@@ -525,14 +525,13 @@
+ 				add_default_links({
+ 					win_names  = { "miniupnpc" },
+ 				})
+-			elseif os.istarget("macosx") then
+-				pkgconfig.add_links("miniupnpc")
+ 			else
++				pkgconfig.add_links("miniupnpc")
+ 				-- Once miniupnpc v2.1 or better becomes near-universal (see above comment),
+ 				-- we can use pkg-config for Linux and BSD.
+-				add_default_links({
+-					unix_names = { "miniupnpc" },
+-				})
++				--add_default_links({
++				--	unix_names = { "miniupnpc" },
++				--})
+ 			end
+ 		end,
+ 	},
diff --git a/0ad/patches/patch-build_premake_premake5.lua b/0ad/patches/patch-build_premake_premake5.lua
new file mode 100644
index 0000000000..f09b9190d2
--- /dev/null
+++ b/0ad/patches/patch-build_premake_premake5.lua
@@ -0,0 +1,14 @@
+$NetBSD: patch-build_premake_premake5.lua,v 1.1 2023/05/05 14:55:18 nikita Exp $
+
+
+--- build/premake/premake5.lua.orig	2023-05-05 11:58:04.687082368 +0200
++++ build/premake/premake5.lua	2023-05-05 12:03:48.476951617 +0200
+@@ -386,7 +386,7 @@
+ 			-- To use our local shared libraries, they need to be found in the
+ 			-- runtime dynamic linker path. Add their path to -rpath.
+ 			if _OPTIONS["libdir"] then
+-				linkoptions {"-Wl,-rpath," .. _OPTIONS["libdir"] }
++				linkoptions {"-Wl,-rpath," .. _OPTIONS["libdir"] .. " -Wl,-rpath,@@PREFIXLIB@@"}
+ 			else
+ 				-- On FreeBSD we need to allow use of $ORIGIN
+ 				if os.istarget("bsd") then
diff --git a/0ad/patches/patch-build_workspaces_clean-workspaces.sh b/0ad/patches/patch-build_workspaces_clean-workspaces.sh
new file mode 100644
index 0000000000..2d554975df
--- /dev/null
+++ b/0ad/patches/patch-build_workspaces_clean-workspaces.sh
@@ -0,0 +1,23 @@
+$NetBSD: patch-build_workspaces_clean-workspaces.sh,v 1.1 2023/05/04 15:20:52 nikita Exp $
+
+
+--- -build/workspaces/clean-workspaces.sh.orig	2022-08-21 14:46:47.000000000 +0200
++++ build/workspaces/clean-workspaces.sh	2023-05-03 20:01:25.557929713 +0200
+@@ -3,7 +3,7 @@
+ # Some of our makefiles depend on GNU make, so we set some sane defaults if MAKE
+ # is not set.
+ case "`uname -s`" in
+-  "FreeBSD" | "OpenBSD" )
++  "FreeBSD" | "NetBSD" | "OpenBSD" )
+     MAKE=${MAKE:="gmake"}
+     ;;
+   * )
+@@ -64,7 +64,7 @@
+ echo "Removing generated stub and test files..."
+ 
+ find ../../source -name "stub_*.cpp" -type f -exec rm {} \;
+-find ../../source -name "test_*.cpp" -type f -not -name "test_setup.cpp" -exec rm {} \;
++find ../../source -name "test_*.cpp" -type f ! -name "test_setup.cpp" -exec rm {} \;
+ 
+ echo "Cleaning build output..."
+ 
diff --git a/0ad/patches/patch-build_workspaces_update-workspaces.sh b/0ad/patches/patch-build_workspaces_update-workspaces.sh
new file mode 100644
index 0000000000..140ca23dab
--- /dev/null
+++ b/0ad/patches/patch-build_workspaces_update-workspaces.sh
@@ -0,0 +1,40 @@
+$NetBSD: patch-build_workspaces_update-workspaces.sh,v 1.1 2023/05/04 15:20:52 nikita Exp $
+
+--- build/workspaces/update-workspaces.sh.orig	2021-07-27 21:57:40.000000000 +0000
++++ build/workspaces/update-workspaces.sh
+@@ -1,10 +1,5 @@
+ #!/bin/sh
+ 
+-if [ "$(id -u)" = "0" ]; then
+-   echo "Running as root will mess up file permissions. Aborting ..." 1>&2
+-   exit 1
+-fi
+-
+ die()
+ {
+   echo ERROR: $*
+@@ -26,7 +21,7 @@ JOBS=${JOBS:="-j2"}
+ # Some of our makefiles depend on GNU make, so we set some sane defaults if MAKE
+ # is not set.
+ case "`uname -s`" in
+-  "FreeBSD" | "OpenBSD" )
++  "FreeBSD" | "NetBSD" | "OpenBSD" )
+     MAKE=${MAKE:="gmake"}
+     ;;
+   * )
+@@ -120,11 +115,14 @@ if [ "$with_system_premake5" = "false" ]
+   ${MAKE} -C $PREMAKE_BUILD_DIR ${JOBS} || die "Premake build failed"
+ 
+   premake_command="premake5/bin/release/premake5"
++  cd ..
++else
++  cd ../premake
+ fi
++# Now in build/premake subdirectory
+ 
+ echo
+ 
+-cd ..
+ 
+ # If we're in bash then make HOSTTYPE available to Premake, for primitive arch-detection
+ export HOSTTYPE="$HOSTTYPE"
diff --git a/0ad/patches/patch-libraries_source_fcollada_include_FCDocument_FCDocument.h b/0ad/patches/patch-libraries_source_fcollada_include_FCDocument_FCDocument.h
new file mode 100644
index 0000000000..e2aa36c490
--- /dev/null
+++ b/0ad/patches/patch-libraries_source_fcollada_include_FCDocument_FCDocument.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-libraries_source_fcollada_include_FCDocument_FCDocument.h,v 1.1 2023/05/04 15:20:52 nikita Exp $
+
+--- libraries/source/fcollada/include/FCDocument/FCDocument.h.orig	2012-06-04 21:33:15.000000000 +0000
++++ libraries/source/fcollada/include/FCDocument/FCDocument.h
+@@ -30,7 +30,7 @@
+ #if defined(WIN32)
+ template <class T> class FCOLLADA_EXPORT FCDLibrary; /**< Trick Doxygen. */
+ template <class T> class FCOLLADA_EXPORT FUUniqueStringMapT; /**< Trick Doxygen. */
+-#elif defined(LINUX) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
++#elif defined(LINUX) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ template <class T> class FCDLibrary; /**< Trick Doxygen. */
+ template <class T> class FUUniqueStringMapT; /**< Trick Doxygen. */
+ #endif // LINUX
diff --git a/0ad/patches/patch-libraries_source_fcollada_include_FUtils_FUCriticalSection.h b/0ad/patches/patch-libraries_source_fcollada_include_FUtils_FUCriticalSection.h
new file mode 100644
index 0000000000..3c2882d809
--- /dev/null
+++ b/0ad/patches/patch-libraries_source_fcollada_include_FUtils_FUCriticalSection.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-libraries_source_fcollada_include_FUtils_FUCriticalSection.h,v 1.1 2023/05/04 15:20:52 nikita Exp $
+
+--- libraries/source/fcollada/include/FUtils/FUCriticalSection.h.orig	2021-08-25 14:44:15.000000000 +0000
++++ libraries/source/fcollada/include/FUtils/FUCriticalSection.h
+@@ -33,7 +33,7 @@ private:
+ #elif defined(__APPLE__)
+ 	//Do something here.
+ 	MPCriticalRegionID criticalSection;
+-#elif defined(LINUX) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
++#elif defined(LINUX) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ #else
+ #warning "FUCriticalSection: Critical section not implemented for other platforms."
+ #endif
diff --git a/0ad/patches/patch-libraries_source_fcollada_include_FUtils_Platforms.h b/0ad/patches/patch-libraries_source_fcollada_include_FUtils_Platforms.h
new file mode 100644
index 0000000000..7361d4f012
--- /dev/null
+++ b/0ad/patches/patch-libraries_source_fcollada_include_FUtils_Platforms.h
@@ -0,0 +1,43 @@
+$NetBSD: patch-libraries_source_fcollada_include_FUtils_Platforms.h,v 1.1 2023/05/04 15:20:52 nikita Exp $
+
+--- libraries/source/fcollada/include/FUtils/Platforms.h.orig	2012-06-04 21:33:15.000000000 +0000
++++ libraries/source/fcollada/include/FUtils/Platforms.h
+@@ -74,7 +74,7 @@
+ #include <wchar.h>
+ #include <stdint.h>
+ 
+-#elif defined(LINUX) || defined(__PPU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
++#elif defined(LINUX) || defined(__PPU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ #include <ctype.h>
+ #include <wctype.h>
+ #include <unistd.h>
+@@ -82,9 +82,9 @@
+ #include <wchar.h>
+ #include <stdarg.h>
+ 
+-#if !defined(__FreeBSD__) && !defined(__OpenBSD__)
++#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
+ #include <malloc.h>
+-#endif // !__FreeBSD__ && !__OpenBSD__
++#endif // !__FreeBSD__ && !__NetBSD__ && !__OpenBSD__
+ 
+ #include <stdlib.h>
+ #include <stdio.h>
+@@ -125,7 +125,7 @@ typedef uint8_t byte;
+ #endif // PLATFORMS
+ 
+ // Important functions that some OSes have missing!
+-#if defined(__APPLE__) || defined(LINUX) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
++#if defined(__APPLE__) || defined(LINUX) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ inline char* strlower(char* str) { char* it = str; while (*it != 0) { *it = tolower(*it); ++it; } return str; }
+ inline wchar_t* wcslwr(wchar_t* str) { wchar_t* it = str; while (*it != 0) { *it = towlower(*it); ++it; } return str; }
+ inline int wcsicmp(const wchar_t* s1, const wchar_t* s2) { wchar_t c1 = *s1, c2 = *s2; while (c1 != 0 && c2 != 0) { if (c1 >= 'a' && c1 <= 'z') c1 -= 'a' + 'A'; if (c2 >= 'a' && c2 <= 'z') c2 -= 'a' + 'A'; if (c2 < c1) return -1; else if (c2 > c1) return 1; c1 = *(++s1); c2 = *(++s2); } return 0; }
+@@ -139,7 +139,7 @@ inline int wcsicmp(const wchar_t* s1, co
+ #elif defined(__PPU__)
+ #define glClearDepth glClearDepthf
+ 
+-#endif // __APPLE__ || LINUX || _FreeBSD__ || __FreeBSD_kernel__ || __OpenBSD__
++#endif // __APPLE__ || LINUX || _FreeBSD__ || __FreeBSD_kernel__ || __NetBSD__ || __OpenBSD__
+ 
+ // Cross-platform needed functions
+ #ifdef WIN32
diff --git a/0ad/patches/patch-libraries_source_fcollada_src_FCollada_FCDocument_FCDocument.h b/0ad/patches/patch-libraries_source_fcollada_src_FCollada_FCDocument_FCDocument.h
new file mode 100644
index 0000000000..09f4b8149c
--- /dev/null
+++ b/0ad/patches/patch-libraries_source_fcollada_src_FCollada_FCDocument_FCDocument.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-libraries_source_fcollada_src_FCollada_FCDocument_FCDocument.h,v 1.1 2023/05/04 15:20:52 nikita Exp $
+
+--- libraries/source/fcollada/src/FCollada/FCDocument/FCDocument.h.orig
++++ libraries/source/fcollada/src/FCollada/FCDocument/FCDocument.h
+@@ -30,7 +30,7 @@
+ #if defined(WIN32)
+ template <class T> class FCOLLADA_EXPORT FCDLibrary; /**< Trick Doxygen. */
+ template <class T> class FCOLLADA_EXPORT FUUniqueStringMapT; /**< Trick Doxygen. */
+-#elif defined(LINUX) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
++#elif defined(LINUX) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ template <class T> class FCDLibrary; /**< Trick Doxygen. */
+ template <class T> class FUUniqueStringMapT; /**< Trick Doxygen. */
+ #endif // LINUX
diff --git a/0ad/patches/patch-libraries_source_fcollada_src_FCollada_FUtils_FUCriticalSection.h b/0ad/patches/patch-libraries_source_fcollada_src_FCollada_FUtils_FUCriticalSection.h
new file mode 100644
index 0000000000..af7457275a
--- /dev/null
+++ b/0ad/patches/patch-libraries_source_fcollada_src_FCollada_FUtils_FUCriticalSection.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-libraries_source_fcollada_src_FCollada_FUtils_FUCriticalSection.h,v 1.1 2023/05/04 15:20:52 nikita Exp $
+
+--- libraries/source/fcollada/src/FCollada/FUtils/FUCriticalSection.h.orig
++++ libraries/source/fcollada/src/FCollada/FUtils/FUCriticalSection.h
+@@ -33,7 +33,7 @@ private:
+ #elif defined(__APPLE__)
+ 	//Do something here.
+ 	MPCriticalRegionID criticalSection;
+-#elif defined(LINUX) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
++#elif defined(LINUX) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ #else
+ #warning "FUCriticalSection: Critical section not implemented for other platforms."
+ #endif
diff --git a/0ad/patches/patch-libraries_source_fcollada_src_FCollada_FUtils_FUStringBuilder.hpp b/0ad/patches/patch-libraries_source_fcollada_src_FCollada_FUtils_FUStringBuilder.hpp
new file mode 100644
index 0000000000..1330c999bc
--- /dev/null
+++ b/0ad/patches/patch-libraries_source_fcollada_src_FCollada_FUtils_FUStringBuilder.hpp
@@ -0,0 +1,85 @@
+$NetBSD: patch-libraries_source_fcollada_src_FCollada_FUtils_FUStringBuilder.hpp,v 1.1 2023/05/04 15:20:52 nikita Exp $
+
+--- libraries/source/fcollada/src/FCollada/FUtils/FUStringBuilder.hpp.orig	2021-08-25 14:44:24.000000000 +0000
++++ libraries/source/fcollada/src/FCollada/FUtils/FUStringBuilder.hpp
+@@ -174,46 +174,45 @@ void FUStringBuilderT<Char>::append(cons
+ template <class Char>
+ void FUStringBuilderT<Char>::append(float f)
+ {
+-#ifdef WIN32
+-	// use <float.h> _isnan method to detect the 1.#IND00 NaN.
+-	if (f != std::numeric_limits<float>::infinity() && f != -std::numeric_limits<float>::infinity() && f != std::numeric_limits<float>::quiet_NaN() && f != std::numeric_limits<float>::signaling_NaN() && !_isnan((double)f))
+-#else
+-	if (f != std::numeric_limits<float>::infinity() && f != -std::numeric_limits<float>::infinity() && f != std::numeric_limits<float>::quiet_NaN() && f != std::numeric_limits<float>::signaling_NaN())
+-#endif
+-	{
+-		if (IsEquivalent(f, 0.0f, std::numeric_limits<float>::epsilon())) append((Char)'0');
+-		else
+-			for (Char c : ToXmlDouble(f))
+-				append(c);
+-	}
+-	else if (f == std::numeric_limits<float>::infinity())
+-	{ append((Char)'I'); append((Char)'N'); append((Char)'F'); }
+-	else if (f == -std::numeric_limits<float>::infinity())
+-	{ append((Char)'-'); append((Char)'I'); append((Char)'N'); append((Char)'F'); }
+-	else
+-	{ append((Char)'N'); append((Char)'a'); append((Char)'N'); }
++	append((double)f);
+ }
+ template <class Char>
+ void FUStringBuilderT<Char>::append(double f)
+ {
+-#ifdef WIN32
+-	// use <float.h> _isnan method to detect the .#IND00 NaN.
+-	if (f != std::numeric_limits<float>::infinity() && f != -std::numeric_limits<float>::infinity() && f != std::numeric_limits<float>::quiet_NaN() && f != std::numeric_limits<float>::signaling_NaN() && !_isnan(f))
+-#else
+-	if (f != std::numeric_limits<float>::infinity() && f != -std::numeric_limits<float>::infinity() && f != std::numeric_limits<float>::quiet_NaN() && f != std::numeric_limits<float>::signaling_NaN())
+-#endif
+-	{
+-		if (IsEquivalent(f, 0.0, std::numeric_limits<double>::epsilon())) append((Char)'0');
+-		else
+-			for (Char c : ToXmlDouble(f))
+-				append(c);
+-	}
+-	else if (f == std::numeric_limits<double>::infinity())
+-	{ append((Char)'I'); append((Char)'N'); append((Char)'F'); }
+-	else if (f == -std::numeric_limits<double>::infinity())
+-	{ append((Char)'-'); append((Char)'I'); append((Char)'N'); append((Char)'F'); }
++	if (f == -std::numeric_limits<double>::infinity()) {
++		append("-INF");
++		return;
++	} else if (f == std::numeric_limits<double>::infinity()) {
++		append("INF");
++		return;
++	} else if (f != f) {
++		append("NaN");
++		return;
++	} else if (-std::numeric_limits<double>::epsilon() < f && f < std::numeric_limits<double>::epsilon()) {
++		append("0.0E0");
++		return;
++	}
++	if (f < 0.0) {
++		f = -f;
++		append('-');
++	}
++
++	int e = 0;
++	if (f < 1.0)
++		for (; f < 1.0; f *= 10.0)
++			e--;
+ 	else
+-	{ append((Char)'N'); append((Char)'a'); append((Char)'N'); }
++		for (; f >= 10.0; f /= 10.0)
++			e++;
++
++	char tmp[10];
++	sprintf(tmp, "%.6g", f);
++	append(tmp);
++	if (tmp[1] == 0) // only one digit, add missing part according canonical representation
++		append(".0");
++
++	sprintf(tmp, "E%d", e);
++	append(tmp);
+ }
+ template <class Char>
+ void FUStringBuilderT<Char>::append(const FMVector2& v)
diff --git a/0ad/patches/patch-libraries_source_fcollada_src_FCollada_FUtils_Platforms.h b/0ad/patches/patch-libraries_source_fcollada_src_FCollada_FUtils_Platforms.h
new file mode 100644
index 0000000000..dae935b3fa
--- /dev/null
+++ b/0ad/patches/patch-libraries_source_fcollada_src_FCollada_FUtils_Platforms.h
@@ -0,0 +1,34 @@
+$NetBSD: patch-libraries_source_fcollada_src_FCollada_FUtils_Platforms.h,v 1.1 2023/05/04 15:20:52 nikita Exp $
+
+--- libraries/source/fcollada/src/FCollada/FUtils/Platforms.h.orig	2012-06-04 21:33:15.000000000 +0000
++++ libraries/source/fcollada/src/FCollada/FUtils/Platforms.h
+@@ -74,7 +74,7 @@
+ #include <wchar.h>
+ #include <stdint.h>
+ 
+-#elif defined(LINUX) || defined(__PPU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
++#elif defined(LINUX) || defined(__PPU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ #include <ctype.h>
+ #include <wctype.h>
+ #include <unistd.h>
+@@ -82,9 +82,9 @@
+ #include <wchar.h>
+ #include <stdarg.h>
+ 
+-#if !defined(__FreeBSD__) && !defined(__OpenBSD__)
++#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
+ #include <malloc.h>
+-#endif // !__FreeBSD__ && !__OpenBSD__
++#endif // !__FreeBSD__ && !__NetBSD__ && !__OpenBSD__
+ 
+ #include <stdlib.h>
+ #include <stdio.h>
+@@ -125,7 +125,7 @@
+ #endif // PLATFORMS
+ 
+ // Important functions that some OSes have missing!
+-#if defined(__APPLE__) || defined(LINUX) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
++#if defined(__APPLE__) || defined(LINUX) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ inline char* strlower(char* str) { char* it = str; while (*it != 0) { *it = tolower(*it); ++it; } return str; }
+ inline wchar_t* wcslwr(wchar_t* str) { wchar_t* it = str; while (*it != 0) { *it = towlower(*it); ++it; } return str; }
+ inline int wcsicmp(const wchar_t* s1, const wchar_t* s2) { wchar_t c1 = *s1, c2 = *s2; while (c1 != 0 && c2 != 0) { if (c1 >= 'a' && c1 <= 'z') c1 -= 'a' + 'A'; if (c2 >= 'a' && c2 <= 'z') c2 -= 'a' + 'A'; if (c2 < c1) return -1; else if (c2 > c1) return 1; c1 = *(++s1); c2 = *(++s2); } return 0; }
diff --git a/0ad/patches/patch-libraries_source_nvtt_src_CMakeLists.txt b/0ad/patches/patch-libraries_source_nvtt_src_CMakeLists.txt
new file mode 100644
index 0000000000..0904ace7c7
--- /dev/null
+++ b/0ad/patches/patch-libraries_source_nvtt_src_CMakeLists.txt
@@ -0,0 +1,20 @@
+$NetBSD: patch-libraries_source_nvtt_src_CMakeLists.txt,v 1.2 2023/05/05 14:55:18 nikita Exp $
+
+
+--- libraries/source/nvtt/src/CMakeLists.txt.orig	2022-09-23 22:36:55.000000000 +0200
++++ libraries/source/nvtt/src/CMakeLists.txt	2023-05-05 13:29:14.769485899 +0200
+@@ -42,11 +42,10 @@
+ 	SET(NVIMAGE_SHARED TRUE)
+ ENDIF(NVTT_SHARED)
+ 
+-SET(CMAKE_SKIP_BUILD_RPATH TRUE)
+-SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
+-SET(CMAKE_INSTALL_RPATH "$ORIGIN")
++SET(CMAKE_SKIP_BUILD_RPATH FALSE)
++SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
++SET(CMAKE_BUILD_RPATH "${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/0ad")
+ SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+-SET(CMAKE_INSTALL_NAME_DIR "@executable_path")
+ 
+ ADD_SUBDIRECTORY(extern)
+ 
diff --git a/0ad/patches/patch-libraries_source_nvtt_src_src_nvtt_CMakeLists.txt b/0ad/patches/patch-libraries_source_nvtt_src_src_nvtt_CMakeLists.txt
new file mode 100644
index 0000000000..ba97a041e7
--- /dev/null
+++ b/0ad/patches/patch-libraries_source_nvtt_src_src_nvtt_CMakeLists.txt
@@ -0,0 +1,17 @@
+$NetBSD: patch-libraries_source_nvtt_src_src_nvtt_CMakeLists.txt,v 1.1 2023/05/05 00:08:13 nikita Exp $
+
+Revert patch by upstream.
+
+--- libraries/source/nvtt/src/src/nvtt/CMakeLists.txt.orig	2023-05-05 01:17:21.236120624 +0200
++++ libraries/source/nvtt/src/src/nvtt/CMakeLists.txt	2023-05-05 01:17:49.911281699 +0200
+@@ -42,10 +42,6 @@
+ ADD_DEFINITIONS(-DNVTT_EXPORTS)
+ 
+ IF(NVTT_SHARED)
+-    IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+-        SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,origin")
+-    ENDIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+-
+     ADD_DEFINITIONS(-DNVTT_SHARED=1)
+     ADD_LIBRARY(nvtt SHARED ${NVTT_SRCS})
+ ELSE(NVTT_SHARED)
diff --git a/0ad/patches/patch-libraries_source_spidermonkey_build.sh b/0ad/patches/patch-libraries_source_spidermonkey_build.sh
new file mode 100644
index 0000000000..8361e45e9f
--- /dev/null
+++ b/0ad/patches/patch-libraries_source_spidermonkey_build.sh
@@ -0,0 +1,20 @@
+$NetBSD: patch-libraries_source_spidermonkey_build.sh,v 1.1 2023/05/04 15:20:52 nikita Exp $
+
+
+--- libraries/source/spidermonkey/build.sh.orig	2023-05-03 20:04:57.672955809 +0200
++++ libraries/source/spidermonkey/build.sh	2023-05-03 20:06:29.174827445 +0200
+@@ -51,12 +51,12 @@
+ then
+   ARCH=${ARCH:=""}
+   if [ -z "${ARCH}" ]; then
+-    if [ "`uname -m`" == "arm64" ]; then
++    if [ "`uname -m`" = "arm64" ]; then
+       ARCH="aarch64"
+     else
+       ARCH="x86_64"
+     fi
+-  elif [ $ARCH == "arm64"  ]; then
++  elif [ $ARCH = "arm64"  ]; then
+     # SM78 doesn't know about arm64 yet, and that's passed by build-osx-libs.sh, so fix it explicitly.
+     ARCH="aarch64"
+   fi
diff --git a/0ad/patches/patch-source_lib_allocators_page__aligned.cpp b/0ad/patches/patch-source_lib_allocators_page__aligned.cpp
new file mode 100644
index 0000000000..8b56cbeef8
--- /dev/null
+++ b/0ad/patches/patch-source_lib_allocators_page__aligned.cpp
@@ -0,0 +1,23 @@
+$NetBSD: patch-source_lib_allocators_page__aligned.cpp,v 1.1 2023/05/04 15:20:52 nikita Exp $
+
+
+--- source/lib/allocators/page_aligned.cpp.orig	2017-07-28 19:57:26 UTC
++++ source/lib/allocators/page_aligned.cpp
+@@ -49,7 +49,7 @@ static const int mmap_flags = MAP_PRIVATE|MAP_ANONYMOU
+ Status mem_Reserve(size_t size, u8** pp)
+ {
+ 	errno = 0;
+-	void* ret = mmap(0, size, PROT_NONE, mmap_flags|MAP_NORESERVE, -1, 0);
++	void* ret = mmap(0, size, PROT_NONE, mmap_flags, -1, 0);
+ 	*pp = (u8*)ret;
+ 	return StatusFromMap(ret);
+ }
+@@ -76,7 +76,7 @@ Status mem_Commit(u8* p, size_t size, int prot)
+ Status mem_Decommit(u8* p, size_t size)
+ {
+ 	errno = 0;
+-	void* ret = mmap(p, size, PROT_NONE, mmap_flags|MAP_NORESERVE|MAP_FIXED, -1, 0);
++	void* ret = mmap(p, size, PROT_NONE, mmap_flags|MAP_FIXED, -1, 0);
+ 	return StatusFromMap(ret);
+ }
+ 
diff --git a/0ad/patches/patch-source_maths_tests_test__Bound.h b/0ad/patches/patch-source_maths_tests_test__Bound.h
new file mode 100644
index 0000000000..8c28f02d64
--- /dev/null
+++ b/0ad/patches/patch-source_maths_tests_test__Bound.h
@@ -0,0 +1,18 @@
+$NetBSD: patch-source_maths_tests_test__Bound.h,v 1.1 2023/05/04 15:20:52 nikita Exp $
+
+
+--- source/maths/tests/test_Bound.h.orig	2023-05-04 00:38:25.197319481 +0200
++++ source/maths/tests/test_Bound.h	2023-05-04 00:43:35.449226082 +0200
+@@ -203,9 +203,9 @@
+ 		CBoundingBoxOriented result;
+ 		flatAabb.Transform(transform, result);
+ 
+-		TS_ASSERT(!isnan(result.m_Basis[0].X) && !isnan(result.m_Basis[0].Y) && !isnan(result.m_Basis[0].Z));
+-		TS_ASSERT(!isnan(result.m_Basis[1].X) && !isnan(result.m_Basis[1].Y) && !isnan(result.m_Basis[1].Z));
+-		TS_ASSERT(!isnan(result.m_Basis[2].X) && !isnan(result.m_Basis[2].Y) && !isnan(result.m_Basis[2].Z));
++		TS_ASSERT(!std::isnan(result.m_Basis[0].X) && !std::isnan(result.m_Basis[0].Y) && !std::isnan(result.m_Basis[0].Z));
++		TS_ASSERT(!std::isnan(result.m_Basis[1].X) && !std::isnan(result.m_Basis[1].Y) && !std::isnan(result.m_Basis[1].Z));
++		TS_ASSERT(!std::isnan(result.m_Basis[2].X) && !std::isnan(result.m_Basis[2].Y) && !std::isnan(result.m_Basis[2].Z));
+ 	}
+ 
+ 	void test_point_visibility()
diff --git a/0ad/patches/patch-source_network_StunClient.cpp b/0ad/patches/patch-source_network_StunClient.cpp
new file mode 100644
index 0000000000..494798411a
--- /dev/null
+++ b/0ad/patches/patch-source_network_StunClient.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-source_network_StunClient.cpp,v 1.1 2023/05/04 15:20:52 nikita Exp $
+
+Add header file for std::byte.
+
+--- source/network/StunClient.cpp.orig	2021-07-27 21:57:02.000000000 +0000
++++ source/network/StunClient.cpp
+@@ -28,6 +28,7 @@
+ #include "lib/external_libraries/enet.h"
+ 
+ #include <chrono>
++#include <cstddef>
+ #include <vector>
+ #include <thread>
+ 
diff --git a/0ad/patches/patch-source_scriptinterface_ScriptTypes.h b/0ad/patches/patch-source_scriptinterface_ScriptTypes.h
new file mode 100644
index 0000000000..36a517beb9
--- /dev/null
+++ b/0ad/patches/patch-source_scriptinterface_ScriptTypes.h
@@ -0,0 +1,20 @@
+$NetBSD: patch-source_scriptinterface_ScriptTypes.h,v 1.1 2023/05/04 15:20:52 nikita Exp $
+
+--- source/scriptinterface/ScriptTypes.h.orig	2021-07-27 21:56:58.000000000 +0000
++++ source/scriptinterface/ScriptTypes.h
+@@ -81,6 +81,7 @@ system-installed version. Make sure you 
+ include paths.
+ #endif
+ 
++#if 0
+ #if MOZJS_MINOR_VERSION != 6
+ #error Your compiler is trying to use an untested minor version of the \
+ SpiderMonkey library. If you are a package maintainer, please make sure \
+@@ -93,6 +94,7 @@ version. Another way for testing is runn
+ final hash (check trac.wildfiregames.com/wiki/Debugging#Replaymode). \
+ For more information check this link: trac.wildfiregames.com/wiki/Debugging#Outofsync
+ #endif
++#endif
+ 
+ class ScriptInterface;
+ 
diff --git a/0ad/patches/patch-source_scriptinterface_tests_test__ScriptConversions.h b/0ad/patches/patch-source_scriptinterface_tests_test__ScriptConversions.h
new file mode 100644
index 0000000000..8c24ce25d5
--- /dev/null
+++ b/0ad/patches/patch-source_scriptinterface_tests_test__ScriptConversions.h
@@ -0,0 +1,14 @@
+$NetBSD: patch-source_scriptinterface_tests_test__ScriptConversions.h,v 1.1 2023/05/04 15:20:52 nikita Exp $
+
+
+--- source/scriptinterface/tests/test_ScriptConversions.h.orig	2023-05-04 01:07:22.308333403 +0200
++++ source/scriptinterface/tests/test_ScriptConversions.h	2023-05-04 01:07:53.059298729 +0200
+@@ -208,7 +208,7 @@
+ 		JS::RootedValue testNANVal(rq.cx);
+ 		Script::ToJSVal(rq, &testNANVal, NAN);
+ 		TS_ASSERT(Script::FromJSVal(rq, testNANVal, f));
+-		TS_ASSERT(isnan(f));
++		TS_ASSERT(std::isnan(f));
+ 	}
+ 
+ 	// NOTE: fixed and vector conversions are defined in simulation2/scripting/EngineScriptConversions.cpp
diff --git a/0ad/patches/patch-source_third__party_mikktspace_weldmesh.cpp b/0ad/patches/patch-source_third__party_mikktspace_weldmesh.cpp
new file mode 100644
index 0000000000..1865463717
--- /dev/null
+++ b/0ad/patches/patch-source_third__party_mikktspace_weldmesh.cpp
@@ -0,0 +1,18 @@
+$NetBSD: patch-source_third__party_mikktspace_weldmesh.cpp,v 1.1 2023/05/04 15:20:52 nikita Exp $
+
+--- source/third_party/mikktspace/weldmesh.cpp.orig	2013-12-06 00:42:50.000000000 +0000
++++ source/third_party/mikktspace/weldmesh.cpp
+@@ -30,7 +30,7 @@
+ #include <string.h>
+ #include <assert.h>
+ 
+-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
++#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ #include <stdlib.h>  /* BSD-based OSes get their malloc stuff through here */
+ #else
+ #include <malloc.h> 
+@@ -199,4 +199,3 @@ static void MergeVertsFast(int * piCurNr
+ 						   pfVertexDataIn, iNrVerticesIn, iFloatsPerVert, iL, iR_in, iChannelNum);	// weld all right of (or equal to) fSep
+ 	}
+ }
+-
diff --git a/0ad/patches/patch-source_third__party_tinygettext_include_tinygettext_iconv.hpp b/0ad/patches/patch-source_third__party_tinygettext_include_tinygettext_iconv.hpp
new file mode 100644
index 0000000000..77a7e13221
--- /dev/null
+++ b/0ad/patches/patch-source_third__party_tinygettext_include_tinygettext_iconv.hpp
@@ -0,0 +1,20 @@
+$NetBSD: patch-source_third__party_tinygettext_include_tinygettext_iconv.hpp,v 1.1 2023/05/04 15:20:52 nikita Exp $
+
+tinygettext fails with NetBSD iconv.
+Use iconv from SDL2 instead.
+
+--- source/third_party/tinygettext/include/tinygettext/iconv.hpp.orig	2021-07-27 21:57:05.000000000 +0000
++++ source/third_party/tinygettext/include/tinygettext/iconv.hpp
+@@ -22,8 +22,11 @@
+ 
+ #include <string>
+ 
++// pkgsrc
++#define TINYGETTEXT_WITH_SDL
++
+ #ifdef TINYGETTEXT_WITH_SDL
+-#  include "SDL.h"
++#  include "SDL2/SDL.h"
+ #else
+ #  include <iconv.h>
+ #endif



Home | Main Index | Thread Index | Old Index