Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/pegtl/, dev-libs/pegtl/files/
Date: Sat, 26 Dec 2020 23:46:32
Message-Id: 1609026361.ea252dd70f621703bac7172a960e4cfd5e2b7cd0.asturm@gentoo
1 commit: ea252dd70f621703bac7172a960e4cfd5e2b7cd0
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sat Dec 26 23:05:46 2020 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sat Dec 26 23:46:01 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ea252dd7
7
8 dev-libs/pegtl: Fix GCC-10 warning, fix cmake module install path
9
10 - Drop -Werror
11 - Drop superfluous LICENSE install to invalid doc dir path.
12
13 Bug: https://bugs.gentoo.org/754687
14 Closes: https://bugs.gentoo.org/733678
15 Package-Manager: Portage-3.0.12, Repoman-3.0.2
16 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
17
18 dev-libs/pegtl/files/pegtl-2.8.3-cmake.patch | 29 ++++++++++++++++++
19 dev-libs/pegtl/files/pegtl-2.8.3-gcc-10.patch | 43 +++++++++++++++++++++++++++
20 dev-libs/pegtl/pegtl-2.8.3-r1.ebuild | 32 ++++++++++++++++++++
21 3 files changed, 104 insertions(+)
22
23 diff --git a/dev-libs/pegtl/files/pegtl-2.8.3-cmake.patch b/dev-libs/pegtl/files/pegtl-2.8.3-cmake.patch
24 new file mode 100644
25 index 00000000000..140e1f5cfbb
26 --- /dev/null
27 +++ b/dev-libs/pegtl/files/pegtl-2.8.3-cmake.patch
28 @@ -0,0 +1,29 @@
29 +--- a/CMakeLists.txt 2020-04-22 19:43:00.000000000 +0200
30 ++++ b/CMakeLists.txt 2020-12-27 00:00:15.886046938 +0100
31 +@@ -78,4 +78,3 @@
32 +
33 + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pegtl-config-version.cmake DESTINATION ${PEGTL_INSTALL_CMAKE_DIR})
34 + install(DIRECTORY include/ DESTINATION ${PEGTL_INSTALL_INCLUDE_DIR})
35 +-install(FILES LICENSE DESTINATION ${PEGTL_INSTALL_DOC_DIR})
36 +--- a/src/test/pegtl/CMakeLists.txt 2020-04-22 19:43:00.000000000 +0200
37 ++++ b/src/test/pegtl/CMakeLists.txt 2020-12-27 00:07:19.122766830 +0100
38 +@@ -123,7 +123,7 @@
39 + if(MSVC)
40 + target_compile_options(${exename} PRIVATE /W4 /WX /utf-8)
41 + else()
42 +- target_compile_options(${exename} PRIVATE -pedantic -Wall -Wextra -Wshadow -Werror)
43 ++ target_compile_options(${exename} PRIVATE -pedantic -Wall -Wextra -Wshadow)
44 + endif()
45 + if(ANDROID)
46 + add_test(NAME ${exename} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../.. COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} "-DTEST_RESOURCES=src/test/pegtl/data;src/test/pegtl/file_data.txt;Makefile" -DTEST_RESOURCES_DIR=${CMAKE_CURRENT_SOURCE_DIR}/../../.. -DUNITTEST=${CMAKE_CURRENT_BINARY_DIR}/${exename} -DTEST_PARAMETER=-all -P ${CMAKE_CURRENT_SOURCE_DIR}/ExecuteOnAndroid.cmake)
47 +--- a/src/example/pegtl/CMakeLists.txt 2020-04-22 19:43:00.000000000 +0200
48 ++++ b/src/example/pegtl/CMakeLists.txt 2020-12-27 00:07:32.970832890 +0100
49 +@@ -48,7 +48,7 @@
50 + if(MSVC)
51 + target_compile_options(${exename} PRIVATE /W4 /WX /utf-8)
52 + else()
53 +- target_compile_options(${exename} PRIVATE -pedantic -Wall -Wextra -Wshadow -Werror)
54 ++ target_compile_options(${exename} PRIVATE -pedantic -Wall -Wextra -Wshadow)
55 + endif()
56 + endforeach(examplesourcefile)
57 +
58
59 diff --git a/dev-libs/pegtl/files/pegtl-2.8.3-gcc-10.patch b/dev-libs/pegtl/files/pegtl-2.8.3-gcc-10.patch
60 new file mode 100644
61 index 00000000000..ef418e44254
62 --- /dev/null
63 +++ b/dev-libs/pegtl/files/pegtl-2.8.3-gcc-10.patch
64 @@ -0,0 +1,43 @@
65 +From a3a292c2ba66bf09b4adc4cee8fcdfb1b1386067 Mon Sep 17 00:00:00 2001
66 +From: Daniel Frey <d.frey@×××.de>
67 +Date: Mon, 11 May 2020 22:19:31 +0200
68 +Subject: [PATCH] Repair warning from GCC 10
69 +
70 +* Backported patch thx to Fedora.
71 +
72 +---
73 + include/tao/pegtl/contrib/rep_one_min_max.hpp | 21 +++++++++++++++++++
74 + 1 file changed, 21 insertions(+)
75 +
76 +diff --git a/include/tao/pegtl/contrib/rep_one_min_max.hpp b/include/tao/pegtl/contrib/rep_one_min_max.hpp
77 +index 7ec4639e..ee0a3782 100644
78 +--- a/include/tao/pegtl/contrib/rep_one_min_max.hpp
79 ++++ b/include/tao/pegtl/contrib/rep_one_min_max.hpp
80 +@@ -45,6 +45,27 @@ namespace tao
81 + }
82 + };
83 +
84 ++ template< unsigned Max, char C >
85 ++ struct rep_one_min_max< 0, Max, C >
86 ++ {
87 ++ using analyze_t = analysis::counted< analysis::rule_type::any, 0 >;
88 ++
89 ++ template< typename Input >
90 ++ static bool match( Input& in )
91 ++ {
92 ++ const auto size = in.size( Max + 1 );
93 ++ std::size_t i = 0;
94 ++ while( ( i < size ) && ( in.peek_char( i ) == C ) ) {
95 ++ ++i;
96 ++ }
97 ++ if( i <= Max ) {
98 ++ bump_help< result_on_found::success, Input, char, C >( in, i );
99 ++ return true;
100 ++ }
101 ++ return false;
102 ++ }
103 ++ };
104 ++
105 + template< unsigned Min, unsigned Max, char C >
106 + inline constexpr bool enable_control< rep_one_min_max< Min, Max, C > > = false;
107 +
108
109 diff --git a/dev-libs/pegtl/pegtl-2.8.3-r1.ebuild b/dev-libs/pegtl/pegtl-2.8.3-r1.ebuild
110 new file mode 100644
111 index 00000000000..7598786994b
112 --- /dev/null
113 +++ b/dev-libs/pegtl/pegtl-2.8.3-r1.ebuild
114 @@ -0,0 +1,32 @@
115 +# Copyright 1999-2020 Gentoo Authors
116 +# Distributed under the terms of the GNU General Public License v2
117 +
118 +EAPI=7
119 +
120 +inherit cmake
121 +
122 +DESCRIPTION="Header-only library for creating parsers according to Parsing Expression Grammar"
123 +HOMEPAGE="https://github.com/taocpp/PEGTL"
124 +SRC_URI="https://github.com/taocpp/PEGTL/archive/${PV}.tar.gz -> ${P}.tar.gz"
125 +
126 +LICENSE="MIT"
127 +SLOT="0"
128 +KEYWORDS="~amd64 ~x86"
129 +IUSE="test"
130 +
131 +RESTRICT="!test? ( test )"
132 +
133 +S="${WORKDIR}/PEGTL-${PV}"
134 +
135 +PATCHES=(
136 + "${FILESDIR}/${P}-cmake.patch"
137 + "${FILESDIR}/${P}-gcc-10.patch" # bug 733678
138 +)
139 +
140 +src_configure() {
141 + local mycmakeargs=(
142 + -DPEGTL_INSTALL_CMAKE_DIR="$(get_libdir)/cmake/${PN}"
143 + -DPEGTL_INSTALL_DOC_DIR="share/doc/${PF}"
144 + )
145 + cmake_src_configure
146 +}