From d5838c31695e8f5dd919c3f9dfa3315a5122373e Mon Sep 17 00:00:00 2001 From: jc_gargma Date: Mon, 20 Dec 2021 10:36:36 -0800 Subject: Rebuild for python 3.10 and boost 1.78 --- PKGBUILD | 17 +++++++++--- python-3.10.patch | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 4 deletions(-) create mode 100644 python-3.10.patch diff --git a/PKGBUILD b/PKGBUILD index 4cf4546..8a50435 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -9,7 +9,7 @@ pkgname=0ad pkgver=a25.b _pkgver=0.0.25b-alpha -pkgrel=2 +pkgrel=3 pkgdesc="Cross-platform, 3D and historically-based real-time strategy game" arch=('x86_64') url="https://play0ad.com/" @@ -18,14 +18,23 @@ depends=('0ad-data' 'binutils' 'boost-libs' 'curl' 'enet' 'libogg' 'libpng' 'lib 'libxml2' 'openal' 'sdl2' 'wxgtk3' 'zlib' 'libgl' 'glu' 'fmt' 'gloox' 'miniupnpc' 'libminiupnpc.so' 'icu' 'nspr' 'libsodium') makedepends=('boost' 'cmake' 'mesa' 'zip' 'libsm' 'rust') -source=("https://releases.wildfiregames.com/$pkgname-$_pkgver-unix-build.tar.xz") -b2sums=('674d69d625137709a186f9273607dc353fc99aea68ef3f2ea5031dbe2f684176910d757c3f03c7fbdac475d30708be448b71f5020d27a65c346bf147223bcb9d') +source=("https://releases.wildfiregames.com/$pkgname-$_pkgver-unix-build.tar.xz" + "python-3.10.patch") +b2sums=('674d69d625137709a186f9273607dc353fc99aea68ef3f2ea5031dbe2f684176910d757c3f03c7fbdac475d30708be448b71f5020d27a65c346bf147223bcb9d' + '6b6853eacbeadfe7e95382c97572c60b1838d5f4b0b925c2bb977be76db6a0a2ac97376089a42fca6a7956319b69c56ec0d2fb59a1114002d708486582de346d') + +prepare() { + patch -d $pkgname-$_pkgver -p1 < python-3.10.patch # Fix spidermonkey build with Python 3.10 +} build() { cd "$pkgname-$_pkgver/build/workspaces" # rust is prone to OOM, use 1 thread per 2GB ram - #export MAKEFLAGS="-j32" + export MAKEFLAGS="-j32" + + # More threads + #sed -i 's/JOBS=${JOBS:="-j2"}/JOBS=${JOBS:="-j32"}/' update-workspaces.sh # -fPIE and -pie break compilation # -flto=auto and -flto=1 break compilation since a24.b diff --git a/python-3.10.patch b/python-3.10.patch new file mode 100644 index 0000000..2935c6c --- /dev/null +++ b/python-3.10.patch @@ -0,0 +1,78 @@ +diff -ru --new-file 0ad-0.0.25b-alpha.orig/libraries/source/spidermonkey/patch.sh 0ad-0.0.25b-alpha/libraries/source/spidermonkey/patch.sh +--- 0ad-0.0.25b-alpha.orig/libraries/source/spidermonkey/patch.sh 2021-12-17 08:53:59.543315034 +0100 ++++ 0ad-0.0.25b-alpha/libraries/source/spidermonkey/patch.sh 2021-12-17 08:53:34.789777469 +0100 +@@ -43,6 +43,8 @@ + # Note that this isn't quite the upstream patch to match our version. + patch -p1 < ../FixRust150.diff + ++patch -p1 < ../python-3.10.diff ++ + # Patch those separately, as they might interfere with normal behaviour. + if [ "$(uname -s)" = "FreeBSD" ]; + then +diff -ru --new-file 0ad-0.0.25b-alpha.orig/libraries/source/spidermonkey/python-3.10.diff 0ad-0.0.25b-alpha/libraries/source/spidermonkey/python-3.10.diff +--- 0ad-0.0.25b-alpha.orig/libraries/source/spidermonkey/python-3.10.diff 1970-01-01 01:00:00.000000000 +0100 ++++ 0ad-0.0.25b-alpha/libraries/source/spidermonkey/python-3.10.diff 2021-12-17 09:05:09.713419684 +0100 +@@ -0,0 +1,62 @@ ++diff -ru mozjs-78.6.0.orig/python/mozbuild/mozbuild/backend/configenvironment.py mozjs-78.6.0/python/mozbuild/mozbuild/backend/configenvironment.py ++--- mozjs-78.6.0.orig/python/mozbuild/mozbuild/backend/configenvironment.py 2020-11-28 17:33:58.000000000 +0100 +++++ mozjs-78.6.0/python/mozbuild/mozbuild/backend/configenvironment.py 2021-12-17 08:52:07.342371513 +0100 ++@@ -9,7 +9,8 @@ ++ import sys ++ import json ++ ++-from collections import Iterable, OrderedDict +++from collections.abc import Iterable +++from collections import OrderedDict ++ from types import ModuleType ++ ++ import mozpack.path as mozpath ++diff -ru mozjs-78.6.0.orig/python/mozbuild/mozbuild/makeutil.py mozjs-78.6.0/python/mozbuild/mozbuild/makeutil.py ++--- mozjs-78.6.0.orig/python/mozbuild/mozbuild/makeutil.py 2020-11-28 17:33:58.000000000 +0100 +++++ mozjs-78.6.0/python/mozbuild/mozbuild/makeutil.py 2021-12-17 09:05:02.820298351 +0100 ++@@ -7,7 +7,7 @@ ++ import os ++ import re ++ import six ++-from collections import Iterable +++from collections.abc import Iterable ++ ++ ++ class Makefile(object): ++diff -ru mozjs-78.6.0.orig/python/mozbuild/mozbuild/util.py mozjs-78.6.0/python/mozbuild/mozbuild/util.py ++--- mozjs-78.6.0.orig/python/mozbuild/mozbuild/util.py 2020-11-28 17:33:58.000000000 +0100 +++++ mozjs-78.6.0/python/mozbuild/mozbuild/util.py 2021-12-17 08:52:31.045908142 +0100 ++@@ -782,7 +782,7 @@ ++ self._strings = StrictOrderingOnAppendList() ++ self._children = {} ++ ++- class StringListAdaptor(collections.Sequence): +++ class StringListAdaptor(collections.abc.Sequence): ++ def __init__(self, hsl): ++ self._hsl = hsl ++ ++diff -ru mozjs-78.6.0.orig/testing/mozbase/manifestparser/manifestparser/filters.py mozjs-78.6.0/testing/mozbase/manifestparser/manifestparser/filters.py ++--- mozjs-78.6.0.orig/testing/mozbase/manifestparser/manifestparser/filters.py 2020-11-28 17:34:00.000000000 +0100 +++++ mozjs-78.6.0/testing/mozbase/manifestparser/manifestparser/filters.py 2021-12-17 09:02:44.801711871 +0100 ++@@ -12,7 +12,8 @@ ++ ++ import itertools ++ import os ++-from collections import defaultdict, MutableSequence +++from collections import defaultdict +++from collections.abc import MutableSequence ++ ++ import six ++ from six import string_types ++diff -ru mozjs-78.6.0.orig/third_party/python/virtualenv/virtualenv.py mozjs-78.6.0/third_party/python/virtualenv/virtualenv.py ++--- mozjs-78.6.0.orig/third_party/python/virtualenv/virtualenv.py 2020-11-28 17:34:05.000000000 +0100 +++++ mozjs-78.6.0/third_party/python/virtualenv/virtualenv.py 2021-12-17 08:58:55.798970530 +0100 ++@@ -1804,7 +1804,7 @@ ++ pass ++ else: ++ # noinspection PyProtectedMember ++- if sysconfig._get_default_scheme() == "posix_local": +++ if sysconfig.get_default_scheme() == "posix_local": ++ local_path = os.path.join(home_dir, "local") ++ if not os.path.exists(local_path): ++ os.mkdir(local_path) -- cgit v1.2.1