--- /dev/null
+--- a/X_graphics.c
++++ b/X_graphics.c
+@@ -10,7 +10,6 @@
+ #include "paint.h"
+ char X_graphics_Id[]="$Id: X_graphics.c,v 1.26 2009/08/28 09:09:17 spb Exp $";
+
+-char *display=NULL; /* name of display to open, NULL for default */
+ char *geom=NULL; /* geometry of window, NULL for default */
+
+ Atom wm_protocols;
+@@ -264,7 +263,8 @@
+ graph_height = gptr->graph_height;
+ /*{{{open display*/
+
+- dpy = XOpenDisplay(display);
++/* display to open, NULL for default */
++ dpy = XOpenDisplay(NULL);
+
+ if( ! dpy )
+ {
--- /dev/null
+--- a/Makefile.alt.JeR
++++ b/Makefile.alt
+@@ -8,17 +8,17 @@
+
+ LOCAL_LIBRARIES = -lX11
+ SYS_LIBRARIES = -lm
+- SRCS = calcalt.c random.c artist.c global.c xmountains.c X_graphics.c print_alg.c
+- OBJS = calcalt.o random.o artist.o global.o xmountains.o X_graphics.o print_alg.o
+- HDRS = crinkle.h global.h paint.h patchlevel.h copyright.h
++ SRCS = calcalt.c random.c artist.c xmountains.c X_graphics.c print_alg.c
++ OBJS = calcalt.o random.o artist.o xmountains.o X_graphics.o print_alg.o
++ HDRS = crinkle.h paint.h patchlevel.h copyright.h
+
+ xmountains: $(OBJS)
+ $(CC) $(LDFLAGS) -o xmountains $(OBJS) -lX11 -lm
+
+
+ calcalt.o: crinkle.h
+-artist.o: global.h paint.h crinkle.h
+-global.o: crinkle.h paint.h
+-xmountains.o: paint.h global.h patchlevel.h copyright.h crinkle.h
++artist.o: paint.h crinkle.h
++: crinkle.h paint.h
++xmountains.o: paint.h patchlevel.h copyright.h crinkle.h
+ X_graphics.o: paint.h crinkle.h
+
--- /dev/null
+--- a/xmountains.c
++++ b/xmountains.c
+@@ -144,7 +144,7 @@
+ void seed_uni(int ijkl);
+ void plot_column(Graph *g);
+
+-main (argc,argv)
++int main (argc,argv)
+ int argc;
+ char **argv;
+ {
--- /dev/null
+--- a/xmountains.c.JeR
++++ b/xmountains.c
+@@ -1,4 +1,5 @@
+
++#include <string.h> /* strcmp() */
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <strings.h>
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=6
-
+EAPI=7
inherit toolchain-funcs
-MY_P=${P/-/_}
-
DESCRIPTION="Fractal terrains of snow-capped mountains near water"
HOMEPAGE="https://spbooth.github.io/xmountains/"
-SRC_URI="http://www.epcc.ed.ac.uk/~spb/${PN}/${MY_P}.tar.gz"
+SRC_URI="http://www.epcc.ed.ac.uk/~spb/${PN}/${P/-/_}.tar.gz"
LICENSE="HPND"
SLOT="0"
KEYWORDS="amd64 ppc x86"
-IUSE=""
RDEPEND="
x11-libs/libX11
- x11-misc/xbitmaps"
-DEPEND="${RDEPEND}
- x11-base/xorg-proto"
-
+ x11-misc/xbitmaps
+"
+DEPEND="
+ ${RDEPEND}
+ x11-base/xorg-proto
+"
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.9-fno-common.patch
+ "${FILESDIR}"/${PN}-2.9-global.patch
+ "${FILESDIR}"/${PN}-2.9-main.patch
+ "${FILESDIR}"/${PN}-2.9-string.patch
+)
S=${WORKDIR}
-src_prepare() {
- default
- # add missing include for strcmp
- sed -i xmountains.c -e '1a#include <string.h> /* strcmp() */' || die
- # remove obsolete references to global.*
- sed -i Makefile.alt README -e 's|global\..||g' || die
-}
-
src_compile() {
emake \
-f Makefile.alt \
CC="$(tc-getCC)" \
CFLAGS="${CFLAGS}" \
- LDFLAGS="${LDFLAGS}" \
+ LDFLAGS="${CFLAGS} ${LDFLAGS}" \
${PN}
}