games-emulation/nestra: Stop using games.eclass
authorPacho Ramos <pacho@gentoo.org>
Sun, 29 Apr 2018 11:39:38 +0000 (13:39 +0200)
committerPacho Ramos <pacho@gentoo.org>
Sun, 29 Apr 2018 13:06:23 +0000 (15:06 +0200)
Package-Manager: Portage-2.3.31, Repoman-2.3.9

games-emulation/nestra/files/nestra-0.66-exec-stack.patch
games-emulation/nestra/files/nestra-0.66-include.patch
games-emulation/nestra/nestra-0.66-r3.ebuild [new file with mode: 0644]

index f5c662e2260060b96b08807755cee49c4d27601d..d9e9b3c6114708e5732e0b730a9d9610b0fca4cd 100644 (file)
@@ -1,5 +1,5 @@
---- x86.S.orig 2006-01-09 20:02:58.000000000 -0500
-+++ x86.S      2006-01-09 20:03:38.000000000 -0500
+--- a/x86.S.orig       2006-01-09 20:02:58.000000000 -0500
++++ b/x86.S    2006-01-09 20:03:38.000000000 -0500
 @@ -1458,3 +1458,7 @@
   leal   0x1(%eax),%ebx
   popl   %eax
index b4733b172bbae44979a6bcba979277fb4241900e..096fd18af47f630dd4b667195dc61f3e3990a052 100644 (file)
@@ -1,5 +1,5 @@
---- comptbl.c
-+++ comptbl.c
+--- a/comptbl.c
++++ b/comptbl.c
 @@ -9,6 +9,7 @@
  #include <stdio.h>
  #include <string.h>
@@ -8,8 +8,8 @@
  
  #define ALLOC_SIZE 0x400000 /* 4MB */
  #define TBL_BASE ((unsigned char *)0x10000000)
---- d6502.c
-+++ d6502.c
+--- a/d6502.c
++++ b/d6502.c
 @@ -1,6 +1,7 @@
  /* 6502 disassembler */
  /* Public Domain */
@@ -18,8 +18,8 @@
  #include "globals.h"
  
  char Opcodes_6502[256][4]={
---- emu.c
-+++ emu.c
+--- a/emu.c
++++ b/emu.c
 @@ -12,6 +12,7 @@
  #include <sys/mman.h>
  #include <stdio.h>
@@ -28,8 +28,8 @@
  
  #include "mapper.h"
  #include "io.h"
---- fb.c
-+++ fb.c
+--- a/fb.c
++++ b/fb.c
 @@ -2,6 +2,8 @@
  /* Framebuffer/pixmap rendering */
  /* Public Domain */
@@ -39,8 +39,8 @@
  #include <stdio.h>
  #include "mapper.h"
  #include "globals.h"
---- io.c
-+++ io.c
+--- a/io.c
++++ b/io.c
 @@ -5,6 +5,7 @@
     to do I/O operations. */
  
@@ -49,8 +49,8 @@
  #include "mapper.h"
  #include "io.h"
  #include "globals.h"
---- mapper.c
-+++ mapper.c
+--- a/mapper.c
++++ b/mapper.c
 @@ -1,6 +1,7 @@
  /* Nestra mapper.c */
  /* Public Domain */
@@ -59,8 +59,8 @@
  #include "mapper.h"
  #include "consts.h"
  
---- x11.c
-+++ x11.c
+--- a/x11.c
++++ b/x11.c
 @@ -1,6 +1,9 @@
  /* Nestra x11.c */
  /* Public Domain */
diff --git a/games-emulation/nestra/nestra-0.66-r3.ebuild b/games-emulation/nestra/nestra-0.66-r3.ebuild
new file mode 100644 (file)
index 0000000..44ca1da
--- /dev/null
@@ -0,0 +1,49 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit epatch toolchain-funcs flag-o-matic
+
+PATCH="${P/-/_}-10.diff"
+DESCRIPTION="NES emulation for Linux/x86"
+HOMEPAGE="http://nestra.linuxgames.com/"
+SRC_URI="http://nestra.linuxgames.com/${P}.tar.gz
+       mirror://debian/pool/contrib/n/nestra/${PATCH}.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="x11-libs/libX11[abi_x86_32(-)]"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${PN}"
+
+src_prepare() {
+       default
+       epatch "${WORKDIR}"/${PATCH}
+       eapply "${FILESDIR}"/${P}-exec-stack.patch
+       eapply "${FILESDIR}"/${P}-include.patch
+
+       append-ldflags -Wl,-z,noexecstack
+       use amd64 && multilib_toolchain_setup x86
+
+       sed -i \
+               -e "s:-L/usr/X11R6/lib:${LDFLAGS}:" \
+               -e 's:-O2 ::' \
+               -e "s:gcc:$(tc-getCC) ${CFLAGS}:" \
+               -e "s:ld:$(tc-getLD) -m elf_i386 $(raw-ldflags):" \
+               Makefile || die
+}
+
+src_compile() {
+       use amd64 && multilib_toolchain_setup x86
+       default
+}
+
+src_install() {
+       dobin nestra
+       einstalldocs
+       doman nestra.6
+}