From 4ca7fb9be00c1d64e8d963012bca7fb0e64fb575 Mon Sep 17 00:00:00 2001 From: Josiah Mullins Date: Wed, 11 Aug 2021 18:10:35 -0400 Subject: 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 when they are really defined in . 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 Closes: https://bugs.gentoo.org/803404 Signed-off-by: Joonas Niilola --- .../files/toxic-0.10.1-NAME_MAX-and-PATH_MAX.patch | 49 +++++++++ .../files/toxic-0.8.3-NAME_MAX-and-PATH_MAX.patch | 49 +++++++++ net-im/toxic/toxic-0.10.1-r1.ebuild | 112 +++++++++++++++++++++ net-im/toxic/toxic-0.10.1.ebuild | 106 ------------------- net-im/toxic/toxic-0.8.3-r2.ebuild | 82 --------------- net-im/toxic/toxic-0.8.3-r3.ebuild | 85 ++++++++++++++++ 6 files changed, 295 insertions(+), 188 deletions(-) create mode 100644 net-im/toxic/files/toxic-0.10.1-NAME_MAX-and-PATH_MAX.patch create mode 100644 net-im/toxic/files/toxic-0.8.3-NAME_MAX-and-PATH_MAX.patch create mode 100644 net-im/toxic/toxic-0.10.1-r1.ebuild delete mode 100644 net-im/toxic/toxic-0.10.1.ebuild delete mode 100644 net-im/toxic/toxic-0.8.3-r2.ebuild create mode 100644 net-im/toxic/toxic-0.8.3-r3.ebuild (limited to 'net-im/toxic') diff --git a/net-im/toxic/files/toxic-0.10.1-NAME_MAX-and-PATH_MAX.patch b/net-im/toxic/files/toxic-0.10.1-NAME_MAX-and-PATH_MAX.patch new file mode 100644 index 000000000000..68cb0bb59ccc --- /dev/null +++ b/net-im/toxic/files/toxic-0.10.1-NAME_MAX-and-PATH_MAX.patch @@ -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 + + #ifdef __APPLE__ +-#include + #include ++#include ++#include + #else + #include ++#include + #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 ++//This includes NAME_MAX and PATH_MAX ++#ifdef __APPLE__ ++#include ++#elif __linux__ ++#include ++#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 ++//This includes NAME_MAX and PATH_MAX ++#ifdef __APPLE__ ++#include ++#elif __linux__ ++#include ++#endif + + #include + diff --git a/net-im/toxic/files/toxic-0.8.3-NAME_MAX-and-PATH_MAX.patch b/net-im/toxic/files/toxic-0.8.3-NAME_MAX-and-PATH_MAX.patch new file mode 100644 index 000000000000..11dc43c6b778 --- /dev/null +++ b/net-im/toxic/files/toxic-0.8.3-NAME_MAX-and-PATH_MAX.patch @@ -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 + #include +-#else ++//This include NAME_MAX ++#include ++#elif __linux__ + #include ++#include //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 ++//This includes PATH_MAX ++#ifdef __APPLE__ ++#include ++#elif __linux__ ++#include ++#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 + ++//This includes PATH_MAX ++#ifdef __APPLE__ ++#include ++#elif __linux__ ++#include ++#endif ++ + #include + + /* Represents line_* hints max strlen */ diff --git a/net-im/toxic/toxic-0.10.1-r1.ebuild b/net-im/toxic/toxic-0.10.1-r1.ebuild new file mode 100644 index 000000000000..931dd62fc29a --- /dev/null +++ b/net-im/toxic/toxic-0.10.1-r1.ebuild @@ -0,0 +1,112 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{7,8,9,10} ) + +inherit python-single-r1 xdg + +DESCRIPTION="A curses-based client for Tox" +HOMEPAGE="https://github.com/JFreegman/toxic" +SRC_URI="https://github.com/JFreegman/toxic/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="+audio-notify debug doc llvm notification png python qrcode +sound +video +X" +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} ) + video? ( sound X ) " + +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 + ) + notification? ( x11-libs/libnotify ) + debug? ( llvm? ( sys-devel/llvm:* ) ) + python? ( ${PYTHON_DEPS} ) + qrcode? ( + media-gfx/qrencode:= + png? ( media-libs/libpng ) + ) + sound? ( + media-libs/openal + net-libs/tox:=[av] + ) + X? ( + x11-base/xorg-proto + x11-libs/libX11 + )" + +DEPEND="${RDEPEND}" + +pkg_setup() { + use python && python-single-r1_pkg_setup +} + +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 linkage of pthread (may be optional) + sed -i -e 's/pthread/lpthread/g' Makefile || die "Unable to fix linking of pthread." + #Makefile sets some required CFLAGS only if CFLAGS variable is undefined, + #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() { + if ! use audio-notify; then + USER_CFLAGS+="-DDISABLE_SOUND_NOTIFY=1 " + fi + if use debug; then + USER_CFLAGS+="-DENABLE_RELEASE=0 " + if use llvm; then + USER_CFLAGS+="-DENABLE_ASAN=1 " + fi + fi + if ! use notification; then + USER_CFLAGS+="-DDISABLE_DESKTOP_NOTIFY=1 " + fi + if ! use png; then + USER_CFLAGS+="-DDISABLE_QRPNG=1 " + fi + if use python; then + USER_CFLAGS+="-DENABLE_PYTHON=1" + fi + if ! use qrcode; then + USER_CFLAGS+="-DDISABLE_QRCODE=1" + fi + if ! use sound; then + USER_CFLAGS+="-DDISABLE_AV=1 " + fi + if ! use video; then + USER_CFLAGS+="-DDISABLE_VI=1" + fi + if ! use X; then + USER_CFLAGS+="-DDISABLE_X11=1 " + fi + USER_CFLAGS+="${CFLAGS}" + export USER_CFLAGS + export USER_LDFLAGS="${LDFLAGS}" + #set install directory to /usr. + sed -i -e "s,/usr/local,${EPREFIX}/usr,g" cfg/global_vars.mk || die "Failed to set install directory!" +} + +src_install() { + default + if ! use audio-notify; then + rm -r "${ED}"/usr/share/"${PN}"/sounds || die "Could not remove sounds directory" + fi +} diff --git a/net-im/toxic/toxic-0.10.1.ebuild b/net-im/toxic/toxic-0.10.1.ebuild deleted file mode 100644 index 4f0639961dc5..000000000000 --- a/net-im/toxic/toxic-0.10.1.ebuild +++ /dev/null @@ -1,106 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{7,8,9} ) - -inherit python-single-r1 xdg - -DESCRIPTION="A curses-based client for Tox" -HOMEPAGE="https://github.com/JFreegman/toxic" -SRC_URI="https://github.com/JFreegman/toxic/archive/v${PV}.tar.gz -> ${P}.tar.gz" - -LICENSE="GPL-3+" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="+audio-notify debug doc llvm notification png python qrcode +sound +video +X" -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} ) - video? ( sound X ) " - -RDEPEND="dev-libs/libconfig:= - net-libs/tox:= - net-misc/curl - sys-libs/ncurses:= - audio-notify? ( - media-libs/freealut - media-libs/openal - ) - notification? ( x11-libs/libnotify ) - debug? ( llvm? ( sys-devel/llvm:* ) ) - python? ( ${PYTHON_DEPS} ) - qrcode? ( - media-gfx/qrencode:= - png? ( media-libs/libpng ) - ) - sound? ( - media-libs/openal - net-libs/tox:=[av] - ) - X? ( - x11-base/xorg-proto - x11-libs/libX11 - )" - -DEPEND="${RDEPEND}" - -pkg_setup() { - use python && python-single-r1_pkg_setup -} - -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 linkage of pthread (may be optional) - sed -i -e 's/pthread/lpthread/g' Makefile || die "Unable to fix linking of pthread." - #Makefile sets some required CFLAGS only if CFLAGS variable is undefined, - #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" -} - -src_configure() { - if ! use audio-notify; then - USER_CFLAGS+="-DDISABLE_SOUND_NOTIFY=1 " - fi - if use debug; then - USER_CFLAGS+="-DENABLE_RELEASE=0 " - if use llvm; then - USER_CFLAGS+="-DENABLE_ASAN=1 " - fi - fi - if ! use notification; then - USER_CFLAGS+="-DDISABLE_DESKTOP_NOTIFY=1 " - fi - if ! use png; then - USER_CFLAGS+="-DDISABLE_QRPNG=1 " - fi - if use python; then - USER_CFLAGS+="-DENABLE_PYTHON=1" - fi - if ! use qrcode; then - USER_CFLAGS+="-DDISABLE_QRCODE=1" - fi - if ! use sound; then - USER_CFLAGS+="-DDISABLE_AV=1 " - fi - if ! use video; then - USER_CFLAGS+="-DDISABLE_VI=1" - fi - if ! use X; then - USER_CFLAGS+="-DDISABLE_X11=1 " - fi - USER_CFLAGS+="${CFLAGS}" - export USER_CFLAGS - export USER_LDFLAGS="${LDFLAGS}" - #set install directory to /usr. - sed -i -e "s,/usr/local,${EPREFIX}/usr,g" cfg/global_vars.mk || die "Failed to set install directory!" -} - -src_install() { - default - if ! use audio-notify; then - rm -r "${ED}"/usr/share/${PN}/sounds || die "Could not remove sounds directory" - fi -} diff --git a/net-im/toxic/toxic-0.8.3-r2.ebuild b/net-im/toxic/toxic-0.8.3-r2.ebuild deleted file mode 100644 index fb4792fc89e0..000000000000 --- a/net-im/toxic/toxic-0.8.3-r2.ebuild +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{7,8,9} ) - -inherit python-single-r1 xdg - -DESCRIPTION="A curses-based client for Tox" -HOMEPAGE="https://github.com/JFreegman/toxic" -SRC_URI="https://github.com/JFreegman/toxic/archive/v${PV}.tar.gz -> ${P}.tar.gz" - -LICENSE="GPL-3+" -SLOT="0" -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:= - net-misc/curl - sys-libs/ncurses:= - notification? ( x11-libs/libnotify ) - python? ( ${PYTHON_DEPS} ) - qrcode? ( media-gfx/qrencode:= ) - sound? ( - media-libs/freealut - media-libs/openal - net-libs/tox:=[av] - ) - video? ( - media-libs/libvpx:= - net-libs/tox:=[av] - x11-libs/libX11 )" - -DEPEND="${RDEPEND}" - -pkg_setup() { - use python && python-single-r1_pkg_setup -} - -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." -} - -src_configure() { - export USER_CFLAGS="${CFLAGS}" - export USER_LDFLAGS="${LDFLAGS}" - if ! use sound; then - export DISABLE_AV=1 - export DISABLE_SOUND_NOTIFY=1 - fi - if ! use video; then - export DISABLE_VI=1 - fi - if ! use X; then - export DISABLE_X11=1 - fi - if ! use notification; then - export DISABLE_DESKTOP_NOTIFY=1 - fi - if ! use qrcode; then - export DISABLE_QRCODE=1 - export DISABLE_QRPNG=1 - fi - if use python; then - export ENABLE_PYTHON=1 - fi - #set install directory to /usr. - sed -i -e "s,/usr/local,${EPREFIX}/usr,g" cfg/global_vars.mk || die "Failed to set install directory!" -} - -src_install() { - default - if ! use sound; then - rm -r "${ED}"/usr/share/${PN}/sounds || die "Could not remove sounds directory" - fi -} diff --git a/net-im/toxic/toxic-0.8.3-r3.ebuild b/net-im/toxic/toxic-0.8.3-r3.ebuild new file mode 100644 index 000000000000..97ed2aa0ae38 --- /dev/null +++ b/net-im/toxic/toxic-0.8.3-r3.ebuild @@ -0,0 +1,85 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{7,8,9,10} ) + +inherit python-single-r1 xdg + +DESCRIPTION="A curses-based client for Tox" +HOMEPAGE="https://github.com/JFreegman/toxic" +SRC_URI="https://github.com/JFreegman/toxic/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="amd64 x86" +IUSE="notification python qrcode +sound +video +X" +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +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:= ) + sound? ( + media-libs/freealut + media-libs/openal + net-libs/tox:=[av] + ) + video? ( + media-libs/libvpx:= + net-libs/tox:=[av] + x11-libs/libX11 )" + +DEPEND="${RDEPEND}" + +pkg_setup() { + use python && python-single-r1_pkg_setup +} + +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() { + export USER_CFLAGS="${CFLAGS}" + export USER_LDFLAGS="${LDFLAGS}" + if ! use sound; then + export DISABLE_AV=1 + export DISABLE_SOUND_NOTIFY=1 + fi + if ! use video; then + export DISABLE_VI=1 + fi + if ! use X; then + export DISABLE_X11=1 + fi + if ! use notification; then + export DISABLE_DESKTOP_NOTIFY=1 + fi + if ! use qrcode; then + export DISABLE_QRCODE=1 + export DISABLE_QRPNG=1 + fi + if use python; then + export ENABLE_PYTHON=1 + fi + #set install directory to /usr. + sed -i -e "s,/usr/local,${EPREFIX}/usr,g" cfg/global_vars.mk || die "Failed to set install directory!" +} + +src_install() { + default + if ! use sound; then + rm -r "${ED}"/usr/share/${PN}/sounds || die "Could not remove sounds directory" + fi +} -- cgit v1.2.3