Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/libtrace/files/, net-libs/libtrace/
Date: Tue, 08 Feb 2022 05:43:32
Message-Id: 1644298939.2ded35bffa1a01d8bc96328701814aa8566d9507.sam@gentoo
1 commit: 2ded35bffa1a01d8bc96328701814aa8566d9507
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 8 05:30:07 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 8 05:42:19 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2ded35bf
7
8 net-libs/libtrace: add 4.0.18_p1
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 net-libs/libtrace/Manifest | 1 +
13 .../files/libtrace-4.0.18_p1-build-system.patch | 133 +++++++++++++++++++++
14 net-libs/libtrace/libtrace-4.0.18_p1.ebuild | 70 +++++++++++
15 3 files changed, 204 insertions(+)
16
17 diff --git a/net-libs/libtrace/Manifest b/net-libs/libtrace/Manifest
18 index 53a961ba3b97..b1de7ff5ca58 100644
19 --- a/net-libs/libtrace/Manifest
20 +++ b/net-libs/libtrace/Manifest
21 @@ -1,2 +1,3 @@
22 DIST libtrace-4.0.15_p1.tar.gz 1891845 BLAKE2B 08faf395f5fdda21829b89a9276649b297d2266ef10d2162b588b39d4d8d2da1306c74bb180d63b92f4422bb157fb451d34cd8167f0bff42322776e3b1ee0e7c SHA512 82f18b03e824f3ac89330854c3659244106ab5323f5e7a43ec7d2280f6ad3d427a906708688469b3f5aa479d11fef99a4bbecea585b81c916029132375582a4e
23 DIST libtrace-4.0.17_p1.tar.gz 1961123 BLAKE2B be961bc58496414415b9affb0a6b77e5f234b92196fb719f3a2e8058ae80ade90977c44d57c75d37cbf26ff2e0c8816a4b376b77b6e44d13833960c6095b7e2c SHA512 85280edd515acf52361c34ebe5324fd95f4fafc72aa22c2c8bd43a6bca9a6b5fc9a046480fc760bb39d8b577532ed416caf10a630cea9465d305f2ed4dcb318e
24 +DIST libtrace-4.0.18_p1.tar.gz 1963425 BLAKE2B fdacd4a44f899dc49fe9571d8e695cd726ea07d1c0595bd7c1f59d53721bd5610126924323c9c7098caf65276219e61265e5e05f23b4a92ae6377268c618202f SHA512 fc2979fa56b0eee25149a3571d0a06e2a46ab6d6fa419b2fc37635ebcf4a8814250005c4dfc5dddb5fb6aa9c74161ab4f475a037e021388054bb62f414b9c5d2
25
26 diff --git a/net-libs/libtrace/files/libtrace-4.0.18_p1-build-system.patch b/net-libs/libtrace/files/libtrace-4.0.18_p1-build-system.patch
27 new file mode 100644
28 index 000000000000..b536302c30b9
29 --- /dev/null
30 +++ b/net-libs/libtrace/files/libtrace-4.0.18_p1-build-system.patch
31 @@ -0,0 +1,133 @@
32 +https://github.com/LibtraceTeam/libtrace/pull/201
33 +
34 +From dde6c39e5808f06f1450b03e7c682edb0f1290cf Mon Sep 17 00:00:00 2001
35 +From: Sam James <sam@g.o>
36 +Date: Tue, 8 Feb 2022 05:30:32 +0000
37 +Subject: [PATCH 1/3] build: fix bashism in configure
38 +
39 +configures have a shebang of #!/bin/sh so need to work with a POSIX-compliant
40 +shell; let's use = instead of == which will have the same effect on both Bash
41 +and said shells (like dash).
42 +
43 +Signed-off-by: Sam James <sam@g.o>
44 +---
45 + configure.in | 2 +-
46 + 1 file changed, 1 insertion(+), 1 deletion(-)
47 +
48 +diff --git a/configure.in b/configure.in
49 +index 95d63fdc..dbbaabb7 100644
50 +--- a/configure.in
51 ++++ b/configure.in
52 +@@ -305,7 +305,7 @@ AC_ARG_WITH(xdp, AS_HELP_STRING(--with-xdp, include XDP capture support),
53 +
54 + if test "$want_xdp" != no; then
55 + AC_CHECK_LIB(elf, elf_begin, elffound=1, elffound=0)
56 +- if test "$elffound" == 1; then
57 ++ if test "$elffound" = 1; then
58 + # check for libbpf
59 + AC_CHECK_LIB(bpf, xsk_socket__create, bpffound=1, bpffound=0, -lelf)
60 +
61 +
62 +From 1525a42b386da02bda3982cf6e8b472f57f8ac34 Mon Sep 17 00:00:00 2001
63 +From: Sam James <sam@g.o>
64 +Date: Tue, 8 Feb 2022 05:32:59 +0000
65 +Subject: [PATCH 2/3] build: make NUMA support optional
66 +
67 +This avoids an 'automagic dependency' [0] on NUMA. This is helpful for
68 +downstreams to ensure we don't miss dependencies or when we may not
69 +want to enable support for a feature even though a dependency is enabled.
70 +
71 +Gentoo has shipped this patch for quite some time.
72 +
73 +[0] https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Automagic_dependencies
74 +
75 +Signed-off-by: Sam James <sam@g.o>
76 +---
77 + configure.in | 18 +++++++++++++++++-
78 + 1 file changed, 17 insertions(+), 1 deletion(-)
79 +
80 +diff --git a/configure.in b/configure.in
81 +index dbbaabb7..6fbff150 100644
82 +--- a/configure.in
83 ++++ b/configure.in
84 +@@ -518,7 +518,23 @@ AC_CHECK_DECL([PACKET_FANOUT],
85 + [[#include <linux/if_packet.h>]])
86 +
87 + # If we use DPDK we might be able to use libnuma
88 +-AC_CHECK_LIB(numa, numa_node_to_cpus, have_numa=1, have_numa=0)
89 ++AC_ARG_WITH(numa,
90 ++ AS_HELP_STRING(--with-numa,include NUMA support),
91 ++[
92 ++ if test "$withval" = no
93 ++ then
94 ++ want_numa=no
95 ++ else
96 ++ want_numa=yes
97 ++ fi
98 ++],[
99 ++ # Default to building without NUMA
100 ++ want_numa=yes
101 ++])
102 ++
103 ++if test "$want_numa" != no; then
104 ++ AC_CHECK_LIB(numa, numa_node_to_cpus, have_numa=1, have_numa=0)
105 ++fi
106 +
107 + # Need libwandder for ETSI live decoding
108 + AC_CHECK_LIB(wandder, init_wandder_decoder, have_wandder=1, have_wandder=0)
109 +
110 +From 153254413ae3cd6a62ee7d8b5eae189e84ebc066 Mon Sep 17 00:00:00 2001
111 +From: Sam James <sam@g.o>
112 +Date: Tue, 8 Feb 2022 05:34:05 +0000
113 +Subject: [PATCH 3/3] build: use pkg-config to find ncurses
114 +
115 +ncurses can be built in a variety of configurations, but the motivating case
116 +for Gentoo was "split tinfo" where libtinfo is no longer included within
117 +libncurses.
118 +
119 +Use pkg-config to find where ncurses is installed and the required libraries
120 +needed to link against it (which will include -ltinfo if required).
121 +
122 +We've been shipping this patch in Gentoo for quite some time.
123 +
124 +Signed-off-by: Sam James <sam@g.o>
125 +---
126 + configure.in | 4 ++++
127 + tools/tracetop/Makefile.am | 2 +-
128 + 2 files changed, 5 insertions(+), 1 deletion(-)
129 +
130 +diff --git a/configure.in b/configure.in
131 +index 6fbff150..cbb94d55 100644
132 +--- a/configure.in
133 ++++ b/configure.in
134 +@@ -79,6 +79,8 @@ AC_PROG_INSTALL
135 + AC_CHECK_PROGS(YACC, 'bison -y' byacc yacc)
136 + AM_PROG_LEX
137 +
138 ++PKG_PROG_PKG_CONFIG
139 ++
140 + # All our source files for function replacements are in lib/
141 + AC_CONFIG_LIBOBJ_DIR(lib)
142 +
143 +@@ -916,6 +918,8 @@ if (test "$use_llvm" != "no"); then
144 + fi
145 + fi
146 +
147 ++PKG_CHECK_MODULES(ncurses,ncurses,have_ncurses=yes,have_ncurses=no)
148 ++
149 + AC_ARG_WITH([ncurses],
150 + AC_HELP_STRING([--with-ncurses], [build tracetop (requires ncurses)]))
151 +
152 +diff --git a/tools/tracetop/Makefile.am b/tools/tracetop/Makefile.am
153 +index 2ebbc3a7..a2eb2797 100644
154 +--- a/tools/tracetop/Makefile.am
155 ++++ b/tools/tracetop/Makefile.am
156 +@@ -6,6 +6,6 @@ bin_PROGRAMS = tracetop
157 + include ../Makefile.tools
158 +
159 + tracetop_SOURCES = tracetop.cc
160 +-tracetop_LDADD = -lncurses
161 ++tracetop_LDADD = @ncurses_LIBS@
162 + tracetop_CPPFLAGS = -fno-strict-aliasing $(AM_CFLAGS)
163 + endif
164 +
165
166 diff --git a/net-libs/libtrace/libtrace-4.0.18_p1.ebuild b/net-libs/libtrace/libtrace-4.0.18_p1.ebuild
167 new file mode 100644
168 index 000000000000..b43bb405d524
169 --- /dev/null
170 +++ b/net-libs/libtrace/libtrace-4.0.18_p1.ebuild
171 @@ -0,0 +1,70 @@
172 +# Copyright 1999-2022 Gentoo Authors
173 +# Distributed under the terms of the GNU General Public License v2
174 +
175 +EAPI=8
176 +
177 +inherit autotools
178 +
179 +DESCRIPTION="A library and tools for trace processing"
180 +HOMEPAGE="https://research.wand.net.nz/software/libtrace.php"
181 +SRC_URI="https://github.com/${PN^}Team/${PN}/archive//${PV/_p/-}.tar.gz -> ${P}.tar.gz"
182 +S="${WORKDIR}/${P/_p/-}"
183 +
184 +LICENSE="LGPL-3"
185 +SLOT="0"
186 +KEYWORDS="~amd64 ~x86"
187 +# doxygen is always needed for man pages, but USE=doc controls installing docs themselves
188 +# (not man pages)
189 +IUSE="doc ncurses numa"
190 +
191 +RDEPEND=">=net-libs/libpcap-0.8
192 + dev-libs/libyaml
193 + dev-libs/openssl:=
194 + net-libs/wandio
195 + ncurses? ( sys-libs/ncurses:= )
196 + numa? ( sys-process/numactl )"
197 +DEPEND="${RDEPEND}"
198 +BDEPEND="app-doc/doxygen[dot]
199 + sys-devel/flex
200 + virtual/os-headers
201 + virtual/pkgconfig
202 + virtual/yacc"
203 +
204 +PATCHES=(
205 + "${FILESDIR}"/${PN}-4.0.18_p1-build-system.patch
206 +)
207 +
208 +src_prepare() {
209 + default
210 +
211 + mv configure.{in,ac} || die
212 +
213 + eautoreconf
214 +
215 + # Comment out FILE_PATTERNS definition (bug #706230)
216 + if has_version ~app-doc/doxygen-1.8.16; then
217 + sed -i -e '/^FILE_PATTERNS/s|^|#|g' docs/${PN}.doxygen.in || die
218 + fi
219 +
220 + # Update doxygen configuration
221 + doxygen -u docs/libtrace.doxygen.in || die
222 +}
223 +
224 +src_configure() {
225 + econf \
226 + $(use_with ncurses) \
227 + $(use_with numa) \
228 + --with-man \
229 + --without-dpdk
230 +}
231 +
232 +src_install() {
233 + default
234 +
235 + if use doc ; then
236 + docinto html
237 + dodoc -r docs/doxygen/html
238 + fi
239 +
240 + find "${ED}" -name "*.la" -delete || die
241 +}