commit:     a7c3ce7ad6d180012f9917bd51724ae31d32194f
Author:     Jakov Smolic <jakov.smolic <AT> sartura <DOT> hr>
AuthorDate: Wed Feb 17 09:36:10 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Wed Feb 17 09:36:10 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a7c3ce7a

dev-lang/snobol: Port to EAPI 7

Closes: https://bugs.gentoo.org/712278

Signed-off-by: Jakov Smolic <jakov.smolic <AT> sartura.hr>
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 .../snobol/files/snobol-1.4.1-fno-common.patch     | 31 ++++++++++++++++
 dev-lang/snobol/metadata.xml                       |  8 ++---
 ...{snobol-1.4.1.ebuild => snobol-1.4.1-r1.ebuild} | 41 +++++++++++-----------
 3 files changed, 56 insertions(+), 24 deletions(-)

diff --git a/dev-lang/snobol/files/snobol-1.4.1-fno-common.patch 
b/dev-lang/snobol/files/snobol-1.4.1-fno-common.patch
new file mode 100644
index 00000000000..8814867c2ae
--- /dev/null
+++ b/dev-lang/snobol/files/snobol-1.4.1-fno-common.patch
@@ -0,0 +1,31 @@
+--- a/include/macros.h
++++ b/include/macros.h
+@@ -192,7 +192,7 @@ extern volatile int math_error;
+ #define RETURN(VALUE) {RSTSTK(); return (VALUE);}
+ #endif /* TRACE_DEPTH not defined */
+ 
+-struct descr _NORET[1];
++extern struct descr _NORET[1];
+ #define NORET ((ptr_t)_NORET)
+ 
+ /****************/
+--- a/isnobol4.c
++++ b/isnobol4.c
+@@ -4,6 +4,7 @@
+ 
+ # include "mlink.h"
+ # include "parms.h"
++extern struct descr _NORET[1];
+ static int
+ ENDALL(retval)
+     ret_t retval;
+--- a/main.c
++++ b/main.c
+@@ -46,6 +46,7 @@ struct vars *varp;
+ const char vers[] = VERSION;
+ const char vdate[] = VERSION_DATE;
+ const char snoname[] = "CSNOBOL4";
++struct descr _NORET[1];
+ 
+ int
+ main(argc, argv)

diff --git a/dev-lang/snobol/metadata.xml b/dev-lang/snobol/metadata.xml
index a4e0d354f69..4073267daf2 100644
--- a/dev-lang/snobol/metadata.xml
+++ b/dev-lang/snobol/metadata.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
 <pkgmetadata>
-    <maintainer type="person">
-        <email>robb...@gentoo.org</email>
-        <name>Robin H. Johnson</name>
-    </maintainer>
+       <maintainer type="person">
+               <email>robb...@gentoo.org</email>
+               <name>Robin H. Johnson</name>
+       </maintainer>
 </pkgmetadata>

diff --git a/dev-lang/snobol/snobol-1.4.1.ebuild 
b/dev-lang/snobol/snobol-1.4.1-r1.ebuild
similarity index 52%
rename from dev-lang/snobol/snobol-1.4.1.ebuild
rename to dev-lang/snobol/snobol-1.4.1-r1.ebuild
index 24b2727cb01..d213113e122 100644
--- a/dev-lang/snobol/snobol-1.4.1.ebuild
+++ b/dev-lang/snobol/snobol-1.4.1-r1.ebuild
@@ -1,10 +1,11 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
+EAPI=7
 
-MY_P="${PN}4-${PV}"
+inherit toolchain-funcs
 
+MY_P="${PN}4-${PV}"
 DESCRIPTION="Phil Budne's port of Macro SNOBOL4 in C, for modern machines"
 HOMEPAGE="http://www.snobol4.org/csnobol4/";
 SRC_URI="ftp://ftp.snobol4.org/snobol/old/${MY_P}.tar.gz";
@@ -14,39 +15,39 @@ SLOT="0"
 KEYWORDS="~amd64 ~x86"
 IUSE="doc"
 
-DEPEND="
-       sys-devel/gcc
-       sys-devel/m4
-       sys-libs/gdbm[berkdb]
-"
-S=${WORKDIR}/${MY_P}
+DEPEND="sys-libs/gdbm[berkdb]"
+RDEPEND="${DEPEND}"
+BDEPEND="sys-devel/m4"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=( "${FILESDIR}"/${P}-fno-common.patch )
 
 src_prepare() {
-       sed -e '/autoconf/s:autoconf:./autoconf:g' \
-               -i configure || die 'autoconf sed failed'
-       sed -e 's/$(INSTALL) -s/$(INSTALL)/' \
-               -i Makefile2.m4 || die 'strip sed failed'
-       echo "ADD_OPT([${CFLAGS}])" >>${S}/local-config
-       echo "ADD_CPPFLAGS([-DUSE_STDARG_H])" >>${S}/local-config
-       echo "ADD_CPPFLAGS([-DHAVE_STDARG_H])" >>${S}/local-config
+       default
+       sed -i -e '/autoconf/s:autoconf:./autoconf:g' configure || die
+       sed -i -e 's/$(INSTALL) -s/$(INSTALL)/' Makefile2.m4 || die
+       echo "ADD_OPT([${CFLAGS}])" >> local-config || die
+       echo "ADD_CPPFLAGS([-DUSE_STDARG_H])" >> local-config || die
+       echo "ADD_CPPFLAGS([-DHAVE_STDARG_H])" >> local-config || die
 
        # this cannot work and will cause funny sandbox violations
        sed -i -e 's~/usr/bin/emerge info~~' timing || die "Failed to exorcise 
the sandbox violations"
 }
 
 src_configure() {
+       tc-export CC
        ./configure --prefix="${EPREFIX}/usr" \
                --snolibdir="${EPREFIX}/usr/lib/snobol4" \
                --mandir="${EPREFIX}/usr/share/man" \
-               --add-cflags="${CFLAGS}"
+               --add-cflags="${CFLAGS}" || die
 }
 
 src_install() {
        emake DESTDIR="${D}" install
 
-       rm "${ED%/}"/usr/lib/snobol4/{load.txt,README}
+       rm "${ED}"/usr/lib/snobol4/{load.txt,README} || die
 
        dodoc doc/*txt
-
-       use doc && dohtml doc/*html
+       use doc && dodoc -r doc/*html
 }

Reply via email to