Gentoo Archives: gentoo-commits

From: Daniel Campbell <zlg@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-im/toxic/files/, net-im/toxic/
Date: Sun, 12 Nov 2017 01:00:15
Message-Id: 1510448268.5673560641c9f35807091c452e19ae67965eca53.zlg@gentoo
1 commit: 5673560641c9f35807091c452e19ae67965eca53
2 Author: Daniel Campbell <zlg <AT> gentoo <DOT> org>
3 AuthorDate: Sun Nov 12 00:57:02 2017 +0000
4 Commit: Daniel Campbell <zlg <AT> gentoo <DOT> org>
5 CommitDate: Sun Nov 12 00:57:48 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=56735606
7
8 net-im/toxic: Correct deps, {C,LD}FLAGS, build log
9
10 Thanks to Felix Janda for reporting the bug and confirming fixes.
11
12 Closes: https://bugs.gentoo.org/634350
13 Package-Manager: Portage-2.3.13, Repoman-2.3.4
14
15 .../files/toxic-0.8.0-verbose-build-log.patch | 230 +++++++++++++++++++++
16 net-im/toxic/metadata.xml | 8 +-
17 net-im/toxic/toxic-0.8.0-r1.ebuild | 92 +++++++++
18 3 files changed, 327 insertions(+), 3 deletions(-)
19
20 diff --git a/net-im/toxic/files/toxic-0.8.0-verbose-build-log.patch b/net-im/toxic/files/toxic-0.8.0-verbose-build-log.patch
21 new file mode 100644
22 index 00000000000..ee1c1d90d07
23 --- /dev/null
24 +++ b/net-im/toxic/files/toxic-0.8.0-verbose-build-log.patch
25 @@ -0,0 +1,230 @@
26 +This patch creates a 'verbosity' flag to satisfy Gentoo packaging
27 +standards.
28 +
29 +Thanks to Felix Janda for reporting both this issue and other issues
30 +with the ebuild. Gentoo bug #634350
31 +
32 +Most of this patch was generated using:
33 +
34 + sed -e 's:^\(\s\+\)@:\1\$(AT):' $(find -name *.mk)
35 +
36 +Verbosity can be activated by using `make V=1`.
37 +
38 +Patch authored by zlg, released under GPL3.
39 +--- a/Makefile
40 ++++ b/Makefile
41 +@@ -3,6 +3,14 @@ CFG_DIR = $(BASE_DIR)/cfg
42 +
43 + -include $(CFG_DIR)/global_vars.mk
44 +
45 ++# Create V for verbosity. Defaults to 0.
46 ++ifndef V
47 ++ V := 0
48 ++endif
49 ++AT_0 := @
50 ++AT_1 :=
51 ++AT = $(AT_$(V))
52 ++
53 + LIBS = libtoxcore ncursesw libconfig libqrencode
54 +
55 + CFLAGS = -std=gnu99 -pthread -Wall -g -fstack-protector-all
56 +@@ -59,20 +67,20 @@ OBJ := $(addprefix $(BUILD_DIR)/, $(OBJ))
57 + all: $(BUILD_DIR)/toxic
58 +
59 + $(BUILD_DIR)/toxic: $(OBJ)
60 +- @echo " LD $(@:$(BUILD_DIR)/%=%)"
61 +- @$(CC) $(CFLAGS) -o $(BUILD_DIR)/toxic $(OBJ) $(LDFLAGS)
62 ++ $(AT)echo " LD $(@:$(BUILD_DIR)/%=%)"
63 ++ $(AT)$(CC) $(CFLAGS) -o $(BUILD_DIR)/toxic $(OBJ) $(LDFLAGS)
64 +
65 + $(BUILD_DIR)/osx_video.o: $(SRC_DIR)/$(OSX_VIDEO)
66 +- @echo " CC $(@:$(BUILD_DIR)/)osx_video.o"
67 +- @$(CC) $(CFLAGS) -o $(BUILD_DIR)/osx_video.o -c $(SRC_DIR)/$(OSX_VIDEO)
68 ++ $(AT)echo " CC $(@:$(BUILD_DIR)/)osx_video.o"
69 ++ $(AT)$(CC) $(CFLAGS) -o $(BUILD_DIR)/osx_video.o -c $(SRC_DIR)/$(OSX_VIDEO)
70 +
71 + $(BUILD_DIR)/%.o: $(SRC_DIR)/%.c
72 +- @if [ ! -e $(BUILD_DIR) ]; then \
73 ++ $(AT)if [ ! -e $(BUILD_DIR) ]; then \
74 + mkdir -p $(BUILD_DIR) ;\
75 + fi
76 +- @echo " CC $(@:$(BUILD_DIR)/%=%)"
77 +- @$(CC) $(CFLAGS) -o $(BUILD_DIR)/$*.o -c $(SRC_DIR)/$*.c
78 +- @$(CC) -MM $(CFLAGS) $(SRC_DIR)/$*.c > $(BUILD_DIR)/$*.d
79 ++ $(AT)echo " CC $(@:$(BUILD_DIR)/%=%)"
80 ++ $(AT)$(CC) $(CFLAGS) -o $(BUILD_DIR)/$*.o -c $(SRC_DIR)/$*.c
81 ++ $(AT)$(CC) -MM $(CFLAGS) $(SRC_DIR)/$*.c > $(BUILD_DIR)/$*.d
82 +
83 + clean:
84 + rm -f $(BUILD_DIR)/*.d $(BUILD_DIR)/*.o $(BUILD_DIR)/toxic
85 +--- a/apidoc/python/Makefile
86 ++++ b/apidoc/python/Makefile
87 +@@ -1,6 +1,14 @@
88 + # Minimal makefile for Sphinx documentation
89 + #
90 +
91 ++# Create V for verbosity. Defaults to 0.
92 ++ifndef V
93 ++ V := 0
94 ++endif
95 ++AT_0 := @
96 ++AT_1 :=
97 ++AT = $(AT_$(V))
98 ++
99 + # You can set these variables from the command line.
100 + SPHINXOPTS =
101 + SPHINXBUILD = sphinx-build
102 +@@ -10,11 +18,11 @@ BUILDDIR = build
103 +
104 + # Put it first so that "make" without argument is like "make help".
105 + help:
106 +- @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
107 ++ $(AT)$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
108 +
109 + .PHONY: help Makefile
110 +
111 + # Catch-all target: route all unknown targets to Sphinx using the new
112 + # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
113 + %: Makefile
114 +- @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
115 +\ No newline at end of file
116 ++ $(AT)$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
117 +--- a/cfg/targets/doc.mk
118 ++++ b/cfg/targets/doc.mk
119 +@@ -2,8 +2,8 @@
120 + doc: $(MANFILES:%=$(DOC_DIR)/%)
121 +
122 + $(DOC_DIR)/%: $(DOC_DIR)/%.asc
123 +- @echo " MAN $(@F)"
124 +- @a2x -f manpage -a revdate=$(shell git log -1 --date=short --format="%ad" $<) \
125 ++ $(AT)echo " MAN $(@F)"
126 ++ $(AT)a2x -f manpage -a revdate=$(shell git log -1 --date=short --format="%ad" $<) \
127 + -a manmanual="Toxic Manual" -a mansource=toxic \
128 + -a manversion=__VERSION__ -a datadir=__DATADIR__ $<
129 +
130 +--- a/cfg/targets/help.mk
131 ++++ b/cfg/targets/help.mk
132 +@@ -1,24 +1,24 @@
133 + # Help target
134 + help:
135 +- @echo "-- Targets --"
136 +- @echo " all: Build toxic and documentation [DEFAULT]"
137 +- @echo " toxic: Build toxic"
138 +- @echo " doc: Build documentation"
139 +- @echo " install: Build toxic and install it in PREFIX (default PREFIX is \"$(abspath $(PREFIX))\")"
140 +- @echo " uninstall: Remove toxic from PREFIX (default PREFIX is \"$(abspath $(PREFIX))\")"
141 +- @echo " clean: Remove built files"
142 +- @echo " help: This help"
143 +- @echo
144 +- @echo "-- Variables --"
145 +- @echo " DISABLE_X11: Set to \"1\" to force building without X11 support"
146 +- @echo " DISABLE_AV: Set to \"1\" to force building without audio call support"
147 +- @echo " DISABLE_SOUND_NOTIFY: Set to \"1\" to force building without sound notification support"
148 +- @echo " DISABLE_DESKTOP_NOTIFY: Set to \"1\" to force building without desktop notifications support"
149 +- @echo " DISABLE_QRPNG: Set to \"1\" to force building without QR exported as PNG support"
150 +- @echo " ENABLE_PYTHON: Set to \"1\" to enable building with Python scripting support"
151 +- @echo " USER_CFLAGS: Add custom flags to default CFLAGS"
152 +- @echo " USER_LDFLAGS: Add custom flags to default LDFLAGS"
153 +- @echo " PREFIX: Specify a prefix directory for binaries, data files,... (default is \"$(abspath $(PREFIX))\")"
154 +- @echo " DESTDIR: Specify a directory where to store installed files (mainly for packaging purpose)"
155 ++ $(AT)echo "-- Targets --"
156 ++ $(AT)echo " all: Build toxic and documentation [DEFAULT]"
157 ++ $(AT)echo " toxic: Build toxic"
158 ++ $(AT)echo " doc: Build documentation"
159 ++ $(AT)echo " install: Build toxic and install it in PREFIX (default PREFIX is \"$(abspath $(PREFIX))\")"
160 ++ $(AT)echo " uninstall: Remove toxic from PREFIX (default PREFIX is \"$(abspath $(PREFIX))\")"
161 ++ $(AT)echo " clean: Remove built files"
162 ++ $(AT)echo " help: This help"
163 ++ $(AT)echo
164 ++ $(AT)echo "-- Variables --"
165 ++ $(AT)echo " DISABLE_X11: Set to \"1\" to force building without X11 support"
166 ++ $(AT)echo " DISABLE_AV: Set to \"1\" to force building without audio call support"
167 ++ $(AT)echo " DISABLE_SOUND_NOTIFY: Set to \"1\" to force building without sound notification support"
168 ++ $(AT)echo " DISABLE_DESKTOP_NOTIFY: Set to \"1\" to force building without desktop notifications support"
169 ++ $(AT)echo " DISABLE_QRPNG: Set to \"1\" to force building without QR exported as PNG support"
170 ++ $(AT)echo " ENABLE_PYTHON: Set to \"1\" to enable building with Python scripting support"
171 ++ $(AT)echo " USER_CFLAGS: Add custom flags to default CFLAGS"
172 ++ $(AT)echo " USER_LDFLAGS: Add custom flags to default LDFLAGS"
173 ++ $(AT)echo " PREFIX: Specify a prefix directory for binaries, data files,... (default is \"$(abspath $(PREFIX))\")"
174 ++ $(AT)echo " DESTDIR: Specify a directory where to store installed files (mainly for packaging purpose)"
175 +
176 + .PHONY: help
177 +--- a/cfg/targets/install.mk
178 ++++ b/cfg/targets/install.mk
179 +@@ -1,29 +1,29 @@
180 + # Install target
181 + install: $(BUILD_DIR)/toxic
182 +- @echo "Installing toxic executable"
183 +- @mkdir -p $(abspath $(DESTDIR)/$(BINDIR))
184 +- @install -m 0755 $(BUILD_DIR)/toxic $(abspath $(DESTDIR)/$(BINDIR)/toxic)
185 ++ $(AT)echo "Installing toxic executable"
186 ++ $(AT)mkdir -p $(abspath $(DESTDIR)/$(BINDIR))
187 ++ $(AT)install -m 0755 $(BUILD_DIR)/toxic $(abspath $(DESTDIR)/$(BINDIR)/toxic)
188 +
189 +- @echo "Installing desktop file"
190 +- @mkdir -p $(abspath $(DESTDIR)/$(APPDIR))
191 +- @install -m 0644 $(MISC_DIR)/$(DESKFILE) $(abspath $(DESTDIR)/$(APPDIR)/$(DESKFILE))
192 ++ $(AT)echo "Installing desktop file"
193 ++ $(AT)mkdir -p $(abspath $(DESTDIR)/$(APPDIR))
194 ++ $(AT)install -m 0644 $(MISC_DIR)/$(DESKFILE) $(abspath $(DESTDIR)/$(APPDIR)/$(DESKFILE))
195 +
196 +- @echo "Installing data files"
197 +- @mkdir -p $(abspath $(DESTDIR)/$(DATADIR))
198 +- @for f in $(DATAFILES) ; do \
199 ++ $(AT)echo "Installing data files"
200 ++ $(AT)mkdir -p $(abspath $(DESTDIR)/$(DATADIR))
201 ++ $(AT)for f in $(DATAFILES) ; do \
202 + install -m 0644 $(MISC_DIR)/$$f $(abspath $(DESTDIR)/$(DATADIR)/$$f) ;\
203 + file=$(abspath $(DESTDIR)/$(DATADIR)/$$f) ;\
204 + sed -e 's:__DATADIR__:'$(abspath $(DATADIR))':g' $$file > temp_file && \
205 + mv temp_file $$file ;\
206 + done
207 +- @mkdir -p $(abspath $(DESTDIR)/$(DATADIR))/sounds
208 +- @for f in $(SNDFILES) ; do \
209 ++ $(AT)mkdir -p $(abspath $(DESTDIR)/$(DATADIR))/sounds
210 ++ $(AT)for f in $(SNDFILES) ; do \
211 + install -m 0644 $(SND_DIR)/$$f $(abspath $(DESTDIR)/$(DATADIR)/sounds/$$f) ;\
212 + done
213 +
214 +- @echo "Installing man pages"
215 +- @mkdir -p $(abspath $(DESTDIR)/$(MANDIR))
216 +- @for f in $(MANFILES) ; do \
217 ++ $(AT)echo "Installing man pages"
218 ++ $(AT)mkdir -p $(abspath $(DESTDIR)/$(MANDIR))
219 ++ $(AT)for f in $(MANFILES) ; do \
220 + if [ ! -e "$(DOC_DIR)/$$f" ]; then \
221 + continue ;\
222 + fi ;\
223 +--- a/cfg/targets/uninstall.mk
224 ++++ b/cfg/targets/uninstall.mk
225 +@@ -1,21 +1,21 @@
226 + # Uninstall target
227 + uninstall:
228 +- @echo "Removing toxic executable"
229 +- @rm -f $(abspath $(DESTDIR)/$(BINDIR)/toxic)
230 ++ $(AT)echo "Removing toxic executable"
231 ++ $(AT)rm -f $(abspath $(DESTDIR)/$(BINDIR)/toxic)
232 +
233 +- @echo "Removing desktop file"
234 +- @rm -f $(abspath $(DESTDIR)/$(APPDIR)/$(DESKFILE))
235 ++ $(AT)echo "Removing desktop file"
236 ++ $(AT)rm -f $(abspath $(DESTDIR)/$(APPDIR)/$(DESKFILE))
237 +
238 +- @echo "Removing data files"
239 +- @for f in $(DATAFILES) ; do \
240 ++ $(AT)echo "Removing data files"
241 ++ $(AT)for f in $(DATAFILES) ; do \
242 + rm -f $(abspath $(DESTDIR)/$(DATADIR)/$$f) ;\
243 + done
244 +- @for f in $(SNDFILES) ; do \
245 ++ $(AT)for f in $(SNDFILES) ; do \
246 + rm -f $(abspath $(DESTDIR)/$(DATADIR)/sounds/$$f) ;\
247 + done
248 +
249 +- @echo "Removing man pages"
250 +- @for f in $(MANFILES) ; do \
251 ++ $(AT)echo "Removing man pages"
252 ++ $(AT)for f in $(MANFILES) ; do \
253 + section=$(abspath $(DESTDIR)/$(MANDIR))/man`echo $$f | rev | cut -d "." -f 1` ;\
254 + file=$$section/$$f ;\
255 + rm -f $$file $$file.gz ;\
256
257 diff --git a/net-im/toxic/metadata.xml b/net-im/toxic/metadata.xml
258 index 4a6dc2b6463..4581d36bbd5 100644
259 --- a/net-im/toxic/metadata.xml
260 +++ b/net-im/toxic/metadata.xml
261 @@ -13,11 +13,13 @@
262 <remote-id type="github">jfreegman/toxic</remote-id>
263 </upstream>
264 <longdescription lang="en">
265 - An ncurses-based Tox client written in C. Supports audio calling, file sharing, and desktop notifications.
266 + An ncurses-based Tox client written in C. Supports audio and video calling, file sharing, and desktop notifications.
267 </longdescription>
268 <use>
269 - <flag name="notifications">Enables desktop notifications with libnotify</flag>
270 - <flag name="av">Enables audio calling and/or audio notifications</flag>
271 + <flag name="audio">Enables audio calling</flag>
272 + <flag name="av">Enables audio/video functionality (deprecated)</flag>
273 + <flag name="notifications">Enables desktop notifications with libnotify, with sound support.</flag>
274 <flag name="qrcode">Enables QR code support</flag>
275 + <flag name="video">Enables video calling</flag>
276 </use>
277 </pkgmetadata>
278
279 diff --git a/net-im/toxic/toxic-0.8.0-r1.ebuild b/net-im/toxic/toxic-0.8.0-r1.ebuild
280 new file mode 100644
281 index 00000000000..e9a1018aa90
282 --- /dev/null
283 +++ b/net-im/toxic/toxic-0.8.0-r1.ebuild
284 @@ -0,0 +1,92 @@
285 +# Copyright 1999-2017 Gentoo Foundation
286 +# Distributed under the terms of the GNU General Public License v2
287 +
288 +EAPI=6
289 +PYTHON_COMPAT=( python3_4 python3_5 python3_6 )
290 +
291 +inherit python-single-r1 xdg
292 +
293 +DESCRIPTION="A curses-based client for Tox."
294 +HOMEPAGE="https://github.com/JFreegman/toxic"
295 +SRC_URI="https://github.com/JFreegman/toxic/archive/v${PV}.tar.gz -> ${P}.tar.gz"
296 +
297 +LICENSE="GPL-3"
298 +SLOT="0"
299 +KEYWORDS="~amd64 ~x86"
300 +IUSE="+X +audio notifications +python +qrcode +video"
301 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
302 +
303 +# Not a typo; net-libs/tox only has a 'both or neither' option
304 +RDEPEND="
305 + || (
306 + audio? ( net-libs/tox:0/0.1[av] )
307 + video? ( net-libs/tox:0/0.1[av] )
308 + net-libs/tox:0/0.1
309 + )
310 + dev-libs/libconfig
311 + net-misc/curl:0=
312 + sys-libs/ncurses:0=
313 + audio? ( media-libs/openal media-libs/freealut )
314 + video? ( media-libs/libvpx:= x11-libs/libX11 )
315 + notifications? ( x11-libs/libnotify )
316 + python? ( ${PYTHON_DEPS} )
317 + qrcode? ( media-gfx/qrencode )
318 +"
319 +DEPEND="
320 + virtual/pkgconfig
321 + ${RDEPEND}
322 +"
323 +
324 +PATCHES=(
325 + "${FILESDIR}/${P}-verbose-build-log.patch"
326 + )
327 +
328 +pkg_setup() {
329 + use python && python-single-r1_pkg_setup
330 +}
331 +
332 +src_prepare() {
333 + default
334 + # bug 630370: version string correction 0.7.2 -> 0.8.0
335 + # REMOVE THIS FOR toxic != 0.8.0
336 + sed -i \
337 + -e 's/^\(TOXIC_VERSION =\).*$/\1 0.8.0/' \
338 + cfg/global_vars.mk || die "Version string correction failed."
339 +}
340 +
341 +src_configure() {
342 + export USER_CFLAGS="${CFLAGS}"
343 + export USER_LDFLAGS="${LDFLAGS}"
344 + if ! use video && ! use audio; then
345 + export DISABLE_AV=1
346 + fi
347 + if ! use audio; then
348 + export DISABLE_SOUND_NOTIFY=1
349 + fi
350 + if ! use X; then
351 + export DISABLE_X11=1
352 + fi
353 + if ! use notifications; then
354 + export DISABLE_DESKTOP_NOTIFY=1
355 + fi
356 + if ! use qrcode; then
357 + export DISABLE_QRPNG=1
358 + fi
359 + if use python; then
360 + export ENABLE_PYTHON=1
361 + fi
362 + sed -i \
363 + -e "s,/usr/local,${EPREFIX}/usr,g" \
364 + cfg/global_vars.mk || die "PREFIX sed failed"
365 +}
366 +
367 +src_compile() {
368 + emake V=1 || die "emake failed"
369 +}
370 +
371 +src_install() {
372 + default
373 + if ! use audio; then
374 + rm -r "${ED%/}"/usr/share/${PN}/sounds || die "Could not remove sounds directory"
375 + fi
376 +}