commit:     44646e26ab25ae7e7a4bb563476dfbc65af38e5c
Author:     Jakov Smolic <jakov.smolic <AT> sartura <DOT> hr>
AuthorDate: Sun Aug 22 19:37:23 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Aug 22 19:37:23 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=44646e26

sci-electronics/splat: Port to EAPI 8

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

 .../splat/files/splat-1.2.2-gcc43.patch            |  4 +-
 sci-electronics/splat/splat-1.4.2.ebuild           | 55 +++++++++++-----------
 2 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/sci-electronics/splat/files/splat-1.2.2-gcc43.patch 
b/sci-electronics/splat/files/splat-1.2.2-gcc43.patch
index 11e65e77f14..be906150b9f 100644
--- a/sci-electronics/splat/files/splat-1.2.2-gcc43.patch
+++ b/sci-electronics/splat/files/splat-1.2.2-gcc43.patch
@@ -1,5 +1,5 @@
---- splat-1.2.1.orig/utils/fontdata.c
-+++ splat-1.2.1/utils/fontdata.c
+--- a/utils/fontdata.c
++++ b/utils/fontdata.c
 @@ -32,6 +32,7 @@
  #include <string.h>
  #include <stdlib.h>

diff --git a/sci-electronics/splat/splat-1.4.2.ebuild 
b/sci-electronics/splat/splat-1.4.2.ebuild
index d9bb7221cd6..8a0b78e7f31 100644
--- a/sci-electronics/splat/splat-1.4.2.ebuild
+++ b/sci-electronics/splat/splat-1.4.2.ebuild
@@ -1,9 +1,9 @@
 # Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
+EAPI=8
 
-inherit epatch toolchain-funcs
+inherit toolchain-funcs
 
 DESCRIPTION="RF Signal Propagation, Loss, And Terrain analysis tool"
 HOMEPAGE="https://www.qsl.net/kd2bd/splat.html";
@@ -14,18 +14,20 @@ SLOT="0"
 KEYWORDS="~amd64 ~ppc ~x86"
 IUSE="doc hires l10n_es"
 
-DEPEND="sys-libs/zlib
-       app-arch/bzip2"
+DEPEND="
+       app-arch/bzip2
+       sys-libs/zlib
+"
 RDEPEND="${DEPEND}"
 
-src_prepare() {
-       epatch "${FILESDIR}/${PN}-1.2.2-gcc43.patch"
-}
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.2.2-gcc43.patch
+)
 
 src_configure() {
        # fake resulting file from interactive configuration script
        # using default resolution
-       cat <<- EOF > "${S}/splat.h"
+       cat <<- EOF > "${S}/splat.h" || die
                /* Parameters for 3 arc-second standard resolution mode of 
operation */
                #define MAXPAGES 9
                #define HD_MODE 0
@@ -33,7 +35,7 @@ src_configure() {
        if use hires; then
                # fake resulting file from interactive configuration script
                # using default resolution
-               cat <<- EOF > "${S}/hires.h"
+               cat <<- EOF > "${S}/hires.h" || die
                        /* Parameters for 3 arc-second hires resolution mode of 
operation */
                        #define MAXPAGES 9
                        #define HD_MODE 1
@@ -42,20 +44,21 @@ src_configure() {
 }
 
 src_compile() {
-       local CC=$(tc-getCC) CXX=$(tc-getCXX)
+       tc-export CC CXX
 
-       ${CXX} -Wall ${CXXFLAGS} ${LDFLAGS} itwom3.0.cpp splat.cpp -o rfsplat 
-lm -lbz2 || die
+       cp {splat,rfsplat}.cpp || die
+       emake LDLIBS="-lm -lbz2" -E "rfsplat: itwom3.0.o"
        if use hires; then
-               cp "${S}/hires.h" "${S}/splat.h"
-               ${CXX} -Wall ${CXXFLAGS} ${LDFLAGS} itwom3.0.cpp splat.cpp -o 
rfsplat-hd -lm -lbz2 || die
+               cp {hires,splat}.h || die
+               cp {splat,rfsplat-hd}.cpp || die
+               emake LDLIBS="-lm -lbz2" -E "rfsplat-hd: itwom3.0.o"
        fi
 
-       cd utils
-       ${CC} -Wall ${CFLAGS} ${LDFLAGS} citydecoder.c -o citydecoder
-       ${CC} -Wall ${CFLAGS} ${LDFLAGS} usgs2sdf.c    -o usgs2sdf
-       ${CC} -Wall ${CFLAGS} ${LDFLAGS} srtm2sdf.c    -o srtm2sdf   -lbz2
-       #${CC} -Wall ${CFLAGS} ${LDFLAGS} fontdata.c    -o fontdata   -lz
-       ${CC} -Wall ${CFLAGS} ${LDFLAGS} bearing.c     -o bearing    -lm
+       cd utils || die
+
+       emake citydecoder usgs2sdf
+       emake LDLIBS=-lbz2 srtm2sdf
+       emake LDLIBS=-lm bearing
 }
 
 src_install() {
@@ -63,9 +66,8 @@ src_install() {
        use l10n_es && SPLAT_LANG="spanish"
        # splat binary
        dobin rfsplat
-       if use hires; then
-               dobin rfsplat-hd
-       fi
+
+       use hires && dobin rfsplat-hd
 
        # utilities
        dobin utils/{citydecoder,usgs2sdf,srtm2sdf,postdownload,bearing}
@@ -74,17 +76,16 @@ src_install() {
        dodoc CHANGES README utils/fips.txt
        newdoc utils/README README.UTILS
 
-       if use doc; then
-               dodoc docs/${SPLAT_LANG}/{pdf/splat.pdf,postscript/splat.ps}
-       fi
+       use doc && dodoc docs/${SPLAT_LANG}/{pdf/splat.pdf,postscript/splat.ps}
+
        #sample data
        docinto sample_data
-       dodoc sample_data/*
+       dodoc -r sample_data/.
 }
 
 pkg_postinst() {
        elog "The original SPLAT! command got renamed to 'rfsplat' to avoid"
-       elog "filename collission with app-portage/splat."
+       elog "filename collision with app-portage/splat."
        elog ""
        elog "Be aware that it is still referenced as 'splat' in the 
documentation."
 }

Reply via email to