Gentoo Archives: gentoo-commits

From: "Vadim A. Misbakh-Soloviov" <mva@×××.name>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gamerlay:master commit in: games-simulation/kerbal-space-program/, ...
Date: Wed, 21 Jun 2017 06:21:51
Message-Id: 1498026091.37baa79165e6395d5712d5e4ab51c5a266120202.mva@gentoo
1 commit: 37baa79165e6395d5712d5e4ab51c5a266120202
2 Author: Vadim A. Misbakh-Soloviov <git <AT> mva <DOT> name>
3 AuthorDate: Wed Jun 21 06:21:31 2017 +0000
4 Commit: Vadim A. Misbakh-Soloviov <mva <AT> mva <DOT> name>
5 CommitDate: Wed Jun 21 06:21:31 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/gamerlay.git/commit/?id=37baa791
7
8 kerbal: fix
9
10 .../kerbal-space-program/files/ksp-wrapper | 43 ++++++++++++++++++
11 ...uild => kerbal-space-program-1.3.0.1804.ebuild} | 51 +++++++++++++---------
12 2 files changed, 74 insertions(+), 20 deletions(-)
13
14 diff --git a/games-simulation/kerbal-space-program/files/ksp-wrapper b/games-simulation/kerbal-space-program/files/ksp-wrapper
15 new file mode 100644
16 index 0000000..fcbf49a
17 --- /dev/null
18 +++ b/games-simulation/kerbal-space-program/files/ksp-wrapper
19 @@ -0,0 +1,43 @@
20 +#!/bin/sh
21 +
22 +arch="$(uname -m)"
23 +arch="${arch/i[2-6]/x}"
24 +PV="__PV__"
25 +s_dir="/usr/share/kerbal-space-program-${PV}"
26 +t_dir="${HOME}/.local/share/kerbal-space-program"
27 +
28 +
29 +mkdir -p "${t_dir}"
30 +cd "${t_dir}";
31 +
32 +IPV=$(cat .version 2>/dev/null)
33 +
34 +if [[ "${IPV}" != "${PV}" ]]; then
35 + cat .content 2>/dev/null | rev | while read t; do
36 + if [[ -d "${t}" ]]; then
37 + rmdir "${f}" &>/dev/null
38 + else
39 + rm "${t}" &>/dev/null
40 + fi
41 + done
42 +
43 + echo -n '' > .content # truncate -s0 ?
44 + cd "${s_dir}"
45 +
46 + find * | while read t; do
47 + if [[ -d "${t}" ]]; then
48 + mkdir -p "${t_dir}/${t}"
49 + else
50 + # Hardlinks with owner/rights change is not allowed,
51 + # and symlinks doesn't work (game engine dereferences
52 + # them and still complains on missing write access)
53 + cp "${s_dir}/${t}" "${t_dir}/${t}"
54 + fi
55 + echo "${t}" >> "${t_dir}"/.content
56 + done
57 + echo "${PV}" > "${t_dir}"/.version
58 +fi
59 +
60 +export LC_NUMERIC="C"
61 +cd "${t_dir}";
62 +exec "./KSP.${arch}" "$@"
63
64 diff --git a/games-simulation/kerbal-space-program/kerbal-space-program-2.13.0.16.ebuild b/games-simulation/kerbal-space-program/kerbal-space-program-1.3.0.1804.ebuild
65 similarity index 60%
66 rename from games-simulation/kerbal-space-program/kerbal-space-program-2.13.0.16.ebuild
67 rename to games-simulation/kerbal-space-program/kerbal-space-program-1.3.0.1804.ebuild
68 index 64582c5..7b542dd 100644
69 --- a/games-simulation/kerbal-space-program/kerbal-space-program-2.13.0.16.ebuild
70 +++ b/games-simulation/kerbal-space-program/kerbal-space-program-1.3.0.1804.ebuild
71 @@ -7,14 +7,27 @@ inherit eutils
72
73 DESCRIPTION="A combination of platformer and role playing game"
74 HOMEPAGE="http://www.unepicgame.com/"
75 -SRC_URI="gog_${P//-/_}.sh"
76 +
77 +GOG_MAGIC="2.13.0.16"
78 +
79 +SRC_PH="gog_${PN//-/_}@PH@_${GOG_MAGIC}.sh"
80 +SRC_URI="
81 + l10n_en? ( ${SRC_PH//@PH@} )
82 + l10n_es? ( ${SRC_PH//@PH@/_spanish} )
83 + l10n_ja? ( ${SRC_PH//@PH@/_japanese} )
84 + l10n_ru? ( ${SRC_PH//@PH@/_russian} )
85 + l10n_zh-CN? ( ${SRC_PH//@PH@/_chinese} )
86 +"
87
88 RESTRICT="fetch strip"
89 LICENSE="EULA"
90
91 SLOT="0"
92 KEYWORDS="amd64 x86"
93 -IUSE=""
94 +
95 +L10NS="l10n_en l10n_es l10n_ja l10n_ru l10n_zh-CN"
96 +IUSE="${L10NS}"
97 +REQUIRED_USE="^^ ( ${L10NS} )"
98
99 DEPEND="app-arch/unzip"
100 RDEPEND="
101 @@ -39,18 +52,29 @@ pkg_nofetch() {
102 }
103
104 src_unpack() {
105 + local tmp="${WORKDIR}/tmp"
106 einfo "\nUnpacking files. This can take several minutes.\n"
107
108 - mkdir "${WORKDIR}/tmp" || die "mkdir 'tmp' failed"
109 - cd "${WORKDIR}/tmp" || die "cd 'tmp' failed"
110 + mkdir "${tmp}" || die "mkdir 'tmp' failed"
111 + cd "${tmp}" || die "cd 'tmp' failed"
112
113 unzip -q "${DISTDIR}/${A}"
114 -
115 local gpath="data/noarch/game"
116
117 mv "${gpath}" "${S}"
118
119 - cd "${S}" && rm -r "${WORKDIR}/tmp"
120 + cd "${S}"
121 +
122 + use l10n_es && unzip -oq KSP-LANG-ES-ES.zip && rm KSP-LANG-ES-ES.zip
123 + use l10n_ja && unzip -oq KSP-LANG-JA.zip && rm KSP-LANG-JA.zip
124 + use l10n_ru && unzip -oq KSP-LANG-RU.zip && rm KSP-LANG-RU.zip
125 + use l10n_zh-CN && unzip -oq KSP-LANG-ZH-CN.zip && rm KSP-LANG-ZH-CN.zip
126 +
127 + rm -r "${WORKDIR}/tmp"
128 +
129 + find . -name .DS_Store -delete
130 +
131 + sed -e "s@__PV__@${PF}@" "${FILESDIR}/ksp-wrapper" > "${T}"/ksp-wrapper
132 }
133
134 src_install() {
135 @@ -62,20 +86,7 @@ src_install() {
136 doins -r .
137 doexe {KSP,Launcher}.x86{,_64} || die "Failed to install executables"
138
139 + newbin "${T}/ksp-wrapper" "${PN}"
140 newicon "Launcher_Data/Resources/UnityPlayer.png" "${PN}.png"
141 - make_wrapper "${PN}" "./KSP.${arch}" "${dir}"
142 - make_wrapper "${PN}-launcher" "./Launcher.${arch}" "${dir}"
143 make_desktop_entry "${PN}" "Kerbal Space Program" "${PN}" || die "make_desktop_entry failed"
144 - make_desktop_entry "${PN}-launcher" "Kerbal Space Program: Launcher" "${PN}" || die "make_desktop_entry failed"
145 -}
146 -
147 -pkg_postinst() {
148 - einfo "Just in case: neither of these DRM-free versions sees Steam's savegames."
149 - einfo "In case, if you played in Steam and moved to DRM-free version,"
150 - einfo "consider copying files from:"
151 - einfo "~/.local/share/Steam/userdata/[your_user_id]/233980/remote/save"
152 - einfo "to:"
153 - einfo "~/.local/share/Unepic/unepic/save"
154 - einfo "and vice versa if you want to import DRM-free saves to Steam."
155 - einfo "Although, it can cause sudden game freezes..."
156 }