0ad: update to 0.27.0, allow cross

This commit is contained in:
JkktBkkt 2025-06-27 20:10:32 +03:00 committed by classabbyamp
parent 0a5264a765
commit 6f7444e81f
18 changed files with 453 additions and 265 deletions

View file

@ -0,0 +1,15 @@
This gets applied in libraries/nvtt/nvtt-${_nvtt_version}
--- a/src/src/nvcore/Debug.cpp 2021-02-27 11:38:49.764811556 +0100
+++ b/src/src/nvcore/Debug.cpp 2021-02-27 11:39:48.919032920 +0100
@@ -40,6 +40,11 @@
# include <signal.h>
#endif
+#if NV_OS_LINUX
+# include <asm/ptrace.h> // struct pt_regs
+#endif
+
+
#if NV_OS_UNIX
# include <unistd.h> // getpid
#endif

View file

@ -1,5 +1,6 @@
--- a/libraries/source/nvtt/src/src/nvmath/SimdVector_VE.h
+++ b/libraries/source/nvtt/src/src/nvmath/SimdVector_VE.h
This gets applied in libraries/source/nvtt/nvtt-${_nvtt_version}
--- a/src/src/nvmath/SimdVector_VE.h
+++ b/src/src/nvmath/SimdVector_VE.h
@@ -27,10 +27,7 @@
#ifndef NV_SIMD_VECTOR_VE_H
#define NV_SIMD_VECTOR_VE_H
@ -11,10 +12,10 @@
namespace nv {
diff --git a/source/nvtt/src/src/nvtt/squish/simd_ve.h b/source/nvtt/src/src/nvtt/squish/simd_ve.h
diff --git a/src/src/nvtt/squish/simd_ve.h b/src/src/nvtt/squish/simd_ve.h
index 5a11858..e256c54 100644
--- a/libraries/source/nvtt/src/src/nvtt/squish/simd_ve.h
+++ b/libraries/source/nvtt/src/src/nvtt/squish/simd_ve.h
--- a/src/src/nvtt/squish/simd_ve.h
+++ b/src/src/nvtt/squish/simd_ve.h
@@ -27,10 +27,7 @@
#ifndef SQUISH_SIMD_VE_H
#define SQUISH_SIMD_VE_H

View file

@ -1,81 +0,0 @@
From 95f1e91ef71d912be5f6dddb6fac68671d850fd6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
Date: Sun, 24 Jul 2022 11:11:01 +0200
Subject: [PATCH] Python/Build: Use r instead of rU file read modes
Fixes Python 3.11 build
---
python/mozbuild/mozbuild/action/process_define_files.py | 2 +-
python/mozbuild/mozbuild/preprocessor.py | 6 +++---
python/mozbuild/mozbuild/util.py | 4 +++-
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/python/mozbuild/mozbuild/action/process_define_files.py b/python/mozbuild/mozbuild/action/process_define_files.py
index 6fff0d1..de2bcf4 100644
--- a/python/mozbuild/mozbuild/action/process_define_files.py
+++ b/python/mozbuild/mozbuild/action/process_define_files.py
@@ -36,7 +36,7 @@ def process_define_file(output, input):
not config.substs.get('JS_STANDALONE'):
config = PartialConfigEnvironment(mozpath.join(topobjdir, 'js', 'src'))
- with open(path, 'rU') as input:
+ with open(path, 'r') as input:
r = re.compile('^\s*#\s*(?P<cmd>[a-z]+)(?:\s+(?P<name>\S+)(?:\s+(?P<value>\S+))?)?', re.U)
for l in input:
m = r.match(l)
diff --git a/python/mozbuild/mozbuild/preprocessor.py b/python/mozbuild/mozbuild/preprocessor.py
index 0e3a750..66f5cf7 100644
--- a/python/mozbuild/mozbuild/preprocessor.py
+++ b/python/mozbuild/mozbuild/preprocessor.py
@@ -517,7 +517,7 @@ class Preprocessor:
if args:
for f in args:
- with io.open(f, 'rU', encoding='utf-8') as input:
+ with io.open(f, 'r', encoding='utf-8') as input:
self.processFile(input=input, output=out)
if depfile:
mk = Makefile()
@@ -807,7 +807,7 @@ class Preprocessor:
args = self.applyFilters(args)
if not os.path.isabs(args):
args = os.path.join(self.curdir, args)
- args = io.open(args, 'rU', encoding='utf-8')
+ args = io.open(args, 'r', encoding='utf-8')
except Preprocessor.Error:
raise
except Exception:
@@ -862,7 +862,7 @@ def preprocess(includes=[sys.stdin], defines={},
pp = Preprocessor(defines=defines,
marker=marker)
for f in includes:
- with io.open(f, 'rU', encoding='utf-8') as input:
+ with io.open(f, 'r', encoding='utf-8') as input:
pp.processFile(input=input, output=output)
return pp.includes
diff --git a/python/mozbuild/mozbuild/util.py b/python/mozbuild/mozbuild/util.py
index 044cf64..eb992ce 100644
--- a/python/mozbuild/mozbuild/util.py
+++ b/python/mozbuild/mozbuild/util.py
@@ -54,6 +54,8 @@ def exec_(object, globals=None, locals=None):
def _open(path, mode):
+ if mode == "rU":
+ mode = "r"
if 'b' in mode:
return io.open(path, mode)
return io.open(path, mode, encoding='utf-8', newline='\n')
@@ -220,7 +222,7 @@ class FileAvoidWrite(BytesIO):
still occur, as well as diff capture if requested.
"""
- def __init__(self, filename, capture_diff=False, dry_run=False, readmode='rU'):
+ def __init__(self, filename, capture_diff=False, dry_run=False, readmode='r'):
BytesIO.__init__(self)
self.name = filename
assert type(capture_diff) == bool
--
2.37.1

View file

@ -1,11 +0,0 @@
--- a/build/moz.configure/rust.configure
+++ b/build/moz.configure/rust.configure
@@ -352,7 +352,7 @@
return None
- rustc_target = find_candidate(candidates)
+ rustc_target = os.environ["RUST_TARGET"]
if rustc_target is None:
die("Don't know how to translate {} for rustc".format(

View file

@ -1,23 +0,0 @@
Index: libraries/source/fcollada/src/Makefile
===================================================================
--- a/libraries/source/fcollada/src/Makefile
+++ b/libraries/source/fcollada/src/Makefile
@@ -224,7 +224,7 @@ OBJECTS_RELEASE = $(addprefix output/rel
OBJECTS_TEST = $(addprefix output/test/,$(SOURCE:.cpp=.o) $(TEST_SOURCE:.cpp=.o))
OBJECTS_ALL = $(OBJECTS_DEBUG) $(OBJECTS_RELEASE) $(OBJECTS_TEST)
-all: output/libFColladaSD.a output/libFColladaSR.a install
+all: output/libFColladaSR.a install
output_dirs:
bash -c 'mkdir -p output/{debug,release,test}/{FCollada/{FCDocument,FMath,FUtils,FColladaTest/{FCTestAssetManagement,FCTestExportImport,FCTestXRef}},FColladaPlugins/FArchiveXML}'
@@ -244,8 +244,7 @@ output/libFColladaSR.a: $(OBJECTS_RELEAS
output/FColladaTest: $(OBJECTS_TEST) | output_dirs
$(CXX) -o $@ $(LDFLAGS) $(OBJECTS_TEST) $(LIBS)
-install: output/libFColladaSD.a output/libFColladaSR.a
- cp output/libFColladaSD.a ../lib/libFColladaSD.a
+install: output/libFColladaSR.a
cp output/libFColladaSR.a ../lib/libFColladaSR.a
dfile = $(@:.o=.d)

View file

@ -0,0 +1,29 @@
diff --git a/source/gui/tests/test_CGUIText.h b/source/gui/tests/test_CGUIText.h
index dd779c6..735fb79 100644
--- a/source/gui/tests/test_CGUIText.h
+++ b/source/gui/tests/test_CGUIText.h
@@ -316,24 +316,6 @@ public:
TS_ASSERT_EQUALS(text.GetSize().Height, lineHeight + padding * 2);
}
- void test_regression_rP26522()
- {
- TS_ASSERT_OK(g_VFS->Mount(L"", DataDir() / "mods" / "mod" / "", VFS_MOUNT_MUST_EXIST));
-
- CGUI gui{*g_ScriptContext};
-
- const CStrW font = L"sans-bold-13";
- CGUIString string;
- CGUIText text;
-
- // rP26522 introduced a bug that triggered in rare cases with word-wrapping.
- string.SetValue(L"90120 min");
- text = CGUIText(gui, string, L"sans-bold-13", 53, 8.f, EAlign::LEFT, nullptr);
-
- TS_ASSERT_EQUALS(text.GetTextCalls().size(), 2);
- TS_ASSERT_EQUALS(text.GetSize().Height, 14 + 9 + 8 * 2);
- }
-
void test_multiple_blank_spaces()
{
CGUI gui{*g_ScriptContext};

View file

@ -1,48 +0,0 @@
From 093e1eb23519ab4a4633a999a555a58e4fd5343e Mon Sep 17 00:00:00 2001
From: Stan <Stan@3db68df2-c116-0410-a063-a993310a9797>
Date: Sat, 13 May 2023 12:08:23 +0000
Subject: [PATCH] Fix compilation with GCC 13.
gcc-13 less often includes cstdint so one might need to include it manually if needed.
The headers already included in Message.h are included within namespace AtlasMessage which didn't break by chance, move them out and add cstdint.
Patch by: @sera
Reviewed by: @phosit
Fixes: #6800
Differential Revision: https://code.wildfiregames.com/D4997
git-svn-id: https://svn.wildfiregames.com/public/ps/trunk@27644 3db68df2-c116-0410-a063-a993310a9797
---
source/tools/atlas/GameInterface/Messages.h | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/source/tools/atlas/GameInterface/Messages.h b/source/tools/atlas/GameInterface/Messages.h
index 2fa47809213..a486d93a687 100644
--- a/source/tools/atlas/GameInterface/Messages.h
+++ b/source/tools/atlas/GameInterface/Messages.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2022 Wildfire Games.
+/* Copyright (C) 2023 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -18,13 +18,15 @@
#ifndef INCLUDED_MESSAGES
#define INCLUDED_MESSAGES
+#include <cstdint>
+#include <string>
+#include <vector>
+
+// Opens namespace AtlasMessage, closes it on second inclusion!
#ifndef MESSAGES_SKIP_SETUP
#include "MessagesSetup.h"
#endif
-#include <vector>
-#include <string>
-
// TODO: organisation, documentation, etc
#ifdef _MSC_VER // (can't use MSC_VERSION here since this file is included by Atlas too)

View file

@ -0,0 +1,20 @@
diff --git a/source/lib/tests/test_secure_crt.h1 b/source/lib/tests/test_secure_crt.h
index 530e998a474..45d81a94306 100644
--- a/source/lib/tests/test_secure_crt.h1
+++ b/source/lib/tests/test_secure_crt.h
@@ -351,13 +351,13 @@ public:
void test_printf_strings()
{
TEST_PRINTF(d10,10, s10, 3, "123", "%s", "123");
- TEST_PRINTF(d10,10, s10, 3, "123", "%hs", "123");
+ //TEST_PRINTF(d10,10, s10, 3, "123", "%hs", "123");
TEST_PRINTF(d10,10, s10, 3, "123", "%ls", L"123");
}
void test_wprintf_strings()
{
- TEST_WPRINTF(wd10,10, ws10, 3, L"123", L"%hs", "123");
+ //TEST_WPRINTF(wd10,10, ws10, 3, L"123", L"%hs", "123");
TEST_WPRINTF(wd10,10, ws10, 3, L"123", L"%ls", L"123");
}
};

View file

@ -1,15 +0,0 @@
Index: 0ad-0.0.26/build/workspaces/update-workspaces.sh
===================================================================
--- 0ad-0.0.26.orig/build/workspaces/update-workspaces.sh
+++ 0ad-0.0.26/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: $*

View file

@ -0,0 +1,64 @@
diff --git a/libraries/source/spidermonkey/build.sh b/libraries/source/spidermonkey/build.sh
index 0dc66e01847..edbe032b525 100755
--- a/libraries/source/spidermonkey/build.sh
+++ b/libraries/source/spidermonkey/build.sh
@@ -46,8 +46,9 @@ if [ ! -e "${FOLDER}.tar.xz" ]; then
fi
# unpack
-rm -Rf "${FOLDER}"
-tar xfJ "${FOLDER}.tar.xz"
+# done via xbps-src extract
+#rm -Rf "${FOLDER}"
+#tar xfJ "${FOLDER}.tar.xz"
# patch
(
diff --git a/libraries/source/cxxtest-4.4/build.sh b/libraries/source/cxxtest-4.4/build.sh
index 3243836ecb1..1ab6e46fff5 100755
--- a/libraries/source/cxxtest-4.4/build.sh1
+++ b/libraries/source/cxxtest-4.4/build.sh
@@ -39,8 +39,9 @@ if [ ! -e "cxxtest-${PV}.tar.gz" ]; then
fi
# unpack
-rm -Rf "cxxtest-${PV}"
-tar -xf "cxxtest-${PV}.tar.gz"
+# done via xbps-src extract
+#rm -Rf "cxxtest-${PV}"
+#tar -xf "cxxtest-${PV}.tar.gz"
# patch
patch -d "cxxtest-${PV}" -p1 <patches/0001-Add-Debian-python3-patch.patch
diff --git a/libraries/source/fcollada/build.sh b/libraries/source/fcollada/build.sh
index 4ba98b9d2a8..4edc51846fe 100755
--- a/libraries/source/fcollada/build.sh
+++ b/libraries/source/fcollada/build.sh
@@ -41,8 +41,9 @@ if [ ! -e "fcollada-${PV}.tar.xz" ]; then
fi
# unpack
-rm -Rf fcollada-${PV}
-tar xf fcollada-${PV}.tar.xz
+# done via xbps-src extract
+#rm -Rf fcollada-${PV}
+#tar xf fcollada-${PV}.tar.xz
# build
(
diff --git a/libraries/source/nvtt/build.sh b/libraries/source/nvtt/build.sh
index 80f29566e23..a5c5b0b7e66 100755
--- a/libraries/source/nvtt/build.sh
+++ b/libraries/source/nvtt/build.sh
@@ -41,8 +41,9 @@ if [ ! -e "nvtt-${PV}.tar.xz" ]; then
fi
# unpack
-rm -Rf nvtt-${PV}
-tar xf nvtt-${PV}.tar.xz
+# done via xbps-src extract
+#rm -Rf nvtt-${PV}
+#tar xf nvtt-${PV}.tar.xz
# patch
patch -d nvtt-${PV} -p1 <patches/0001-Don-t-overspecify-flags.patch

View file

@ -0,0 +1,158 @@
From 263b481442ccf51f8588828c8bce7a2843299864 Mon Sep 17 00:00:00 2001
From: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Date: Sun, 27 Apr 2025 08:33:11 +0200
Subject: [PATCH] Cmake-4 support for nvtt
Fix nvtt build to support cmake-4, while at it also fix other
related outstanding cmake issues in nvtt.
Fixes: #7538
Fixes: #7764
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
---
libraries/source/nvtt/build.sh | 7 +++-
.../0001-Don-t-overspecify-flags.patch | 41 +++++++++++++++++++
.../0002-Bump-cmake-min-version-to-3.10.patch | 27 ++++++++++++
...ecute_process-insted-of-exec_program.patch | 26 ++++++++++++
4 files changed, 100 insertions(+), 1 deletion(-)
create mode 100644 libraries/source/nvtt/patches/0001-Don-t-overspecify-flags.patch
create mode 100644 libraries/source/nvtt/patches/0002-Bump-cmake-min-version-to-3.10.patch
create mode 100644 libraries/source/nvtt/patches/0003-Use-execute_process-insted-of-exec_program.patch
diff --git a/libraries/source/nvtt/build.sh b/libraries/source/nvtt/build.sh
index 8a00df89f3..a855940d90 100755
--- a/libraries/source/nvtt/build.sh
+++ b/libraries/source/nvtt/build.sh
@@ -6,7 +6,7 @@ set -e
cd "$(dirname "$0")"
PV=28209
-LIB_VERSION=${PV}
+LIB_VERSION=${PV}+wfg1
fetch()
{
@@ -46,6 +46,11 @@ fi
rm -Rf nvtt-${PV}
"${TAR}" xf nvtt-${PV}.tar.xz
+# patch
+patch -d nvtt-${PV} -p1 <patches/0001-Don-t-overspecify-flags.patch
+patch -d nvtt-${PV} -p1 <patches/0002-Bump-cmake-min-version-to-3.10.patch
+patch -d nvtt-${PV} -p1 <patches/0003-Use-execute_process-insted-of-exec_program.patch
+
# build
(
cd nvtt-${PV}
diff --git a/libraries/source/nvtt/patches/0001-Don-t-overspecify-flags.patch b/libraries/source/nvtt/patches/0001-Don-t-overspecify-flags.patch
new file mode 100644
index 0000000000..4cc8e83d11
--- /dev/null
+++ b/libraries/source/nvtt/patches/0001-Don-t-overspecify-flags.patch
@@ -0,0 +1,41 @@
+From fee966a8d44afc26005df9b539b16a5ee7f99107 Mon Sep 17 00:00:00 2001
+From: Ralph Sennhauser <ralph.sennhauser@gmail.com>
+Date: Sun, 27 Apr 2025 07:53:42 +0200
+Subject: [PATCH] Don't overspecify flags
+
+Cmake picks flags like CFALGS CXXFLAGS and LDFLAGS from environment. The
+use of CMAKE_LINK_FLAGS even triggers a warning.
+
+Fixes: #7538
+Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
+---
+ build.sh | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/build.sh b/build.sh
+index dae3bcf..935c6ff 100755
+--- a/build.sh
++++ b/build.sh
+@@ -29,9 +29,6 @@ if [ "$(uname -s)" = "Darwin" ]; then
+ # but they're not as flexible for cross-compiling
+ # Disable png support (avoids some conflicts with MacPorts)
+ cmake .. \
+- -DCMAKE_LINK_FLAGS="$LDFLAGS" \
+- -DCMAKE_C_FLAGS="$CFLAGS" \
+- -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
+ -DCMAKE_BUILD_TYPE=Release \
+ $CMAKE_FLAGS \
+ -DBINDIR=bin \
+@@ -40,9 +37,6 @@ if [ "$(uname -s)" = "Darwin" ]; then
+ -G "Unix Makefiles"
+ else
+ cmake .. \
+- -DCMAKE_LINK_FLAGS="$LDFLAGS" \
+- -DCMAKE_C_FLAGS="$CFLAGS" \
+- -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
+ $CMAKE_FLAGS \
+--
+2.49.0
+
diff --git a/libraries/source/nvtt/patches/0002-Bump-cmake-min-version-to-3.10.patch b/libraries/source/nvtt/patches/0002-Bump-cmake-min-version-to-3.10.patch
new file mode 100644
index 0000000000..64fcfce75e
--- /dev/null
+++ b/libraries/source/nvtt/patches/0002-Bump-cmake-min-version-to-3.10.patch
@@ -0,0 +1,27 @@
+From cc07839eff9be49e2c3df4e68ce18f3134caafd2 Mon Sep 17 00:00:00 2001
+From: Ralph Sennhauser <ralph.sennhauser@gmail.com>
+Date: Sun, 27 Apr 2025 07:57:10 +0200
+Subject: [PATCH] Bump cmake min version to 3.10
+
+Cmake-4 removes support for cmake < cmake-3.5 and deprecates cmake <
+cmake-3.10
+
+Fixes: #7764
+Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
+---
+ src/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index b18b791..b517b52 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0)
++CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
+ PROJECT(NV)
+ ENABLE_TESTING()
+
+--
+2.49.0
+
diff --git a/libraries/source/nvtt/patches/0003-Use-execute_process-insted-of-exec_program.patch b/libraries/source/nvtt/patches/0003-Use-execute_process-insted-of-exec_program.patch
new file mode 100644
index 0000000000..faf94c6ff3
--- /dev/null
+++ b/libraries/source/nvtt/patches/0003-Use-execute_process-insted-of-exec_program.patch
@@ -0,0 +1,26 @@
+From 324f50d1ccf5ca38e0f3817c8d18208bd72e01f2 Mon Sep 17 00:00:00 2001
+From: Ralph Sennhauser <ralph.sennhauser@gmail.com>
+Date: Sun, 27 Apr 2025 08:05:59 +0200
+Subject: [PATCH] Use execute_process insted of exec_program
+
+Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
+---
+ src/cmake/DetermineProcessor.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/cmake/DetermineProcessor.cmake b/src/cmake/DetermineProcessor.cmake
+index 7db7a95..13d39de 100644
+--- a/src/cmake/DetermineProcessor.cmake
++++ b/src/cmake/DetermineProcessor.cmake
+@@ -8,7 +8,7 @@ IF(UNIX)
+ #EXEC_PROGRAM(uname ARGS -p OUTPUT_VARIABLE NV_SYSTEM_PROCESSOR RETURN_VALUE val)
+
+ #IF("${val}" GREATER 0 OR NV_SYSTEM_PROCESSOR STREQUAL "unknown")
+- EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE NV_SYSTEM_PROCESSOR RETURN_VALUE val)
++ execute_process(COMMAND uname -m OUTPUT_VARIABLE NV_SYSTEM_PROCESSOR ERROR_VARIABLE val)
+ #ENDIF("${val}" GREATER 0 OR NV_SYSTEM_PROCESSOR STREQUAL "unknown")
+
+ IF(NV_SYSTEM_PROCESSOR STREQUAL "Power Macintosh")
+--
+2.49.0
+

View file

@ -1,14 +0,0 @@
--- a/libraries/source/nvtt/src/src/nvcore/Debug.cpp 2021-02-27 11:38:49.764811556 +0100
+++ b/libraries/source/nvtt/src/src/nvcore/Debug.cpp 2021-02-27 11:39:48.919032920 +0100
@@ -40,6 +40,11 @@
# include <signal.h>
#endif
+#if NV_OS_LINUX
+# include <asm/ptrace.h> // struct pt_regs
+#endif
+
+
#if NV_OS_UNIX
# include <unistd.h> // getpid
#endif

View file

@ -0,0 +1,53 @@
From 06d4f83dc8e4f3d610b939024a848b8ef0aac19b Mon Sep 17 00:00:00 2001
From: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Date: Fri, 27 Jun 2025 08:24:34 +0200
Subject: [PATCH] Add support for specifying pkg-config via env
For cross compiling there is a need to specify an alternative binary for
pkg-config. It's customary to use the environment variable PKG_CONFIG for
this.
Ref: #8135
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
---
build/premake/pkgconfig/pkgconfig.lua | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/build/premake/pkgconfig/pkgconfig.lua b/build/premake/pkgconfig/pkgconfig.lua
index 1f06c8b0ad..d1523c2de5 100644
--- a/build/premake/pkgconfig/pkgconfig.lua
+++ b/build/premake/pkgconfig/pkgconfig.lua
@@ -1,9 +1,14 @@
local m = {}
-m._VERSION = "1.2.0-dev"
+m._VERSION = "1.3.0-dev"
m.additional_pc_path = nil
m.static_link_libs = false
+local pkg_config_command = "pkg-config"
+if os.getenv("PKG_CONFIG") then
+ pkg_config_command = os.getenv("PKG_CONFIG")
+end
+
local function os_capture(cmd)
return io.popen(cmd, 'r'):read('*a'):gsub("\n", " ")
end
@@ -12,7 +17,7 @@ local function parse_pkg_config_includes(lib, alternative_cmd, alternative_flags
local result
if not alternative_cmd then
local pc_path = m.additional_pc_path and "PKG_CONFIG_PATH="..m.additional_pc_path or ""
- result = os_capture(pc_path.." pkg-config --cflags "..lib)
+ result = os_capture(pc_path .. " " .. pkg_config_command .. " --cflags " .. lib)
else
if not alternative_flags then
result = os_capture(alternative_cmd.." --cflags")
@@ -65,7 +70,7 @@ function m.add_links(lib, alternative_cmd, alternative_flags)
if not alternative_cmd then
local pc_path = m.additional_pc_path and "PKG_CONFIG_PATH="..m.additional_pc_path or ""
local static = m.static_link_libs and " --static " or ""
- result = os_capture(pc_path.." pkg-config --libs "..static..lib)
+ result = os_capture(pc_path .. " " .. pkg_config_command .. " --libs " .. static .. lib)
else
if not alternative_flags then
result = os_capture(alternative_cmd.." --libs")

View file

@ -1,38 +0,0 @@
Index: 0ad-0.0.26/libraries/source/spidermonkey/patch.sh
===================================================================
--- 0ad-0.0.26.orig/libraries/source/spidermonkey/patch.sh
+++ 0ad-0.0.26/libraries/source/spidermonkey/patch.sh
@@ -2,6 +2,24 @@
# Apply patches if needed
# This script gets called from build.sh.
+unset GIT_DIR
+HOME=/tmp
+PATH=/usr/libexec/chroot-git:$PATH
+GIT_CEILING_DIRECTORIES="$(cd .. && pwd)"
+export GIT_CEILING_DIRECTORIES HOME
+git config --global --add safe.directory "$PWD"
+git config --global user.name 'Void Linux'
+git config --global user.email 'none@voidlinux.org'
+git init . -b for-build
+git add . >/dev/null 2>&1
+git commit -m needs-git-because-virtual-env-has-binaries-diff
+
+git am --keep-cr ../1654457-virtualenv.patch
+git am --keep-cr ../python-3.11.patch
+patch -p1 < ../rust-target.patch
+
+ sed -i -e 's/exec python3 /exec python3.11 /' js/src/configure*
+
# SM78 fails to create virtual envs on macs with python > 3.7
# Unfortunately, 3.7 is mostly unavailable on ARM macs.
# Therefore, replace the custom script with a more up-to-date version from pip
@@ -26,7 +41,7 @@ else
#
# It is assumed that the updated version fetched for macOS systems
# above does not have this problem.
- patch -p1 < ../FixVirtualenvForPython310.diff
+ : patch -p1 < ../FixVirtualenvForPython310.diff
fi
# Mozglue symbols need to be linked against static builds.

View file

@ -0,0 +1,13 @@
diff --git a/build/workspaces/update-workspaces.sh1 b/build/workspaces/update-workspaces.sh
index fe3da6a5241..763c64dc479 100755
--- a/build/workspaces/update-workspaces.sh1
+++ b/build/workspaces/update-workspaces.sh
@@ -47,8 +47,6 @@ fi
echo
-# If we're in bash then make HOSTTYPE available to Premake, for primitive arch-detection
-export HOSTTYPE="$HOSTTYPE"
# Now run Premake to create the makefiles
echo "Premake args: ${premake_args}"
if [ "$OS" != "Darwin" ]; then

View file

@ -0,0 +1,22 @@
From 3ff3f728900b89c4e00bddb03fc1aeb0bf7baad0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C8=98tefan=20Talpalaru?= <stefantalpalaru@yahoo.com>
Date: Fri, 31 Jan 2025 13:01:40 +0100
Subject: [PATCH] build-source-libs.sh: fix "--with-system-premake"
---
libraries/build-source-libs.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libraries/build-source-libs.sh b/libraries/build-source-libs.sh
index 323260a51e..da67b293cb 100755
--- a/libraries/build-source-libs.sh
+++ b/libraries/build-source-libs.sh
@@ -62,7 +62,7 @@ while [ "$#" -gt 0 ]; do
--with-system-cxxtest) with_system_cxxtest=true ;;
--with-system-nvtt) with_system_nvtt=true ;;
--with-system-mozjs) with_system_mozjs=true ;;
- --with-system-premake) with_system_mozjs=true ;;
+ --with-system-premake) with_system_premake=true ;;
--with-spirv-reflect) with_spirv_reflect=true ;;
-j*) JOBS="$1" ;;
*)

View file

@ -1,27 +1,33 @@
# Template file for '0ad'
pkgname=0ad
version=0.0.26
revision=9
archs="x86_64* i686* aarch64* armv7l* ppc64le*"
version=0.27.0
revision=1
archs="x86_64* i686* aarch64* armv7l* ppc64le* riscv64*"
# Unclear whether ppc64le and riscv64 will work, though upstream seems to support them
build_helper=rust
hostmakedepends="pkg-config perl cmake python3.11 rust cargo yasm tar clang"
_cxxtest_version=4.4
_fcollada_version=28209
_nvtt_version=28209
hostmakedepends="pkg-config perl cmake python3 rust cargo yasm llvm xz m4
premake5 subversion"
makedepends="SDL2-devel boost-devel gloox-devel libcurl-devel libenet-devel
libopenal-devel libpng-devel libsodium-devel libxml2-devel miniupnpc-devel
nspr-devel wxWidgets-gtk3-devel fmt-devel freetype-devel"
depends="${pkgname}-data"
nspr-devel wxWidgets-gtk3-devel fmt-devel freetype-devel mozjs115-devel"
depends="0ad-data"
checkdepends="0ad-data"
short_desc="Historically-based real-time strategy game"
maintainer="Helmut Pozimski <helmut@pozimski.eu>"
license="GPL-2.0-or-later, CC-BY-SA-3.0, MPL-2.0, MIT"
homepage="https://play0ad.com"
distfiles="https://releases.wildfiregames.com/${pkgname}-${version}-alpha-unix-build.tar.xz
https://github.com/mozilla/gecko-dev/commit/74641307d32a59806b75cd2b8c7161aca50d5cb7.patch>1654457-virtualenv.patch"
checksum="2e1c6df7e3312e77c5f82788664cffc3a78d3bf60606c00039275e1d13c0ee4b
f18fa3adae7acb07a49148354b6804028e6c9d7344991622fb7c00f638173e03"
nocross="uses bundled third-party libraries that do not cross-compile"
distfiles="
https://releases.wildfiregames.com/${pkgname}-${version}-unix-build.tar.xz
https://github.com/CxxTest/cxxtest/archive/refs/tags/${_cxxtest_version}.tar.gz>cxxtest-${_cxxtest_version}.tar.gz"
checksum="
aa94857009750d5f61dbf016bc150e3bdcbdb3acdfc8ad20b73ab8b43e9a1ba6
1c154fef91c65dbf1cd4519af7ade70a61d85a923b6e0c0b007dc7f4895cf7d8"
skip_extraction="cxxtest-${_cxxtest_version}.tar.gz"
lib32disabled=yes
skip_extraction="1654457-virtualenv.patch"
CXXFLAGS="-fpermissive"
# Use BFD linker to avoid erroneous detection of llvm pr8927 with *-musl
LDFLAGS="-fuse-ld=bfd"
@ -32,32 +38,69 @@ if [ "$XBPS_TARGET_LIBC" = musl ]; then
makedepends+=" libexecinfo-devel"
fi
post_patch() {
if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
echo "TARGET_LINK_LIBRARIES(nvcore execinfo)" >> \
libraries/source/nvtt/src/src/nvcore/CMakeLists.txt
fi
cp ${FILESDIR}/python-3.11.patch libraries/source/spidermonkey/
cp ${FILESDIR}/rust-target.patch libraries/source/spidermonkey/
cp ${XBPS_SRCDISTDIR}/${pkgname}-${version}/1654457-virtualenv.patch \
libraries/source/spidermonkey/
post_extract() {
# tests still need to be extracted and built as a library as it is a dependency internally (for now)
msg_normal "Extracting cxxtest-${_cxxtest_version}"
vsrcextract -C ${wrksrc}/libraries/source/cxxtest-${_cxxtest_version}/ --no-strip-components cxxtest-${_cxxtest_version}.tar.gz
msg_normal "Fetching fcollada from svn\n"
svn export --quiet https://svn.wildfiregames.com/public/source-libs/trunk/fcollada@${_fcollada_version} ${wrksrc}/libraries/source/fcollada/fcollada-${_fcollada_version}
msg_normal "Fetching nvtt from svn\n"
svn export --quiet https://svn.wildfiregames.com/public/source-libs/trunk/nvtt@${_nvtt_version} ${wrksrc}/libraries/source/nvtt/nvtt-${_nvtt_version}
}
do_configure() {
export JOBS="${makejobs}"
cd ${wrksrc}/build/workspaces
./clean-workspaces.sh
post_patch() {
msg_normal "Applying patch 0ad/files/nvtt-ppc-musl.patch\n"
patch -sNp1 -i ${FILESDIR}/nvtt-ppc-musl.patch -d ${wrksrc}/libraries/source/nvtt/nvtt-${_nvtt_version}
msg_normal "Applying patch 0ad/files/nvtt-ppc64.patch\n"
patch -sNp1 -i ${FILESDIR}/nvtt-ppc64.patch -d ${wrksrc}/libraries/source/nvtt/nvtt-${_nvtt_version}
if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
echo "TARGET_LINK_LIBRARIES(nvcore execinfo)" >> \
${wrksrc}/libraries/source/nvtt/nvtt-${_nvtt_version}/src/src/nvcore/CMakeLists.txt
fi
}
do_build() {
export JOBS="${makejobs}"
case "$XBPS_TARGET_MACHINE" in
i686*)
CXXFLAGS=" -msse2"
;;
esac
_build_options="--with-system-premake5 --with-lto --with-system-mozjs "
if [ -n "$CROSS_BUILD" ]; then
_build_options+="--without-tests "
fi
cd ${wrksrc}/libraries
msg_normal "Building libraries\n"
# These have to be set separately, as passing extra arguments errors out
./build-source-libs.sh --with-system-premake --with-system-mozjs
cd ${wrksrc}/build/workspaces
./update-workspaces.sh --bindir=/usr/bin --libdir=/usr/lib/0ad \
--datadir=/usr/share/${pkgname}/data
msg_normal "Building the project\n"
./update-workspaces.sh ${_build_options} \
--bindir=/usr/bin --libdir=/usr/lib/${pkgname} --datadir=/usr/share/${pkgname}/data
cd ${wrksrc}
make config=release -C build/workspaces/gcc ${makejobs}
}
pre_check() {
ln -sf /usr/share/${pkgname}/data/mods/mod ${wrksrc}/binaries/data/mods
ln -sf /usr/share/${pkgname}/data/mods/public ${wrksrc}/binaries/data/mods
ln -sf ${wrksrc}/binaries/system /usr/lib/${pkgname}
}
do_check() {
cd ${wrksrc}/binaries/system/
./test
}
do_install() {
vbin binaries/system/pyrogenesis
vmkdir usr/lib/${pkgname}
@ -67,5 +110,5 @@ do_install() {
vbin build/resources/${pkgname}.sh ${pkgname}
vinstall build/resources/${pkgname}.desktop 0644 usr/share/applications
vinstall build/resources/${pkgname}.png 0644 usr/share/pixmaps
vlicense LICENSE.txt
vlicense LICENSE.md
}

View file

@ -1 +1 @@
pattern='href="0ad-\K[\d\.]*+(?=-alpha-unix-build.tar.xz")'
pattern='href="0ad-\K[\d\.]*+(?=-unix-build.tar.xz")'