Gentoo Archives: gentoo-commits

From: Pacho Ramos <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-strategy/netherearth/, games-strategy/netherearth/files/
Date: Wed, 02 May 2018 19:28:42
Message-Id: 1525289286.6fc56d0836ec8f7ba43b83cd8fb8ac51d1af8394.pacho@gentoo
1 commit: 6fc56d0836ec8f7ba43b83cd8fb8ac51d1af8394
2 Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 2 18:47:24 2018 +0000
4 Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
5 CommitDate: Wed May 2 19:28:06 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6fc56d08
7
8 games-strategy/netherearth: Stop using games.eclass
9
10 Package-Manager: Portage-2.3.31, Repoman-2.3.9
11
12 .../files/netherearth-0.52-freeglut.patch | 4 +-
13 .../files/netherearth-0.52-ldflags.patch | 4 +-
14 .../netherearth/netherearth-0.52-r1.ebuild | 86 ++++++++++++++++++++++
15 3 files changed, 90 insertions(+), 4 deletions(-)
16
17 diff --git a/games-strategy/netherearth/files/netherearth-0.52-freeglut.patch b/games-strategy/netherearth/files/netherearth-0.52-freeglut.patch
18 index 0fc147f0b7a..b61e1f139b0 100644
19 --- a/games-strategy/netherearth/files/netherearth-0.52-freeglut.patch
20 +++ b/games-strategy/netherearth/files/netherearth-0.52-freeglut.patch
21 @@ -1,5 +1,5 @@
22 ---- main.cpp
23 -+++ main.cpp
24 +--- a/main.cpp
25 ++++ b/main.cpp
26 @@ -8,6 +8,7 @@
27
28 #include <stdio.h>
29
30 diff --git a/games-strategy/netherearth/files/netherearth-0.52-ldflags.patch b/games-strategy/netherearth/files/netherearth-0.52-ldflags.patch
31 index 6b7ed3a8989..7d81f912764 100644
32 --- a/games-strategy/netherearth/files/netherearth-0.52-ldflags.patch
33 +++ b/games-strategy/netherearth/files/netherearth-0.52-ldflags.patch
34 @@ -1,5 +1,5 @@
35 ---- Makefile.old 2010-10-12 09:30:19.000000000 +0200
36 -+++ Makefile 2010-10-12 09:30:38.000000000 +0200
37 +--- a/Makefile.old 2010-10-12 09:30:19.000000000 +0200
38 ++++ b/Makefile 2010-10-12 09:30:38.000000000 +0200
39 @@ -17,4 +17,4 @@
40 all: $(TARGET)
41
42
43 diff --git a/games-strategy/netherearth/netherearth-0.52-r1.ebuild b/games-strategy/netherearth/netherearth-0.52-r1.ebuild
44 new file mode 100644
45 index 00000000000..e1aa7cabaaa
46 --- /dev/null
47 +++ b/games-strategy/netherearth/netherearth-0.52-r1.ebuild
48 @@ -0,0 +1,86 @@
49 +# Copyright 1999-2018 Gentoo Foundation
50 +# Distributed under the terms of the GNU General Public License v2
51 +
52 +EAPI=6
53 +inherit desktop
54 +
55 +MY_PV="${PV/./}"
56 +DESCRIPTION="A remake of the SPECTRUM game Nether Earth"
57 +HOMEPAGE="http://www.braingames.getput.com/nether/"
58 +SRC_URI="http://www.braingames.getput.com/nether/sources.zip
59 + http://www.braingames.getput.com/nether/${PN}${MY_PV}.zip"
60 +
61 +LICENSE="all-rights-reserved"
62 +SLOT="0"
63 +KEYWORDS="~amd64 ~x86"
64 +IUSE=""
65 +RESTRICT="mirror bindist"
66 +
67 +RDEPEND="
68 + >=media-libs/libsdl-1.2.6-r3
69 + >=media-libs/sdl-mixer-1.2.5-r1
70 + media-libs/freeglut
71 +"
72 +DEPEND="${RDEPEND}
73 + app-arch/unzip
74 +"
75 +
76 +S="${WORKDIR}/sources"
77 +
78 +data="../nether earth v${PV}"
79 +
80 +src_unpack() {
81 + unzip -LL "${DISTDIR}/${PN}${MY_PV}.zip" >/dev/null || die
82 + unzip -LL "${DISTDIR}/sources.zip" >/dev/null || die
83 +}
84 +
85 +src_prepare() {
86 + default
87 +
88 + DATA_DIR=/usr/share/${PN}
89 +
90 + cp "${FILESDIR}/Makefile" . || die
91 +
92 + # Fix compilation errors/warnings
93 + eapply "${FILESDIR}"/${P}-linux.patch
94 +
95 + eapply "${FILESDIR}"/${P}-freeglut.patch \
96 + "${FILESDIR}"/${P}-glibc-212.patch \
97 + "${FILESDIR}"/${P}-ldflags.patch
98 +
99 + # Modify dirs and some fopen() permissions
100 + eapply "${FILESDIR}/${P}-gentoo-paths.patch"
101 + sed -i \
102 + -e "s:models:${DATA_DIR}/models:" \
103 + -e "s:textures:${DATA_DIR}/textures:" \
104 + -e "s:maps/\*:${DATA_DIR}/maps/\*:" \
105 + -e "s:\./maps:${DATA_DIR}/maps:" \
106 + mainmenu.cpp || die
107 + sed -i \
108 + -e "s:models:${DATA_DIR}/models:g" \
109 + -e "s:textures:${DATA_DIR}/textures:" \
110 + -e "s:sound/:${DATA_DIR}/sound/:" \
111 + nether.cpp || die
112 + sed -i -e "s:maps:${DATA_DIR}/maps:" \
113 + main.cpp || die
114 + sed -i -e "s:textures/:${DATA_DIR}/textures/:" \
115 + myglutaux.cpp || die
116 +
117 + cd "${data}"
118 + rm textures/thumbs.db
119 +}
120 +
121 +src_install() {
122 + dobin nether_earth
123 +
124 + cd "${data}"
125 +
126 + # Install all game data
127 + insinto "${DATA_DIR}"
128 + doins -r maps models sound textures
129 +
130 + dodoc readme.txt
131 +
132 + newicon textures/nuclear.bmp ${PN}.bmp
133 + make_desktop_entry nether_earth "Nether Earth" /usr/share/pixmaps/${PN}.bmp
134 +}