+# Copyright © 2013, 2015, 2021 Nick Bowler
+# License GPLv3+: GNU General Public License version 3 or any later version.
+# This is free software: you are free to change and redistribute it.
+# There is NO WARRANTY, to the extent permitted by law.
+
+EAPI=7
+
+inherit desktop
+
+DESCRIPTION="Master of Orion 2 Data Files"
+SRC_URI="gog_master_of_orion_2_2.0.0.6.sh"
+
+LICENSE="GOG-EULA"
+SLOT="0"
+KEYWORDS="~amd64"
+
+RESTRICT="fetch"
+
+BDEPEND="app-arch/unzip
+ media-gfx/icoutils
+ || ( media-gfx/graphicsmagick media-gfx/imagemagick )"
+
+src_unpack () {
+ ( unzip -LLqd $P "$DISTDIR/$A" || exit $(($?>1)) ) ||
+ die "Failed to extract $A"
+}
+
+src_compile () {
+ wrestool -t 14 -x -o orion95.ico data/noarch/data/orion95.exe || die
+ convert=`has_version media-gfx/graphicsmagick && echo 'gm'`
+ convert=${convert:+"$convert "}convert
+
+ einfo "$convert"
+ $convert orion95.ico moo2.png || die
+}
+
+src_install() {
+ insinto "/usr/share/$PN"
+ doins data/noarch/data/*.lbx
+
+ doicon -s 32 moo2.png
+ newicon -s 256 data/noarch/support/icon.png moo2.png
+}