Commit graph

148 commits

Author SHA1 Message Date
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
Lancelot de Ferrière
ffa6943057 Reapply "Update various macos Libraries"
This reverts commit e609af395d.
2024-12-07 18:36:33 +01:00
Lancelot de Ferrière
e609af395d Revert "Update various macos Libraries"
This reverts commit 8c9ed820cb.
2024-12-07 18:20:16 +01:00
Lancelot de Ferrière
8c9ed820cb Update various macos Libraries 2024-12-07 18:15:15 +01:00
Itms
91289c8362
Fix error in build-macos-libs.sh
Issue introduced in 9fd05e38a4, revealed by c280df9e64.
2024-12-05 09:51:24 +01:00
Antoine Le Gonidec
2451167a37
Update the MacOS libraries build process to avoid "empty" error messages
The die function now only displays a message if it has been called with
a message argument.
2024-12-03 13:53:42 +01:00
Antoine Le Gonidec
c280df9e64
Fix errors handling when building the libraries for MacOS
The shell option "set -e" has a tricky, but standard, behaviour:
Anything called on the left side of a || or && token ignores "set -e",
so failure in a command in a subshell called on the left side of "|| die"
does not prevent the execution of the following commands in the subshell.

Adding explicit "|| die" calls after each command that could fail (and
should interrupt the process) works around this behaviour, by emulating
the intuitive "set -e" behaviour.
2024-12-03 13:53:34 +01:00
Stan
ce588689ee
Move Windows tool executables to win source libs. 2024-11-13 21:13:18 +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
31365e7aed Adopt clean-source-libs.sh to split sources
After 26994b156b just removing the
libraries/source directory will delete files under version control
needed to build the packages.

Use git clean instead to get back to a clean slate.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-10-24 19:11:47 +02:00
Ralph Sennhauser
28a9692893 Allow system cxxtest
Add option to build-source-libs and premake to uses system provided
cxxtest.

Closes: #5792

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-10-13 18:27:18 +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
Stanislas Daniel Claude Dolcini
9c72741e69
Fix x86_64 cross-compilation on macOS 2024-09-22 16:16:40 +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
Ralph Sennhauser
2b5ecd02a7 build-source-libs.sh: drop Perl dependency
Instead of using Perl to get the absolute path due to readlink -f
implementations differing behaviour use realpath. Since the inclusion
into coreutils this should be a valid alternative.

Also check for [[:space:]] instead of only \s as if that one is an issue
the others are as well.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-09-08 17:51:16 +02:00
Ralph Sennhauser
bf82871ca8 build-source-libs.sh: remove --source-libs-dir
During the migration it apparently looked possibly useful at some point,
in the end it remained unused.

Further the clean-source-libs.sh doesn't handle the case where
build-source-libs.sh was invoked with --source-libs-dir.

Finally, when switching to support individual package this becomes very
complex to support.

For all the above reason remove the option.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-09-08 17:51:16 +02:00
Itms
33134af6c3 Stop using the source-libs repository on Windows
All prebuilt files for Windows libraries are now stored in the
windows-libs SVN repository for the foreseeable future.
2024-09-08 17:51:15 +02:00
Stan
9fd05e38a4 Update libraries to fix some build errors on recent macOS.
Fixes #6797
Fixes #6902
Refs #6915
Fixes #6916
Refs #4362
2024-09-03 11:17:12 +02:00
Ralph Sennhauser
f87dfebc71 build-macos-libs.sh: move to posix shell
This removes the remaining bashisms and changes the shebang.

Also remove command chaining in subshells as this allows for comments
to go where they belong and shellcheck directives to be more specific.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-09-02 15:37:44 +02:00
Ralph Sennhauser
9ac60514c3 build-macos-libs.sh: partial move to posix shell
Change all non posix constructs except for stacked pushd/popd for the
sake of reviewability.

The reminder will be done in a separate commit.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-08-30 18:36:09 +02:00
Ralph Sennhauser
6f5ac7c4ae Fix issues pointed out by shellcheck
Some are real bugs, some are bashisms, but most is zealous quoting of
variables.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-08-28 18:23:18 +02:00
Ralph Sennhauser
abdda50892 Format shell scripts using shfmt
This updates shell scripts to use a consistent style that can be enforced
via pre-commit hook.

As for choosing tabs over spaces, some arguments are:

- tabs can help people with visual impairment
- tabs allow for indenting heredocs in bash
- tabs are the default for the tool shfmt

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-08-26 09:03:00 +02:00
Itms
0b7da91992 Adapt libraries scripts to the new SVN repo. 2024-08-20 20:58:09 +02:00
Itms
0aeaa8f70a Adapt macOS libraries to the new build flow. 2024-08-20 19:10:25 +02:00
Itms
5c1195f66a New Linux/BSD build flow.
Getting and building libraries is now clearly separated from preparing
workspaces.
Some disk space is automatically reclaimed and cleanup is streamlined.
2024-08-20 19:09:23 +02:00
Itms
17ae3b224d Retrieve Windows binaries for the build, fixes #1814. 2024-08-20 18:54:00 +02:00
bb
157c6af18e Make the space in 0 A.D. non-breaking throughout the codebase.
Avoid cases of filenames
Update years in terms and other legal(ish) documents
Don't update years in license headers, since change is not meaningful

Will add linter rule in seperate commit

Happy recompiling everyone!

Original Patch By: Nescio
Comment By: Gallaecio
Differential Revision: D2620
This was SVN commit r27786.
2023-07-27 20:54:46 +00:00
wraitii
0d5cc1b994 Fix game crash when communicating with the lobby on macOS 13
Summary:
On macOS Ventura (at least version 13.2.1 and above), the game crashes
instantly when clicking on buttons communicating with the lobby.

This issue is solved by upgrading nettle to 3.9 and GNUTLS to 3.8.

Patch by: froissant
Accepted By: wraitii
Trac Tickets: #6807

Differential Revision: https://code.wildfiregames.com/D5018
This was SVN commit r27667.
2023-06-06 07:07:50 +00:00
Stan
a4d4df9dd8 Check for the existence of libMoltenVK
Patch by: @Langbart
Fixes #6729

This was SVN commit r27541.
2023-02-13 12:07:35 +00:00
Stan
d6121a43ea Add MoltenVK support to fix Vulkan on macOS.
Tested by: @Langbart, @real_tabasco_sauce, @wraitii
Refs #6636
Differential Revision: https://code.wildfiregames.com/D4905
This was SVN commit r27488.
2023-01-26 15:24:12 +00:00
Stan
2943747add Fix FMT and NVTT not linking with the correct SDK.
Tested by: @Langbart
Differential Revision: https://code.wildfiregames.com/D4898
This was SVN commit r27469.
2023-01-19 21:10:18 +00:00
vladislavbelov
408c93744c Adds dependent libraries for Vulkan. Refs #6636
Tested By: phosit, Stan
Differential Revision: https://code.wildfiregames.com/D4869
This was SVN commit r27387.
2023-01-08 23:12:54 +00:00
wraitii
f82fc6431b Fix SM compilation on M1, fix cross-compilation.
Fixes 08e7efc76a.
The SM build script worked on its own, but the mac OS libraries script
passes it an unexpected value.
This also fixes cross-compilation arm -> x86.
Harfbuzz is explicitly not used when compiling freetype to avoid
pkgconfig using it.

Reorganize the logic a little bit around architecture handling.

Differential Revision: https://code.wildfiregames.com/D4647
This was SVN commit r26882.
2022-05-15 21:22:49 +00:00
wraitii
08e7efc76a Allo native builds on Mac OS M1 / Apple Silicon
- Update GMP to a version that supports arm64 darwin
- Patch spidermonkey 78 to build and run on arm64 darwin
- Choose the correct architecture dynamically in build scripts
- Include python workaround that fixes python related errors on
spidermonkey build

Based on a patch by: kumikumi
Based on a patch by: Langbart
Fixes #6474

Differential Revision: https://code.wildfiregames.com/D4607
This was SVN commit r26881.
2022-05-15 06:45:53 +00:00
Stan
663fb3f527 Update the LIB_URL for zlib.
Fixes: #6496
Refs: #4362
Patch by: @Langbart
Differential Revision: https://code.wildfiregames.com/D4603
This was SVN commit r26788.
2022-04-14 22:35:17 +00:00
wraitii
c1f779dff5 Fix compilation on Apple Silicon
This allows cross-compiling for x86_64 on mac ARM machines, and sets
things up for a switch later.
SDL upgrade is necessary for compilation with the GLES headers in
different SDKs.

Tested by: langbart, minohaka
Differential Revision: https://code.wildfiregames.com/D4424
This was SVN commit r26208.
2022-01-13 14:42:42 +00:00
Stan
c9bea80e0d Use GLAD2 a multi-Language Vulkan/GL/GLES/EGL/GLX/WGL Loader-Generator.
Comments by: @nwtour, @Langbart, @bb
Based on patch by: @echotangoecho
Tested on Windows 7 & 10, Ubuntu and macos.

Differential Revision: https://code.wildfiregames.com/D721
This was SVN commit r26093.
2021-12-21 22:03:31 +00:00
vladislavbelov
fe511e88d9 Adds FreeType support to the engine.
Tested By: Langbart, Imarok, Stan, s0600204, wraitii
Differential Revision: https://code.wildfiregames.com/D4108
This was SVN commit r26040.
2021-12-08 22:14:43 +00:00