commit:     0fb4370d24599d56435c8427b727b949cf5a36e4
Author:     Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
AuthorDate: Mon Apr 18 16:05:40 2022 +0000
Commit:     Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
CommitDate: Tue Apr 19 18:31:26 2022 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=0fb4370d

dev-libs/protothreads: EAPI 8

Closes: https://bugs.gentoo.org/785367
Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>

 .../files/protothreads-1.4-fix-clang-build.patch   | 16 +++++++++++++++
 ...patch => protothreads-1.4-respect-cflags.patch} |  0
 ...reads-1.4.ebuild => protothreads-1.4-r1.ebuild} | 24 ++++++++++++++--------
 3 files changed, 31 insertions(+), 9 deletions(-)

diff --git a/dev-libs/protothreads/files/protothreads-1.4-fix-clang-build.patch 
b/dev-libs/protothreads/files/protothreads-1.4-fix-clang-build.patch
new file mode 100644
index 000000000..34b4446cd
--- /dev/null
+++ b/dev-libs/protothreads/files/protothreads-1.4-fix-clang-build.patch
@@ -0,0 +1,16 @@
+--- a/Makefile
++++ b/Makefile
+@@ -1,9 +1,9 @@
+-CFLAGS+=-Wuninitialized
++CFLAGS+=-Wuninitialized -I. -fPIE
+ 
+ all: example-codelock example-buffer example-small
+ 
+-example-codelock: example-codelock.c pt.h lc.h
++example-codelock: example-codelock.c
+ 
+-example-buffer: example-buffer.c pt.h lc.h
++example-buffer: example-buffer.c
+ 
+-example-small: example-small.c pt.h lc.h
++example-small: example-small.c

diff --git a/dev-libs/protothreads/files/respect-cflags.patch 
b/dev-libs/protothreads/files/protothreads-1.4-respect-cflags.patch
similarity index 100%
rename from dev-libs/protothreads/files/respect-cflags.patch
rename to dev-libs/protothreads/files/protothreads-1.4-respect-cflags.patch

diff --git a/dev-libs/protothreads/protothreads-1.4.ebuild 
b/dev-libs/protothreads/protothreads-1.4-r1.ebuild
similarity index 76%
rename from dev-libs/protothreads/protothreads-1.4.ebuild
rename to dev-libs/protothreads/protothreads-1.4-r1.ebuild
index 544561d4d..c312adc83 100644
--- a/dev-libs/protothreads/protothreads-1.4.ebuild
+++ b/dev-libs/protothreads/protothreads-1.4-r1.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI="7"
+EAPI=8
 
 inherit toolchain-funcs
 
@@ -11,6 +11,7 @@ SRC_URI="
        
https://web.archive.org/web/20190518175329/http://dunkels.com/adam/download/pt-${PV}.tar.gz
 -> ${P}.tar
        
https://web.archive.org/web/20190518175329/http://dunkels.com/adam/download/graham-pt.h
 "
+S="${WORKDIR}/pt-${PV}"
 
 LICENSE="BSD"
 SLOT="0"
@@ -18,18 +19,23 @@ KEYWORDS="~amd64"
 IUSE="doc examples"
 
 BDEPEND="doc? ( app-doc/doxygen )"
-PATCHES=( "${FILESDIR}/respect-cflags.patch" )
-S="${WORKDIR}/pt-${PV}"
+PATCHES=(
+       "${FILESDIR}/${P}-respect-cflags.patch"
+       "${FILESDIR}/${P}-fix-clang-build.patch"
+)
 
 src_unpack() {
        default
-       cp "${DISTDIR}/graham-pt.h" "${S}"
+       cp "${DISTDIR}/graham-pt.h" "${S}" || die
 }
 
 src_compile() {
-       export CC=$(tc-getCC)
-       default
-       use doc && cd doc && emake
+       tc-export CC
+       use examples && emake
+       if use doc ; then
+               pushd doc || die
+               emake
+       fi
 }
 
 src_install() {
@@ -46,7 +52,7 @@ src_install() {
        if use examples ; then
                insinto "/usr/share/${P}/examples"
                doins *.c
-               exeinto "/usr/libexec/${P}"
+               exeinto "/usr/libexec/${PN}"
                doexe example-buffer
                doexe example-codelock
                doexe example-small

Reply via email to