1 |
commit: 724f9c5be4812a400d7ed0c8fbe69da1edcfe5e4 |
2 |
Author: James Le Cuirot <chewi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Apr 26 22:25:09 2017 +0000 |
4 |
Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Apr 27 21:41:27 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=724f9c5b |
7 |
|
8 |
games-action/descent2-data: Rewrite with GOG, closes #369397, #612896 |
9 |
|
10 |
Thanks to Jared B for the initial ebuild work and Xdelta patches. |
11 |
|
12 |
Package-Manager: Portage-2.3.5, Repoman-2.3.2 |
13 |
|
14 |
games-action/descent2-data/Manifest | 2 + |
15 |
.../descent2-data/descent2-data-1.0.ebuild | 4 +- |
16 |
.../descent2-data/descent2-data-1.2.ebuild | 121 +++++++++++++++++++++ |
17 |
3 files changed, 125 insertions(+), 2 deletions(-) |
18 |
|
19 |
diff --git a/games-action/descent2-data/Manifest b/games-action/descent2-data/Manifest |
20 |
new file mode 100644 |
21 |
index 00000000000..1c4606943d9 |
22 |
--- /dev/null |
23 |
+++ b/games-action/descent2-data/Manifest |
24 |
@@ -0,0 +1,2 @@ |
25 |
+DIST d2xptch12.tgz 158419 SHA256 61743c19baecde602c778e6ea44ef4a28bab9b8aa16a5f2772e3799863487a80 SHA512 14d59280e685a9c3d5e23e1d535f37f89768e022b795067793a994c5150685addfcacbd2dc52231804240d01d17d57b1db04335d41bc5930e3c8a845ebbb396b WHIRLPOOL ea2d14205eaa8978f22b9e9c3e20d99cf4c9ea8f43a4c688cb4cd9fc85b41b1dfdfed9fa38161ba776357a16370ede00fcc191a5d01ba1e7c4635720f0d1e77c |
26 |
+DIST setup_descent2_2.1.0.10.exe 554371624 SHA256 e787d95574f8a4bf3c442ad49e837186319d3bb041a33a00df726be3be7c9750 SHA512 0db1935864eb59002cc995dfe9c40badd72d0a3dcec61092b0760481cd3d1316db17631c05043b938e4b958d696c508ce379face9baa260dcc598c77b4460618 WHIRLPOOL 1f13b652c79752772cf2a151ca7663443e8936be352ddb100e140b00bc6f88a13ba5d4dfad17cb07ed78ed5b629fad1aaeeb7424a2216b68761c4065b6f8ac3c |
27 |
|
28 |
diff --git a/games-action/descent2-data/descent2-data-1.0.ebuild b/games-action/descent2-data/descent2-data-1.0.ebuild |
29 |
index 8a1ae686d06..cd4b41ef4d8 100644 |
30 |
--- a/games-action/descent2-data/descent2-data-1.0.ebuild |
31 |
+++ b/games-action/descent2-data/descent2-data-1.0.ebuild |
32 |
@@ -1,4 +1,4 @@ |
33 |
-# Copyright 1999-2015 Gentoo Foundation |
34 |
+# Copyright 1999-2017 Gentoo Foundation |
35 |
# Distributed under the terms of the GNU General Public License v2 |
36 |
|
37 |
EAPI=5 |
38 |
@@ -15,7 +15,7 @@ SRC_URI="" |
39 |
# mirror://3dgamers/descent2/d2ptch${MY_PV}.exe |
40 |
|
41 |
# See readme.txt |
42 |
-LICENSE="${PN}" |
43 |
+LICENSE="descent-data" |
44 |
SLOT="0" |
45 |
KEYWORDS="amd64 ppc x86" |
46 |
IUSE="videos" |
47 |
|
48 |
diff --git a/games-action/descent2-data/descent2-data-1.2.ebuild b/games-action/descent2-data/descent2-data-1.2.ebuild |
49 |
new file mode 100644 |
50 |
index 00000000000..94768008928 |
51 |
--- /dev/null |
52 |
+++ b/games-action/descent2-data/descent2-data-1.2.ebuild |
53 |
@@ -0,0 +1,121 @@ |
54 |
+# Copyright 1999-2017 Gentoo Foundation |
55 |
+# Distributed under the terms of the GNU General Public License v2 |
56 |
+ |
57 |
+EAPI=6 |
58 |
+ |
59 |
+CDROM_OPTIONAL="yes" |
60 |
+inherit cdrom eutils |
61 |
+ |
62 |
+# Not possible to apply official 1.2 patch under Linux. A Gentoo user |
63 |
+# created Xdelta patches and the DXX-Rebirth project kindly hosted them. |
64 |
+MY_PATCH="http://www.dxx-rebirth.com/download/dxx/misc/d2xptch12.tgz" |
65 |
+ |
66 |
+# For GOG install |
67 |
+MY_EXE="setup_descent2_2.1.0.10.exe" |
68 |
+ |
69 |
+DESCRIPTION="Data files for Descent 2" |
70 |
+HOMEPAGE="http://www.interplay.com/games/descent.php" |
71 |
+SRC_URI="cdinstall? ( ${MY_PATCH} ) |
72 |
+ !cdinstall? ( ${MY_EXE} )" |
73 |
+LICENSE="descent-data" |
74 |
+SLOT="0" |
75 |
+KEYWORDS="~amd64 ~x86" |
76 |
+IUSE="doc videos" |
77 |
+RESTRICT="bindist !cdinstall? ( fetch )" |
78 |
+ |
79 |
+# <d2x-0.2.5-r3 may include the data. |
80 |
+RDEPEND="!<games-action/d2x-0.2.5-r3 |
81 |
+ !games-action/descent2-demodata" |
82 |
+ |
83 |
+DEPEND="cdinstall? ( |
84 |
+ app-arch/unarj |
85 |
+ dev-util/xdelta:3 |
86 |
+ ) |
87 |
+ !cdinstall? ( |
88 |
+ app-arch/innoextract |
89 |
+ )" |
90 |
+ |
91 |
+S="${WORKDIR}" |
92 |
+ |
93 |
+pkg_nofetch() { |
94 |
+ elog "You must place a copy of, or symlink to, the GOG setup package here:" |
95 |
+ elog "${DISTDIR}/${MY_EXE}" |
96 |
+ echo |
97 |
+ elog "If you wish to install from CD-ROM instead, please enable the cdinstall flag." |
98 |
+} |
99 |
+ |
100 |
+src_unpack() { |
101 |
+ if use cdinstall; then |
102 |
+ default |
103 |
+ cdrom_get_cds d2data/descent2.sow:descent2.hog |
104 |
+ |
105 |
+ case ${CDROM_SET} in |
106 |
+ 0) |
107 |
+ einfo "Found Descent 2 CD" |
108 |
+ unarj e "${CDROM_ABSMATCH}" || die ;; |
109 |
+ 1) |
110 |
+ einfo "Found Descent 2 installation" |
111 |
+ cd "${CDROM_ABSMATCH%/*}" || die ;; |
112 |
+ esac |
113 |
+ else |
114 |
+ einfo "Unpacking ${MY_EXE}. This will take a while..." |
115 |
+ innoextract -e -s -p1 -L -I app -d gog "${DISTDIR}/${MY_EXE}" || die |
116 |
+ cd "${WORKDIR}/gog/app" || die |
117 |
+ fi |
118 |
+ |
119 |
+ eshopts_push -s globstar nocaseglob nullglob |
120 |
+ |
121 |
+ # Strip directories |
122 |
+ # Lowercase |
123 |
+ # d2{-2plyr,chaos}.* into data/missions |
124 |
+ # *.dem into data/demos |
125 |
+ # Documentation into doc |
126 |
+ # Remainder into data |
127 |
+ # Exclude Vertigo files |
128 |
+ |
129 |
+ tar c \ |
130 |
+ --mode=u+w \ |
131 |
+ --ignore-case \ |
132 |
+ --xform='s:.*/::xg' \ |
133 |
+ --xform='s:.*:\L\0:x' \ |
134 |
+ --xform='s:^d2(-2plyr|chaos)\.:data/missions/\0:x' \ |
135 |
+ --xform='s:.*\.dem$:data/demos/\0:x' \ |
136 |
+ --xform='s:.*\.(pdf|txt)$:doc/\0:x' \ |
137 |
+ --xform='s:^[^/]+$:data/\0:x' \ |
138 |
+ --exclude='d2x*' \ |
139 |
+ --exclude='hoard.ham' \ |
140 |
+ --exclude='panic.*' \ |
141 |
+ --exclude="$(use doc || echo '*.pdf')" \ |
142 |
+ --exclude="$(use videos || echo '*.mvl')" \ |
143 |
+ *.{txt,pdf} *-h.mvl **/*.{ham,hog,mn2,pig,s11,s22} \ |
144 |
+ | tar x -C "${WORKDIR}" |
145 |
+ |
146 |
+ assert "tar failed" |
147 |
+ eshopts_pop |
148 |
+} |
149 |
+ |
150 |
+src_prepare() { |
151 |
+ # Patch to 1.2 if necessary |
152 |
+ if use cdinstall; then |
153 |
+ if [[ $(md5sum data/descent2.ham) != 7f30c3d7d4087b8584b49012a53ce022* ]]; then |
154 |
+ local i |
155 |
+ for i in *.xdelta; do |
156 |
+ xdelta3 -d -s data/"${i%.*}" "${i}" data/"${i%.*}".new || die |
157 |
+ mv data/"${i%.*}"{.new,} || die |
158 |
+ done |
159 |
+ fi |
160 |
+ fi |
161 |
+ |
162 |
+ default |
163 |
+} |
164 |
+ |
165 |
+src_install() { |
166 |
+ insinto /usr/share/games/d2x |
167 |
+ doins -r data/* |
168 |
+ [[ -d doc ]] && dodoc doc/* |
169 |
+} |
170 |
+ |
171 |
+pkg_postinst() { |
172 |
+ elog "A client is needed to run the game, e.g. games-action/dxx-rebirth." |
173 |
+ echo |
174 |
+} |