app-crypt/etoken-sac: fix eutils EAPI 7
[gentoo-zh.git] / dev-util / gyp / gyp-20220404165439.ebuild
blob63df0a85d719b3e0f329b9d9be84b50ac7bece23
1 # Copyright 2017-2023 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI="8"
5 PYTHON_COMPAT=( python3_{10..12} )
6 DISTUTILS_SINGLE_IMPL="1"
8 inherit distutils-r1
10 if [[ "${PV}" == "99999999999999" ]]; then
11         inherit git-r3
13         EGIT_REPO_URI="https://chromium.googlesource.com/external/gyp"
16 DESCRIPTION="GYP (Generate Your Projects) meta-build system"
17 HOMEPAGE="https://gyp.gsrc.io/ https://chromium.googlesource.com/external/gyp"
18 COMMIT="9ecf45e37677743503342ee4c6a76eaee80e4a7f"
19 if [[ "${PV}" != "99999999999999" ]]; then
20         inherit vcs-snapshot
22         SRC_URI="https://github.com/chromium/${PN}/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
25 LICENSE="BSD"
26 SLOT="0"
27 KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
28 IUSE=""
30 BDEPEND=""
31 DEPEND=""
32 RDEPEND="$(python_gen_cond_dep 'dev-python/six[${PYTHON_USEDEP}]')"
34 PATCHES=(
35         "${FILESDIR}"/0001-${P}-python38.patch
36         "${FILESDIR}"/0002-${P}-fix-cmake.patch
37         "${FILESDIR}"/0003-${P}-fips.patch
40 python_prepare_all() {
41         distutils-r1_python_prepare_all
43         sed -e "s/'  Linux %s' % ' '\.join(platform.linux_distribution())/'  Linux'/" -i gyptest.py || die
44         sed -e "s/the_dict_key is 'variables'/the_dict_key == 'variables'/" -i pylib/gyp/input.py || die
45         sed \
46                 -e "s/os\.environ\['PRESERVE'\] is not ''/os.environ['PRESERVE'] != ''/" \
47                 -e "s/conditions is ()/conditions == ()/" \
48                 -i test/lib/TestCmd.py || die
51 python_test() {
52         # More errors with DeprecationWarnings enabled.
53         local -x PYTHONWARNINGS=""
55         "${PYTHON}" gyptest.py --all --verbose