| 
									
										
										
										
											2016-02-16 22:08:08 +00:00
										 |  |  | # Copyright 2015-2016 Julian Ospald <hasufell@posteo.de> | 
					
						
							|  |  |  | # Distributed under the terms of the GNU General Public License v2 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-02-29 17:39:49 +00:00
										 |  |  | require desktop-utils gtk-icon-cache freedesktop-desktop freedesktop-mime | 
					
						
							| 
									
										
										
										
											2016-02-29 17:42:58 +00:00
										 |  |  | require lua [ whitelist="5.1" multibuild=false ] | 
					
						
							| 
									
										
										
										
											2016-04-22 15:42:34 +00:00
										 |  |  | require github [ user=OpenRA project=OpenRA tag=release-${PV} ] | 
					
						
							| 
									
										
										
										
											2016-02-16 22:08:08 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | SUMMARY="A free RTS engine supporting games like Command & Conquer and Red Alert" | 
					
						
							|  |  |  | HOMEPAGE="http://www.openra.net/" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-02-17 01:53:28 +00:00
										 |  |  | ## this is a massive amount of 3rd party deps that would otherwise | 
					
						
							|  |  |  | ## be fetched during build time | 
					
						
							| 
									
										
										
										
											2016-02-16 22:08:08 +00:00
										 |  |  | NG_SRC="https://nuget.org/api/v2/package" | 
					
						
							|  |  |  | # 3rd party deps | 
					
						
							|  |  |  | StyleCopPlus_MSBuild="${NG_SRC}/StyleCopPlus.MSBuild/4.7.49.5 -> StyleCopPlus_MSBuild-4.7.49.5.zip" | 
					
						
							|  |  |  | StyleCop_MSBuild="${NG_SRC}/StyleCop.MSBuild/4.7.49.0 -> StyleCop_MSBuild-4.7.49.0.zip" | 
					
						
							|  |  |  | SharpZipLib="${NG_SRC}/SharpZipLib/0.86.0 -> SharpZipLib-0.86.0.zip" | 
					
						
							| 
									
										
										
										
											2016-02-29 17:39:49 +00:00
										 |  |  | MaxMind_Db="${NG_SRC}/MaxMind.Db/1.1.0.0 -> MaxMind_Db-1.1.0.0.zip" | 
					
						
							|  |  |  | Newtonsoft_Json="${NG_SRC}/Newtonsoft.Json/7.0.1 -> Newtonsoft_Json-7.0.1.zip" | 
					
						
							|  |  |  | RestSharp="${NG_SRC}/RestSharp/105.2.3 -> RestSharp-105.2.3.zip" | 
					
						
							|  |  |  | MaxMind_GeoIP2="${NG_SRC}/MaxMind.GeoIP2/2.3.1 -> MaxMind_GeoIP2-2.3.1.zip" | 
					
						
							| 
									
										
										
										
											2016-05-14 01:10:18 +00:00
										 |  |  | SharpFont="${NG_SRC}/SharpFont/3.1.0 -> SharpFont-3.1.0.zip" | 
					
						
							|  |  |  | NUnit="${NG_SRC}/NUnit/3.0.1 -> NUnit-3.0.1.zip" | 
					
						
							|  |  |  | NUnit_Console="${NG_SRC}/NUnit.Console/3.0.1 -> NUnit_Console-3.0.1.zip" | 
					
						
							|  |  |  | Mono_Nat="${NG_SRC}/Mono.Nat/1.2.24 -> Mono_Nat-1.2.24.zip" | 
					
						
							| 
									
										
										
										
											2016-02-16 22:08:08 +00:00
										 |  |  | FuzzyLogicLibrary="${NG_SRC}/FuzzyLogicLibrary/1.2.0 -> FuzzyLogicLibrary-1.2.0.zip" | 
					
						
							|  |  |  | SDL2CS="https://github.com/OpenRA/SDL2-CS/releases/download/20150709/SDL2-CS.dll -> SDL2-CS.dll.20150709" | 
					
						
							|  |  |  | Eluant="https://github.com/OpenRA/Eluant/releases/download/20140425/Eluant.dll -> Eluant.dll.20140425" | 
					
						
							| 
									
										
										
										
											2016-02-29 17:39:49 +00:00
										 |  |  | SmartIrc4net="${NG_SRC}/SmartIrc4net/0.4.5.1 -> SmartIrc4net-0.4.5.1.zip" | 
					
						
							| 
									
										
										
										
											2016-02-16 22:08:08 +00:00
										 |  |  | # unfortunately, this may randomly change | 
					
						
							|  |  |  | GEO_IP_DB="http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz -> GeoLite2-Country-2015-10-18.mmdb.gz" | 
					
						
							| 
									
										
										
										
											2016-05-14 01:10:18 +00:00
										 |  |  | OpenAL_CS="https://github.com/OpenRA/OpenAL-CS/releases/download/20151227/OpenAL-CS.dll -> OpenAL-CS-20151227.dll" | 
					
						
							|  |  |  | OpenAL_CS_config="https://github.com/OpenRA/OpenAL-CS/releases/download/20151227/OpenAL-CS.dll.config -> OpenAL-CS-20151227.dll.config" | 
					
						
							| 
									
										
										
										
											2016-02-16 22:08:08 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | DOWNLOADS="${DOWNLOADS}
 | 
					
						
							|  |  |  | ${StyleCopPlus_MSBuild} | 
					
						
							|  |  |  | ${StyleCop_MSBuild} | 
					
						
							|  |  |  | ${SharpZipLib} | 
					
						
							|  |  |  | ${MaxMind_Db} | 
					
						
							|  |  |  | ${Newtonsoft_Json} | 
					
						
							|  |  |  | ${RestSharp} | 
					
						
							|  |  |  | ${MaxMind_GeoIP2} | 
					
						
							|  |  |  | ${SharpFont} | 
					
						
							|  |  |  | ${NUnit} | 
					
						
							| 
									
										
										
										
											2016-05-14 01:10:18 +00:00
										 |  |  | ${NUnit_Console} | 
					
						
							| 
									
										
										
										
											2016-02-16 22:08:08 +00:00
										 |  |  | ${Mono_Nat} | 
					
						
							|  |  |  | ${FuzzyLogicLibrary} | 
					
						
							|  |  |  | ${SDL2CS} | 
					
						
							|  |  |  | ${Eluant} | 
					
						
							| 
									
										
										
										
											2016-02-29 17:39:49 +00:00
										 |  |  | ${SmartIrc4net} | 
					
						
							| 
									
										
										
										
											2016-02-16 22:08:08 +00:00
										 |  |  | ${GEO_IP_DB} | 
					
						
							| 
									
										
										
										
											2016-05-14 01:10:18 +00:00
										 |  |  | ${OpenAL_CS} | 
					
						
							|  |  |  | ${OpenAL_CS_config} | 
					
						
							| 
									
										
										
										
											2016-02-16 22:08:08 +00:00
										 |  |  | "
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | LICENCES="GPL-3" | 
					
						
							|  |  |  | SLOT="0" | 
					
						
							|  |  |  | PLATFORMS="~amd64 ~x86" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | MYOPTIONS="
 | 
					
						
							|  |  |  |     ( providers: ijg-jpeg jpeg-turbo ) [[ number-selected = exactly-one ]] | 
					
						
							|  |  |  | "
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | DEPENDENCIES="
 | 
					
						
							| 
									
										
										
										
											2016-02-28 23:05:15 +00:00
										 |  |  |     build: | 
					
						
							|  |  |  |         virtual/unzip | 
					
						
							| 
									
										
										
										
											2016-02-16 22:08:08 +00:00
										 |  |  |     build+run: | 
					
						
							|  |  |  |         dev-dotnet/libgdiplus | 
					
						
							| 
									
										
										
										
											2016-05-14 01:10:18 +00:00
										 |  |  |         dev-lang/mono[>=4.2] | 
					
						
							| 
									
										
										
										
											2016-02-16 22:08:08 +00:00
										 |  |  |         media-libs/SDL:2[X] | 
					
						
							| 
									
										
										
										
											2016-05-14 01:10:18 +00:00
										 |  |  |         media-libs/freetype:2 | 
					
						
							| 
									
										
										
										
											2016-02-16 22:08:08 +00:00
										 |  |  |         media-libs/openal | 
					
						
							|  |  |  |         x11-dri/mesa | 
					
						
							| 
									
										
										
										
											2016-02-29 17:42:58 +00:00
										 |  |  |         providers:ijg-jpeg? ( media-libs/jpeg:= ) | 
					
						
							| 
									
										
										
										
											2016-02-16 22:08:08 +00:00
										 |  |  |         providers:jpeg-turbo? ( media-libs/libjpeg-turbo ) | 
					
						
							| 
									
										
										
										
											2016-05-14 01:10:18 +00:00
										 |  |  |     run: | 
					
						
							|  |  |  |         x11-apps/xdg-utils | 
					
						
							|  |  |  |     suggestion: | 
					
						
							|  |  |  |         gnome-desktop/zenity [[ description = [ Graphical error dialogs ] ]] | 
					
						
							| 
									
										
										
										
											2016-02-16 22:08:08 +00:00
										 |  |  | "
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | WORK=${WORKBASE}/OpenRA-release-${PV} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | src_unpack() { | 
					
						
							| 
									
										
										
										
											2016-04-22 15:42:34 +00:00
										 |  |  |     unpack openra-release-${PV}.tar.gz | 
					
						
							| 
									
										
										
										
											2016-02-17 01:53:28 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     # this is pure crapshit, but it will successfully die | 
					
						
							|  |  |  |     # if upstream has added/changed files | 
					
						
							|  |  |  |     edo cd "${WORK}"/thirdparty | 
					
						
							|  |  |  |     edo sed -i \
 | 
					
						
							|  |  |  |         -e 's/get()/furz()/' \
 | 
					
						
							|  |  |  |         -e 's|curl |: |' \
 | 
					
						
							|  |  |  |         fetch-thirdparty-deps.sh | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     edo mkdir "${WORK}"/thirdparty/download | 
					
						
							|  |  |  |     get() { | 
					
						
							|  |  |  |         # don't add dies here | 
					
						
							|  |  |  |         local archive="${1/./_}" | 
					
						
							|  |  |  |         local version="${2}" | 
					
						
							|  |  |  |         mkdir -p "${WORK}"/thirdparty/download/${1} | 
					
						
							|  |  |  |         unzip -o -qq "${FETCHEDDIR}"/${archive}-${version}.zip \
 | 
					
						
							|  |  |  |             -d "${WORK}"/thirdparty/download/${1} | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     export -f get | 
					
						
							|  |  |  |     edo ./fetch-thirdparty-deps.sh | 
					
						
							|  |  |  |     unset get | 
					
						
							|  |  |  |     edo cd "${WORK}"/thirdparty/download | 
					
						
							|  |  |  |     edo cp "${FETCHEDDIR}"/${SDL2CS##* } ./SDL2-CS.dll | 
					
						
							|  |  |  |     edo cp "${FETCHEDDIR}"/${Eluant##* } ./Eluant.dll | 
					
						
							|  |  |  |     edo cp "${FETCHEDDIR}"/${GEO_IP_DB##* } ./GeoLite2-Country.mmdb.gz | 
					
						
							| 
									
										
										
										
											2016-05-14 01:10:18 +00:00
										 |  |  |     edo cp "${FETCHEDDIR}"/${OpenAL_CS##* } ./OpenAL-CS.dll | 
					
						
							|  |  |  |     edo cp "${FETCHEDDIR}"/${OpenAL_CS_config##* } ./OpenAL-CS.dll.config | 
					
						
							| 
									
										
										
										
											2016-02-16 22:08:08 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | src_configure() { :; } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | src_prepare() { | 
					
						
							| 
									
										
										
										
											2016-02-17 01:53:28 +00:00
										 |  |  |     # register game-version | 
					
						
							| 
									
										
										
										
											2016-05-21 15:07:20 +00:00
										 |  |  |     emake VERSION="release-${PV}" version | 
					
						
							| 
									
										
										
										
											2016-02-16 22:08:08 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-02-17 01:53:28 +00:00
										 |  |  |     edo sed \
 | 
					
						
							| 
									
										
										
										
											2016-02-29 17:42:58 +00:00
										 |  |  |         -e "s/@LIBLUA51@/liblua5.1.so/" \
 | 
					
						
							| 
									
										
										
										
											2016-02-17 01:53:28 +00:00
										 |  |  |         "${WORK}"/thirdparty/Eluant.dll.config.in > Eluant.dll.config | 
					
						
							| 
									
										
										
										
											2016-02-16 22:08:08 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-02-17 01:53:28 +00:00
										 |  |  |     edo cd "${WORK}"/thirdparty/download | 
					
						
							|  |  |  |     edo cp *.dll *.dll.config GeoLite2-Country.mmdb.gz "${WORK}"/ | 
					
						
							| 
									
										
										
										
											2016-02-16 22:08:08 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | src_compile() { | 
					
						
							| 
									
										
										
										
											2016-05-21 15:07:20 +00:00
										 |  |  |     emake VERSION="release-${PV}" core tools | 
					
						
							| 
									
										
										
										
											2016-02-16 22:08:08 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | src_install() { | 
					
						
							| 
									
										
										
										
											2016-02-17 01:53:28 +00:00
										 |  |  |     emake \
 | 
					
						
							|  |  |  |         datadir="/usr/share" \
 | 
					
						
							| 
									
										
										
										
											2016-02-16 22:08:08 +00:00
										 |  |  |         bindir="/usr/$(exhost --target)/bin" \
 | 
					
						
							| 
									
										
										
										
											2016-02-17 01:53:28 +00:00
										 |  |  |         libdir="/usr/$(exhost --target)/libexec" \
 | 
					
						
							| 
									
										
										
										
											2016-05-21 15:07:20 +00:00
										 |  |  |         VERSION="release-${PV}" \
 | 
					
						
							| 
									
										
										
										
											2016-02-17 01:53:28 +00:00
										 |  |  |         DESTDIR="${IMAGE}" \
 | 
					
						
							|  |  |  |         install-all install-linux-scripts install-linux-mime install-linux-icons | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     exeinto /usr/$(exhost --target)/libexec/openra | 
					
						
							|  |  |  |     doexe Eluant.dll.config | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # desktop entries | 
					
						
							| 
									
										
										
										
											2016-02-29 17:39:49 +00:00
										 |  |  |     install_desktop_entry "Exec=${PN} Game.Mod=cnc" "Name=OpenRA CNC" | 
					
						
							|  |  |  |     install_desktop_entry "Exec=${PN} Game.Mod=ra" "Name=OpenRA RA" | 
					
						
							|  |  |  |     install_desktop_entry "Exec=${PN} Game.Mod=d2k" "Name=OpenRA Dune2k" | 
					
						
							|  |  |  |     install_desktop_entry "Exec=${PN}-editor" "Name=OpenRA Map Editor" | 
					
						
							| 
									
										
										
										
											2016-02-16 22:08:08 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | pkg_postinst() { | 
					
						
							|  |  |  |     gtk-icon-cache_pkg_postinst | 
					
						
							|  |  |  |     freedesktop-mime_pkg_postinst | 
					
						
							|  |  |  |     freedesktop-desktop_pkg_postinst | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | pkg_postrm() { | 
					
						
							|  |  |  |     gtk-icon-cache_pkg_postrm | 
					
						
							|  |  |  |     freedesktop-desktop_pkg_postrm | 
					
						
							|  |  |  |     freedesktop-mime_pkg_postrm | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2016-02-28 23:05:15 +00:00
										 |  |  | 
 |