From c123aa26f5d2ea3e1029cbb5e58d45ffbabcbf8d Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Mon, 26 Apr 2021 01:46:20 +0200 Subject: [PATCH] dev-libs/protothreads: respect CC Closes: https://bugs.gentoo.org/784938 Package-Manager: Portage-3.0.18, Repoman-3.0.3 Signed-off-by: Alessandro Barbieri --- .../protothreads/files/respect-cflags.patch | 8 ++++++++ dev-libs/protothreads/protothreads-1.4.ebuild | 17 +++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 dev-libs/protothreads/files/respect-cflags.patch diff --git a/dev-libs/protothreads/files/respect-cflags.patch b/dev-libs/protothreads/files/respect-cflags.patch new file mode 100644 index 0000000000..395764048a --- /dev/null +++ b/dev-libs/protothreads/files/respect-cflags.patch @@ -0,0 +1,8 @@ +--- a/Makefile ++++ b/Makefile +@@ -1,4 +1,4 @@ +-CFLAGS=-O -Wuninitialized -Werror ++CFLAGS+=-Wuninitialized + + all: example-codelock example-buffer example-small + diff --git a/dev-libs/protothreads/protothreads-1.4.ebuild b/dev-libs/protothreads/protothreads-1.4.ebuild index dd783a3517..544561d4d3 100644 --- a/dev-libs/protothreads/protothreads-1.4.ebuild +++ b/dev-libs/protothreads/protothreads-1.4.ebuild @@ -1,9 +1,11 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI="7" -DESCRIPTION="Protothreads - Lightweight, Stackless Threads in C" +inherit toolchain-funcs + +DESCRIPTION="Lightweight, Stackless Threads in C" HOMEPAGE="https://web.archive.org/web/20190923093100/http://dunkels.com/adam/pt/" SRC_URI=" https://web.archive.org/web/20190518175329/http://dunkels.com/adam/download/pt-${PV}.tar.gz -> ${P}.tar @@ -16,7 +18,7 @@ KEYWORDS="~amd64" IUSE="doc examples" BDEPEND="doc? ( app-doc/doxygen )" - +PATCHES=( "${FILESDIR}/respect-cflags.patch" ) S="${WORKDIR}/pt-${PV}" src_unpack() { @@ -24,13 +26,8 @@ src_unpack() { cp "${DISTDIR}/graham-pt.h" "${S}" } -src_prepare() { - sed -i 's/-Werror//g' Makefile - sed -i 's/-O//g' Makefile - default -} - src_compile() { + export CC=$(tc-getCC) default use doc && cd doc && emake } @@ -44,7 +41,7 @@ src_install() { dodoc README docinto html dodoc -r doc/html/. - + docompress -x "/usr/share/doc/${P}/html" fi if use examples ; then insinto "/usr/share/${P}/examples"