Gentoo Archives: gentoo-dev

From: Sam James <sam@g.o>
To: gentoo-dev@l.g.o
Cc: mgorny@g.o, floppym@g.o, williamh@g.o, kde@g.o, orbea <orbea@××××××.net>, Sam James <sam@g.o>
Subject: [gentoo-dev] [PATCH 3/5] cmake.eclass: Support dev-util/samurai
Date: Sun, 08 May 2022 23:08:16
Message-Id: 20220508230716.1259369-3-sam@gentoo.org
In Reply to: [gentoo-dev] [PATCH 1/5] ninja-utils.eclass: Support dev-util/samurai by Sam James
1 From: orbea <orbea@××××××.net>
2
3 samurai is a ninja-compatible build tool written in C which
4 works with cmake, meson and other users of ninja.
5
6 It is feature-complete and supports most of the same options
7 as ninja.
8
9 Signed-off-by: orbea <orbea@××××××.net>
10 Signed-off-by: Sam James <sam@g.o>
11 ---
12 eclass/cmake.eclass | 13 +++++++++----
13 1 file changed, 9 insertions(+), 4 deletions(-)
14
15 diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass
16 index 59e5b60957c2..7ad0f6a7d45e 100644
17 --- a/eclass/cmake.eclass
18 +++ b/eclass/cmake.eclass
19 @@ -136,7 +136,7 @@ case ${CMAKE_MAKEFILE_GENERATOR} in
20 BDEPEND="sys-devel/make"
21 ;;
22 ninja)
23 - BDEPEND="dev-util/ninja"
24 + BDEPEND="${NINJA_DEPEND}"
25 ;;
26 *)
27 eerror "Unknown value for \${CMAKE_MAKEFILE_GENERATOR}"
28 @@ -365,7 +365,7 @@ cmake_src_prepare() {
29
30 # if ninja is enabled but not installed, the build could fail
31 # this could happen if ninja is manually enabled (eg. make.conf) but not installed
32 - if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]] && ! has_version -b dev-util/ninja; then
33 + if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]] && ! has_version -b "${NINJA_DEPEND}"; then
34 eerror "CMAKE_MAKEFILE_GENERATOR is set to ninja, but ninja is not installed."
35 die "Please install dev-util/ninja or unset CMAKE_MAKEFILE_GENERATOR."
36 fi
37 @@ -703,12 +703,17 @@ cmake_src_test() {
38 # @DESCRIPTION:
39 # Function for installing the package. Automatically detects the build type.
40 cmake_src_install() {
41 + local generator=${CMAKE_MAKEFILE_GENERATOR}
42 + case ${CMAKE_MAKEFILE_GENERATOR} in
43 + ninja) generator="eninja" ;;
44 + esac
45 +
46 debug-print-function ${FUNCNAME} "$@"
47
48 _cmake_check_build_dir
49 pushd "${BUILD_DIR}" > /dev/null || die
50 - DESTDIR="${D}" ${CMAKE_MAKEFILE_GENERATOR} install "$@" ||
51 - die "died running ${CMAKE_MAKEFILE_GENERATOR} install"
52 + DESTDIR="${D}" ${generator} install "$@" ||
53 + die "died running ${generator} install"
54 popd > /dev/null || die
55
56 if [[ ${EAPI} == 7 ]]; then
57 --
58 2.35.1

Replies

Subject Author
Re: [gentoo-dev] [PATCH 3/5] cmake.eclass: Support dev-util/samurai "Michał Górny" <mgorny@g.o>