| 
									
										
										
										
											2016-02-24 01:45:48 +00:00
										 |  |  | # Copyright 2016 Julian Ospald <hasufell@posteo.de> | 
					
						
							|  |  |  | # Distributed under the terms of the GNU General Public License v2 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-26 12:53:36 +00:00
										 |  |  | require desktop-utils | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-02-24 01:45:48 +00:00
										 |  |  | SUMMARY="Faster Than Light: A spaceship simulation real-time roguelike-like game" | 
					
						
							| 
									
										
										
										
											2016-08-13 00:28:35 +00:00
										 |  |  | HP="http://www.ftlgame.com" | 
					
						
							|  |  |  | GOG_HP="https://www.gog.com/game/faster_than_light" | 
					
						
							|  |  |  | HOMEPAGE="${HP} ${GOG_HP}" | 
					
						
							| 
									
										
										
										
											2016-08-13 00:20:11 +00:00
										 |  |  | FTL_SH="gog_ftl_advanced_edition_2.0.0.2.sh" | 
					
						
							| 
									
										
										
										
											2016-08-13 00:28:35 +00:00
										 |  |  | FTL_TAR="FTL.${PV}.tar.gz" | 
					
						
							| 
									
										
										
										
											2016-08-13 00:20:11 +00:00
										 |  |  | DOWNLOADS="
 | 
					
						
							|  |  |  |     gog? ( manual: ${FTL_SH} ) | 
					
						
							| 
									
										
										
										
											2016-08-13 00:28:35 +00:00
										 |  |  |     !gog? ( manual: ${FTL_TAR} ) | 
					
						
							| 
									
										
										
										
											2016-08-13 00:20:11 +00:00
										 |  |  | "
 | 
					
						
							| 
									
										
										
										
											2016-02-24 01:45:48 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | LICENCES="all-rights-reserved Boost-1.0 free-noncomm MIT FTL LGPL-2.1 ZLIB libpng" | 
					
						
							|  |  |  | SLOT="0" | 
					
						
							|  |  |  | PLATFORMS="-* ~amd64 ~x86" | 
					
						
							|  |  |  | MYOPTIONS="
 | 
					
						
							| 
									
										
										
										
											2016-08-13 00:20:11 +00:00
										 |  |  |     gog [[ description = [ Use the gog advanced edition version ] ]] | 
					
						
							| 
									
										
										
										
											2016-02-24 01:45:48 +00:00
										 |  |  |     ( platform: amd64 x86 ) | 
					
						
							|  |  |  | "
 | 
					
						
							| 
									
										
										
										
											2016-05-13 20:41:29 +00:00
										 |  |  | RESTRICT="fetch" | 
					
						
							| 
									
										
										
										
											2016-02-24 01:45:48 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | DEPENDENCIES="
 | 
					
						
							|  |  |  |     run: | 
					
						
							|  |  |  |         media-libs/DevIL | 
					
						
							|  |  |  |         media-libs/SDL:0[X] | 
					
						
							|  |  |  |         media-libs/freetype:2 | 
					
						
							|  |  |  |         sys-libs/zlib | 
					
						
							|  |  |  |         x11-dri/mesa | 
					
						
							| 
									
										
										
										
											2016-08-13 00:20:11 +00:00
										 |  |  |     build: | 
					
						
							|  |  |  |         virtual/unzip | 
					
						
							| 
									
										
										
										
											2016-02-24 01:45:48 +00:00
										 |  |  | "
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-13 00:20:11 +00:00
										 |  |  | WORK="${WORKBASE}" | 
					
						
							| 
									
										
										
										
											2016-02-24 01:45:48 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | pkg_nofetch() { | 
					
						
							| 
									
										
										
										
											2016-08-13 00:28:35 +00:00
										 |  |  |     local hp=${HP} | 
					
						
							|  |  |  |     optionq gog && hp=${GOG_HP} | 
					
						
							|  |  |  |     local file=${FTL_TAR} | 
					
						
							|  |  |  |     optionq gog && file=${FTL_SH} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     einfo "Please buy & download ${file} from:" | 
					
						
							|  |  |  |     einfo "  ${hp}" | 
					
						
							| 
									
										
										
										
											2016-02-24 01:45:48 +00:00
										 |  |  |     einfo "and move it to ${FETCHEDDIR}" | 
					
						
							|  |  |  |     einfo | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | pkg_setup() { | 
					
						
							|  |  |  |     exdirectory --allow /opt | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-13 00:20:11 +00:00
										 |  |  | src_unpack() { | 
					
						
							|  |  |  |     if optionq gog ; then | 
					
						
							|  |  |  |         unzip -qo "${FETCHEDDIR}/${FTL_SH}" | 
					
						
							|  |  |  |         [[ $? -le 1 ]] || die "unpacking ${FTL_SH} failed!" | 
					
						
							|  |  |  |     else | 
					
						
							|  |  |  |         default | 
					
						
							|  |  |  |     fi | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-02-24 01:45:48 +00:00
										 |  |  | src_install() { | 
					
						
							|  |  |  |     local dir=/opt/${PN} | 
					
						
							|  |  |  |     local arch=$(option platform:amd64 "amd64" "x86") | 
					
						
							| 
									
										
										
										
											2016-08-13 00:20:11 +00:00
										 |  |  |     local datadir=${WORKBASE}/${PN}/data | 
					
						
							|  |  |  |     optionq gog && datadir=${WORKBASE}/data/noarch/game/data | 
					
						
							|  |  |  |     local htmldir=${WORKBASE}/${PN} | 
					
						
							|  |  |  |     optionq gog && htmldir=${WORKBASE}/data/noarch/docs | 
					
						
							| 
									
										
										
										
											2016-02-24 01:45:48 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     insinto "${dir}" | 
					
						
							| 
									
										
										
										
											2016-08-13 00:20:11 +00:00
										 |  |  |     doins -r "${datadir}"/resources | 
					
						
							| 
									
										
										
										
											2016-02-24 01:45:48 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     exeinto "${dir}"/bin | 
					
						
							| 
									
										
										
										
											2016-08-13 00:20:11 +00:00
										 |  |  |     doexe "${datadir}"/${arch}/bin/${PN} | 
					
						
							| 
									
										
										
										
											2016-02-24 01:45:48 +00:00
										 |  |  |     exeinto "${dir}"/lib | 
					
						
							| 
									
										
										
										
											2016-08-13 00:20:11 +00:00
										 |  |  |     doexe "${datadir}"/${arch}/lib/*.so* | 
					
						
							| 
									
										
										
										
											2016-02-24 01:45:48 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     herebin ${PN} << EOF | 
					
						
							|  |  |  | #!/bin/sh
 | 
					
						
							|  |  |  | cd "/opt/FTL" | 
					
						
							|  |  |  | if [ "\${LD_LIBRARY_PATH+set}" = "set" ] ; then | 
					
						
							|  |  |  | export LD_LIBRARY_PATH="\${LD_LIBRARY_PATH}:/opt/FTL/lib" | 
					
						
							|  |  |  | else | 
					
						
							|  |  |  | export LD_LIBRARY_PATH="/opt/FTL/lib" | 
					
						
							|  |  |  | fi | 
					
						
							| 
									
										
										
										
											2018-01-30 22:49:08 +00:00
										 |  |  | exec /opt/FTL/bin/FTL "\$@" | 
					
						
							| 
									
										
										
										
											2016-02-24 01:45:48 +00:00
										 |  |  | EOF | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-26 12:53:36 +00:00
										 |  |  |     install_desktop_entry "Name=Faster Than Light" \
 | 
					
						
							|  |  |  |         "Icon=/usr/share/pixmaps/FTL.bmp" | 
					
						
							| 
									
										
										
										
											2016-02-24 01:45:48 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     insinto /usr/share/pixmaps | 
					
						
							| 
									
										
										
										
											2016-08-13 00:20:11 +00:00
										 |  |  |     newins "${datadir}"/resources/exe_icon.bmp FTL.bmp | 
					
						
							| 
									
										
										
										
											2016-02-24 01:45:48 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     insinto /usr/share/doc/${PNVR}/html | 
					
						
							| 
									
										
										
										
											2016-08-13 00:20:11 +00:00
										 |  |  |     doins "${htmldir}"/${PN}_README.html | 
					
						
							| 
									
										
										
										
											2016-02-24 01:45:48 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 |