1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit desktop xdg cmake
8 DESCRIPTION="Open source remake of The Settlers II: Gold Edition (needs original data files)"
9 HOMEPAGE="https://www.siedler25.org/"
11 # To generate from git repo:
12 # echo -e "COMMIT=\"$(git rev-parse HEAD)\"\nSRC_URI=\"\n\thttps://github.com/Return-To-The-Roots/s25client/archive/\${COMMIT}.tar.gz -> s25client-\${COMMIT}.tar.gz" && git submodule --quiet foreach --recursive 'url=$(git remote get-url origin); gh=${url#*github.com[:/]}; gh=${gh%.git}; echo -e "\thttps://github.com/${gh}/archive/${sha1}.tar.gz -> \${PN}-${gh##*/}-${sha1}.tar.gz"' | egrep -v "/(dev-tools|libsamplerate|s25update)/" | sort && echo '"'
13 COMMIT="784eb58fc1eb42751042d82f16cc92617fc6c2ae"
15 https://github.com/Return-To-The-Roots/s25client/archive/${COMMIT}.tar.gz -> s25client-${COMMIT}.tar.gz
16 https://github.com/mat007/turtle/archive/5f8421b1d270665347280d4cab1caf159d6858de.tar.gz -> ${PN}-turtle-5f8421b1d270665347280d4cab1caf159d6858de.tar.gz
17 https://github.com/Return-To-The-Roots/languages/archive/b1978170473bbf39a24254814e1b1f967a51ef4c.tar.gz -> ${PN}-languages-b1978170473bbf39a24254814e1b1f967a51ef4c.tar.gz
18 https://github.com/Return-To-The-Roots/libendian/archive/dd2c11498f679247530b6b7cf7bd5964f539ddfd.tar.gz -> ${PN}-libendian-dd2c11498f679247530b6b7cf7bd5964f539ddfd.tar.gz
19 https://github.com/Return-To-The-Roots/liblobby/archive/7d85ec40f03af619a6734f20edb28d991b3d61f2.tar.gz -> ${PN}-liblobby-7d85ec40f03af619a6734f20edb28d991b3d61f2.tar.gz
20 https://github.com/Return-To-The-Roots/libsiedler2/archive/800d58ea072c35d3cf9832d2f6a5cdae92fc0445.tar.gz -> ${PN}-libsiedler2-800d58ea072c35d3cf9832d2f6a5cdae92fc0445.tar.gz
21 https://github.com/Return-To-The-Roots/libutil/archive/c91488e4d2f0079a864c4be80eaba24a871e9772.tar.gz -> ${PN}-libutil-c91488e4d2f0079a864c4be80eaba24a871e9772.tar.gz
22 https://github.com/Return-To-The-Roots/mygettext/archive/7e46bbb3e24891348f5629887efb0173690e83b8.tar.gz -> ${PN}-mygettext-7e46bbb3e24891348f5629887efb0173690e83b8.tar.gz
23 https://github.com/Return-To-The-Roots/s25edit/archive/04b5e725036a0568e8da15447167c240563dbaba.tar.gz -> ${PN}-s25edit-04b5e725036a0568e8da15447167c240563dbaba.tar.gz
24 https://github.com/Return-To-The-Roots/s25maps/archive/11a5f3e95405b7cf8088641efb4939eba9639cbc.tar.gz -> ${PN}-s25maps-11a5f3e95405b7cf8088641efb4939eba9639cbc.tar.gz
25 https://github.com/satoren/kaguya/archive/38ca7e1d894c138e454bbe5c89048bdd5091545a.tar.gz -> ${PN}-kaguya-38ca7e1d894c138e454bbe5c89048bdd5091545a.tar.gz
28 LICENSE="GPL-2+ GPL-3 Boost-1.0"
30 KEYWORDS="~amd64 ~x86"
32 RESTRICT="!test? ( test )"
37 >=dev-libs/boost-1.64:0=[nls]
38 >=media-libs/libsamplerate-0.1.9
39 >=media-libs/libsdl2-2.0.10-r2[opengl,sound,video]
41 media-libs/sdl2-mixer[vorbis,wav]
48 test? ( >=sys-devel/clang-5 )
56 S="${WORKDIR}/s25client-${COMMIT}"
59 "${FILESDIR}"/${PN}-loosen-libs.patch
62 # Build type is checked but blank is valid.
77 DST=external/${DST,,} ;;
80 rmdir "${S}/${DST}" || die
81 mv "${SRC}" "${S}/${DST}" || die
87 -DBUILD_TESTING=$(usex test)
90 -DRTTR_BUILD_UPDATER=OFF
91 -DRTTR_ENABLE_OPTIMIZATIONS=OFF
92 -DRTTR_ENABLE_SANITIZERS=$(usex test)
93 -DRTTR_INCLUDE_DEVTOOLS=OFF
94 -DRTTR_LIBDIR="$(get_libdir)/${PN}"
95 -DRTTR_REVISION="${COMMIT}"
96 -DRTTR_USE_SYSTEM_SAMPLERATE=ON
97 -DRTTR_VERSION="${PV}"
101 einfo "Forcing clang due to USE=test."
110 SDL_AUDIODRIVER=dummy \
111 SDL_VIDEODRIVER=dummy \
118 doicon -s 64 tools/release/debian/s25rttr.png
119 make_desktop_entry s25client "Return to the Roots"
125 if ! has_version -r games-strategy/settlers-2-gold-data; then
126 elog "Install games-strategy/settlers-2-gold-data or manually copy the DATA"
127 elog "and GFX directories from original data files into"
128 elog "${EPREFIX}/usr/share/${PN}/S2."