1 |
On Sun, 2022-05-08 at 23:07 +0000, Sam James wrote: |
2 |
> From: orbea <orbea@××××××.net> |
3 |
> |
4 |
> samurai is a ninja-compatible build tool written in C which |
5 |
> works with cmake, meson and other users of ninja. |
6 |
> |
7 |
> It is feature-complete and supports most of the same options |
8 |
> as ninja. |
9 |
> |
10 |
> Signed-off-by: orbea <orbea@××××××.net> |
11 |
> Signed-off-by: Sam James <sam@g.o> |
12 |
> --- |
13 |
> eclass/cmake.eclass | 13 +++++++++---- |
14 |
> 1 file changed, 9 insertions(+), 4 deletions(-) |
15 |
> |
16 |
> diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass |
17 |
> index 59e5b60957c2..7ad0f6a7d45e 100644 |
18 |
> --- a/eclass/cmake.eclass |
19 |
> +++ b/eclass/cmake.eclass |
20 |
> @@ -136,7 +136,7 @@ case ${CMAKE_MAKEFILE_GENERATOR} in |
21 |
> BDEPEND="sys-devel/make" |
22 |
> ;; |
23 |
> ninja) |
24 |
> - BDEPEND="dev-util/ninja" |
25 |
> + BDEPEND="${NINJA_DEPEND}" |
26 |
> ;; |
27 |
> *) |
28 |
> eerror "Unknown value for \${CMAKE_MAKEFILE_GENERATOR}" |
29 |
> @@ -365,7 +365,7 @@ cmake_src_prepare() { |
30 |
> |
31 |
> # if ninja is enabled but not installed, the build could fail |
32 |
> # this could happen if ninja is manually enabled (eg. make.conf) but not installed |
33 |
> - if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]] && ! has_version -b dev-util/ninja; then |
34 |
> + if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]] && ! has_version -b "${NINJA_DEPEND}"; then |
35 |
> eerror "CMAKE_MAKEFILE_GENERATOR is set to ninja, but ninja is not installed." |
36 |
> die "Please install dev-util/ninja or unset CMAKE_MAKEFILE_GENERATOR." |
37 |
> fi |
38 |
> @@ -703,12 +703,17 @@ cmake_src_test() { |
39 |
> # @DESCRIPTION: |
40 |
> # Function for installing the package. Automatically detects the build type. |
41 |
> cmake_src_install() { |
42 |
> + local generator=${CMAKE_MAKEFILE_GENERATOR} |
43 |
> + case ${CMAKE_MAKEFILE_GENERATOR} in |
44 |
> + ninja) generator="eninja" ;; |
45 |
> + esac |
46 |
> + |
47 |
> debug-print-function ${FUNCNAME} "$@" |
48 |
> |
49 |
> _cmake_check_build_dir |
50 |
> pushd "${BUILD_DIR}" > /dev/null || die |
51 |
> - DESTDIR="${D}" ${CMAKE_MAKEFILE_GENERATOR} install "$@" || |
52 |
> - die "died running ${CMAKE_MAKEFILE_GENERATOR} install" |
53 |
> + DESTDIR="${D}" ${generator} install "$@" || |
54 |
> + die "died running ${generator} install" |
55 |
> popd > /dev/null || die |
56 |
|
57 |
I'm sorry for missing this earlier but could we perhaps reuse |
58 |
cmake_build here? Instead of this whole block above, something like: |
59 |
|
60 |
DESTDIR="${D}" cmake_build install "$@" |
61 |
|
62 |
> |
63 |
> if [[ ${EAPI} == 7 ]]; then |
64 |
|
65 |
-- |
66 |
Best regards, |
67 |
Michał Górny |