mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-20 22:27:17 -08:00
net-im/toxic: Fix incorrect header file inclusion
It seems that the upstream developer believes that the macros NAME_MAX and PATH_MAX are defined in <limits.h> when they are really defined in <linux/limits.h>. More interestingly, it seems that GCC automatically corrects for this while clang does not. This commit adds patches necessary to fix this as well as some minor fixes. Signed-off-by: Josiah Mullins <JoMull01@protonmail.com> Closes: https://bugs.gentoo.org/803404 Signed-off-by: Joonas Niilola <juippis@gentoo.org>
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
diff -ruN src/autocomplete.c src/autocomplete.c
|
||||
--- src/autocomplete.c 2021-07-26 15:04:59.172715491 -0400
|
||||
+++ src/autocomplete.c 2021-07-26 15:22:06.652686609 -0400
|
||||
@@ -25,10 +25,12 @@
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
-#include <sys/types.h>
|
||||
#include <sys/dir.h>
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/sysinfo.h>
|
||||
#else
|
||||
#include <dirent.h>
|
||||
+#include <linux/limits.h>
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
#include "configdir.h"
|
||||
diff -ruN src/file_transfers.h src/file_transfers.h
|
||||
--- src/file_transfers.h 2021-07-26 15:39:36.765990567 -0400
|
||||
+++ src/file_transfers.h 2021-07-26 15:39:41.899323757 -0400
|
||||
@@ -24,6 +24,12 @@
|
||||
#define FILE_TRANSFERS_H
|
||||
|
||||
#include <limits.h>
|
||||
+//This includes NAME_MAX and PATH_MAX
|
||||
+#ifdef __APPLE__
|
||||
+#include <sys/sysinfo.h>
|
||||
+#elif __linux__
|
||||
+#include <linux/limits.h>
|
||||
+#endif
|
||||
|
||||
#include "notify.h"
|
||||
#include "toxic.h"
|
||||
diff -ruN src/settings.h src/settings.h
|
||||
--- src/settings.h 2021-07-26 15:04:59.176048823 -0400
|
||||
+++ src/settings.h 2021-07-26 15:12:01.772703590 -0400
|
||||
@@ -24,6 +24,12 @@
|
||||
#define SETTINGS_H
|
||||
|
||||
#include <limits.h>
|
||||
+//This includes NAME_MAX and PATH_MAX
|
||||
+#ifdef __APPLE__
|
||||
+#include <sys/sysinfo.h>
|
||||
+#elif __linux__
|
||||
+#include <linux/limits.h>
|
||||
+#endif
|
||||
|
||||
#include <tox/tox.h>
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
diff -ruN src/autocomplete.c src/autocomplete.c
|
||||
--- src/autocomplete.c 2021-07-26 10:43:37.453154392 -0400
|
||||
+++ src/autocomplete.c 2021-07-26 10:59:29.856460938 -0400
|
||||
@@ -27,8 +27,11 @@
|
||||
#ifdef __APPLE__
|
||||
#include <sys/types.h>
|
||||
#include <sys/dir.h>
|
||||
-#else
|
||||
+//This include NAME_MAX
|
||||
+#include <sys/sysinfo.h>
|
||||
+#elif __linux__
|
||||
#include <dirent.h>
|
||||
+#include <linux/limits.h>//This includes NAME_MAX
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
#include "windows.h"
|
||||
diff -ruN src/file_transfers.h src/file_transfers.h
|
||||
--- src/file_transfers.h 2021-07-26 10:43:37.456487724 -0400
|
||||
+++ src/file_transfers.h 2021-07-26 11:41:30.513057111 -0400
|
||||
@@ -24,6 +24,12 @@
|
||||
#define FILE_TRANSFERS_H
|
||||
|
||||
#include <limits.h>
|
||||
+//This includes PATH_MAX
|
||||
+#ifdef __APPLE__
|
||||
+#include <sys/sysinfo.h>
|
||||
+#elif __linux__
|
||||
+#include <linux/limits.h>
|
||||
+#endif
|
||||
|
||||
#include "toxic.h"
|
||||
#include "windows.h"
|
||||
diff -ruN src/settings.h src/settings.h
|
||||
--- src/settings.h 2021-07-26 10:43:37.459821058 -0400
|
||||
+++ src/settings.h 2021-07-26 11:45:46.709716594 -0400
|
||||
@@ -25,6 +25,13 @@
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
+//This includes PATH_MAX
|
||||
+#ifdef __APPLE__
|
||||
+#include <sys/sysinfo.h>
|
||||
+#elif __linux__
|
||||
+#include <linux/limits.h>
|
||||
+#endif
|
||||
+
|
||||
#include <tox/tox.h>
|
||||
|
||||
/* Represents line_* hints max strlen */
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
EAPI=7
|
||||
|
||||
PYTHON_COMPAT=( python3_{7,8,9} )
|
||||
PYTHON_COMPAT=( python3_{7,8,9,10} )
|
||||
|
||||
inherit python-single-r1 xdg
|
||||
|
||||
@@ -18,10 +18,12 @@ IUSE="+audio-notify debug doc llvm notification png python qrcode +sound +video
|
||||
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )
|
||||
video? ( sound X ) "
|
||||
|
||||
RDEPEND="dev-libs/libconfig:=
|
||||
net-libs/tox:=
|
||||
BDEPEND="dev-libs/libconfig"
|
||||
|
||||
RDEPEND="net-libs/tox:=
|
||||
net-misc/curl
|
||||
sys-libs/ncurses:=
|
||||
sys-kernel/linux-headers
|
||||
audio-notify? (
|
||||
media-libs/freealut
|
||||
media-libs/openal
|
||||
@@ -58,6 +60,10 @@ src_prepare() {
|
||||
#This line changes the "lazy set if absent" assignment to a "lazy set" assignment.
|
||||
#look below in src_configure to see how CFLAGS are passed to the makefile in USER_CFLAGS
|
||||
sed -i -e 's/?=/=/g' Makefile || die "Unable to force CFLAGS and LDFLAGS"
|
||||
#Fix incomplete invocation of python-config
|
||||
sed -i -e "s/--ldflags/--ldflags --embed/" cfg/checks/python.mk || die "Unable to fix python linking"
|
||||
#Fix incorrect include statements for NAME_MAX and PATH_MAX macros
|
||||
eapply -p0 "${FILESDIR}/${P}-NAME_MAX-and-PATH_MAX.patch" || die "Unable to fix header inclusion"
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
@@ -101,6 +107,6 @@ src_configure() {
|
||||
src_install() {
|
||||
default
|
||||
if ! use audio-notify; then
|
||||
rm -r "${ED}"/usr/share/${PN}/sounds || die "Could not remove sounds directory"
|
||||
rm -r "${ED}"/usr/share/"${PN}"/sounds || die "Could not remove sounds directory"
|
||||
fi
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
EAPI=7
|
||||
|
||||
PYTHON_COMPAT=( python3_{7,8,9} )
|
||||
PYTHON_COMPAT=( python3_{7,8,9,10} )
|
||||
|
||||
inherit python-single-r1 xdg
|
||||
|
||||
@@ -17,11 +17,12 @@ KEYWORDS="amd64 x86"
|
||||
IUSE="notification python qrcode +sound +video +X"
|
||||
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
|
||||
|
||||
RDEPEND="
|
||||
dev-libs/libconfig:=
|
||||
>=net-libs/tox-0.2.8:=
|
||||
BDEPEND="dev-libs/libconfig"
|
||||
|
||||
RDEPEND="net-libs/tox:=
|
||||
net-misc/curl
|
||||
sys-libs/ncurses:=
|
||||
sys-kernel/linux-headers
|
||||
notification? ( x11-libs/libnotify )
|
||||
python? ( ${PYTHON_DEPS} )
|
||||
qrcode? ( media-gfx/qrencode:= )
|
||||
@@ -45,6 +46,8 @@ src_prepare() {
|
||||
default
|
||||
#prevent man files from being compressed.
|
||||
sed -i -e "/gzip/d" cfg/targets/install.mk || die "Unable to prevent compression of man pages."
|
||||
#Fix incorrect include declarations for NAME_MAX and PATH_MAX.
|
||||
eapply -p0 "${FILESDIR}/${P}-NAME_MAX-and-PATH_MAX.patch" || die "Unable to fix include statements"
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
Reference in New Issue
Block a user