From 610599d8a8ea30956f5c9ce12db2d2f221dc4b34 Mon Sep 17 00:00:00 2001 From: Jeroen Roovers Date: Mon, 27 Jan 2020 05:20:45 +0100 Subject: [PATCH] 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 --- .../files/xmountains-2.9-fno-common.patch | 20 +++++++++++ .../files/xmountains-2.9-global.patch | 26 ++++++++++++++ .../files/xmountains-2.9-main.patch | 11 ++++++ .../files/xmountains-2.9-string.patch | 8 +++++ x11-misc/xmountains/xmountains-2.9-r1.ebuild | 36 +++++++++---------- 5 files changed, 81 insertions(+), 20 deletions(-) create mode 100644 x11-misc/xmountains/files/xmountains-2.9-fno-common.patch create mode 100644 x11-misc/xmountains/files/xmountains-2.9-global.patch create mode 100644 x11-misc/xmountains/files/xmountains-2.9-main.patch create mode 100644 x11-misc/xmountains/files/xmountains-2.9-string.patch 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 000000000000..e7140ca4fada --- /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 000000000000..77ce47ac4eb2 --- /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 000000000000..26297783c7ee --- /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 000000000000..c78569a2116a --- /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 /* strcmp() */ + #include + #include + #include diff --git a/x11-misc/xmountains/xmountains-2.9-r1.ebuild b/x11-misc/xmountains/xmountains-2.9-r1.ebuild index 712987fe73bd..3ba1649dc3fd 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 /* 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} } -- 2.26.2