commit: 9eb6c02ad48ddb65dc1c0e53900237219b03ee90 Author: Gerion Entrup <gerion.entrup <AT> flump <DOT> de> AuthorDate: Tue Feb 11 00:04:28 2020 +0000 Commit: gerion <gerion.entrup <AT> flump <DOT> de> CommitDate: Tue Feb 11 00:05:18 2020 +0000 URL: https://gitweb.gentoo.org/repo/user/gerislay.git/commit/?id=9eb6c02a
dev-util/ninja: add 1.10.0 bad quality, use the one from the distribution once it is ready Signed-off-by: Gerion Entrup <gerion.entrup <AT> flump.de> dev-util/ninja/Manifest | 4 + dev-util/ninja/files/ninja-1.9.0-musl.patch | 39 ++++++++ dev-util/ninja/metadata.xml | 11 +++ dev-util/ninja/ninja-1.10.0.ebuild | 133 ++++++++++++++++++++++++++++ 4 files changed, 187 insertions(+) diff --git a/dev-util/ninja/Manifest b/dev-util/ninja/Manifest new file mode 100644 index 0000000..643b9cb --- /dev/null +++ b/dev-util/ninja/Manifest @@ -0,0 +1,4 @@ +AUX ninja-1.9.0-musl.patch 1997 BLAKE2B 5fa4e9b171a87ebb8fb618a2b4b0c47668d0aaf0a2b3a5b08a3be5649235228d2cd38c3891d52b1d1e0217f16b1e13175a1a077567c07e83ba8cd36aae96c7aa SHA512 78b29a57ec3c4feedf2bcfe9370b30cecd5302f29e8e14c6a3bc01becb555be6330aafba12f9225625af0644ea1f534feba8396d32bb944253a9daa5dd0e98d8 +DIST ninja-1.10.0.tar.gz 210313 BLAKE2B 0a3db145deaea8a990958ad2e812bc18ed014aaba94911a2905b082745a0d08f10ce1113badabaa362f3834540b7bd3858f07e2a5fce268c66d3d6c73e974e76 SHA512 5ed47ef1ff18a03eb73296629679a8617a08ee443e10e28ae9cb24e4506f84fe1eb142888adea9a62364b626b35817def8c55ba956c9b3cbc7b82d3e62293044 +EBUILD ninja-1.10.0.ebuild 2673 BLAKE2B d73d7e8c0edc6202eb09a88eb38646ae52c05bc79a264dc9443661ca5fce009638c99e746de08f9f582e381a286057726cc73f692c6e38d0257a70ffbc07a5ec SHA512 b62abf26edd5279134cce0cac89e018c376ca27649287b6edc1bd2bd83c6e36945829ad8e1736e9b3eef3a94cc647fc2d17cf8ba33777e81b6e71aa65309842c +MISC metadata.xml 340 BLAKE2B 7cf71b1a09f74328ea74362db4250bf038c0455dcd5f65676ceb5d80a61b5c2923696ecfeccf9d6cd264633e7dc00daa80bf960cc67e5b889d18d487d8e89b97 SHA512 4b78365b98eb9b8a1ef27115261dbf426942cccb7be03c8264e2728e60dedfec8fa51ee3f43488043be5af21b28a74c1c81f4767bcc58574873c2223172447b2 diff --git a/dev-util/ninja/files/ninja-1.9.0-musl.patch b/dev-util/ninja/files/ninja-1.9.0-musl.patch new file mode 100644 index 0000000..f6aeb42 --- /dev/null +++ b/dev-util/ninja/files/ninja-1.9.0-musl.patch @@ -0,0 +1,39 @@ +From 567815df38a2ff54ad7478a90bd75c91e434236a Mon Sep 17 00:00:00 2001 +From: makepost <[email protected]> +Date: Mon, 24 Dec 2018 03:13:16 +0200 +Subject: [PATCH] Use st_mtim if st_mtime is macro, fix #1510 + +In POSIX.1-2008, sys_stat has a st_mtim member and a st_mtime backward +compatibility macro. Should help avoid hardcoding platform detection. +--- + src/disk_interface.cc | 14 ++++---------- + 1 file changed, 4 insertions(+), 10 deletions(-) + +diff --git a/src/disk_interface.cc b/src/disk_interface.cc +index d4c2fb087..dc297c449 100644 +--- a/src/disk_interface.cc ++++ b/src/disk_interface.cc +@@ -202,19 +202,13 @@ TimeStamp RealDiskInterface::Stat(const string& path, string* err) const { + // that it doesn't exist. + if (st.st_mtime == 0) + return 1; +-#if defined(__APPLE__) && !defined(_POSIX_C_SOURCE) ++#if defined(_AIX) ++ return (int64_t)st.st_mtime * 1000000000LL + st.st_mtime_n; ++#elif defined(__APPLE__) + return ((int64_t)st.st_mtimespec.tv_sec * 1000000000LL + + st.st_mtimespec.tv_nsec); +-#elif (_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700 || defined(_BSD_SOURCE) || defined(_SVID_SOURCE) || \ +- defined(__BIONIC__) || (defined (__SVR4) && defined (__sun)) || defined(__FreeBSD__)) +- // For glibc, see "Timestamp files" in the Notes of http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html +- // newlib, uClibc and musl follow the kernel (or Cygwin) headers and define the right macro values above. +- // For bsd, see https://github.com/freebsd/freebsd/blob/master/sys/sys/stat.h and similar +- // For bionic, C and POSIX API is always enabled. +- // For solaris, see https://docs.oracle.com/cd/E88353_01/html/E37841/stat-2.html. ++#elif defined(st_mtime) // A macro, so we're likely on modern POSIX. + return (int64_t)st.st_mtim.tv_sec * 1000000000LL + st.st_mtim.tv_nsec; +-#elif defined(_AIX) +- return (int64_t)st.st_mtime * 1000000000LL + st.st_mtime_n; + #else + return (int64_t)st.st_mtime * 1000000000LL + st.st_mtimensec; + #endif diff --git a/dev-util/ninja/metadata.xml b/dev-util/ninja/metadata.xml new file mode 100644 index 0000000..723d554 --- /dev/null +++ b/dev-util/ninja/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>[email protected]</email> + <name>Chromium in Gentoo Project</name> + </maintainer> + <upstream> + <remote-id type="github">martine/ninja</remote-id> + </upstream> +</pkgmetadata> diff --git a/dev-util/ninja/ninja-1.10.0.ebuild b/dev-util/ninja/ninja-1.10.0.ebuild new file mode 100644 index 0000000..60af1db --- /dev/null +++ b/dev-util/ninja/ninja-1.10.0.ebuild @@ -0,0 +1,133 @@ +# Copyright 2012-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python{2_7,3_6,3_7} ) + +inherit bash-completion-r1 elisp-common python-any-r1 toolchain-funcs + +if [[ ${PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/ninja-build/ninja.git" +else + MY_P="ninja-${KITWARE_VERSION}" + SRC_URI="https://github.com/ninja-build/ninja/archive/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris" +fi + +DESCRIPTION="A small build system similar to make" +HOMEPAGE="https://ninja-build.org/" + +LICENSE="Apache-2.0" +SLOT="0" + +IUSE="doc emacs test vim-syntax" +RESTRICT="!test? ( test )" + +BDEPEND=" + ${PYTHON_DEPS} + dev-util/re2c + doc? ( + app-text/asciidoc + app-doc/doxygen + dev-libs/libxslt + ) + test? ( dev-cpp/gtest ) +" +RDEPEND=" + emacs? ( >=app-editors/emacs-23.1:* ) + vim-syntax? ( + || ( + app-editors/vim + app-editors/gvim + ) + ) +" + +# PATCHES=( +# "${FILESDIR}/ninja-1.9.0-musl.patch" +# ) + +run_for_build() { + 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} + local -x LDFLAGS=${BUILD_LDFLAGS} + fi + echo "$@" >&2 + "$@" +} + +src_compile() { + tc-export AR CXX + + # configure.py uses CFLAGS instead of CXXFLAGS + export CFLAGS=${CXXFLAGS} + + run_for_build ${EPYTHON} configure.py --bootstrap --verbose || die + + if tc-is-cross-compiler; then + mv ninja ninja-build || die + ${EPYTHON} configure.py || die + ./ninja-build -v ninja || die + else + ln ninja ninja-build || die + fi + + if use doc; then + ./ninja-build -v doxygen manual || die + fi + + if use emacs; then + elisp-compile misc/ninja-mode.el || die + fi +} + +src_test() { + if ! tc-is-cross-compiler; then + # Bug 485772 + ulimit -n 2048 + ./ninja -v ninja_test || die + ./ninja_test || die + fi +} + +src_install() { + # dodoc README HACKING.md + if use doc; then + docinto html + dodoc -r doc/doxygen/html/. + dodoc doc/manual.html + fi + dobin ninja + + newbashcomp misc/bash-completion "${PN}" + + if use vim-syntax; then + insinto /usr/share/vim/vimfiles/syntax/ + doins misc/ninja.vim + + echo 'au BufNewFile,BufRead *.ninja set ft=ninja' > "${T}/ninja.vim" + insinto /usr/share/vim/vimfiles/ftdetect + doins "${T}/ninja.vim" + fi + + insinto /usr/share/zsh/site-functions + newins misc/zsh-completion _ninja + + if use emacs; then + cd misc || die + elisp-install ninja ninja-mode.el* || die + fi +} + +pkg_postinst() { + use emacs && elisp-site-regen +} + +pkg_postrm() { + use emacs && elisp-site-regen +}
