commit:     59f9c2a9dd278aabe4224592812266f2bd8369b6
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  3 02:09:48 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jan  3 02:09:48 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=59f9c2a9

dev-libs/cxxopts: fix build issues

* Fix build w/ GCC 15 (missing include (in installed header))
* Fix test build w/ newer ICU (which needs C++17)

Closes: https://bugs.gentoo.org/938824
Closes: https://bugs.gentoo.org/937503
Closes: https://bugs.gentoo.org/940222
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/cxxopts/cxxopts-3.2.1-r1.ebuild         | 49 ++++++++++++++++++++++++
 dev-libs/cxxopts/files/cxxopts-3.2.1-gcc15.patch | 18 +++++++++
 2 files changed, 67 insertions(+)

diff --git a/dev-libs/cxxopts/cxxopts-3.2.1-r1.ebuild 
b/dev-libs/cxxopts/cxxopts-3.2.1-r1.ebuild
new file mode 100644
index 000000000000..738734154e08
--- /dev/null
+++ b/dev-libs/cxxopts/cxxopts-3.2.1-r1.ebuild
@@ -0,0 +1,49 @@
+# Copyright 2020-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+DESCRIPTION="Lightweight C++ command line option parser"
+HOMEPAGE="https://github.com/jarro2783/cxxopts";
+SRC_URI="https://github.com/jarro2783/${PN}/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86"
+IUSE="icu test"
+
+RESTRICT="
+       !test? ( test )
+"
+
+DOCS=(
+       README.md
+       CHANGELOG.md
+)
+
+PATCHES=(
+       "${FILESDIR}"/${P}-gcc15.patch
+)
+
+src_prepare() {
+       sed -r -e 's:-Werror[[:space:]]*::' -i cmake/cxxopts.cmake || die
+       cmake_src_prepare
+}
+
+src_configure() {
+       # bug #938824, bug #940222
+       sed -i -e '/set.*CMAKE_CXX_STANDARD/s:11:17:' \
+               test/{add-subdirectory,find-package}-test/CMakeLists.txt || die
+
+       local mycmakeargs=(
+               # bug #938824, bug #940222
+               -DCXXOPTS_CXX_STANDARD=17
+               -DCXXOPTS_BUILD_EXAMPLES:BOOL=OFF
+               -DCXXOPTS_BUILD_TESTS:BOOL=$(usex test)
+               -DCXXOPTS_ENABLE_INSTALL:BOOL=ON
+               -DCXXOPTS_USE_UNICODE_HELP:BOOL=$(usex icu)
+       )
+       cmake_src_configure
+}

diff --git a/dev-libs/cxxopts/files/cxxopts-3.2.1-gcc15.patch 
b/dev-libs/cxxopts/files/cxxopts-3.2.1-gcc15.patch
new file mode 100644
index 000000000000..288de016ea21
--- /dev/null
+++ b/dev-libs/cxxopts/files/cxxopts-3.2.1-gcc15.patch
@@ -0,0 +1,18 @@
+https://github.com/jarro2783/cxxopts/commit/63d1b65a694cfceafc20863afa75df49dfbe6b2a
+
+From 63d1b65a694cfceafc20863afa75df49dfbe6b2a Mon Sep 17 00:00:00 2001
+From: pastalian <28638872+pastal...@users.noreply.github.com>
+Date: Wed, 28 Aug 2024 20:31:42 +0900
+Subject: [PATCH] Add missing header for gcc-15 (#438)
+
+--- a/include/cxxopts.hpp
++++ b/include/cxxopts.hpp
+@@ -27,6 +27,7 @@ THE SOFTWARE.
+ #ifndef CXXOPTS_HPP_INCLUDED
+ #define CXXOPTS_HPP_INCLUDED
+ 
++#include <cstdint>
+ #include <cstdlib>
+ #include <cstring>
+ #include <exception>
+

Reply via email to