app-shells/bash-completion: add 2.16.0
[gentoo/gentoo.git] / dev-build / gn / gn-0.2154.ebuild
blob5dea03c85f581232661e3bf9dd08b74ca1140a6d
1 # Copyright 2018-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
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
12         inherit git-r3
13         EGIT_REPO_URI="https://gn.googlesource.com/gn"
14 else
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"
20 LICENSE="BSD"
21 SLOT="0"
23 BDEPEND="
24         ${PYTHON_DEPS}
25         app-alternatives/ninja
28 PATCHES=(
29         "${FILESDIR}"/gn-gen-r5.patch
32 pkg_setup() {
33         :
36 src_configure() {
37         python_setup
38         tc-export AR CC CXX
39         if use elibc_musl ; then # bug 906362
40                 export CC="${CC} -D_LARGEFILE64_SOURCE"
41                 export CXX="${CXX} -D_LARGEFILE64_SOURCE"
42         fi
43         unset CFLAGS
44         set -- ${EPYTHON} build/gen.py --no-last-commit-position --no-strip --no-static-libstdc++ --allow-warnings
45         edo "$@"
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_
52         EOF
55 src_compile() {
56         eninja -C out gn
59 src_test() {
60         eninja -C out gn_unittests
61         out/gn_unittests || die
64 src_install() {
65         dobin out/gn
66         einstalldocs
68         insinto /usr/share/vim/vimfiles
69         doins -r misc/vim/{autoload,ftdetect,ftplugin,syntax}