From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 06861158087 for ; Mon, 7 Feb 2022 04:31:31 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2458B2BC007; Mon, 7 Feb 2022 04:31:30 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B13EC2BC00A for ; Mon, 7 Feb 2022 04:31:29 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 742DD342EF4 for ; Mon, 7 Feb 2022 04:31:28 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D94B52B3 for ; Mon, 7 Feb 2022 04:31:26 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1644208257.c5948582c8e35c33b8d6793d6e2c83949b152586.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: games-strategy/0ad/files/, games-strategy/0ad/ X-VCS-Repository: repo/gentoo X-VCS-Files: games-strategy/0ad/0ad-0.0.25b_alpha.ebuild games-strategy/0ad/files/0ad-0.0.25b_alpha-fix-setuptools.patch X-VCS-Directories: games-strategy/0ad/ games-strategy/0ad/files/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: c5948582c8e35c33b8d6793d6e2c83949b152586 X-VCS-Branch: master Date: Mon, 7 Feb 2022 04:31:26 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: c5314e0e-8360-4938-b160-4cb6a0c8d2c2 X-Archives-Hash: ff85b0144bea8910f9bfd01de6920ff1 commit: c5948582c8e35c33b8d6793d6e2c83949b152586 Author: Sam James gentoo org> AuthorDate: Mon Feb 7 04:30:43 2022 +0000 Commit: Sam James gentoo org> CommitDate: Mon Feb 7 04:30:57 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c5948582 games-strategy/0ad: fix build with newer setuptools Closes: https://bugs.gentoo.org/826762 Thanks-to: Stephen Cavilia atomicradi.us> Signed-off-by: Sam James gentoo.org> games-strategy/0ad/0ad-0.0.25b_alpha.ebuild | 3 +- .../files/0ad-0.0.25b_alpha-fix-setuptools.patch | 188 +++++++++++++++++++++ 2 files changed, 190 insertions(+), 1 deletion(-) diff --git a/games-strategy/0ad/0ad-0.0.25b_alpha.ebuild b/games-strategy/0ad/0ad-0.0.25b_alpha.ebuild index e01f6242d2cd..d7b282a68f35 100644 --- a/games-strategy/0ad/0ad-0.0.25b_alpha.ebuild +++ b/games-strategy/0ad/0ad-0.0.25b_alpha.ebuild @@ -1,4 +1,4 @@ -# Copyright 2014-2021 Gentoo Authors +# Copyright 2014-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -90,6 +90,7 @@ RDEPEND=" PATCHES=( "${FILESDIR}"/${PN}-0.0.24b_alpha-respect-tc.patch + "${FILESDIR}"/${PN}-0.0.25b_alpha-fix-setuptools.patch ) pkg_setup() { diff --git a/games-strategy/0ad/files/0ad-0.0.25b_alpha-fix-setuptools.patch b/games-strategy/0ad/files/0ad-0.0.25b_alpha-fix-setuptools.patch new file mode 100644 index 000000000000..ea0626fadadd --- /dev/null +++ b/games-strategy/0ad/files/0ad-0.0.25b_alpha-fix-setuptools.patch @@ -0,0 +1,188 @@ +https://bugs.gentoo.org/826762 +https://bugzilla.mozilla.org/show_bug.cgi?id=1665675 +https://phabricator.services.mozilla.com/D90627 +--- a/libraries/source/spidermonkey/patch.sh ++++ b/libraries/source/spidermonkey/patch.sh +@@ -51,5 +51,7 @@ then + # https://svnweb.freebsd.org/ports/head/lang/spidermonkey78/files/patch-third__party_rust_cc_.cargo-checksum.json?view=log + patch -p1 < ../FixFreeBSDCargoChecksum.diff + # https://svnweb.freebsd.org/ports/head/lang/spidermonkey78/files/patch-third__party_rust_cc_src_lib.rs?view=log + patch -p1 < ../FixFreeBSDRustThirdPartyOSDetection.diff + fi ++ ++patch -p1 < ../FixSysconfigImport.diff +--- a/libraries/source/spidermonkey/FixSysconfigImport.diff ++++ b/libraries/source/spidermonkey/FixSysconfigImport.diff +@@ -0,0 +1,171 @@ ++diff --git a/python/mozbuild/mozbuild/configure/__init__.py b/python/mozbuild/mozbuild/configure/__init__.py ++--- a/python/mozbuild/mozbuild/configure/__init__.py +++++ b/python/mozbuild/mozbuild/configure/__init__.py ++@@ -877,17 +877,56 @@ ++ ++ def _apply_imports(self, func, glob): ++ for _from, _import, _as in self._imports.pop(func, ()): ++- _from = '%s.' % _from if _from else '' ++- if _as: ++- glob[_as] = self._get_one_import('%s%s' % (_from, _import)) +++ self._get_one_import(_from, _import, _as, glob) +++ +++ def _handle_wrapped_import(self, _from, _import, _as, glob): +++ """Given the name of a module, "import" a mocked package into the glob +++ iff the module is one that we wrap (either for the sandbox or for the +++ purpose of testing). Applies if the wrapped module is exposed by an +++ attribute of `self`. +++ +++ For example, if the import statement is `from os import environ`, then +++ this function will set +++ glob['environ'] = self._wrapped_os.environ. +++ +++ Iff this function handles the given import, return True. +++ """ +++ module = (_from or _import).split('.')[0] +++ attr = '_wrapped_' + module +++ wrapped = getattr(self, attr, None) +++ if wrapped: +++ if _as or _from: +++ obj = self._recursively_get_property( +++ module, (_from + '.' if _from else '') + _import, wrapped) +++ glob[_as or _import] = obj ++ else: ++- what = _import.split('.')[0] ++- glob[what] = self._get_one_import('%s%s' % (_from, what)) +++ glob[module] = wrapped +++ return True +++ else: +++ return False +++ +++ def _recursively_get_property(self, module, what, wrapped): +++ """Traverse the wrapper object `wrapped` (which represents the module +++ `module`) and return the property represented by `what`, which may be a +++ series of nested attributes. +++ +++ For example, if `module` is 'os' and `what` is 'os.path.join', +++ return `wrapped.path.join`. +++ """ +++ if what == module: +++ return wrapped +++ assert what.startswith(module + '.') +++ attrs = what[len(module + '.'):].split('.') +++ for attr in attrs: +++ wrapped = getattr(wrapped, attr) +++ return wrapped ++ ++ @memoized_property ++ def _wrapped_os(self): ++ wrapped_os = {} ++ exec_('from os import *', {}, wrapped_os) +++ # Special case os and os.environ so that os.environ is our copy of +++ # the environment. ++ wrapped_os['environ'] = self._environ ++ return ReadOnlyNamespace(**wrapped_os) ++ ++@@ -913,57 +952,62 @@ ++ ++ return ReadOnlyNamespace(**wrapped_subprocess) ++ ++- def _get_one_import(self, what): ++- # The special `__sandbox__` module gives access to the sandbox ++- # instance. ++- if what == '__sandbox__': ++- return self +++ @memoized_property +++ def _wrapped_six(self): +++ if six.PY3: +++ return six +++ wrapped_six = {} +++ exec_('from six import *', {}, wrapped_six) +++ wrapped_six_moves = {} +++ exec_('from six.moves import *', {}, wrapped_six_moves) +++ wrapped_six_moves_builtins = {} +++ exec_('from six.moves.builtins import *', {}, +++ wrapped_six_moves_builtins) +++ ++ # Special case for the open() builtin, because otherwise, using it ++ # fails with "IOError: file() constructor not accessible in ++ # restricted mode". We also make open() look more like python 3's, ++ # decoding to unicode strings unless the mode says otherwise. ++- if what == '__builtin__.open' or what == 'builtins.open': ++- if six.PY3: ++- return open +++ def wrapped_open(name, mode=None, buffering=None): +++ args = (name,) +++ kwargs = {} +++ if buffering is not None: +++ kwargs['buffering'] = buffering +++ if mode is not None: +++ args += (mode,) +++ if 'b' in mode: +++ return open(*args, **kwargs) +++ kwargs['encoding'] = system_encoding +++ return codecs.open(*args, **kwargs) +++ +++ wrapped_six_moves_builtins['open'] = wrapped_open +++ wrapped_six_moves['builtins'] = ReadOnlyNamespace( +++ **wrapped_six_moves_builtins) +++ wrapped_six['moves'] = ReadOnlyNamespace(**wrapped_six_moves) ++ ++- def wrapped_open(name, mode=None, buffering=None): ++- args = (name,) ++- kwargs = {} ++- if buffering is not None: ++- kwargs['buffering'] = buffering ++- if mode is not None: ++- args += (mode,) ++- if 'b' in mode: ++- return open(*args, **kwargs) ++- kwargs['encoding'] = system_encoding ++- return codecs.open(*args, **kwargs) ++- return wrapped_open ++- # Special case os and os.environ so that os.environ is our copy of ++- # the environment. ++- if what == 'os.environ': ++- return self._environ ++- if what == 'os': ++- return self._wrapped_os ++- # And subprocess, so that its functions use our os.environ ++- if what == 'subprocess': ++- return self._wrapped_subprocess ++- if what in ('subprocess.call', 'subprocess.check_call', ++- 'subprocess.check_output', 'subprocess.Popen'): ++- return getattr(self._wrapped_subprocess, what[len('subprocess.'):]) +++ return ReadOnlyNamespace(**wrapped_six) +++ +++ def _get_one_import(self, _from, _import, _as, glob): +++ """Perform the given import, placing the result into the dict glob.""" +++ if not _from and _import == '__builtin__': +++ glob[_as or '__builtin__'] = __builtin__ +++ return +++ if _from == '__builtin__': +++ _from = 'six.moves.builtins' +++ # The special `__sandbox__` module gives access to the sandbox +++ # instance. +++ if not _from and _import == '__sandbox__': +++ glob[_as or _import] = self +++ return +++ if self._handle_wrapped_import(_from, _import, _as, glob): +++ return +++ # If we've gotten this far, we should just do a normal import. ++ # Until this proves to be a performance problem, just construct an ++ # import statement and execute it. ++- import_line = '' ++- if '.' in what: ++- _from, what = what.rsplit('.', 1) ++- if _from == '__builtin__' or _from.startswith('__builtin__.'): ++- _from = _from.replace('__builtin__', 'six.moves.builtins') ++- import_line += 'from %s ' % _from ++- if what == '__builtin__': ++- what = 'six.moves.builtins' ++- import_line += 'import %s as imported' % what ++- glob = {} +++ import_line = '%simport %s%s' % ( +++ ('from %s ' % _from) if _from else '', _import, +++ (' as %s' % _as) if _as else '') ++ exec_(import_line, {}, glob) ++- return glob['imported'] ++ ++ def _resolve_and_set(self, data, name, value, when=None): ++ # Don't set anything when --help was on the command line +