app-editors/kakoune: Bump to 2021.11.08-r1

Fix build with gcc-12.1.0 bug #840647
Patch taken from upstream and will no longer be needed once there is a
new release.
See https://github.com/mawww/kakoune/issues/4544
and https://github.com/mawww/kakoune/pull/4549
for additional details.

Closes: https://bugs.gentoo.org/840647
Signed-off-by: Ian Hixson <mujo@sdf.org>
Closes: https://github.com/gentoo/gentoo/pull/25551
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Ian Hixson
2022-05-18 11:10:13 -07:00
committed by Sam James
parent ed2bacec6a
commit 75ea56ddb2
2 changed files with 102 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
https://bugs.gentoo.org/840647
https://github.com/mawww/kakoune/issues/4544
https://github.com/mawww/kakoune/pull/4549
https://github.com/mawww/kakoune/commit/d1ea2ffa600fd2a7b14e415b68ceedba3325c5db
commit d1ea2ffa600fd2a7b14e415b68ceedba3325c5db
Author: Tim Allen <screwtape@froup.com>
Date: Sat Feb 12 21:35:33 2022 +1100
Make Color::validate_alpha() a constexpr function.
We call it from a constexpr constructor, so it needs to be constexpr itself.
Fixes #4544.
diff --git a/src/color.cc b/src/color.cc
index b355b9cf..dfe2e955 100644
--- a/src/color.cc
+++ b/src/color.cc
@@ -34,13 +34,6 @@ bool is_color_name(StringView color)
return contains(color_names, color);
}
-void Color::validate_alpha()
-{
- static_assert(RGB == 17);
- if (a < RGB)
- throw runtime_error("Colors alpha must be > 16");
-}
-
Color str_to_color(StringView color)
{
auto it = find_if(color_names, [&](const char* c){ return color == c; });
diff --git a/src/color.hh b/src/color.hh
index 943678ed..85babd98 100644
--- a/src/color.hh
+++ b/src/color.hh
@@ -1,6 +1,7 @@
#ifndef color_hh_INCLUDED
#define color_hh_INCLUDED
+#include "exception.hh"
#include "hash.hh"
#include "meta.hh"
#include "assert.hh"
@@ -55,7 +56,11 @@ struct Color
}
private:
- void validate_alpha();
+ constexpr void validate_alpha() {
+ static_assert(RGB == 17);
+ if (a < RGB)
+ throw runtime_error("Colors alpha must be > 16");
+ }
};
constexpr bool operator==(Color lhs, Color rhs)

View File

@@ -0,0 +1,44 @@
# Copyright 2020-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit toolchain-funcs
DESCRIPTION="Modal editor inspired by vim"
HOMEPAGE="http://kakoune.org/ https://github.com/mawww/kakoune"
SRC_URI="https://github.com/mawww/kakoune/releases/download/v${PV}/${P}.tar.bz2"
LICENSE="Unlicense"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
BDEPEND="virtual/pkgconfig"
PATCHES=(
"${FILESDIR}"/${P}-gcc12.patch
)
src_prepare() {
sed -i '/CXXFLAGS += -O3/d' src/Makefile || die
default
}
src_configure() {
tc-export CXX
}
src_compile() {
emake -C src all
}
src_test() {
emake -C src test
}
src_install() {
emake PREFIX="${D}"/usr docdir="${ED}/usr/share/doc/${PF}" install
rm "${ED}/usr/share/man/man1/kak.1.gz" || die
doman doc/kak.1
}