| 
									
										
										
										
											2016-05-26 15:06:25 +00:00
										 |  |  | # Copyright 2016 Julian Ospald <hasufell@posteo.de> | 
					
						
							|  |  |  | # Distributed under the terms of the GNU General Public License v2 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | require cmake [ api=2 ] gtk-icon-cache | 
					
						
							| 
									
										
										
										
											2018-03-24 14:34:58 +00:00
										 |  |  | require github [ user=gerstrong tag=v${PV} ] | 
					
						
							| 
									
										
										
										
											2016-05-26 15:06:25 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | SUMMARY="Open Source Commander Keen clone (needs original game files)" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | LICENCES="GPL-2 LGPL-2" | 
					
						
							|  |  |  | SLOT="0" | 
					
						
							|  |  |  | PLATFORMS="~amd64 ~x86" | 
					
						
							|  |  |  | RESTRICT="mirror" # contains keen files, but we do not install them | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-24 14:34:58 +00:00
										 |  |  | PY_SLOT="3.6" | 
					
						
							| 
									
										
										
										
											2016-12-30 20:28:33 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-26 15:06:25 +00:00
										 |  |  | DEPENDENCIES="
 | 
					
						
							|  |  |  |     build: | 
					
						
							|  |  |  |         dev-libs/boost | 
					
						
							|  |  |  |         virtual/pkg-config | 
					
						
							|  |  |  |     build+run: | 
					
						
							| 
									
										
										
										
											2016-12-30 20:28:33 +00:00
										 |  |  |         dev-lang/python:${PY_SLOT} | 
					
						
							| 
									
										
										
										
											2016-05-26 15:06:25 +00:00
										 |  |  |         media-libs/SDL:2[X] | 
					
						
							|  |  |  |         media-libs/SDL_image:2 | 
					
						
							| 
									
										
										
										
											2018-03-24 14:34:58 +00:00
										 |  |  |         media-libs/SDL_mixer:2 | 
					
						
							| 
									
										
										
										
											2016-12-30 20:28:33 +00:00
										 |  |  |         net-misc/curl | 
					
						
							| 
									
										
										
										
											2016-06-09 00:28:46 +00:00
										 |  |  |         sys-libs/zlib | 
					
						
							| 
									
										
										
										
											2016-05-26 15:06:25 +00:00
										 |  |  |         x11-dri/mesa | 
					
						
							|  |  |  | "
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | src_prepare() { | 
					
						
							|  |  |  |     # don't install questionable bundled keen data | 
					
						
							|  |  |  |     edo rm -r vfsroot | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # fixes build skew | 
					
						
							|  |  |  |     edo sed -i \
 | 
					
						
							|  |  |  |         -e '/INCLUDE(package.cmake)/d' \
 | 
					
						
							|  |  |  |         CMakeLists.txt | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     cmake_src_prepare | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-12-30 20:28:33 +00:00
										 |  |  | src_configure() { | 
					
						
							|  |  |  |     CMAKE_SRC_CONFIGURE_PARAMS=( | 
					
						
							|  |  |  |         -DAPPDIR="/usr/$(exhost --target)/bin" | 
					
						
							|  |  |  |         -DBUILD_TARGET="LINUX" | 
					
						
							|  |  |  |         -DDOCDIR="/usr/share/doc/${PNVR}" | 
					
						
							|  |  |  |         -DGAMES_SHAREDIR="/usr/share" | 
					
						
							|  |  |  |         -DOGG=ON | 
					
						
							|  |  |  |         -DOPENGL=ON | 
					
						
							|  |  |  |         -DSHAREDIR="/usr/share" | 
					
						
							|  |  |  |         -DTREMOR=OFF | 
					
						
							|  |  |  |         -DUSE_SDL2=1 | 
					
						
							| 
									
										
										
										
											2017-01-06 14:18:10 +00:00
										 |  |  |         -DUSE_PYTHON3=ON | 
					
						
							| 
									
										
										
										
											2016-12-30 20:28:33 +00:00
										 |  |  |         -DPYTHON_LIBRARY="$(python${PY_SLOT} -c 'import os.path, sysconfig; print(os.path.join(sysconfig.get_config_var("LIBDIR"), sysconfig.get_config_var("LDLIBRARY")) if sysconfig.get_config_var("LDLIBRARY") else "")')" | 
					
						
							|  |  |  |         -DPYTHON_INCLUDE_DIR="$(python${PY_SLOT} -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_inc())')" | 
					
						
							|  |  |  |     ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     cmake_src_configure | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-26 15:06:25 +00:00
										 |  |  | src_install() { | 
					
						
							|  |  |  |     cmake_src_install | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     insinto /usr/share/applications | 
					
						
							|  |  |  |     doins share/cgenius.desktop | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     insinto /usr/share/icons/hicolor/512x512/apps | 
					
						
							|  |  |  |     doins src/CGLogo.png | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | pkg_postinst() { | 
					
						
							|  |  |  |     elog "Check your settings in ~/.CommanderGenius/cgenius.cfg" | 
					
						
							|  |  |  |     elog "after you have started the game for the first time." | 
					
						
							|  |  |  |     elog "You may also want to set \"OpenGL = true\"" | 
					
						
							|  |  |  |     elog | 
					
						
							|  |  |  |     elog "Then create the folder ~/.CommanderGenius/games" | 
					
						
							|  |  |  |     elog "and drop your keen game folders into it." | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     gtk-icon-cache_pkg_postinst | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 |