summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'games-simulation/kerbal-space-program/kerbal-space-program-1.4.5.02243.ebuild')
-rw-r--r--games-simulation/kerbal-space-program/kerbal-space-program-1.4.5.02243.ebuild100
1 files changed, 100 insertions, 0 deletions
diff --git a/games-simulation/kerbal-space-program/kerbal-space-program-1.4.5.02243.ebuild b/games-simulation/kerbal-space-program/kerbal-space-program-1.4.5.02243.ebuild
new file mode 100644
index 0000000..e61c442
--- /dev/null
+++ b/games-simulation/kerbal-space-program/kerbal-space-program-1.4.5.02243.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils
+
+DESCRIPTION="A space flight simulation"
+HOMEPAGE="http://kerbalspaceprogram.com/"
+
+GOG_MAGIC="22594"
+
+SRC_PH="${PN//-/_}@PH@_${PV//./_}_${GOG_MAGIC}.sh"
+SRC_URI="
+ l10n_de? ( ${SRC_PH//@PH@/_de} )
+ l10n_en? ( ${SRC_PH//@PH@/_en} )
+ l10n_es? ( ${SRC_PH//@PH@/_es} )
+ l10n_fr? ( ${SRC_PH//@PH@/_fr} )
+ l10n_it? ( ${SRC_PH//@PH@/_it} )
+ l10n_ja? ( ${SRC_PH//@PH@/_ja} )
+ l10n_pt-BR? ( ${SRC_PH//@PH@/_pt} )
+ l10n_ru? ( ${SRC_PH//@PH@/_ru} )
+ l10n_zh-CN? ( ${SRC_PH//@PH@/_zh} )
+"
+
+RESTRICT="fetch strip"
+LICENSE="EULA"
+
+SLOT="0"
+KEYWORDS="amd64 x86"
+
+L10NS="l10n_de l10n_en l10n_es l10n_fr l10n_it l10n_ja l10n_pt-BR l10n_ru l10n_zh-CN"
+IUSE="${L10NS}"
+REQUIRED_USE="^^ ( ${L10NS} )"
+
+DEPEND="app-arch/unzip"
+RDEPEND="
+ dev-libs/glib:2
+ media-libs/mesa
+ sys-libs/glibc:2.2
+ x11-libs/gdk-pixbuf:2
+ x11-libs/gtk+:2
+ x11-libs/libX11
+ x11-libs/libXcursor
+ x11-libs/libXrandr
+"
+QA_DIR="usr/share/${PF}"
+QA_PREBUILT="${QA_DIR}/Launcher.x86 ${QA_DIR}/KSP.x86 ${QA_DIR}/Launcher_Data/Mono/x86/libmono.so ${QA_DIR}/KSP_Data/Mono/x86/libmono.so"
+
+pkg_nofetch() {
+ einfo ""
+ einfo "Please buy and download \"${A}\" from corresponding shop (HumbleBundle or GOG)"
+ einfo "and move/link it to \"${DISTDIR}\""
+ einfo "You can get more info on ${HOMEPAGE}"
+ einfo ""
+}
+
+src_unpack() {
+ local tmp="${WORKDIR}/tmp"
+ einfo "\nUnpacking files. This can take several minutes.\n"
+
+ mkdir "${tmp}" || die "mkdir 'tmp' failed"
+ cd "${tmp}" || die "cd 'tmp' failed"
+
+ unzip -q "${DISTDIR}/${A}"
+ local gpath="data/noarch/game"
+
+ mv "${gpath}" "${S}"
+
+ cd "${S}"
+
+ use l10n_de && unzip -oq ksp-lang-de-de.zip && rm ksp-lang-de-de.zip
+ use l10n_es && unzip -oq ksp-lang-es-es.zip && rm ksp-lang-es-es.zip
+ use l10n_fr && unzip -oq ksp-lang-fr-fr.zip && rm ksp-lang-fr-fr.zip
+ use l10n_it && unzip -oq ksp-lang-it-it.zip && rm ksp-lang-it-it.zip
+ use l10n_ja && unzip -oq ksp-lang-ja.zip && rm ksp-lang-ja.zip
+ use l10n_pt-BR && unzip -oq ksp-lang-pt-br.zip && rm ksp-lang-pt-br.zip
+ use l10n_ru && unzip -oq ksp-lang-ru.zip && rm ksp-lang-ru.zip
+ use l10n_zh-CN && unzip -oq ksp-lang-zh-cn.zip && rm ksp-lang-zh-cn.zip
+
+ rm -r "${WORKDIR}/tmp"
+
+ find . -name .DS_Store -delete
+
+ sed -e "s@__PV__@${PV}@" "${FILESDIR}/ksp-wrapper" > "${T}"/ksp-wrapper
+}
+
+src_install() {
+ local arch="${ARCH//amd/x86_}"
+ local dir="/usr/share/${PF}"
+ insinto "${dir}"
+ exeinto "${dir}"
+
+ doins -r .
+ doexe {KSP,Launcher}.x86{,_64} || die "Failed to install executables"
+
+ newbin "${T}/ksp-wrapper" "${PN}"
+ newicon "Launcher_Data/Resources/UnityPlayer.png" "${PN}.png"
+ make_desktop_entry "${PN}" "Kerbal Space Program" "${PN}" || die "make_desktop_entry failed"
+}