1 |
commit: 61a59bd4bd8f1bc7dd41dc0bff153c866d9ddb53 |
2 |
Author: Viorel Munteanu <ceamac.paragon <AT> gmail <DOT> com> |
3 |
AuthorDate: Tue Feb 8 05:07:31 2022 +0000 |
4 |
Commit: Viorel Munteanu <ceamac.paragon <AT> gmail <DOT> com> |
5 |
CommitDate: Tue Feb 8 05:07:31 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=61a59bd4 |
7 |
|
8 |
app-misc/fastfetch: fix automagical deps |
9 |
|
10 |
Patch the build system instead of sedding out checks |
11 |
|
12 |
Signed-off-by: Viorel Munteanu <ceamac.paragon <AT> gmail.com> |
13 |
|
14 |
...fetch-9999.ebuild => fastfetch-0.569-r1.ebuild} | 36 ++-- |
15 |
app-misc/fastfetch/fastfetch-9999.ebuild | 31 ++-- |
16 |
.../fastfetch-0.569-cmake-optional-deps.patch | 199 +++++++++++++++++++++ |
17 |
3 files changed, 232 insertions(+), 34 deletions(-) |
18 |
|
19 |
diff --git a/app-misc/fastfetch/fastfetch-9999.ebuild b/app-misc/fastfetch/fastfetch-0.569-r1.ebuild |
20 |
similarity index 72% |
21 |
copy from app-misc/fastfetch/fastfetch-9999.ebuild |
22 |
copy to app-misc/fastfetch/fastfetch-0.569-r1.ebuild |
23 |
index e93f5cf46..ce926d740 100644 |
24 |
--- a/app-misc/fastfetch/fastfetch-9999.ebuild |
25 |
+++ b/app-misc/fastfetch/fastfetch-0.569-r1.ebuild |
26 |
@@ -11,14 +11,15 @@ if [[ ${PV} == *9999 ]]; then |
27 |
inherit git-r3 |
28 |
EGIT_REPO_URI="https://github.com/LinusDierheimer/fastfetch.git" |
29 |
else |
30 |
- COMMIT="f72ec8a99f6021e95abce282668cce99fabd28c5" |
31 |
- VERSION_REV="f72ec8a" |
32 |
+ COMMIT="7ad73d3ba13489b341a07782e6374d92c54091ba" |
33 |
+ VERSION_REV="7ad73d3" |
34 |
SRC_URI="https://github.com/LinusDierheimer/fastfetch/archive/${COMMIT}.tar.gz -> ${P}.tar.gz" |
35 |
S="${WORKDIR}/${PN}-${COMMIT}" |
36 |
fi |
37 |
|
38 |
LICENSE="MIT" |
39 |
SLOT="0" |
40 |
+KEYWORDS="~amd64" |
41 |
IUSE="X gnome pci vulkan wayland xcb xfce xrandr" |
42 |
|
43 |
# note - qa-vdb will always report errors because fastfetch loads the libs dynamically |
44 |
@@ -40,24 +41,23 @@ BDEPEND="virtual/pkgconfig" |
45 |
|
46 |
REQUIRED_USE="xrandr? ( X )" |
47 |
|
48 |
-# disable_check VAR lib |
49 |
-disable_check() { |
50 |
- sed -i -e " |
51 |
- /pkg_check_modules ($1 /d |
52 |
- /message.*$2/d" CMakeLists.txt || die "Cannot disable $1" |
53 |
-} |
54 |
+PATCHES=( |
55 |
+ "${FILESDIR}/fastfetch-0.569-cmake-optional-deps.patch" |
56 |
+) |
57 |
|
58 |
src_configure() { |
59 |
- disable_check RPM librpm |
60 |
- |
61 |
- use X || disable_check X11 x11 |
62 |
- use gnome || (disable_check GIO gio- && disable_check DCONF dconf) |
63 |
- use pci || disable_check LIBPCI libpci |
64 |
- use vulkan || disable_check VULKAN vulkan |
65 |
- use wayland || disable_check WAYLAND wayland-client |
66 |
- use xcb || (disable_check XCB_RANDR xcb-randr && disable_check XCB xcb) |
67 |
- use xfce || disable_check XFCONF libxfconf |
68 |
- use xrandr || disable_check XRANDR xrandr |
69 |
+ local mycmakeargs=( |
70 |
+ -DENABLE_RPM=no |
71 |
+ -DENABLE_VULKAN=$(usex vulkan) |
72 |
+ -DENABLE_WAYLAND=$(usex wayland) |
73 |
+ -DENABLE_XCB_RANDR=$(usex xcb) |
74 |
+ -DENABLE_XCB=$(usex xcb) |
75 |
+ -DENABLE_XRANDR=$(usex xrandr) |
76 |
+ -DENABLE_X11=$(usex X) |
77 |
+ -DENABLE_GIO=$(usex gnome) |
78 |
+ -DENABLE_DCONF=$(usex gnome) |
79 |
+ -DENABLE_XFCONF=$(usex xfce) |
80 |
+ ) |
81 |
|
82 |
if [[ ${PV} != *9999 ]]; then |
83 |
# version comes from git, fake it |
84 |
|
85 |
diff --git a/app-misc/fastfetch/fastfetch-9999.ebuild b/app-misc/fastfetch/fastfetch-9999.ebuild |
86 |
index e93f5cf46..4c5668f4e 100644 |
87 |
--- a/app-misc/fastfetch/fastfetch-9999.ebuild |
88 |
+++ b/app-misc/fastfetch/fastfetch-9999.ebuild |
89 |
@@ -40,24 +40,23 @@ BDEPEND="virtual/pkgconfig" |
90 |
|
91 |
REQUIRED_USE="xrandr? ( X )" |
92 |
|
93 |
-# disable_check VAR lib |
94 |
-disable_check() { |
95 |
- sed -i -e " |
96 |
- /pkg_check_modules ($1 /d |
97 |
- /message.*$2/d" CMakeLists.txt || die "Cannot disable $1" |
98 |
-} |
99 |
+PATCHES=( |
100 |
+ "${FILESDIR}/fastfetch-0.569-cmake-optional-deps.patch" |
101 |
+) |
102 |
|
103 |
src_configure() { |
104 |
- disable_check RPM librpm |
105 |
- |
106 |
- use X || disable_check X11 x11 |
107 |
- use gnome || (disable_check GIO gio- && disable_check DCONF dconf) |
108 |
- use pci || disable_check LIBPCI libpci |
109 |
- use vulkan || disable_check VULKAN vulkan |
110 |
- use wayland || disable_check WAYLAND wayland-client |
111 |
- use xcb || (disable_check XCB_RANDR xcb-randr && disable_check XCB xcb) |
112 |
- use xfce || disable_check XFCONF libxfconf |
113 |
- use xrandr || disable_check XRANDR xrandr |
114 |
+ local mycmakeargs=( |
115 |
+ -DENABLE_RPM=no |
116 |
+ -DENABLE_VULKAN=$(usex vulkan) |
117 |
+ -DENABLE_WAYLAND=$(usex wayland) |
118 |
+ -DENABLE_XCB_RANDR=$(usex xcb) |
119 |
+ -DENABLE_XCB=$(usex xcb) |
120 |
+ -DENABLE_XRANDR=$(usex xrandr) |
121 |
+ -DENABLE_X11=$(usex X) |
122 |
+ -DENABLE_GIO=$(usex gnome) |
123 |
+ -DENABLE_DCONF=$(usex gnome) |
124 |
+ -DENABLE_XFCONF=$(usex xfce) |
125 |
+ ) |
126 |
|
127 |
if [[ ${PV} != *9999 ]]; then |
128 |
# version comes from git, fake it |
129 |
|
130 |
diff --git a/app-misc/fastfetch/files/fastfetch-0.569-cmake-optional-deps.patch b/app-misc/fastfetch/files/fastfetch-0.569-cmake-optional-deps.patch |
131 |
new file mode 100644 |
132 |
index 000000000..617b6c6e9 |
133 |
--- /dev/null |
134 |
+++ b/app-misc/fastfetch/files/fastfetch-0.569-cmake-optional-deps.patch |
135 |
@@ -0,0 +1,199 @@ |
136 |
+Add options to disable automagical dependencies |
137 |
+ |
138 |
+diff --git a/CMakeLists.txt b/CMakeLists.txt |
139 |
+index 0915750..05ca503 100644 |
140 |
+--- a/CMakeLists.txt |
141 |
++++ b/CMakeLists.txt |
142 |
+@@ -48,82 +48,116 @@ find_package(Threads REQUIRED) |
143 |
+ |
144 |
+ find_package(PkgConfig REQUIRED) |
145 |
+ |
146 |
+-pkg_check_modules (LIBPCI libpci) |
147 |
+-if(LIBPCI_FOUND) |
148 |
+- add_compile_definitions(FF_HAVE_LIBPCI=1) |
149 |
+-else(LIBPCI_FOUND) |
150 |
+- message(WARNING "Package libpci not found. Building without support.") |
151 |
+-endif(LIBPCI_FOUND) |
152 |
+- |
153 |
+-pkg_check_modules (VULKAN vulkan) |
154 |
+-if(VULKAN_FOUND) |
155 |
+- add_compile_definitions(FF_HAVE_VULKAN=1) |
156 |
+-else(VULKAN_FOUND) |
157 |
+- message(WARNING "Package vulkan not found. Building without support.") |
158 |
+-endif(VULKAN_FOUND) |
159 |
+- |
160 |
+-pkg_check_modules (WAYLAND wayland-client) |
161 |
+-if(WAYLAND_FOUND) |
162 |
+- add_compile_definitions(FF_HAVE_WAYLAND=1) |
163 |
+-else(WAYLAND_FOUND) |
164 |
+- message(WARNING "Package wayland-client not found. Building without support.") |
165 |
+-endif(WAYLAND_FOUND) |
166 |
+- |
167 |
+-pkg_check_modules (XCB_RANDR xcb-randr) |
168 |
+-if(XCB_RANDR_FOUND) |
169 |
+- add_compile_definitions(FF_HAVE_XCB_RANDR=1) |
170 |
+-else(XCB_RANDR_FOUND) |
171 |
+- message(WARNING "Package xcb-randr not found. Building without support.") |
172 |
+-endif(XCB_RANDR_FOUND) |
173 |
+- |
174 |
+-pkg_check_modules (XCB xcb) |
175 |
+-if(XCB_FOUND) |
176 |
+- add_compile_definitions(FF_HAVE_XCB=1) |
177 |
+-else(XCB_FOUND) |
178 |
+- message(WARNING "Package xcb not found. Building without support.") |
179 |
+-endif(XCB_FOUND) |
180 |
+- |
181 |
+-pkg_check_modules (XRANDR xrandr) |
182 |
+-if(XRANDR_FOUND) |
183 |
+- add_compile_definitions(FF_HAVE_XRANDR=1) |
184 |
+-else(XRANDR_FOUND) |
185 |
+- message(WARNING "Package xrandr not found. Building without support.") |
186 |
+-endif(XRANDR_FOUND) |
187 |
+- |
188 |
+-pkg_check_modules (X11 x11) |
189 |
+-if(X11_FOUND) |
190 |
+- add_compile_definitions(FF_HAVE_X11=1) |
191 |
+-else(X11_FOUND) |
192 |
+- message(WARNING "Package x11 not found. Building without support.") |
193 |
+-endif(X11_FOUND) |
194 |
+- |
195 |
+-pkg_check_modules (GIO gio-2.0) |
196 |
+-if(GIO_FOUND) |
197 |
+- add_compile_definitions(FF_HAVE_GIO=1) |
198 |
+-else(GIO_FOUND) |
199 |
+- message(WARNING "Package gio-2.0 not found. Building without support.") |
200 |
+-endif(GIO_FOUND) |
201 |
+- |
202 |
+-pkg_check_modules (DCONF dconf) |
203 |
+-if(DCONF_FOUND) |
204 |
+- add_compile_definitions(FF_HAVE_DCONF=1) |
205 |
+-else(DCONF_FOUND) |
206 |
+- message(WARNING "Package dconf not found. Building without support.") |
207 |
+-endif(DCONF_FOUND) |
208 |
+- |
209 |
+-pkg_check_modules (XFCONF libxfconf-0) |
210 |
+-if(XFCONF_FOUND) |
211 |
+- add_compile_definitions(FF_HAVE_XFCONF=1) |
212 |
+-else(XFCONF_FOUND) |
213 |
+- message(WARNING "Package libxfconf-0 not found. Building without support.") |
214 |
+-endif(XFCONF_FOUND) |
215 |
+- |
216 |
+-pkg_check_modules (RPM rpm) |
217 |
+-if(RPM_FOUND) |
218 |
+- add_compile_definitions(FF_HAVE_RPM=1) |
219 |
+-else(RPM_FOUND) |
220 |
+- message(WARNING "Package librpm not found. Building without support.") |
221 |
+-endif(RPM_FOUND) |
222 |
++OPTION(ENABLE_LIBPCI "Enable libpci" ON) |
223 |
++OPTION(ENABLE_VULKAN "Enable vulkan" ON) |
224 |
++OPTION(ENABLE_WAYLAND "Enable wayland-client" ON) |
225 |
++OPTION(ENABLE_XCB_RANDR "Enable xcb-randr" ON) |
226 |
++OPTION(ENABLE_XCB "Enable xcb" ON) |
227 |
++OPTION(ENABLE_XRANDR "Enable xrandr" ON) |
228 |
++OPTION(ENABLE_X11 "Enable x11" ON) |
229 |
++OPTION(ENABLE_GIO "Enable gio-2.0" ON) |
230 |
++OPTION(ENABLE_DCONF "Enable dconf" ON) |
231 |
++OPTION(ENABLE_XFCONF "Enable libxfconf-0" ON) |
232 |
++OPTION(ENABLE_RPM "Enable rpm" ON) |
233 |
++ |
234 |
++if(ENABLE_LIBPCI) |
235 |
++ pkg_check_modules (LIBPCI libpci) |
236 |
++ if(LIBPCI_FOUND) |
237 |
++ add_compile_definitions(FF_HAVE_LIBPCI=1) |
238 |
++ else(LIBPCI_FOUND) |
239 |
++ message(WARNING "Package libpci not found. Building without support.") |
240 |
++ endif(LIBPCI_FOUND) |
241 |
++endif(ENABLE_LIBPCI) |
242 |
++ |
243 |
++if(ENABLE_VULKAN) |
244 |
++ pkg_check_modules (VULKAN vulkan) |
245 |
++ if(VULKAN_FOUND) |
246 |
++ add_compile_definitions(FF_HAVE_VULKAN=1) |
247 |
++ else(VULKAN_FOUND) |
248 |
++ message(WARNING "Package vulkan not found. Building without support.") |
249 |
++ endif(VULKAN_FOUND) |
250 |
++endif(ENABLE_VULKAN) |
251 |
++ |
252 |
++if(ENABLE_WAYLAND) |
253 |
++ pkg_check_modules (WAYLAND wayland-client) |
254 |
++ if(WAYLAND_FOUND) |
255 |
++ add_compile_definitions(FF_HAVE_WAYLAND=1) |
256 |
++ else(WAYLAND_FOUND) |
257 |
++ message(WARNING "Package wayland-client not found. Building without support.") |
258 |
++ endif(WAYLAND_FOUND) |
259 |
++endif(ENABLE_WAYLAND) |
260 |
++ |
261 |
++if(ENABLE_XCB_RANDR) |
262 |
++ pkg_check_modules (XCB_RANDR xcb-randr) |
263 |
++ if(XCB_RANDR_FOUND) |
264 |
++ add_compile_definitions(FF_HAVE_XCB_RANDR=1) |
265 |
++ else(XCB_RANDR_FOUND) |
266 |
++ message(WARNING "Package xcb-randr not found. Building without support.") |
267 |
++ endif(XCB_RANDR_FOUND) |
268 |
++endif(ENABLE_XCB_RANDR) |
269 |
++ |
270 |
++if(ENABLE_XCB) |
271 |
++ pkg_check_modules (XCB xcb) |
272 |
++ if(XCB_FOUND) |
273 |
++ add_compile_definitions(FF_HAVE_XCB=1) |
274 |
++ else(XCB_FOUND) |
275 |
++ message(WARNING "Package xcb not found. Building without support.") |
276 |
++ endif(XCB_FOUND) |
277 |
++endif(ENABLE_XCB) |
278 |
++ |
279 |
++if(ENABLE_XRANDR) |
280 |
++ pkg_check_modules (XRANDR xrandr) |
281 |
++ if(XRANDR_FOUND) |
282 |
++ add_compile_definitions(FF_HAVE_XRANDR=1) |
283 |
++ else(XRANDR_FOUND) |
284 |
++ message(WARNING "Package xrandr not found. Building without support.") |
285 |
++ endif(XRANDR_FOUND) |
286 |
++endif(ENABLE_XRANDR) |
287 |
++ |
288 |
++if(ENABLE_X11) |
289 |
++ pkg_check_modules (X11 x11) |
290 |
++ if(X11_FOUND) |
291 |
++ add_compile_definitions(FF_HAVE_X11=1) |
292 |
++ else(X11_FOUND) |
293 |
++ message(WARNING "Package x11 not found. Building without support.") |
294 |
++ endif(X11_FOUND) |
295 |
++endif(ENABLE_X11) |
296 |
++ |
297 |
++if(ENABLE_GIO) |
298 |
++ pkg_check_modules (GIO gio-2.0) |
299 |
++ if(GIO_FOUND) |
300 |
++ add_compile_definitions(FF_HAVE_GIO=1) |
301 |
++ else(GIO_FOUND) |
302 |
++ message(WARNING "Package gio-2.0 not found. Building without support.") |
303 |
++ endif(GIO_FOUND) |
304 |
++endif(ENABLE_GIO) |
305 |
++ |
306 |
++if(ENABLE_DCONF) |
307 |
++ pkg_check_modules (DCONF dconf) |
308 |
++ if(DCONF_FOUND) |
309 |
++ add_compile_definitions(FF_HAVE_DCONF=1) |
310 |
++ else(DCONF_FOUND) |
311 |
++ message(WARNING "Package dconf not found. Building without support.") |
312 |
++ endif(DCONF_FOUND) |
313 |
++endif(ENABLE_DCONF) |
314 |
++ |
315 |
++if(ENABLE_XFCONF) |
316 |
++ pkg_check_modules (XFCONF libxfconf-0) |
317 |
++ if(XFCONF_FOUND) |
318 |
++ add_compile_definitions(FF_HAVE_XFCONF=1) |
319 |
++ else(XFCONF_FOUND) |
320 |
++ message(WARNING "Package libxfconf-0 not found. Building without support.") |
321 |
++ endif(XFCONF_FOUND) |
322 |
++endif(ENABLE_XFCONF) |
323 |
++ |
324 |
++if(ENABLE_RPM) |
325 |
++ pkg_check_modules (RPM rpm) |
326 |
++ if(RPM_FOUND) |
327 |
++ add_compile_definitions(FF_HAVE_RPM=1) |
328 |
++ else(RPM_FOUND) |
329 |
++ message(WARNING "Package librpm not found. Building without support.") |
330 |
++ endif(RPM_FOUND) |
331 |
++endif(ENABLE_RPM) |
332 |
+ |
333 |
+ include_directories( |
334 |
+ ${PROJECT_BINARY_DIR} |