Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-im/toxic/files/, net-im/toxic/
Date: Tue, 24 Aug 2021 08:50:40
Message-Id: 1629795026.ad66309ae5c1a1a68cf7f3f89157a100bc00709e.juippis@gentoo
1 commit: ad66309ae5c1a1a68cf7f3f89157a100bc00709e
2 Author: Josiah Mullins <JoMull01 <AT> protonmail <DOT> com>
3 AuthorDate: Wed Aug 11 22:44:01 2021 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 24 08:50:26 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ad66309a
7
8 net-im/toxic: Bump to 0.11.1
9
10 Signed-off-by: Josiah Mullins <JoMull01 <AT> protonmail.com>
11 Closes: https://github.com/gentoo/gentoo/pull/21964
12 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
13
14 net-im/toxic/Manifest | 1 +
15 .../files/toxic-0.11.1-NAME_MAX-and-PATH_MAX.patch | 48 +++++++++
16 net-im/toxic/metadata.xml | 1 +
17 net-im/toxic/toxic-0.11.1.ebuild | 114 +++++++++++++++++++++
18 4 files changed, 164 insertions(+)
19
20 diff --git a/net-im/toxic/Manifest b/net-im/toxic/Manifest
21 index b1c440bd83e..5f20858fcd7 100644
22 --- a/net-im/toxic/Manifest
23 +++ b/net-im/toxic/Manifest
24 @@ -1,2 +1,3 @@
25 DIST toxic-0.10.1.tar.gz 1165118 BLAKE2B d367039bef9c97c23c8e5453b607cf72f70776e8c86c41da0480eb04725a901bf33bb89727aee3010ad97d33ef2aa653ff09ea49b597cdf2008ff976c395065c SHA512 aec2e6612d639e0210ae68db3368b656647575e3d927444d0726422ff2cf9718dd5a8b3f37a8253cdc3714f09f9f96828dfccf7a7ae12f8a41ce3207f92a684d
26 +DIST toxic-0.11.1.tar.gz 1204163 BLAKE2B 1e388982236badf1a27cb1cfd9e84ec635be6a576a0719a7394f32ac82f23796f94236ab807180620cbfa8c0c42f43ff244d2d99d27cd5ab3258c1ce69acc545 SHA512 53fba05271020547e779d63bea777f90f56b61e3eb2775afabe92e047a8347b4a9166628bb59d2eaab2e36a1121d791206ac68ff6604cb06fac6aaddbb05e787
27 DIST toxic-0.8.3.tar.gz 1147100 BLAKE2B d73a861112aca65e54773c98473c2858bb81e63fef11212633e34dac9e87101956e3ab0d9d56757767bc5d48d1d5a406e550f8fc55ae34860dbc4977c94ee347 SHA512 c8d746efcc055592dd990dfa57415cc1eacaaa3b66303d7583d9f9e7e98b8829c8f1ae849f36a243c8896e99787dd2e493c92367de719b20a4a160bc7daea76e
28
29 diff --git a/net-im/toxic/files/toxic-0.11.1-NAME_MAX-and-PATH_MAX.patch b/net-im/toxic/files/toxic-0.11.1-NAME_MAX-and-PATH_MAX.patch
30 new file mode 100644
31 index 00000000000..09845d294a2
32 --- /dev/null
33 +++ b/net-im/toxic/files/toxic-0.11.1-NAME_MAX-and-PATH_MAX.patch
34 @@ -0,0 +1,48 @@
35 +diff -ruN src/autocomplete.c src/autocomplete.c
36 +--- src/autocomplete.c 2021-08-09 18:52:27.090248882 -0400
37 ++++ src/autocomplete.c 2021-08-11 14:57:39.029828530 -0400
38 +@@ -25,10 +25,12 @@
39 + #include <string.h>
40 +
41 + #ifdef __APPLE__
42 +-#include <sys/types.h>
43 + #include <sys/dir.h>
44 ++#include <sys/types.h>
45 ++#include <sys/sysinfo.h>//This should contain PATH_MAX and NAME_MAX
46 + #else
47 + #include <dirent.h>
48 ++#include <linux/limits.h>
49 + #endif /* __APPLE__ */
50 +
51 + #include "configdir.h"
52 +diff -ruN src/file_transfers.h src/file_transfers.h
53 +--- src/file_transfers.h 2021-07-26 15:39:36.765990567 -0400
54 ++++ src/file_transfers.h 2021-08-11 14:59:41.223159195 -0400
55 +@@ -24,6 +24,12 @@
56 + #define FILE_TRANSFERS_H
57 +
58 + #include <limits.h>
59 ++//This should include NAME_MAX and PATH_MAX
60 ++#ifdef __APPLE__
61 ++#include <sys/sysinfo.h>
62 ++#elif __linux__
63 ++#include <linux/limits.h>
64 ++#endif
65 +
66 + #include "notify.h"
67 + #include "toxic.h"
68 +diff -ruN src/settings.h src/settings.h
69 +--- src/settings.h 2021-08-09 18:52:27.093582216 -0400
70 ++++ src/settings.h 2021-08-11 15:00:46.889824433 -0400
71 +@@ -24,6 +24,12 @@
72 + #define SETTINGS_H
73 +
74 + #include <limits.h>
75 ++//This should include NAME_MAX and PATH_MAX
76 ++#ifdef __APPLE__
77 ++#include <sys/sysinfo.h>
78 ++#elif __linux__
79 ++#include <linux/limits.h>
80 ++#endif
81 +
82 + #include <tox/tox.h>
83
84 diff --git a/net-im/toxic/metadata.xml b/net-im/toxic/metadata.xml
85 index 799dd08bb74..a2f38a60d5b 100644
86 --- a/net-im/toxic/metadata.xml
87 +++ b/net-im/toxic/metadata.xml
88 @@ -21,6 +21,7 @@
89 </longdescription>
90 <use>
91 <flag name="audio-notify">Enables native sound notifications</flag>
92 + <flag name="games">Enables some small mini-games</flag>
93 <flag name="llvm">Enables support for LLVM Address Sanitizer</flag>
94 <flag name="notification">Enables desktop notifications with libnotify, with sound support.</flag>
95 <flag name="qrcode">Enables QR code support</flag>
96
97 diff --git a/net-im/toxic/toxic-0.11.1.ebuild b/net-im/toxic/toxic-0.11.1.ebuild
98 new file mode 100644
99 index 00000000000..f0ddb6556dd
100 --- /dev/null
101 +++ b/net-im/toxic/toxic-0.11.1.ebuild
102 @@ -0,0 +1,114 @@
103 +# Copyright 1999-2021 Gentoo Authors
104 +# Distributed under the terms of the GNU General Public License v2
105 +
106 +EAPI=7
107 +
108 +PYTHON_COMPAT=( python3_{8,9,10} )
109 +
110 +inherit python-single-r1 xdg
111 +
112 +DESCRIPTION="A curses-based client for Tox"
113 +HOMEPAGE="https://github.com/JFreegman/toxic"
114 +SRC_URI="https://github.com/JFreegman/toxic/archive/v${PV}.tar.gz -> ${P}.tar.gz"
115 +
116 +LICENSE="GPL-3+"
117 +SLOT="0"
118 +KEYWORDS="~amd64 ~x86"
119 +IUSE="+audio-notify debug games llvm notification png python qrcode +sound +video +X"
120 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )
121 + video? ( sound X ) "
122 +
123 +BDEPEND="dev-libs/libconfig:="
124 +
125 +RDEPEND="net-libs/tox:=
126 + net-misc/curl
127 + sys-kernel/linux-headers
128 + sys-libs/ncurses:=
129 + audio-notify? (
130 + media-libs/freealut
131 + media-libs/openal
132 + )
133 + notification? ( x11-libs/libnotify )
134 + debug? ( llvm? ( sys-devel/llvm:* ) )
135 + python? ( ${PYTHON_DEPS} )
136 + qrcode? (
137 + media-gfx/qrencode:=
138 + png? ( media-libs/libpng )
139 + )
140 + sound? (
141 + media-libs/openal
142 + net-libs/tox:=[av]
143 + )
144 + X? (
145 + x11-base/xorg-proto
146 + x11-libs/libX11
147 + )"
148 +
149 +DEPEND="${RDEPEND}"
150 +
151 +pkg_setup() {
152 + use python && python-single-r1_pkg_setup
153 +}
154 +
155 +src_prepare() {
156 + default
157 + #prevent man files from being compressed.
158 + sed -i -e "/gzip/d" cfg/targets/install.mk || die "Unable to prevent compression of man pages."
159 + #Fix incorrect linkage of pthread (may be optional)
160 + sed -i -e 's/pthread/lpthread/g' Makefile || die "Unable to fix linking of pthread."
161 + #Makefile sets some required CFLAGS only if CFLAGS variable is undefined,
162 + #This line changes the "lazy set if absent" assignment to a "lazy set" assignment.
163 + #look below in src_configure to see how CFLAGS are passed to the makefile in USER_CFLAGS
164 + sed -i -e 's/?=/=/g' Makefile || die "Unable to change assignment of CFLAGS and LDFLAGS"
165 + #Fix incomplete invocation of python-config
166 + sed -i -e "s/--ldflags/--ldflags --embed/" cfg/checks/python.mk || die "Unable to fix python linking"
167 + #This is to fix incorrect include statements of NAME_MAX and PATH_MAX macros
168 + eapply -p0 "${FILESDIR}/${P}-NAME_MAX-and-PATH_MAX.patch" || die "Unable to fix include statements"
169 +}
170 +
171 +src_configure() {
172 + if ! use audio-notify; then
173 + export DISABLE_SOUND_NOTIFY=1
174 + fi
175 + if use debug; then
176 + export ENABLE_RELEASE=0
177 + if use llvm; then
178 + export ENABLE_ASAN=1
179 + fi
180 + fi
181 + if ! use games; then
182 + export DISABLE_GAMES=1
183 + fi
184 + if ! use notification; then
185 + export DISABLE_DESKTOP_NOTIFY=1
186 + fi
187 + if ! use png; then
188 + export DISABLE_QRPNG=1
189 + fi
190 + if use python; then
191 + export ENABLE_PYTHON=1
192 + fi
193 + if ! use qrcode; then
194 + export DISABLE_QRCODE=1
195 + fi
196 + if ! use sound; then
197 + export DISABLE_AV=1
198 + fi
199 + if ! use video; then
200 + export DISABLE_VI=1
201 + fi
202 + if ! use X; then
203 + export DISABLE_X11=1
204 + fi
205 + export USER_CFLAGS="${CFLAGS}"
206 + export USER_LDFLAGS="${LDFLAGS}"
207 + #set install directory to /usr.
208 + sed -i -e "s,/usr/local,${EPREFIX}/usr,g" cfg/global_vars.mk || die "Failed to set install directory!"
209 +}
210 +
211 +src_install() {
212 + default
213 + if ! use audio-notify; then
214 + rm -r "${ED}"/usr/share/${PN}/sounds || die "Could not remove sounds directory"
215 + fi
216 +}