Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-editors/kakoune/, app-editors/kakoune/files/
Date: Thu, 19 May 2022 02:03:59
Message-Id: 1652925448.75ea56ddb2052f91951e83b4d5e80ed1fc611f6f.sam@gentoo
1 commit: 75ea56ddb2052f91951e83b4d5e80ed1fc611f6f
2 Author: Ian Hixson <mujo <AT> sdf <DOT> org>
3 AuthorDate: Wed May 18 18:10:13 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu May 19 01:57:28 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75ea56dd
7
8 app-editors/kakoune: Bump to 2021.11.08-r1
9
10 Fix build with gcc-12.1.0 bug #840647
11 Patch taken from upstream and will no longer be needed once there is a
12 new release.
13 See https://github.com/mawww/kakoune/issues/4544
14 and https://github.com/mawww/kakoune/pull/4549
15 for additional details.
16
17 Closes: https://bugs.gentoo.org/840647
18 Signed-off-by: Ian Hixson <mujo <AT> sdf.org>
19 Closes: https://github.com/gentoo/gentoo/pull/25551
20 Signed-off-by: Sam James <sam <AT> gentoo.org>
21
22 .../kakoune/files/kakoune-2021.11.08-gcc12.patch | 58 ++++++++++++++++++++++
23 app-editors/kakoune/kakoune-2021.11.08-r1.ebuild | 44 ++++++++++++++++
24 2 files changed, 102 insertions(+)
25
26 diff --git a/app-editors/kakoune/files/kakoune-2021.11.08-gcc12.patch b/app-editors/kakoune/files/kakoune-2021.11.08-gcc12.patch
27 new file mode 100644
28 index 000000000000..7f1101cdbf49
29 --- /dev/null
30 +++ b/app-editors/kakoune/files/kakoune-2021.11.08-gcc12.patch
31 @@ -0,0 +1,58 @@
32 +https://bugs.gentoo.org/840647
33 +https://github.com/mawww/kakoune/issues/4544
34 +https://github.com/mawww/kakoune/pull/4549
35 +https://github.com/mawww/kakoune/commit/d1ea2ffa600fd2a7b14e415b68ceedba3325c5db
36 +
37 +commit d1ea2ffa600fd2a7b14e415b68ceedba3325c5db
38 +Author: Tim Allen <screwtape@×××××.com>
39 +Date: Sat Feb 12 21:35:33 2022 +1100
40 +
41 + Make Color::validate_alpha() a constexpr function.
42 +
43 + We call it from a constexpr constructor, so it needs to be constexpr itself.
44 +
45 + Fixes #4544.
46 +
47 +diff --git a/src/color.cc b/src/color.cc
48 +index b355b9cf..dfe2e955 100644
49 +--- a/src/color.cc
50 ++++ b/src/color.cc
51 +@@ -34,13 +34,6 @@ bool is_color_name(StringView color)
52 + return contains(color_names, color);
53 + }
54 +
55 +-void Color::validate_alpha()
56 +-{
57 +- static_assert(RGB == 17);
58 +- if (a < RGB)
59 +- throw runtime_error("Colors alpha must be > 16");
60 +-}
61 +-
62 + Color str_to_color(StringView color)
63 + {
64 + auto it = find_if(color_names, [&](const char* c){ return color == c; });
65 +diff --git a/src/color.hh b/src/color.hh
66 +index 943678ed..85babd98 100644
67 +--- a/src/color.hh
68 ++++ b/src/color.hh
69 +@@ -1,6 +1,7 @@
70 + #ifndef color_hh_INCLUDED
71 + #define color_hh_INCLUDED
72 +
73 ++#include "exception.hh"
74 + #include "hash.hh"
75 + #include "meta.hh"
76 + #include "assert.hh"
77 +@@ -55,7 +56,11 @@ struct Color
78 + }
79 +
80 + private:
81 +- void validate_alpha();
82 ++ constexpr void validate_alpha() {
83 ++ static_assert(RGB == 17);
84 ++ if (a < RGB)
85 ++ throw runtime_error("Colors alpha must be > 16");
86 ++ }
87 + };
88 +
89 + constexpr bool operator==(Color lhs, Color rhs)
90
91 diff --git a/app-editors/kakoune/kakoune-2021.11.08-r1.ebuild b/app-editors/kakoune/kakoune-2021.11.08-r1.ebuild
92 new file mode 100644
93 index 000000000000..37633ce21f75
94 --- /dev/null
95 +++ b/app-editors/kakoune/kakoune-2021.11.08-r1.ebuild
96 @@ -0,0 +1,44 @@
97 +# Copyright 2020-2021 Gentoo Authors
98 +# Distributed under the terms of the GNU General Public License v2
99 +
100 +EAPI=8
101 +
102 +inherit toolchain-funcs
103 +
104 +DESCRIPTION="Modal editor inspired by vim"
105 +HOMEPAGE="http://kakoune.org/ https://github.com/mawww/kakoune"
106 +SRC_URI="https://github.com/mawww/kakoune/releases/download/v${PV}/${P}.tar.bz2"
107 +
108 +LICENSE="Unlicense"
109 +SLOT="0"
110 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
111 +
112 +BDEPEND="virtual/pkgconfig"
113 +
114 +PATCHES=(
115 + "${FILESDIR}"/${P}-gcc12.patch
116 +)
117 +
118 +src_prepare() {
119 + sed -i '/CXXFLAGS += -O3/d' src/Makefile || die
120 + default
121 +}
122 +
123 +src_configure() {
124 + tc-export CXX
125 +}
126 +
127 +src_compile() {
128 + emake -C src all
129 +}
130 +
131 +src_test() {
132 + emake -C src test
133 +}
134 +
135 +src_install() {
136 + emake PREFIX="${D}"/usr docdir="${ED}/usr/share/doc/${PF}" install
137 +
138 + rm "${ED}/usr/share/man/man1/kak.1.gz" || die
139 + doman doc/kak.1
140 +}