Gentoo Archives: gentoo-commits

From: Daniel Pielmeier <billie@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/conky/files/, app-admin/conky/
Date: Thu, 06 Aug 2020 15:11:19
Message-Id: 1596726602.8ed09d7c40c3ac74314039fc9fd90b4805b140cd.billie@gentoo
1 commit: 8ed09d7c40c3ac74314039fc9fd90b4805b140cd
2 Author: Jan Seeger <jan.seeger <AT> thenybble <DOT> de>
3 AuthorDate: Wed Aug 5 13:44:04 2020 +0000
4 Commit: Daniel Pielmeier <billie <AT> gentoo <DOT> org>
5 CommitDate: Thu Aug 6 15:10:02 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8ed09d7c
7
8 app/admin-conky-1.10.8-r10: Patched crash on virtual Pulseaudio sinks
9
10 Using upstream commits
11 https://github.com/brndnmtthws/conky/commit/2a7226d89331f7d5d0abf0b9aff6d75435dd3a2d and
12 https://github.com/brndnmtthws/conky/commit/ddf8a0f58f3110e31ec4c44ecff838d2b231f6f3. Added missing
13 braces for multi-line macro, added version bumped ebuild.
14
15 Signed-off-by: Jan Seeger <jan.seeger <AT> thenybble.de>
16 Signed-off-by: Daniel Pielmeier <billie <AT> gentoo.org>
17
18 app-admin/conky/conky-1.10.8-r10.ebuild | 186 +++++++++++++++++++++
19 .../conky/files/conky-1.10.8-virtual-sinks.patch | 49 ++++++
20 2 files changed, 235 insertions(+)
21
22 diff --git a/app-admin/conky/conky-1.10.8-r10.ebuild b/app-admin/conky/conky-1.10.8-r10.ebuild
23 new file mode 100644
24 index 00000000000..d84975354f0
25 --- /dev/null
26 +++ b/app-admin/conky/conky-1.10.8-r10.ebuild
27 @@ -0,0 +1,186 @@
28 +# Copyright 1999-2020 Gentoo Authors
29 +# Distributed under the terms of the GNU General Public License v2
30 +
31 +EAPI=7
32 +
33 +inherit cmake linux-info readme.gentoo-r1
34 +
35 +DESCRIPTION="An advanced, highly configurable system monitor for X"
36 +HOMEPAGE="https://github.com/brndnmtthws/conky"
37 +SRC_URI="https://github.com/brndnmtthws/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
38 +
39 +LICENSE="GPL-3 BSD LGPL-2.1 MIT"
40 +SLOT="0"
41 +KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86"
42 +IUSE="apcupsd cmus curl eve hddtemp ical iconv imlib iostats ipv6 irc
43 + lua-cairo lua-imlib lua-rsvg math moc mpd mysql nano-syntax ncurses
44 + nvidia +portmon pulseaudio rss systemd thinkpad truetype vim-syntax
45 + weather-metar webserver wifi X xmms2"
46 +
47 +COMMON_DEPEND="
48 + X? (
49 + imlib? ( media-libs/imlib2[X] )
50 + lua-cairo? ( >=dev-lua/toluapp-1.0.93 x11-libs/cairo[X] )
51 + lua-imlib? ( >=dev-lua/toluapp-1.0.93 media-libs/imlib2[X] )
52 + lua-rsvg? ( >=dev-lua/toluapp-1.0.93 gnome-base/librsvg )
53 + nvidia? ( x11-drivers/nvidia-drivers[tools,static-libs] )
54 + truetype? ( x11-libs/libXft >=media-libs/freetype-2 )
55 + x11-libs/libX11
56 + x11-libs/libXdamage
57 + x11-libs/libXinerama
58 + x11-libs/libXfixes
59 + x11-libs/libXext
60 + xmms2? ( media-sound/xmms2 )
61 + )
62 + cmus? ( media-sound/cmus )
63 + curl? ( net-misc/curl )
64 + eve? ( net-misc/curl dev-libs/libxml2 )
65 + ical? ( dev-libs/libical:= )
66 + iconv? ( virtual/libiconv )
67 + irc? ( net-libs/libircclient )
68 + mysql? ( dev-db/mysql-connector-c )
69 + ncurses? ( sys-libs/ncurses:= )
70 + pulseaudio? ( media-sound/pulseaudio )
71 + rss? ( dev-libs/libxml2 net-misc/curl dev-libs/glib:2 )
72 + systemd? ( sys-apps/systemd )
73 + wifi? ( net-wireless/wireless-tools )
74 + weather-metar? ( net-misc/curl )
75 + webserver? ( net-libs/libmicrohttpd )
76 + || ( dev-lang/lua:0 dev-lang/lua:5.1 )
77 +"
78 +RDEPEND="
79 + ${COMMON_DEPEND}
80 + apcupsd? ( sys-power/apcupsd )
81 + hddtemp? ( app-admin/hddtemp )
82 + moc? ( media-sound/moc )
83 + nano-syntax? ( app-editors/nano )
84 + vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )
85 +"
86 +DEPEND="
87 + ${COMMON_DEPEND}
88 + app-text/docbook2X
89 +"
90 +
91 +CONFIG_CHECK=~IPV6
92 +
93 +DOCS=( README.md TODO ChangeLog NEWS AUTHORS )
94 +
95 +PATCHES=(
96 + "${FILESDIR}"/${P}-use-pkgconfig.patch
97 + "${FILESDIR}"/${P}-libical-3.patch
98 + "${FILESDIR}"/${P}-portmon.patch
99 + "${FILESDIR}"/${P}-clang.patch
100 + "${FILESDIR}"/${P}-virtual-sinks.patch
101 +)
102 +
103 +DISABLE_AUTOFORMATTING="yes"
104 +DOC_CONTENTS="You can find sample configurations at ${ROOT}/usr/share/doc/${PF}.
105 +To customize, copy to ${XDG_CONFIG_HOME}/conky/conky.conf
106 +and edit it to your liking.
107 +
108 +There are pretty html docs available at the conky homepage
109 +or in ${ROOT}/usr/share/doc/${PF}/html.
110 +
111 +Also see https://wiki.gentoo.org/wiki/Conky/HOWTO"
112 +
113 +pkg_setup() {
114 + use ipv6 && linux-info_pkg_setup
115 +}
116 +
117 +src_prepare() {
118 + cmake_src_prepare
119 +
120 + sed -i -e "s|find_program(APP_MAN man)|set(APP_MAN $(which man) CACHE FILEPATH MAN_BINARY)|" \
121 + cmake/ConkyPlatformChecks.cmake || die
122 +}
123 +
124 +src_configure() {
125 + local mycmakeargs
126 +
127 + if use X; then
128 + mycmakeargs=(
129 + -DBUILD_X11=ON
130 + -DOWN_WINDOW=ON
131 + -DBUILD_XDAMAGE=ON
132 + -DBUILD_XINERAMA=ON
133 + -DBUILD_XDBE=ON
134 + -DBUILD_XFT=$(usex truetype)
135 + -DBUILD_IMLIB2=$(usex imlib)
136 + -DBUILD_XSHAPE=ON
137 + -DBUILD_ARGB=ON
138 + -DBUILD_LUA_CAIRO=$(usex lua-cairo)
139 + -DBUILD_LUA_IMLIB2=$(usex lua-imlib)
140 + -DBUILD_LUA_RSVG=$(usex lua-rsvg)
141 + -DBUILD_NVIDIA=$(usex nvidia)
142 + -DBUILD_XMMS2=$(usex xmms2)
143 + )
144 + else
145 + mycmakeargs=(
146 + -DBUILD_X11=OFF
147 + -DBUILD_NVIDIA=OFF
148 + -DBUILD_LUA_CAIRO=OFF
149 + -DBUILD_LUA_IMLIB2=OFF
150 + -DBUILD_LUA_RSVG=OFF
151 + -DBUILD_XMMS2=OFF
152 + )
153 + fi
154 +
155 + mycmakeargs+=(
156 + -DBUILD_APCUPSD=$(usex apcupsd)
157 + -DBUILD_CMUS=$(usex cmus)
158 + -DBUILD_CURL=$(usex curl)
159 + -DBUILD_EVE=$(usex eve)
160 + -DBUILD_HDDTEMP=$(usex hddtemp)
161 + -DBUILD_IOSTATS=$(usex iostats)
162 + -DBUILD_ICAL=$(usex ical)
163 + -DBUILD_ICONV=$(usex iconv)
164 + -DBUILD_IPV6=$(usex ipv6)
165 + -DBUILD_IRC=$(usex irc)
166 + -DBUILD_MATH=$(usex math)
167 + -DBUILD_MOC=$(usex moc)
168 + -DBUILD_MPD=$(usex mpd)
169 + -DBUILD_MYSQL=$(usex mysql)
170 + -DBUILD_NCURSES=$(usex ncurses)
171 + -DBUILD_PORT_MONITORS=$(usex portmon)
172 + -DBUILD_PULSEAUDIO=$(usex pulseaudio)
173 + -DBUILD_RSS=$(usex rss)
174 + -DBUILD_JOURNAL=$(usex systemd)
175 + -DBUILD_IBM=$(usex thinkpad)
176 + -DBUILD_HTTP=$(usex webserver)
177 + -DBUILD_WEATHER_METAR=$(usex weather-metar)
178 + -DBUILD_WLAN=$(usex wifi)
179 + -DBUILD_BUILTIN_CONFIG=ON
180 + -DBUILD_OLD_CONFIG=ON
181 + -DBUILD_I18N=ON
182 + -DMAINTAINER_MODE=ON
183 + -DRELEASE=ON
184 + -DBUILD_AUDACIOUS=OFF
185 + -DBUILD_BMPX=OFF
186 + -DDOC_PATH=/usr/share/doc/${PF}
187 + )
188 +
189 + cmake_src_configure
190 +}
191 +
192 +src_install() {
193 + cmake_src_install
194 +
195 + if use vim-syntax; then
196 + insinto /usr/share/vim/vimfiles/ftdetect
197 + doins "${S}"/extras/vim/ftdetect/conkyrc.vim
198 +
199 + insinto /usr/share/vim/vimfiles/syntax
200 + doins "${S}"/extras/vim/syntax/conkyrc.vim
201 + fi
202 +
203 + if use nano-syntax; then
204 + insinto /usr/share/nano/
205 + doins "${S}"/extras/nano/conky.nanorc
206 + fi
207 +
208 + readme.gentoo_create_doc
209 +}
210 +
211 +pkg_postinst() {
212 + readme.gentoo_print_elog
213 +}
214
215 diff --git a/app-admin/conky/files/conky-1.10.8-virtual-sinks.patch b/app-admin/conky/files/conky-1.10.8-virtual-sinks.patch
216 new file mode 100644
217 index 00000000000..c0198ccc4ec
218 --- /dev/null
219 +++ b/app-admin/conky/files/conky-1.10.8-virtual-sinks.patch
220 @@ -0,0 +1,49 @@
221 +From 8221ba62045012abf8a4443de20f17a0a8fc1288 Mon Sep 17 00:00:00 2001
222 +From: Jan Seeger <jan.seeger@×××××××××.de>
223 +Date: Wed, 5 Aug 2020 15:39:20 +0200
224 +Subject: Fixed crash on virtual sinks.
225 +
226 +Taken from upstream commits
227 +https://github.com/brndnmtthws/conky/commit/ddf8a0f58f3110e31ec4c44ecff838d2b231f6f3 and
228 +https://github.com/brndnmtthws/conky/commit/2a7226d89331f7d5d0abf0b9aff6d75435dd3a2d.
229 +
230 +Signed-off-by: Jan Seeger <jan.seeger@×××××××××.de>
231 +---
232 + src/pulseaudio.cc | 12 +++++++++---
233 + 1 file changed, 9 insertions(+), 3 deletions(-)
234 +
235 +diff --git a/src/pulseaudio.cc b/src/pulseaudio.cc
236 +index 93226c1b..af814bd6 100644
237 +--- a/src/pulseaudio.cc
238 ++++ b/src/pulseaudio.cc
239 +@@ -53,8 +53,13 @@ void pa_sink_info_callback(pa_context *c, const pa_sink_info *i, int eol, void *
240 + pdr->sink_mute = i->mute;
241 + pdr->sink_card = i->card;
242 + pdr->sink_index = i->index;
243 +- pdr->sink_active_port_name.assign(i->active_port->name);
244 +- pdr->sink_active_port_description.assign(i->active_port->description);
245 ++ if (i->active_port != nullptr) {
246 ++ pdr->sink_active_port_name.assign(i->active_port->name);
247 ++ pdr->sink_active_port_description.assign(i->active_port->description);
248 ++ } else {
249 ++ pdr->sink_active_port_name.erase();
250 ++ pdr->sink_active_port_name.erase();
251 ++ }
252 + pdr->sink_volume = round_to_int(100.0f * (float)pa_cvolume_avg(&(i->volume)) / (float)PA_VOLUME_NORM);
253 + pa_threaded_mainloop_signal(pulseaudio->mainloop, 0);
254 + }
255 +@@ -224,9 +229,10 @@ void init_pulseaudio(struct text_object *obj) {
256 + return;
257 + }
258 +
259 +- if(pulseaudio->result.sink_card!=(uint32_t)-1)
260 ++ if(pulseaudio->result.sink_card!=(uint32_t)-1) {
261 + PULSEAUDIO_WAIT(pa_context_get_card_info_by_index(pulseaudio->context, pulseaudio->result.sink_card,
262 + pa_card_info_callback, &pulseaudio->result));
263 ++ }
264 +
265 + // get notification when something changes in PA
266 + pa_context_set_subscribe_callback(pulseaudio->context, subscribe_cb, &pulseaudio->result);
267 +--
268 +2.26.2
269 +