From 26d21387e55aaf6c762f781fe2e510b55b9c9825 Mon Sep 17 00:00:00 2001 From: Flatcar Buildbot Date: Mon, 30 Jun 2025 07:07:32 +0000 Subject: [PATCH] dev-build/ninja: Sync with Gentoo It's from Gentoo commit 39e50c16874dfc9993ed2886b7dbebb01b8921f1. --- .../portage-stable/dev-build/ninja/Manifest | 1 + .../dev-build/ninja/ninja-1.13.0.ebuild | 132 ++++++++++++++++++ 2 files changed, 133 insertions(+) create mode 100644 sdk_container/src/third_party/portage-stable/dev-build/ninja/ninja-1.13.0.ebuild diff --git a/sdk_container/src/third_party/portage-stable/dev-build/ninja/Manifest b/sdk_container/src/third_party/portage-stable/dev-build/ninja/Manifest index 621e98b627..71ab2ed855 100644 --- a/sdk_container/src/third_party/portage-stable/dev-build/ninja/Manifest +++ b/sdk_container/src/third_party/portage-stable/dev-build/ninja/Manifest @@ -1,3 +1,4 @@ DIST gtest-1.14.0.tar.gz 867764 BLAKE2B c457f55ac572b9fb1553eee3df7eeeaf1e7dd2c3d747dd5e90dd279038fa5c71bb7b7d9ba1cf7e6143898b2a1d24d100584bd2a48ded41a426870c4825eec1b2 SHA512 765c326ccc1b87a01027385e69238266e356361cd4ee3e18e3c9d137a5d11fa5d657c164d02dd1be8fe693c8e10f2b580588dbfa57d27f070e2750f50d3e662c DIST ninja-1.11.1.tar.gz 229479 BLAKE2B c96cf7c319b7abd65f644465688d256f8b3a576c4616d0c63852e25dd0dc5f63c66708d429d8dddb6228502eb147211a86a5dd369b80ec2228902b370d2343e5 SHA512 1bca38877c70ee6613f347ffccef5adc02ba0a3947c62ae004ea97f918442b5a3de92378e4f820ae2a7676bc7609d25fbc7d41f6cfb3a61e5e4b26ec3639e403 DIST ninja-1.12.1.tar.gz 240483 BLAKE2B 915545888cbd7d9e6e7e4fb0bad42f6c36ecef2de93356966541de0f8f4315e59e47cf20f189de5de11ba2a038488c7964ec709bad8868488cc03524a88483f4 SHA512 d6e6f0e89a4844a69069ff0c7cefc07704a41c7b0c062a57534de87decdde63e27928147b321111b806aa7efa1061f031a1319b074391db61b0cbdccf096954c +DIST ninja-1.13.0.tar.gz 291328 BLAKE2B 263da5b3991a7569012a46f2311b50fafc32838aebca79772fdebade4c87d1b01286ba24b4055d19b372cd3829a22f04892518227ce976e24a55777d9b9c762f SHA512 e03f721a34c19e47160eae2daa56299f4d030df646f63a277b8089b37ed8922e0cc944c421d257a33ee05b177a61ed15d8eb0e8584c3196da3137677b7b41db6 diff --git a/sdk_container/src/third_party/portage-stable/dev-build/ninja/ninja-1.13.0.ebuild b/sdk_container/src/third_party/portage-stable/dev-build/ninja/ninja-1.13.0.ebuild new file mode 100644 index 0000000000..8185b7a0c8 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-build/ninja/ninja-1.13.0.ebuild @@ -0,0 +1,132 @@ +# Copyright 2012-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{11..14} ) + +inherit bash-completion-r1 edo python-any-r1 toolchain-funcs + +DESCRIPTION="A small build system similar to make" +HOMEPAGE="https://ninja-build.org/" + +if [[ ${PV} == 9999 ]]; then + EGIT_REPO_URI="https://github.com/ninja-build/ninja.git" + inherit git-r3 +else + SRC_URI="https://github.com/ninja-build/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" +fi + +GTEST_VER=1.14.0 +SRC_URI+=" test? ( https://github.com/google/googletest/archive/refs/tags/v${GTEST_VER}.tar.gz -> gtest-${GTEST_VER}.tar.gz )" + +LICENSE="Apache-2.0" +SLOT="0" +IUSE="doc test" +RESTRICT="!test? ( test )" + +BDEPEND=" + ${PYTHON_DEPS} + dev-util/re2c + doc? ( + app-text/asciidoc + app-text/doxygen + dev-libs/libxslt + media-gfx/graphviz + ) +" +PDEPEND=" + app-alternatives/ninja +" + +PATCHES=( + "${FILESDIR}"/ninja-cflags.patch +) + +pkg_setup() { + : +} + +src_unpack() { + if [[ ${PV} == 9999 ]] ; then + git-r3_src_unpack + fi + + default +} + +bootstrap() { + if tc-is-cross-compiler; then + local -x AR=$(tc-getBUILD_AR) + local -x CXX=$(tc-getBUILD_CXX) + local -x CFLAGS= + local -x CXXFLAGS="${BUILD_CXXFLAGS} -D_FILE_OFFSET_BITS=64" + local -x LDFLAGS=${BUILD_LDFLAGS} + fi + + local bootstrap_args=( + --with-python=python + --bootstrap + --verbose + $(usev test --gtest-source-dir="${WORKDIR}"/googletest-${GTEST_VER}) + ) + + edo ${EPYTHON} configure.py "${bootstrap_args[@]}" +} + +src_compile() { + python_setup + + tc-export AR CXX + unset CFLAGS + export CXXFLAGS="${CXXFLAGS} -D_FILE_OFFSET_BITS=64" + + bootstrap + + if use doc; then + edo ./ninja -v doxygen manual + fi + + if tc-is-cross-compiler; then + edo ${EPYTHON} configure.py --with-python=python + edo ./ninja -v ninja + fi +} + +src_test() { + if ! tc-is-cross-compiler; then + # Bug 485772 + ulimit -n 2048 + edo ./ninja -v ninja_test + edo ./ninja_test + fi +} + +src_install() { + newbin ninja{,-reference} + + if use doc; then + docinto html + dodoc -r doc/doxygen/html/. + dodoc doc/manual.html + fi + + newbashcomp misc/bash-completion ${PN} + + insinto /usr/share/vim/vimfiles/syntax/ + doins misc/ninja.vim + + echo 'au BufNewFile,BufRead *.ninja set ft=ninja' > "${T}"/ninja.vim || die + insinto /usr/share/vim/vimfiles/ftdetect + doins "${T}"/ninja.vim + + insinto /usr/share/zsh/site-functions + newins misc/zsh-completion _ninja +} + +pkg_postinst() { + if ! [[ -e "${EROOT}/usr/bin/ninja" ]]; then + ln -s ninja-reference "${EROOT}/usr/bin/ninja" || die + fi +}