summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViolet Purcell <vimproved@inventati.org>2023-06-19 21:56:50 +0000
committerSam James <sam@gentoo.org>2023-06-25 08:22:07 +0100
commitc8f21b68cbb2af2738dbc972166f6b4bfa4e4494 (patch)
tree62910cdf8736b080895833bc6d5ad905b18345f1
parentmedia-sound/flac123: bump to 2.1.0, moved to github, dropped unused dep (diff)
downloadgentoo-c8f21b68cbb2af2738dbc972166f6b4bfa4e4494.tar.gz
gentoo-c8f21b68cbb2af2738dbc972166f6b4bfa4e4494.tar.bz2
gentoo-c8f21b68cbb2af2738dbc972166f6b4bfa4e4494.zip
sys-process/btop: Backport musl 1.2.4 fix
Closes: https://bugs.gentoo.org/908670 Signed-off-by: Violet Purcell <vimproved@inventati.org> Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r--sys-process/btop/btop-1.2.13-r2.ebuild67
-rw-r--r--sys-process/btop/files/btop-1.2.13-musl-1.2.4-lfs64.patch39
2 files changed, 106 insertions, 0 deletions
diff --git a/sys-process/btop/btop-1.2.13-r2.ebuild b/sys-process/btop/btop-1.2.13-r2.ebuild
new file mode 100644
index 000000000000..22dd41185a5b
--- /dev/null
+++ b/sys-process/btop/btop-1.2.13-r2.ebuild
@@ -0,0 +1,67 @@
+# Copyright 2021-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs xdg-utils
+
+DESCRIPTION="A monitor of resources"
+HOMEPAGE="https://github.com/aristocratos/btop"
+SRC_URI="https://github.com/aristocratos/btop/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~riscv ~x86"
+
+PATCHES=(
+ # Backported fixes for https://bugs.gentoo.org/884005,
+ # can be removed in 1.2.14 or later
+ "${FILESDIR}/${P}-fix-makefile-deps.patch"
+ "${FILESDIR}/${P}-verbose-mkdir.patch"
+
+ # Backported fix for https://bugs.gentoo.org/908670
+ # can be removed in 1.2.14 or later
+ "${FILESDIR}/${P}-musl-1.2.4-lfs64.patch"
+)
+
+pkg_setup() {
+ if [[ "${MERGE_TYPE}" != "binary" ]]; then
+ if tc-is-clang ; then
+ if [[ "$(clang-major-version)" -lt 16 ]]; then
+ die "sys-process/btop requires >=sys-devel/clang-16.0.0 to build."
+ fi
+ elif ! tc-is-gcc ; then
+ die "$(tc-getCXX) is not a supported compiler. Please use sys-devel/gcc or >=sys-devel/clang-16.0.0 instead."
+ fi
+ fi
+}
+
+src_prepare() {
+ default
+ # btop installs README.md to /usr/share/btop by default
+ sed -i '/^.*cp -p README.md.*$/d' Makefile || die
+}
+
+src_compile() {
+ # Disable btop optimization flags, since we have our flags in CXXFLAGS
+ emake VERBOSE=true OPTFLAGS="" CXX="$(tc-getCXX)"
+}
+
+src_install() {
+ emake \
+ PREFIX="${EPREFIX}/usr" \
+ DESTDIR="${D}" \
+ install
+
+ dodoc README.md CHANGELOG.md
+}
+
+pkg_postinst() {
+ xdg_desktop_database_update
+ xdg_icon_cache_update
+}
+
+pkg_postrm() {
+ xdg_desktop_database_update
+ xdg_icon_cache_update
+}
diff --git a/sys-process/btop/files/btop-1.2.13-musl-1.2.4-lfs64.patch b/sys-process/btop/files/btop-1.2.13-musl-1.2.4-lfs64.patch
new file mode 100644
index 000000000000..e91fa7d7de9c
--- /dev/null
+++ b/sys-process/btop/files/btop-1.2.13-musl-1.2.4-lfs64.patch
@@ -0,0 +1,39 @@
+Fix for building on musl 1.2.4 and above due to deprecation of LFS64 interfaces.
+
+Bug: https://bugs.gentoo.org/908670
+Upstream Commit: https://github.com/aristocratos/btop/commit/7e50b03e391a346b2b6ce92be332c58d91f75a000w
+
+With hunks from:
+From af7d5086fce8d995f3f8b10677d107a1124a12bf Mon Sep 17 00:00:00 2001
+From: "Jakob P. Liljenberg" <admin@qvantnet.com>
+Date: Thu, 15 Jun 2023 17:45:05 +0200
+Subject: [PATCH] Merge pull request #510 from nobounce/LLVM
+--- a/src/linux/btop_collect.cpp
++++ b/src/linux/btop_collect.cpp
+@@ -1079,9 +1079,9 @@ namespace Mem {
+ bool new_ignored = false;
+ for (auto& [mountpoint, disk] : disks) {
+ if (std::error_code ec; not fs::exists(mountpoint, ec) or v_contains(ignore_list, mountpoint)) continue;
+- struct statvfs64 vfs;
+- if (statvfs64(mountpoint.c_str(), &vfs) < 0) {
+- Logger::warning("Failed to get disk/partition stats for mount \""+ mountpoint + "\" with statvfs64 error code: " + to_string(errno) + ". Ignoring...");
++ struct statvfs vfs;
++ if (statvfs(mountpoint.c_str(), &vfs) < 0) {
++ Logger::warning("Failed to get disk/partition stats for mount \""+ mountpoint + "\" with statvfs error code: " + to_string(errno) + ". Ignoring...");
+ ignore_list.push_back(mountpoint);
+ new_ignored = true;
+ continue;
+--- a/Makefile
++++ b/Makefile
+@@ -130,8 +156,8 @@ override GOODFLAGS := $(foreach flag,$(TESTFLAGS),$(strip $(shell echo "int main
+ #? Flags, Libraries and Includes
+ override REQFLAGS := -std=c++20
+ WARNFLAGS := -Wall -Wextra -pedantic
+ OPTFLAGS := -O2 -ftree-loop-vectorize -flto=$(THREADS)
+-LDCXXFLAGS := -pthread -D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS $(GOODFLAGS) $(ADDFLAGS)
++LDCXXFLAGS := -pthread -D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS -D_FILE_OFFSET_BITS=64 $(GOODFLAGS) $(ADDFLAGS)
+ override CXXFLAGS += $(REQFLAGS) $(LDCXXFLAGS) $(OPTFLAGS) $(WARNFLAGS)
+ override LDFLAGS += $(LDCXXFLAGS) $(OPTFLAGS) $(WARNFLAGS)
+ INC := -I$(INCDIR) -I$(SRCDIR)
+--
+2.41.0