| 
									
										
										
										
											2016-02-19 16:41:51 +00:00
										 |  |  | # Copyright 2016 Julian Ospald <hasufell@posteo.de> | 
					
						
							|  |  |  | # Distributed under the terms of the GNU General Public License v2 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | require gtk-icon-cache | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SUMMARY="Pillars Of Eternity" | 
					
						
							|  |  |  | HOMEPAGE="http://www.gog.com/game/pillars_of_eternity_hero_edition" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | BASE_SRC_DL="gog_pillars_of_eternity_2.9.0.13.sh" | 
					
						
							|  |  |  | DLC1_SRC_DL="gog_pillars_of_eternity_kickstarter_item_dlc_2.0.0.2.sh" | 
					
						
							|  |  |  | DLC2_SRC_DL="gog_pillars_of_eternity_kickstarter_pet_dlc_2.0.0.2.sh" | 
					
						
							|  |  |  | DLC3_SRC_DL="gog_pillars_of_eternity_preorder_item_and_pet_dlc_2.0.0.2.sh" | 
					
						
							| 
									
										
										
										
											2016-02-24 00:12:18 +00:00
										 |  |  | DOWNLOADS="
 | 
					
						
							|  |  |  |     manual: | 
					
						
							|  |  |  |         ${BASE_SRC_DL} | 
					
						
							|  |  |  |         dlc1? ( ${DLC1_SRC_DL} ) | 
					
						
							|  |  |  |         dlc2? ( ${DLC2_SRC_DL} ) | 
					
						
							|  |  |  |         dlc3? ( ${DLC3_SRC_DL} ) | 
					
						
							|  |  |  | "
 | 
					
						
							| 
									
										
										
										
											2016-02-19 16:41:51 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | LICENCES="all-rights-reserved" | 
					
						
							|  |  |  | SLOT="0" | 
					
						
							|  |  |  | PLATFORMS="-* ~amd64" | 
					
						
							|  |  |  | MYOPTIONS="
 | 
					
						
							|  |  |  |     dlc1 [[ description = [ Install the Kickstarter Bonus Item ] ]] | 
					
						
							|  |  |  |     dlc2 [[ description = [ Install the Kickstarter Bonus Pet ] ]] | 
					
						
							|  |  |  |     dlc3 [[ description = [ Install the Pre-Order Bonus Item and Pet ] ]] | 
					
						
							|  |  |  | "
 | 
					
						
							|  |  |  | RESTRICT="fetch bindist" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | DEPENDENCIES="
 | 
					
						
							| 
									
										
										
										
											2016-02-28 23:05:15 +00:00
										 |  |  |     build: | 
					
						
							|  |  |  |         virtual/unzip | 
					
						
							| 
									
										
										
										
											2016-02-19 16:41:51 +00:00
										 |  |  |     run: | 
					
						
							|  |  |  |         dev-libs/atk | 
					
						
							|  |  |  |         media-libs/fontconfig | 
					
						
							|  |  |  |         media-libs/freetype:2 | 
					
						
							|  |  |  |         x11-dri/mesa | 
					
						
							|  |  |  |         x11-libs/cairo | 
					
						
							|  |  |  |         x11-libs/gdk-pixbuf:2.0 | 
					
						
							|  |  |  |         x11-libs/gtk+:2 | 
					
						
							|  |  |  |         x11-libs/pango | 
					
						
							|  |  |  | "
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | WORK="${WORKBASE}/data/noarch" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | pkg_nofetch() { | 
					
						
							| 
									
										
										
										
											2016-02-28 23:05:15 +00:00
										 |  |  |     einfo | 
					
						
							|  |  |  |     einfo "Please buy & download \"${BASE_SRC_DL}\"" | 
					
						
							|  |  |  |     option dlc1 && einfo "and \"${DLC1_SRC_DL}\"" | 
					
						
							|  |  |  |     option dlc2 && einfo "and \"${DLC2_SRC_DL}\"" | 
					
						
							|  |  |  |     option dlc3 && einfo "and \"${DLC3_SRC_DL}\"" | 
					
						
							|  |  |  |     einfo "from:" | 
					
						
							|  |  |  |     einfo "  ${HOMEPAGE}" | 
					
						
							|  |  |  |     einfo "and move/link it to \"${FETCHEDDIR}\"" | 
					
						
							|  |  |  |     einfo | 
					
						
							| 
									
										
										
										
											2016-02-19 16:41:51 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | pkg_setup() { | 
					
						
							|  |  |  |     exdirectory --allow /opt | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | unpack_zip() { | 
					
						
							|  |  |  |     local file="$1" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     unzip -qo "${file}" | 
					
						
							|  |  |  |     [[ $? -le 1 ]] || die "unpacking ${file} failed!" | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | src_unpack() { | 
					
						
							|  |  |  |     # unzip | 
					
						
							|  |  |  |     unpack_zip "${FETCHEDDIR}/${DOWNLOADS}" | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | src_unpack() { | 
					
						
							| 
									
										
										
										
											2016-02-28 23:05:15 +00:00
										 |  |  |     if option dlc1 ; then | 
					
						
							|  |  |  |         unpack_zip "${FETCHEDDIR}/${DLC1_SRC_DL}" | 
					
						
							|  |  |  |     fi | 
					
						
							| 
									
										
										
										
											2016-02-19 16:41:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-02-28 23:05:15 +00:00
										 |  |  |     if option dlc2 ; then | 
					
						
							|  |  |  |         unpack_zip "${FETCHEDDIR}/${DLC2_SRC_DL}" | 
					
						
							|  |  |  |     fi | 
					
						
							| 
									
										
										
										
											2016-02-19 16:41:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-02-28 23:05:15 +00:00
										 |  |  |     if option dlc3 ; then | 
					
						
							|  |  |  |         unpack_zip "${FETCHEDDIR}/${DLC3_SRC_DL}" | 
					
						
							|  |  |  |     fi | 
					
						
							| 
									
										
										
										
											2016-02-19 16:41:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-02-28 23:05:15 +00:00
										 |  |  |     unpack_zip "${FETCHEDDIR}/${BASE_SRC_DL}" | 
					
						
							| 
									
										
										
										
											2016-02-19 16:41:51 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | src_install() { | 
					
						
							| 
									
										
										
										
											2016-02-28 23:05:15 +00:00
										 |  |  |     local dir=/opt/${PN} | 
					
						
							| 
									
										
										
										
											2016-02-19 16:41:51 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     insinto /usr/share/icons/hicolor/512x512/apps | 
					
						
							| 
									
										
										
										
											2016-02-28 23:05:15 +00:00
										 |  |  |     newins game/PillarsOfEternity.png ${PN}.png | 
					
						
							| 
									
										
										
										
											2016-02-19 16:41:51 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     herebin ${PN} <<EOF | 
					
						
							|  |  |  | #!/bin/sh
 | 
					
						
							|  |  |  | cd "${dir}/game" | 
					
						
							|  |  |  | exec "./PillarsOfEternity" "\$@" | 
					
						
							|  |  |  | EOF | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     insinto /usr/share/applications | 
					
						
							|  |  |  |     hereins ${PN}.desktop <<EOF | 
					
						
							|  |  |  | [Desktop Entry] | 
					
						
							|  |  |  | Name=Pillars Of Eternity | 
					
						
							|  |  |  | Type=Application | 
					
						
							|  |  |  | Comment=${SUMMARY} | 
					
						
							|  |  |  | Exec=${PN} | 
					
						
							|  |  |  | TryExec=${PN} | 
					
						
							|  |  |  | Icon=${PN} | 
					
						
							|  |  |  | Categories=Game;RolePlaying; | 
					
						
							|  |  |  | EOF | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-02-28 23:05:15 +00:00
										 |  |  |     dodoc game/Docs/{pe-game-manual.pdf,readme.txt} | 
					
						
							| 
									
										
										
										
											2016-02-19 16:41:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-02-28 23:05:15 +00:00
										 |  |  |     dodir "${dir}" | 
					
						
							|  |  |  |     edo rm "${WORK}"/game/PillarsOfEternity_Data/Plugins/x86_64/libCSteamworks.so \
 | 
					
						
							|  |  |  |         "${WORK}"/game/PillarsOfEternity_Data/Plugins/x86_64/libsteam_api.so | 
					
						
							|  |  |  |     edo mv "${WORK}/game" "${IMAGE}${dir}/" | 
					
						
							|  |  |  |     edo chmod +x "${IMAGE}${dir}"/game/PillarsOfEternity | 
					
						
							| 
									
										
										
										
											2016-02-19 16:41:51 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     # there are empty installed dirs for some reason, just keep em | 
					
						
							|  |  |  |     find "${IMAGE}" -depth -type d -empty -exec sh -c 'touch "${1}"' - '{}'/.keep_${CATEGORY}_${PN}-${SLOT%/*} \; || die | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 |