summaryrefslogtreecommitdiff
path: root/dev-build/ninja/ninja-9999.ebuild
diff options
context:
space:
mode:
Diffstat (limited to 'dev-build/ninja/ninja-9999.ebuild')
-rw-r--r--dev-build/ninja/ninja-9999.ebuild38
1 files changed, 32 insertions, 6 deletions
diff --git a/dev-build/ninja/ninja-9999.ebuild b/dev-build/ninja/ninja-9999.ebuild
index b387ddf90c06..1f7a8e02d01c 100644
--- a/dev-build/ninja/ninja-9999.ebuild
+++ b/dev-build/ninja/ninja-9999.ebuild
@@ -15,12 +15,16 @@ else
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~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 )"
+
DESCRIPTION="A small build system similar to make"
HOMEPAGE="https://ninja-build.org/"
LICENSE="Apache-2.0"
SLOT="0"
-IUSE="doc"
+IUSE="doc test"
+RESTRICT="!test? ( test )"
BDEPEND="
${PYTHON_DEPS}
@@ -36,14 +40,19 @@ PDEPEND="
app-alternatives/ninja
"
+PATCHES=(
+ "${FILESDIR}"/ninja-cflags.patch
+)
+
pkg_setup() {
:
}
-src_prepare() {
- local PATCHES=(
- "${FILESDIR}"/ninja-cflags.patch
- )
+src_unpack() {
+ if [[ ${PV} == 9999 ]] ; then
+ git-r3_src_unpack
+ fi
+
default
}
@@ -55,7 +64,15 @@ bootstrap() {
local -x CXXFLAGS="${BUILD_CXXFLAGS} -D_FILE_OFFSET_BITS=64"
local -x LDFLAGS=${BUILD_LDFLAGS}
fi
- edo ${EPYTHON} configure.py --with-python=python --bootstrap --verbose
+
+ 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() {
@@ -77,6 +94,15 @@ src_compile() {
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}