1 # Copyright 2018-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python3_{10..12} )
7 inherit edo ninja-utils python-any-r1 toolchain-funcs
9 DESCRIPTION="GN is a meta-build system that generates build files for Ninja"
10 HOMEPAGE="https://gn.googlesource.com/"
11 if [[ ${PV} == 9999 ]]; then
13 EGIT_REPO_URI="https://gn.googlesource.com/gn"
15 # The version number is derived from `git describe HEAD --abbrev=12`
16 SRC_URI="https://deps.gentoo.zip/dev-build/gn/${P}.tar.xz"
17 KEYWORDS="~amd64 ~arm64 ~loong ~ppc64 ~riscv ~x86"
25 app-alternatives/ninja
29 "${FILESDIR}"/gn-gen-r5.patch
39 if use elibc_musl ; then # bug 906362
40 export CC="${CC} -D_LARGEFILE64_SOURCE"
41 export CXX="${CXX} -D_LARGEFILE64_SOURCE"
44 set -- ${EPYTHON} build/gen.py --no-last-commit-position --no-strip --no-static-libstdc++ --allow-warnings
46 cat >out/last_commit_position.h <<-EOF || die
47 #ifndef OUT_LAST_COMMIT_POSITION_H_
48 #define OUT_LAST_COMMIT_POSITION_H_
49 #define LAST_COMMIT_POSITION_NUM ${PV##0.}
50 #define LAST_COMMIT_POSITION "${PV}"
51 #endif // OUT_LAST_COMMIT_POSITION_H_
60 eninja -C out gn_unittests
61 out/gn_unittests || die
68 insinto /usr/share/vim/vimfiles
69 doins -r misc/vim/{autoload,ftdetect,ftplugin,syntax}