sys-process/tiptop: fix build for clang16

- new upstream website

Closes: https://bugs.gentoo.org/884361

Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
Closes: https://github.com/gentoo/gentoo/pull/28644
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Pascal Jäger
2022-12-11 23:33:55 +01:00
committed by Sam James
parent 32a2ca20d1
commit 4ecc97f4be
5 changed files with 124 additions and 0 deletions

View File

@@ -1,2 +1,3 @@
DIST tiptop-2.3.1.tar.gz 100993 BLAKE2B fd05d9d59fda2e81c194dedabb7d9d94220e790a8118048ebc3edd84706471a8892a918e02ebc7436c3c75e7a98c5c3ab98e11d614ced304ac81fdf8ce1951ed SHA512 73d275bc3957583524c872b401cf4fa773de7b4e7b7177f1787851f43e7c4aeefd953eb50b2dbce3babfc7a1c46707370ba4ad06998260177994b2eafb91395b
DIST tiptop-2.3.1_p4_p20221211.tar.gz 931179 BLAKE2B bc9bccf2c8146c60200304975cb900b455c5f2c0c410ff010fc785709ed468fe3c01b8ac8f4809a1f067cc67fb7a5a6d33739de1b650f447ebe90a9b21a032ee SHA512 c848513a1ccd8c367aa1edd91cfe6f27245710d6b32ff6e1f81a6694c8e21cb41d53e0bc00a18eadf0877600fa29b1defbd0db6165591a8d34887d11ca1af7f2
DIST tiptop_2.3.1-4.debian.tar.xz 3716 BLAKE2B 14e5192888b99681f8114fd9abcafb4c2fc00b1923560ea93ba4c714dc1164731cdf16d42d73946413f743fe48b6d27151804f5f6e65cab7afa8834f54c683e1 SHA512 45d34abc16327bc443387c941c0477b2c491510c7cda1da8a7f7a704c8b891ef07c96122be46c501e55e471df5bcfd50919f586a67d8b91b764d3bdefa599872

View File

@@ -0,0 +1,46 @@
Subject: [PATCH] advice user to run as root when paranoid_level==3
Corresponds with Debian patch 0003_Report_root_needed
https://sources.debian.org/patches/tiptop/2.3.1-4/0003-Report_root_needed.patch/
Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
--- a/src/requisite.c
+++ b/src/requisite.c
@@ -17,13 +17,34 @@
#include "pmc.h"
#include "requisite.h"
+#define PARANOID1 "/proc/sys/kernel/perf_counter_paranoid"
+#define PARANOID2 "/proc/sys/kernel/perf_event_paranoid"
void check()
{
int fd, cpu, grp, flags, pid;
+ FILE* paranoid;
+ int paranoia_level = 999;
struct utsname os;
struct STRUCT_NAME events = {0, };
+ int n;
+ paranoid = fopen(PARANOID1, "r");
+ if (!paranoid)
+ paranoid = fopen(PARANOID2, "r");
+
+ if (!paranoid) {
+ fprintf(stderr, "System does not support performance events.\n");
+ fprintf(stderr, "File '/proc/sys/kernel/perf_*_paranoid' is missing.\n");
+ exit(EXIT_FAILURE);
+ }
+ n = fscanf(paranoid, "%d", &paranoia_level);
+ if (n != 1) {
+ fprintf(stderr, "Could not read '/proc/sys/kernel/perf_*_paranoid'.\n");
+ fprintf(stderr, "Trying to proceed anyway...\n");
+ }
+
+ fclose(paranoid);
events.disabled = 0;
events.exclude_hv = 1;
events.exclude_kernel = 1;
--
2.38.1

View File

@@ -0,0 +1,35 @@
Date: Sun, 11 Dec 2022 22:11:42 +0100
Subject: [PATCH] Fix build for sys-devel/reflex
When LEX=reflex is used, this compiling calc.lex fails with a
implicit function declaration error when
Werror=implicit-function-declaration. (Like with clang16)
Bug: https://bugs.gentoo.org/884361
PR to upstream this: https://github.com/FeCastle/tiptop/pull/9
Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
Clang16 will not allow implicit function declarations by default
--- a/src/calc.lex
+++ b/src/calc.lex
@@ -11,6 +11,7 @@
%{
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include "formula-parser.h"
#include "y.tab.h"
--- a/src/process.h
+++ b/src/process.h
@@ -95,4 +95,6 @@ void reset_values(const struct process_list* const);
void update_name_cmdline(int pid, int name_only);
+void handle_error(int retval);
+
#endif /* _PROCESS_H */
--
2.38.1

View File

@@ -2,4 +2,7 @@
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<!-- maintainer-needed -->
<upstream>
<remote-id type="github">FeCastle/tiptop</remote-id>
</upstream>
</pkgmetadata>

View File

@@ -0,0 +1,39 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit autotools
GIT_COMMIT="529886d445ec32febad14246245372a8f244b3eb"
DESCRIPTION="top for performance counters"
HOMEPAGE="https://github.com/FeCastle/tiptop"
SRC_URI="https://github.com/FeCastle/tiptop/archive/${GIT_COMMIT}.tar.gz -> ${P}.tar.gz"
SRC_URI+=" http://deb.debian.org/debian/pool/main/t/tiptop/tiptop_$(ver_cut 1-3)-$(ver_cut 5).debian.tar.xz"
S="${WORKDIR}/${PN}-${GIT_COMMIT}"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
RDEPEND="
dev-libs/libxml2:2
dev-libs/papi
sys-libs/ncurses:=
"
DEPEND="${RDEPEND}"
# drop when patch$ tiptop-2.3.1-implicit-function-declaration.patch is merged upstream
BDEPEND="app-alternatives/lex"
PATCHES=(
"${WORKDIR}"/debian/patches
"${FILESDIR}"/${PN}-2.3.1-tinfo.patch #618124
"${FILESDIR}"/${PN}-2.3.1-advise-user-to-run-as-root-when-paranoid_level-3.patch
"${FILESDIR}"/${PN}-2.3.1-implicit-function-declaration.patch
)
src_prepare() {
default
eautoreconf #618124
}