1
0
forked from mirrors/0ad

42 Commits

Author SHA1 Message Date
Olivier Tilloy 6436ba3af9 Spidermonkey build: cherry-pick an upstream commit to create thin archives
This saves a sizeable amount of disk space during the build, by not creating
a very large libjs_static.a (~1.5 GB) that contains a copy of all the symbols
in the object files generated during the build.

Upstream bug: https://bugzilla.mozilla.org/show_bug.cgi?id=2008085
Upstream commit: https://hg.mozilla.org/mozilla-central/rev/a924182c4e55

Note that the upstream commit doesn't apply cleanly to Spidermonkey 128.13.0,
it had to be rebased.
2026-01-25 10:58:33 +01:00
Ralph Sennhauser 9c1f133118 Package cpp-httplib
Intended as replacment for mongoose, which due to license change can't
be updated anymore.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-01-24 10:45:48 +01:00
Olivier Tilloy 8bd0d0b84f Spidermonkey build: do not unpack unneeded test files
This change reduces the disk space requirement by 50%, from 1.1 GB down to 564 MB.
It is relevant when building 0AD in resource-constrained environments (e.g. in CI).
2025-12-31 13:34:09 +01:00
Timothy Pearson 2c9928e4cb Fix FTBFS on ppc64le systems
Tested to compile and function normally under Debian Trixie ppc64le / POWER9

Signed-off-by: Timothy Pearson <tpearson@raptorcs.com>
2025-10-16 20:53:14 -05:00
Ralph Sennhauser aa601de72c Set owner and group when creating tar archive
tar --no-same-owner is only default for non root users, therefore if
extracting as root owner ship is by the user id creating the archive.
This is an issue if extracting happens in a container and cleanup
outside the container by a non root user like on our CI when building
the appimage. Therefore package the tar archives for fcollada and nvtt
with owner and group root.

Fixes: #8440
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-10-13 19:03:42 +02:00
Ralph Sennhauser 4bf107352f Fix building spidermonkey with python 3.14
Fixes: #8427
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-10-11 15:47:45 +02:00
Ralph Sennhauser 59cb3cd67b Bump premake to 5.0.0-beta7
Fixes: #8362
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-09-18 12:06:29 +02:00
Itms 7fde47e1f3 Fix linker invocation on macOS Sequoia 2025-08-15 19:43:36 +02:00
Itms 758229558e Fix segfault during GUI GC 2025-08-15 19:43:36 +02:00
Itms 7038d87454 Update SpiderMonkey to ESR 128.13
Fixes #7662
2025-08-15 19:43:34 +02:00
Itms 733297a038 Fix use of pkg-config when building SM on macOS 2025-08-15 11:32:33 +02:00
Vincent Cheng 390a2f473e Fix nvtt build failure on Debian i386 2025-08-14 20:14:21 +02:00
Itms 03fff3572f Use conforming preprocessor with modern MSVC
https://learn.microsoft.com/en-us/cpp/preprocessor/preprocessor-experimental-overview
2025-08-04 17:35:48 +02:00
Ralph Sennhauser ead2fbc115 Improve clang default toolset on BSD
The gmake action has a separate idea as to what the default toolset
should be, add that to the patch fixing the default for BSD.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-14 14:13:09 +02:00
Ralph Sennhauser 638c04987e Bump premake to version 5.0.0-beta6
This makes 5.0.0-beta5 the minimally supported version as the gmake2
action was renamed to gmake while gmake was renamed to gmakelegacy. So
from now on gmake action is to be used.

Clear out all old version dependent code.

Fixes: #7789
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-12 20:57:54 +02:00
Ralph Sennhauser 895cb63c4a Add --build-archive to spidermonkey build.sh
This option allows to build the spidermonky archive hosted by WFG from
the upstream firefox tarball.

First this serves as documentation as to how the taball is created and
by integrating it into the regular build process allows to easely bump
spidermonky version for local testing.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-31 17:10:10 +02:00
Lancelot de Ferrière 1f2156adcc Fix library build on MacOS Sonoma 2025-05-02 21:05:31 +02:00
Ralph Sennhauser 263b481442 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>
2025-04-27 09:58:23 +02:00
phosit 40fe7df654 Silence dangling pointer warning for JS::Rooted
With much help by @sera.
2025-02-24 21:30:56 +01:00
Ralph Sennhauser 84b407aa35 Update premake to v5.0.0-beta4
https://github.com/premake/premake-core/releases/tag/v5.0.0-beta4

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-02-18 17:42:42 +01:00
Vincent Cheng 026a668a0f Make sure mozjs patch FixFpNormIssue.diff applies cleanly on i386 2025-02-15 12:46:08 +01:00
Martijn van Duren 2338473da1 Make libraries/*/build.sh use "${TAR}" instead of tar directly.
This allows systems using a tar version not supporting all the required
flags to easily switch to gnu tar.
2025-02-09 14:31:10 +01:00
Ralph Sennhauser f9a43c8c40 Add support for fetch-only for libraries
Used to prefetch all required tarballs to build pyrogenesis later
without network access as is common for Linux package build and some
other CI environments.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-01-20 16:58:37 +01:00
Ralph Sennhauser f97a1f1c54 Fix spidermonkey profiling build
Instruments is macOS only, so don't try to enable it on other platforms.

Also don't quote ${JOBS} as it might be unset and passing an empty
string to "mach build" may result in configure failing.

Fixes: #7470
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-01-08 07:32:59 +01:00
Lancelot de Ferrière a6693e8c1f Fix samply profiling of SM JS code 2024-12-30 09:13:06 +01:00
Ralph Sennhauser 00813ff99a Backport premake extra arch support
Grab upstream patches adding support for building premake on riscv64
[1], loongarch64 [2], and e2k [3].

[1] 82c9d90495940e2d0d574e1c7849e9698f23b090
[2] 928397f72c00979d57ec4688cb1fb26ec7f2449b
[3] 5c524b6d53307bcb4ba7b02c9dba20100df68943

Fixes: #7346
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-12-21 12:10:03 +01:00
Ralph Sennhauser accecc5894 Bump premake-core to 5.0.0-beta3
This is the version used for Windows already and contains the fix for
building against spidermonkey on all Linux distributions.

Backport patch to fix running on *BSD. Also make clang default on *BSD
as a toolset will always added to generated makefiles in beta3, so it
won't magically do what we expect when not adding --cc explicitly.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-12-15 18:34:27 +01:00
Stan d15f1c29e4 Unify library building logs 2024-12-15 15:41:37 +01:00
Dunedan 721e90ba6a Fix compilation of SM with recent Python versions
This adds a patch for a bug in SpiderMonkey, preventing compilation of
SpiderMonkey with Python >=3.12.8 and Python >=3.13.1. The bug is
tracked upstream in https://bugzilla.mozilla.org/show_bug.cgi?id=1935621
2024-12-10 22:51:31 +01:00
Itms 72ea129751 Fix SpiderMonkey debug DEFINEs in pkg-config 2024-12-09 10:46:13 +01:00
Itms 0de5f2fb25 Upgrade SpiderMonkey to ESR 115 2024-12-09 10:46:12 +01:00
Itms 6a5488832e Upgrade SpiderMonkey to ESR 102 2024-12-09 10:43:31 +01:00
Itms 2e32636a53 Use Mozilla's mach to build SpiderMonkey
This removes the need for many customizations in the build script.
2024-12-09 10:42:21 +01:00
Itms 88d3550aaa Fix SpiderMonkey build on Windows 2024-12-09 10:31:34 +01:00
Itms f88bac98b4 Fix SpiderMonkey build on recent macOS
Fixes #6905
Fixes #6915
2024-12-09 10:30:49 +01:00
Itms 682de9f289 Unbundle SpiderMonkey
This deletes the RETRY flag from the build script, which can be
manually mocked if needed.
2024-12-09 10:11:34 +01:00
Ralph Sennhauser 1f60a9b22d Include system mozjs with -idirafter
Cherry-pick upstream patch adding support for -idirafter [1] which
allows us to work around the issue of some distributions bundling the
icu headers with spidermonkey resulting in a conflict.

Further add support to our premake pkgconfig module to allow using this
feature and make use of it for when building with --with-system-mozjs.

[1] premake-core baf145dc388509c953a01bcd964835e2027208bf

Fixes: #5868
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-11-11 20:04:10 +01:00
Ralph Sennhauser 3ba61ed39e Improve cxxtest python compatibility
Use patch by Debian [1] replacing python in shebang with python3 and fixing
some warnings with recent python versions.

The reason being some use an alias of python for python3 instead of the
customary symlink. Aliases are only expanded in interactive shells
unless expansion is explicitly enabled.

[1] https://sources.debian.org/patches/cxxtest/4.4%2Bgit171022-2/python3.patch/

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-11-03 07:10:06 +01:00
Ralph Sennhauser 486509d5b9 Package and bump premake-core
Treat premake like any other dependency and package it separately, this
makes it much easier to bump it in future by making it easier to track
modifications if any.

Moving it to libraries as it is handled the same as other packages. An
argument could be made to have it in build due to it's special nature.
The issue with that approach would be how to handle clean-workspace.sh.
If we split it out we would need a separate clean-premake.sh script and
if we have it cleaned by clean-workspace we through away the download
and already built binary.

Also bump version to 5.0.0-beta2 and backport patch for macOS fix
instead of the Makefile changes. The same fix is needed for gcc-14
(reported upstream), so add a patch injecting unistd.h for Unixes.

Fixes: #6816
Fixes: #6632
Refs: #6847
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-10-26 20:18:56 +02:00
Ralph Sennhauser 4f93ddf47e Use upstream tarball for cxxtest
Update source build.sh to use upstream tarball and drop any custom
patches at the same time.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-10-13 18:27:18 +02:00
Ralph Sennhauser 39f3fa7d5b Package spirv-reflect for building shaders
Usually not available in Linux Distributions as it isn't customary to
package the SDK but only the bits needed as separate packages.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-09-24 18:45:22 +02:00
Ralph Sennhauser 26994b156b Split source package downloads
Instead of fetching the whole svn repo containing all current
dependencies into source, fetch them individually into subdirectories of
source.

Adds a wrapper script to each package to place the build output where
it's currently expected.

This allows adding and removing dependencies as well as changing origin
of those packages on a case by case basis.

It's recommended to run "git clean -dxf libraries/source" to free up
extra space and remove untracked files no longer covered by changes in
.gitignore.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-09-08 22:17:08 +02:00