You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
113 lines
2.5 KiB
113 lines
2.5 KiB
6 years ago
|
# Copyright 1999-2018 Gentoo Foundation
|
||
8 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
|
||
|
EAPI=5
|
||
6 years ago
|
inherit eutils cmake-utils gnome2-utils readme.gentoo-r1
|
||
8 years ago
|
|
||
|
DESCRIPTION="Open Source remake of The Settlers II game (needs original game files)"
|
||
|
HOMEPAGE="http://www.siedler25.org/"
|
||
|
# no upstream source tarball yet
|
||
|
# https://bugs.launchpad.net/s25rttr/+bug/1069546
|
||
|
SRC_URI="https://dev.gentoo.org/~hasufell/distfiles/${P}.tar.xz"
|
||
|
|
||
|
LICENSE="GPL-3"
|
||
|
SLOT="0"
|
||
7 years ago
|
KEYWORDS="~amd64 ~x86"
|
||
8 years ago
|
IUSE="debug"
|
||
|
|
||
6 years ago
|
RDEPEND="
|
||
|
app-arch/bzip2
|
||
8 years ago
|
media-libs/libsamplerate
|
||
|
media-libs/libsdl[X,sound,opengl,video]
|
||
|
media-libs/libsndfile
|
||
|
media-libs/sdl-mixer[vorbis]
|
||
|
net-libs/miniupnpc
|
||
|
virtual/libiconv
|
||
6 years ago
|
virtual/opengl
|
||
|
"
|
||
8 years ago
|
DEPEND="${RDEPEND}
|
||
6 years ago
|
sys-devel/gettext
|
||
|
"
|
||
8 years ago
|
|
||
7 years ago
|
PATCHES=(
|
||
|
"${FILESDIR}"/${P}-cmake.patch
|
||
|
"${FILESDIR}"/${P}-soundconverter.patch
|
||
|
"${FILESDIR}"/${P}-fpic.patch
|
||
|
"${FILESDIR}"/${P}-format.patch
|
||
|
"${FILESDIR}"/${P}-miniupnpc-api-14.patch
|
||
|
"${FILESDIR}"/${P}-cmake-3.patch
|
||
|
"${FILESDIR}"/${P}-gcc6.patch
|
||
|
)
|
||
|
|
||
6 years ago
|
DOC_CONTENTS="Copy your Settlers2 game files into ~/.${PN}/S2"
|
||
8 years ago
|
|
||
|
src_configure() {
|
||
|
local arch
|
||
|
case ${ARCH} in
|
||
|
amd64)
|
||
|
arch="x86_64" ;;
|
||
|
x86)
|
||
|
arch="i386" ;;
|
||
|
*) die "Architecture ${ARCH} not yet supported" ;;
|
||
|
esac
|
||
|
|
||
|
local mycmakeargs=(
|
||
|
-DCOMPILEFOR="linux"
|
||
|
-DCOMPILEARCH="${arch}"
|
||
|
-DCMAKE_SKIP_RPATH=YES
|
||
6 years ago
|
-DPREFIX="/usr/"
|
||
|
-DBINDIR="/usr/bin"
|
||
|
-DDATADIR="/usr/share"
|
||
|
-DLIBDIR="/usr/$(get_libdir)/${PN}"
|
||
|
-DDRIVERDIR="/usr/$(get_libdir)/${PN}"
|
||
8 years ago
|
-DGAMEDIR="~/.${PN}/S2"
|
||
|
-DBUILD_GLFW_DRIVER=OFF
|
||
|
)
|
||
|
|
||
|
cmake-utils_src_configure
|
||
|
}
|
||
|
|
||
|
src_compile() {
|
||
|
# work around some relative paths (CMAKE_IN_SOURCE_BUILD not supported)
|
||
|
ln -s "${CMAKE_USE_DIR}"/RTTR "${CMAKE_BUILD_DIR}"/RTTR || die
|
||
|
|
||
|
cmake-utils_src_compile
|
||
|
|
||
|
mv "${CMAKE_USE_DIR}"/RTTR/{sound-convert,s-c_resample} "${T}"/ || die
|
||
|
}
|
||
|
|
||
|
src_install() {
|
||
|
cd "${CMAKE_BUILD_DIR}" || die
|
||
|
|
||
6 years ago
|
exeinto /usr/"$(get_libdir)"/${PN}
|
||
8 years ago
|
doexe "${T}"/{sound-convert,s-c_resample}
|
||
6 years ago
|
exeinto /usr/"$(get_libdir)"/${PN}/video
|
||
8 years ago
|
doexe driver/video/SDL/src/libvideoSDL.so
|
||
6 years ago
|
exeinto /usr/"$(get_libdir)"/${PN}/audio
|
||
8 years ago
|
doexe driver/audio/SDL/src/libaudioSDL.so
|
||
|
|
||
6 years ago
|
insinto /usr/share
|
||
8 years ago
|
doins -r "${CMAKE_USE_DIR}"/RTTR
|
||
6 years ago
|
dosym ./LSTS/splash.bmp /usr/share/RTTR/splash.bmp
|
||
8 years ago
|
|
||
|
doicon -s 64 "${CMAKE_USE_DIR}"/debian/${PN}.png
|
||
6 years ago
|
dobin src/s25client
|
||
8 years ago
|
make_desktop_entry "s25client" "Settlers RTTR" "${PN}"
|
||
|
|
||
6 years ago
|
dodoc RTTR/texte/{keyboardlayout.txt,readme.txt}
|
||
|
readme.gentoo_create_doc
|
||
8 years ago
|
}
|
||
|
|
||
|
pkg_preinst() {
|
||
|
gnome2_icon_savelist
|
||
|
}
|
||
|
|
||
|
pkg_postinst() {
|
||
|
gnome2_icon_cache_update
|
||
6 years ago
|
readme.gentoo_print_elog
|
||
8 years ago
|
}
|
||
|
|
||
|
pkg_postrm() {
|
||
|
gnome2_icon_cache_update
|
||
|
}
|