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-admin/lnav/files/, app-admin/lnav/
Date: Sat, 02 Oct 2021 04:27:19
Message-Id: 1633148805.8a7d108e817923b96029671420ba834a1a294257.sam@gentoo
1 commit: 8a7d108e817923b96029671420ba834a1a294257
2 Author: Randy Barlow <randy <AT> electronsweatshop <DOT> com>
3 AuthorDate: Fri Oct 1 05:17:23 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 2 04:26:45 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8a7d108e
7
8 app-admin/lnav: Unbundle doctest
9
10 Backport https://github.com/tstack/lnav/pull/915 so we can use
11 the system doctest while we wait on a new lnav upstream release.
12
13 Closes: https://bugs.gentoo.org/809752
14 Closes: https://bugs.gentoo.org/812353
15 Signed-off-by: Randy Barlow <randy <AT> electronsweatshop.com>
16 Closes: https://github.com/gentoo/gentoo/pull/22454
17 Signed-off-by: Sam James <sam <AT> gentoo.org>
18
19 .../files/lnav-0.10.0-use-system-doctest.patch | 73 ++++++++++++++++++++++
20 app-admin/lnav/lnav-0.10.0-r2.ebuild | 62 ++++++++++++++++++
21 2 files changed, 135 insertions(+)
22
23 diff --git a/app-admin/lnav/files/lnav-0.10.0-use-system-doctest.patch b/app-admin/lnav/files/lnav-0.10.0-use-system-doctest.patch
24 new file mode 100644
25 index 00000000000..09fe364487b
26 --- /dev/null
27 +++ b/app-admin/lnav/files/lnav-0.10.0-use-system-doctest.patch
28 @@ -0,0 +1,73 @@
29 +From 85515b2c196f2e361e93c158201f74177dc4ae37 Mon Sep 17 00:00:00 2001
30 +From: Randy Barlow <randy@×××××××××××××××××.com>
31 +Date: Sat, 18 Sep 2021 21:56:19 -0400
32 +Subject: [PATCH] Provide a configure flag to use the system doctest
33 +
34 +This will allow distributions to more easily maintain
35 +incompatibilies between doctest and the rest of their software.
36 +
37 +Fixes #912
38 +
39 +Signed-off-by: Randy Barlow <randy@×××××××××××××××××.com>
40 +---
41 + configure.ac | 21 +
42 + src/Makefile.am | 4 +
43 + src/doctest.hh | 5502 +--------------------------------------
44 + src/doctest_vendored.hh | 5464 ++++++++++++++++++++++++++++++++++++++
45 + 4 files changed, 5527 insertions(+), 5464 deletions(-)
46 + create mode 100644 src/doctest_vendored.hh
47 +
48 +diff --git a/configure.ac b/configure.ac
49 +index f2127def..33746d1e 100644
50 +--- a/configure.ac
51 ++++ b/configure.ac
52 +@@ -153,6 +153,27 @@ AS_IF([test "x$enable_simd" = "xyes"], [
53 + ])
54 +
55 +
56 ++AC_ARG_WITH([system_doctest],
57 ++ AS_HELP_STRING(
58 ++ [--with-system-doctest],
59 ++ [Use the system provided doctest library rather than the bundled one]
60 ++ ),
61 ++ [], []
62 ++)
63 ++
64 ++AS_IF([test "x$with_system_doctest" = "xyes"], [
65 ++ AC_CHECK_HEADERS(doctest/doctest.h)
66 ++ AS_IF([test "x$ac_cv_header_doctest_doctest_h" != "xyes"], [
67 ++ AC_MSG_ERROR([system doctest not found])dnl
68 ++ ])
69 ++ AC_DEFINE([DOCTEST_HEADER], ["doctest/doctest.h"], [doctest include path])
70 ++])
71 ++AS_IF([test "x$with_system_doctest" != "xyes"], [
72 ++ AC_DEFINE([DOCTEST_HEADER], ["doctest_vendored.hh"], [doctest include path])
73 ++ AS_VAR_SET(doctest_vendored_h, "doctest_vendored.hh")
74 ++ AC_SUBST(doctest_vendored_h)
75 ++])
76 ++
77 +
78 + LNAV_WITH_JEMALLOC
79 +
80 +diff --git a/src/Makefile.am b/src/Makefile.am
81 +index 9be9168e..8dc0cd94 100644
82 +--- a/src/Makefile.am
83 ++++ b/src/Makefile.am
84 +@@ -151,6 +151,9 @@ dist_noinst_DATA = \
85 + $(FORMAT_FILES) \
86 + xterm-palette.json
87 +
88 ++EXTRA_HEADERS = \
89 ++ doctest_vendored.hh
90 ++
91 + noinst_HEADERS = \
92 + all_logs_vtab.hh \
93 + ansi_scrubber.hh \
94 +@@ -174,6 +177,7 @@ noinst_HEADERS = \
95 + db_sub_source.hh \
96 + doc_status_source.hh \
97 + doctest.hh \
98 ++ $(doctest_vendored_h) \
99 + elem_to_json.hh \
100 + environ_vtab.hh \
101 + field_overlay_source.hh \
102
103 diff --git a/app-admin/lnav/lnav-0.10.0-r2.ebuild b/app-admin/lnav/lnav-0.10.0-r2.ebuild
104 new file mode 100644
105 index 00000000000..e3da36aee5c
106 --- /dev/null
107 +++ b/app-admin/lnav/lnav-0.10.0-r2.ebuild
108 @@ -0,0 +1,62 @@
109 +# Copyright 1999-2021 Gentoo Authors
110 +# Distributed under the terms of the GNU General Public License v2
111 +
112 +EAPI=7
113 +
114 +inherit autotools
115 +
116 +DESCRIPTION="A curses-based tool for viewing and analyzing log files"
117 +HOMEPAGE="https://lnav.org"
118 +SRC_URI="https://github.com/tstack/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
119 +
120 +LICENSE="BSD-2"
121 +SLOT="0"
122 +KEYWORDS="~amd64 ~x86"
123 +IUSE="unicode test"
124 +RESTRICT="!test? ( test )"
125 +
126 +RDEPEND="
127 + app-arch/bzip2:0=
128 + app-arch/libarchive:=
129 + test? ( dev-cpp/doctest )
130 + >=dev-db/sqlite-3.9.0
131 + dev-libs/libpcre[cxx]
132 + >=net-misc/curl-7.23.0
133 + sys-libs/ncurses:=[unicode(+)?]
134 + sys-libs/readline:0=
135 + sys-libs/zlib:0="
136 +DEPEND="${RDEPEND}"
137 +
138 +DOCS=( AUTHORS NEWS README )
139 +PATCHES=(
140 + "${FILESDIR}"/${PN}-0.10.0-disable-tests.patch
141 + "${FILESDIR}"/${PN}-0.10.0-disable-remote-tests.patch
142 + # This allows us to use the --with-system-doctest configure flag, and should not be needed in
143 + # the next release of lnav. See https://github.com/tstack/lnav/pull/915
144 + # This patch isn't completely identical to the one in PR #915 because that patch was too large
145 + # for repoman's tastes. See the comment in src_prepare() for how I applied the rest of this
146 + # patch with rm and a heredoc.
147 + # https://bugs.gentoo.org/812353
148 + "${FILESDIR}"/${PN}-0.10.0-use-system-doctest.patch
149 +)
150 +
151 +src_prepare() {
152 + # repoman didn't like having a ~500 kiB patch file, so I'm just manually removing the doctest we
153 + # don't want (the bundled one) and putting the one we do want here.
154 + # We won't need this once we get rid of lnav-0.10.0-use-system-doctest.patch
155 + cat <<EOF > src/doctest.hh
156 +#include "config.h"
157 +#include DOCTEST_HEADER
158 +EOF
159 + # We won't need this once we get rid of lnav-0.10.0-use-system-doctest.patch
160 + touch src/doctest_vendored.hh
161 + default
162 + eautoreconf
163 +}
164 +
165 +src_configure() {
166 + econf \
167 + --disable-static \
168 + $(use_with test system-doctest) \
169 + $(use_with unicode ncursesw)
170 +}