commit:     610599d8a8ea30956f5c9ce12db2d2f221dc4b34
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 27 04:20:45 2020 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Mon Jan 27 04:21:15 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=610599d8

x11-misc/xmountains: Fix CFLAGS=-fno-common

Package-Manager: Portage-2.3.85, Repoman-2.3.20
Closes: https://bugs.gentoo.org/show_bug.cgi?id=706606
Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>

 .../files/xmountains-2.9-fno-common.patch          | 20 ++++++++++++
 .../xmountains/files/xmountains-2.9-global.patch   | 26 ++++++++++++++++
 .../xmountains/files/xmountains-2.9-main.patch     | 11 +++++++
 .../xmountains/files/xmountains-2.9-string.patch   |  8 +++++
 x11-misc/xmountains/xmountains-2.9-r1.ebuild       | 36 ++++++++++------------
 5 files changed, 81 insertions(+), 20 deletions(-)

diff --git a/x11-misc/xmountains/files/xmountains-2.9-fno-common.patch 
b/x11-misc/xmountains/files/xmountains-2.9-fno-common.patch
new file mode 100644
index 00000000000..e7140ca4fad
--- /dev/null
+++ b/x11-misc/xmountains/files/xmountains-2.9-fno-common.patch
@@ -0,0 +1,20 @@
+--- 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 )
+   {

diff --git a/x11-misc/xmountains/files/xmountains-2.9-global.patch 
b/x11-misc/xmountains/files/xmountains-2.9-global.patch
new file mode 100644
index 00000000000..77ce47ac4eb
--- /dev/null
+++ b/x11-misc/xmountains/files/xmountains-2.9-global.patch
@@ -0,0 +1,26 @@
+--- 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
+ 

diff --git a/x11-misc/xmountains/files/xmountains-2.9-main.patch 
b/x11-misc/xmountains/files/xmountains-2.9-main.patch
new file mode 100644
index 00000000000..26297783c7e
--- /dev/null
+++ b/x11-misc/xmountains/files/xmountains-2.9-main.patch
@@ -0,0 +1,11 @@
+--- 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;
+ {

diff --git a/x11-misc/xmountains/files/xmountains-2.9-string.patch 
b/x11-misc/xmountains/files/xmountains-2.9-string.patch
new file mode 100644
index 00000000000..c78569a2116
--- /dev/null
+++ b/x11-misc/xmountains/files/xmountains-2.9-string.patch
@@ -0,0 +1,8 @@
+--- a/xmountains.c.JeR
++++ b/xmountains.c
+@@ -1,4 +1,5 @@
+ 
++#include <string.h> /* strcmp() */
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <strings.h>

diff --git a/x11-misc/xmountains/xmountains-2.9-r1.ebuild 
b/x11-misc/xmountains/xmountains-2.9-r1.ebuild
index 712987fe73b..3ba1649dc3f 100644
--- a/x11-misc/xmountains/xmountains-2.9-r1.ebuild
+++ b/x11-misc/xmountains/xmountains-2.9-r1.ebuild
@@ -1,43 +1,39 @@
-# 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}
 }
 

Reply via email to