Skip to content

Commit

Permalink
games-misc/fortune-mod: port to EAPI 7, eutils--
Browse files Browse the repository at this point in the history
Signed-off-by: Sam James <[email protected]>
  • Loading branch information
thesamesam committed Apr 4, 2021
1 parent 21545c5 commit 3e90b0c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 19 deletions.
4 changes: 2 additions & 2 deletions games-misc/fortune-mod/files/01_all_fortune_all-fix.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- fortune/fortune.c.old 2006-03-11 15:33:14.000000000 +0100
+++ fortune/fortune.c 2006-03-11 15:43:16.000000000 +0100
--- a/fortune/fortune.c
+++ b/fortune/fortune.c
@@ -974,7 +974,7 @@
if (!ret)
ret=add_file(percent, fullpathname, NULL, &File_list,
Expand Down
24 changes: 12 additions & 12 deletions games-misc/fortune-mod/files/fortune-mod-1.99.1-gentoo.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- fortune-mod-1.99.1/datfiles/Makefile
+++ fortune-mod-1.99.1/datfiles/Makefile
--- a/datfiles/Makefile
+++ b/datfiles/Makefile
@@ -58,7 +58,7 @@
if [ $(WEB) = 1 ] ; then cd html && $(MAKE) install ; fi
for i in $(COOKIES) ; do \
Expand All @@ -9,8 +9,8 @@
done

clean:
--- fortune-mod-1.99.1/datfiles/off/Makefile
+++ fortune-mod-1.99.1/datfiles/off/Makefile
--- a/datfiles/off/Makefile
+++ b/datfiles/off/Makefile
@@ -38,7 +38,7 @@
install -m 0755 -d $(OCOOKIEDIR)
for i in $(OCOOKIES) ; \
Expand All @@ -20,8 +20,8 @@
done

clean:
--- fortune-mod-1.99.1/Makefile
+++ fortune-mod-1.99.1/Makefile
--- a/Makefile
+++ b/Makefile
@@ -65,8 +65,7 @@
RECODELIBS=-lrecode

Expand All @@ -32,8 +32,8 @@

# The above flags are used by default; the debug flags are used when make
# is called with a debug target, such as 'make debug'
--- fortune-mod-1.99.1/fortune/fortune.c
+++ fortune-mod-1.99.1/fortune/fortune.c
--- a/fortune/fortune.c
+++ b/fortune/fortune.c
@@ -97,7 +97,7 @@
#endif /* killing warnings */

Expand Down Expand Up @@ -72,8 +72,8 @@
crequest = malloc(strlen(ctype) + 7 + 1);
sprintf(crequest, "UTF-8..%s", ctype);
recode_scan_request (request, crequest);
--- fortune-mod-1.99.1/util/rot.c
+++ fortune-mod-1.99.1/util/rot.c
--- a/util/rot.c
+++ b/util/rot.c
@@ -5,10 +5,11 @@

#include <stdio.h>
Expand All @@ -87,8 +87,8 @@

while ((a = getchar()) != EOF)
{
--- fortune-mod-1.99.1/util/unstr.c
+++ fortune-mod-1.99.1/util/unstr.c
--- a/util/unstr.c
+++ b/util/unstr.c
@@ -96,6 +96,7 @@
#include <string.h>
#include <unistd.h>
Expand Down
17 changes: 12 additions & 5 deletions games-misc/fortune-mod/fortune-mod-1.99.1-r3.ebuild
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=5
inherit eutils toolchain-funcs
EAPI=7

inherit toolchain-funcs

DESCRIPTION="The notorious fortune program"
HOMEPAGE="http://www.redellipse.net/code/fortune"
Expand All @@ -16,9 +17,13 @@ IUSE="offensive elibc_glibc"
DEPEND="app-text/recode:0="
RDEPEND="${DEPEND}"

PATCHES=(
"${FILESDIR}"/${P}-gentoo.patch
"${FILESDIR}"/01_all_fortune_all-fix.patch
)

src_prepare() {
epatch "${FILESDIR}"/${P}-gentoo.patch \
"${FILESDIR}"/01_all_fortune_all-fix.patch
default

sed -i \
-e 's:/games::' \
Expand All @@ -37,9 +42,11 @@ src_prepare() {
Makefile \
|| die "sed REGEXLIBS failed"
fi

if [[ ${CHOST} == *-solaris* ]] ; then
sed -i -e 's:u_int:uint:g' util/strfile.h || die "sed strfile.h failed"
fi

if [[ ${CHOST} == *-darwin* ]] ; then
sed -i -e 's/-DBSD_REGEX/-DPOSIX_REGEX/' Makefile || die "sed Makefile failed"
fi
Expand All @@ -48,7 +55,7 @@ src_prepare() {
src_compile() {
local myrex=
[[ ${CHOST} == *-interix* ]] && myrex="REGEXDEFS=-DNO_REGEX"
emake prefix="${EPREFIX}" CC="$(tc-getCC)" $myrex
emake prefix="${EPREFIX}" CC="$(tc-getCC)" ${myrex}
}

src_install() {
Expand Down

0 comments on commit 3e90b0c

Please sign in to comment.