Gentoo Archives: gentoo-commits

From: Conrad Kostecki <conikost@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/qdirstat/, sys-apps/qdirstat/files/
Date: Wed, 09 Feb 2022 12:36:54
Message-Id: 1644410078.1d4d614e35253dfa2d748e5386d4040da9ecc0fd.conikost@gentoo
1 commit: 1d4d614e35253dfa2d748e5386d4040da9ecc0fd
2 Author: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 9 12:34:38 2022 +0000
4 Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 9 12:34:38 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d4d614e
7
8 sys-apps/qdirstat: fix build with musl
9
10 Closes: https://bugs.gentoo.org/832904
11 Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>
12
13 sys-apps/qdirstat/files/qdirstat-1.8-musl.patch | 102 ++++++++++++++++++++++++
14 sys-apps/qdirstat/qdirstat-1.8.ebuild | 4 +-
15 2 files changed, 105 insertions(+), 1 deletion(-)
16
17 diff --git a/sys-apps/qdirstat/files/qdirstat-1.8-musl.patch b/sys-apps/qdirstat/files/qdirstat-1.8-musl.patch
18 new file mode 100644
19 index 000000000000..e730352a8040
20 --- /dev/null
21 +++ b/sys-apps/qdirstat/files/qdirstat-1.8-musl.patch
22 @@ -0,0 +1,102 @@
23 +From ca2c6c4a0a90ed467af9c4c73b918dd4bf720f2a Mon Sep 17 00:00:00 2001
24 +From: Stefan Hundhammer <Stefan.Hundhammer@×××.de>
25 +Date: Wed, 9 Feb 2022 11:05:31 +0100
26 +Subject: [PATCH] Fixed GitHub issue #187: ALLPERMS not defined in libc-musl
27 +
28 +---
29 + src/BrokenLibc.h | 45 +++++++++++++++++++++++++++++++++++++++++++++
30 + src/FileInfo.cpp | 1 +
31 + src/FormatUtil.cpp | 1 +
32 + src/src.pro | 3 ++-
33 + 4 files changed, 49 insertions(+), 1 deletion(-)
34 + create mode 100644 src/BrokenLibc.h
35 +
36 +diff --git a/src/BrokenLibc.h b/src/BrokenLibc.h
37 +new file mode 100644
38 +index 00000000..8bdf2a84
39 +--- /dev/null
40 ++++ b/src/BrokenLibc.h
41 +@@ -0,0 +1,45 @@
42 ++/*
43 ++ * File name: BrokenLibc.h
44 ++ * Summary: Substitutes for common system-level defines
45 ++ * License: GPL V2 - See file LICENSE for details.
46 ++ *
47 ++ * Author: Stefan Hundhammer <Stefan.Hundhammer@×××.de>
48 ++ */
49 ++
50 ++#ifndef BrokenLibc_h
51 ++#define BrokenLibc_h
52 ++
53 ++// This contains common #defines that are present on modern systems, but
54 ++// sometimes not on systems that insist to exchange known working subsystems
55 ++// such as glibc with their own version, commonly because of the "not invented
56 ++// here" syndrome.
57 ++
58 ++
59 ++// Make sure the original defines are available regardless of include order
60 ++
61 ++#include <sys/stat.h> // ALLPERMS
62 ++
63 ++
64 ++#ifndef ALLPERMS
65 ++# define ALLPERMS 07777
66 ++
67 ++// Uncomment for debugging:
68 ++// # warning "Using ALLPERMS replacement"
69 ++
70 ++// Not available in musl-libc used on Gentoo:
71 ++//
72 ++// https://github.com/shundhammer/qdirstat/issues/187
73 ++//
74 ++// Original from Linux / glibc /usr/include/x86_64-linux-gnu/sys/stat.h :
75 ++//
76 ++// #define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)/* 07777 */
77 ++//
78 ++// But that might induce more complaints because any of S_IRWXU, S_IRWXG
79 ++// etc. may also not be defined on such a system. So let's keep it simple.
80 ++// If they also use a different bit pattern for those permissions, that's their
81 ++// problem.
82 ++#endif
83 ++
84 ++
85 ++
86 ++#endif // BrokenLibc_h
87 +diff --git a/src/FileInfo.cpp b/src/FileInfo.cpp
88 +index 6be13a8d..d8195819 100644
89 +--- a/src/FileInfo.cpp
90 ++++ b/src/FileInfo.cpp
91 +@@ -26,6 +26,7 @@
92 + #include "SysUtil.h"
93 + #include "Logger.h"
94 + #include "Exception.h"
95 ++#include "BrokenLibc.h" // ALLPERMS
96 +
97 + // Some filesystems (NTFS seems to be among them) may handle block fragments
98 + // well. Don't report files as "sparse" files if the block size is only a few
99 +diff --git a/src/FormatUtil.cpp b/src/FormatUtil.cpp
100 +index 6c755d79..43ca9ec4 100644
101 +--- a/src/FormatUtil.cpp
102 ++++ b/src/FormatUtil.cpp
103 +@@ -11,6 +11,7 @@
104 + #include <QTextStream>
105 +
106 + #include "FormatUtil.h"
107 ++#include "BrokenLibc.h" // ALLPERMS
108 +
109 + using namespace QDirStat;
110 +
111 +diff --git a/src/src.pro b/src/src.pro
112 +index c9616462..50b51ca4 100644
113 +--- a/src/src.pro
114 ++++ b/src/src.pro
115 +@@ -157,7 +157,8 @@ HEADERS = \
116 + ActionManager.h \
117 + AdaptiveTimer.h \
118 + Attic.h \
119 +- BreadcrumbNavigator.h \
120 ++ BreadcrumbNavigator.h \
121 ++ BrokenLibc.h \
122 + BucketsTableModel.h \
123 + BusyPopup.h \
124 + Cleanup.h \
125
126 diff --git a/sys-apps/qdirstat/qdirstat-1.8.ebuild b/sys-apps/qdirstat/qdirstat-1.8.ebuild
127 index 64ab49423bd4..62fb4a2c928d 100644
128 --- a/sys-apps/qdirstat/qdirstat-1.8.ebuild
129 +++ b/sys-apps/qdirstat/qdirstat-1.8.ebuild
130 @@ -1,4 +1,4 @@
131 -# Copyright 1999-2021 Gentoo Authors
132 +# Copyright 1999-2022 Gentoo Authors
133 # Distributed under the terms of the GNU General Public License v2
134
135 EAPI=8
136 @@ -26,6 +26,8 @@ RDEPEND="
137 dev-perl/URI
138 "
139
140 +PATCHES=( "${FILESDIR}/${PN}-1.8-musl.patch" )
141 +
142 src_prepare() {
143 default