commit:     3e16317b57e96c4875486f111707727e056a0f4b
Author:     Jan Segre <jan <AT> segre <DOT> in>
AuthorDate: Sat Jan 28 14:21:34 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Jul 26 08:12:35 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3e16317b

games-simulation/openrct2: new package, #607444

OpenRCT2 (https://openrct2.website/) is an open source re-implementation
of RollerCoaster Tycoon 2. The original data files from RCT2 are still
needed to play this game, see:
https://github.com/OpenRCT2/OpenRCT2/wiki/Required-RCT2-files#how-to-retrieve

Closes: https://github.com/gentoo/gentoo/pull/3694
Package-Manager: Portage-2.3.6, Repoman-2.3.1
Signed-off-by: Jan Segre <jan <AT> segre.in>

 games-simulation/openrct2/Manifest                 |   2 +
 .../openrct2-0.1.0-remove-external-gtest.patch     |  67 ++++++++++++++
 .../files/openrct2-0.1.0-respect-libdir.patch      |  11 +++
 games-simulation/openrct2/metadata.xml             |  27 ++++++
 games-simulation/openrct2/openrct2-0.1.0.ebuild    | 100 +++++++++++++++++++++
 games-simulation/openrct2/openrct2-9999.ebuild     | 100 +++++++++++++++++++++
 6 files changed, 307 insertions(+)

diff --git a/games-simulation/openrct2/Manifest 
b/games-simulation/openrct2/Manifest
new file mode 100644
index 00000000000..545dbe32f6b
--- /dev/null
+++ b/games-simulation/openrct2/Manifest
@@ -0,0 +1,2 @@
+DIST openrct2-0.1.0.tar.gz 6253207 SHA256 
0347a47d380fc18ea543928c92a13d1bdb4431573154afeb80fa33f1149e6992 SHA512 
102902f47948e2dc648a48897eddbb53bbd451fd6e9a66f397c6f026012131c11e3c5a5aa208b9d719a0e75aa244c9a3967ae3b98c33ba695fd622cb1bd18f12
 WHIRLPOOL 
18d1fc763606b9fb85fae9ba056ef3b8ae9be68903fbd137e045f594e273c954777c2ea2f2ede65e3695d43e4c4a714df9f77afaf07b5a6555a314e616188a3d
+DIST openrct2-title-sequence-v0.1.0.zip 1766393 SHA256 
1df6ad253896bd09b728616f7bf12f4b797ef9db2b9bab8465b08662f47f4bef SHA512 
0d1b47c5fc5d1d9e5580b30d0f43d5532b388f1a5685060ca9313ec2f76c61a5fc96b8aa37689072b71edd9fb1aedddd46fa38c237ccb7198841d7bc33bf2a2b
 WHIRLPOOL 
f78612445dda2c55aa224e4df0ece92a5f762049ca1b6bcf4e00f72f6aaf900fb944a6a1dd358900b1968a63b301af8bf4b1ca0a645c43c0ca2221279efabd9a

diff --git 
a/games-simulation/openrct2/files/openrct2-0.1.0-remove-external-gtest.patch 
b/games-simulation/openrct2/files/openrct2-0.1.0-remove-external-gtest.patch
new file mode 100644
index 00000000000..2c1392b731f
--- /dev/null
+++ b/games-simulation/openrct2/files/openrct2-0.1.0-remove-external-gtest.patch
@@ -0,0 +1,67 @@
+--- a/test/tests/CMakeLists.txt        2017-07-13 14:46:34.690292993 +0200
++++ b/test/tests/CMakeLists.txt        2017-07-13 14:56:57.678054368 +0200
+@@ -2,61 +2,13 @@
+ 
+ option(DISABLE_RCT2_TESTS "Disable tests that require RollerCoaster Tycoon 2 
assets.")
+ 
+-# Bootstrap GoogleTest
+-INCLUDE(ExternalProject)
++find_package(GTest REQUIRED)
+ 
+-ExternalProject_Add(
+-        googletest-distribution
+-        URL https://github.com/google/googletest/archive/release-1.8.0.tar.gz
+-        URL_HASH SHA1=e7e646a6204638fe8e87e165292b8dd9cd4c36ed
+-        TIMEOUT 10
+-        CONFIGURE_COMMAND ""
+-        BUILD_COMMAND ""
+-        INSTALL_COMMAND ""
+-)
+-
+-# Specify include dir
+-ExternalProject_Get_Property(googletest-distribution SOURCE_DIR)
+-set(GOOGLETEST_DISTRIB_SOURCE_DIR "${SOURCE_DIR}")
+-
+-ExternalProject_Add(
+-        googletest
+-        DEPENDS googletest-distribution
+-        DOWNLOAD_COMMAND ""
+-        SOURCE_DIR "${GOOGLETEST_DISTRIB_SOURCE_DIR}/googletest"
+-        CMAKE_ARGS "-DCMAKE_CXX_FLAGS=${TARGET_M}"
+-        BUILD_BYPRODUCTS 
"googletest-prefix/src/googletest-build/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}"
+-        BUILD_BYPRODUCTS 
"googletest-prefix/src/googletest-build/${CMAKE_STATIC_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}"
+-        # Disable install step
+-        INSTALL_COMMAND ""
+-        # Wrap download, configure and build steps in a script to log output
+-        LOG_DOWNLOAD ON
+-        LOG_CONFIGURE ON
+-        LOG_BUILD ON)
+-
+-
+-# Specify include dir
+-set(GTEST_INCLUDE_DIR ${GOOGLETEST_DISTRIB_SOURCE_DIR}/googletest/include)
+-
+-# Library
+-ExternalProject_Get_Property(googletest BINARY_DIR)
+-set(GOOGLETEST_BINARY_DIR "${BINARY_DIR}")
+-set(GTEST_LIBRARY_PATH 
${GOOGLETEST_BINARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX})
+-set(GTEST_MAIN_LIBRARY_PATH 
${GOOGLETEST_BINARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX})
+-set(GTEST_LIBRARY gtest)
+-set(GTEST_MAIN_LIBRARY gtest_main)
+-add_library(${GTEST_LIBRARY} STATIC IMPORTED)
+-add_library(${GTEST_MAIN_LIBRARY} STATIC IMPORTED)
+-set_property(TARGET ${GTEST_LIBRARY} PROPERTY IMPORTED_LOCATION 
${GTEST_LIBRARY_PATH})
+-set_property(TARGET ${GTEST_MAIN_LIBRARY} PROPERTY IMPORTED_LOCATION 
${GTEST_MAIN_LIBRARY_PATH})
+-add_dependencies(${GTEST_LIBRARY} googletest)
+-add_dependencies(${GTEST_MAIN_LIBRARY} ${GTEST_LIBRARY})
+-
+-include_directories(SYSTEM ${GTEST_INCLUDE_DIR})
++include_directories(SYSTEM ${GTEST_INCLUDE_DIRS})
+ include_directories("${ROOT_DIR}/src")
+ include_directories(${SDL2_INCLUDE_DIRS})
+ 
+-set(GTEST_LIBRARIES gtest gtest_main pthread)
++set(GTEST_LIBRARIES ${GTEST_BOTH_LIBRARIES})
+ 
+ # Some most common files required in tests
+ set(COMMON_TEST_SOURCES

diff --git 
a/games-simulation/openrct2/files/openrct2-0.1.0-respect-libdir.patch 
b/games-simulation/openrct2/files/openrct2-0.1.0-respect-libdir.patch
new file mode 100644
index 00000000000..60695802764
--- /dev/null
+++ b/games-simulation/openrct2/files/openrct2-0.1.0-respect-libdir.patch
@@ -0,0 +1,11 @@
+--- a/CMakeLists.txt   2017-07-26 00:54:48.021345174 -0300
++++ b/CMakeLists.txt   2017-07-26 00:54:39.510156990 -0300
+@@ -140,7 +140,7 @@
+     if (PORTABLE)
+         install(TARGETS "libopenrct2" LIBRARY DESTINATION "bin")
+     else ()
+-        install(TARGETS "libopenrct2" LIBRARY DESTINATION "lib")
++        install(TARGETS "libopenrct2" LIBRARY DESTINATION 
"${CMAKE_INSTALL_LIBDIR}")
+     endif ()
+ endif ()
+ install(TARGETS "openrct2" RUNTIME DESTINATION "bin")

diff --git a/games-simulation/openrct2/metadata.xml 
b/games-simulation/openrct2/metadata.xml
new file mode 100644
index 00000000000..e6ebc48e755
--- /dev/null
+++ b/games-simulation/openrct2/metadata.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>j...@segre.in</email>
+               <name>Jan Segre</name>
+       </maintainer>
+       <maintainer type="person">
+               <email>hend...@consetetur.de</email>
+               <name>Hendrik v. Raven (lorem_ipsum)</name>
+       </maintainer>
+       <maintainer type="project">
+               <email>proxy-ma...@gentoo.org</email>
+               <name>Proxy Maintainers</name>
+       </maintainer>
+       <longdescription lang="en">
+               An open-source re-implementation of RollerCoaster Tycoon 2. A 
construction and management simulation video game that simulates amusement park 
management.
+       </longdescription>
+       <use>
+               <flag name="multiplayer">Enable multiplayer functionality</flag>
+               <flag name="twitch">Enable Twitch support</flag>
+       </use>
+       <upstream>
+               <remote-id type="github">OpenRCT2/OpenRCT2</remote-id>
+               <bugs-to>https://github.com/OpenRCT2/OpenRCT2/issues</bugs-to>
+       </upstream>
+</pkgmetadata>

diff --git a/games-simulation/openrct2/openrct2-0.1.0.ebuild 
b/games-simulation/openrct2/openrct2-0.1.0.ebuild
new file mode 100644
index 00000000000..a0f3e627052
--- /dev/null
+++ b/games-simulation/openrct2/openrct2-0.1.0.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils gnome2-utils
+
+DESCRIPTION="An open source re-implementation of RollerCoaster Tycoon 2"
+HOMEPAGE="https://openrct2.website/";
+if [[ ${PV} == 9999 ]]; then
+       EGIT_REPO_URI="https://github.com/OpenRCT2/OpenRCT2.git";
+       EGIT_BRANCH="develop"
+       inherit git-r3
+       SRC_URI=""
+else
+       KEYWORDS="~amd64 ~x86"
+       SRC_URI="https://github.com/OpenRCT2/OpenRCT2/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+       S="${WORKDIR}/OpenRCT2-${PV}"
+fi
+
+TSV="0.1.0"
+SRC_URI+=" 
https://github.com/OpenRCT2/title-sequences/releases/download/v${TSV}/title-sequence-v${TSV}.zip
 -> ${PN}-title-sequence-v${TSV}.zip "
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE="libressl +multiplayer opengl test truetype +twitch"
+
+# This is needed because of this bug: 
https://github.com/OpenRCT2/OpenRCT2/issues/5469
+REQUIRED_USE="multiplayer? ( twitch )"
+
+RDEPEND="
+       >=dev-libs/jansson-2.5
+       >=dev-libs/libzip-1.0
+       media-libs/libpng:0=
+       media-libs/libsdl2
+       || (
+               media-libs/speexdsp
+               <media-libs/speex-1.2.0
+       )
+       multiplayer? (
+               libressl? ( dev-libs/libressl:0= )
+               !libressl? ( dev-libs/openssl:0= )
+       )
+       opengl? ( virtual/opengl )
+       truetype? (
+               media-libs/sdl2-ttf
+               media-libs/fontconfig
+       )
+       twitch? ( net-misc/curl[ssl] )
+"
+DEPEND="${RDEPEND}
+       test? ( dev-cpp/gtest )
+"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-0.1.0-remove-external-gtest.patch"
+       "${FILESDIR}/${PN}-0.1.0-respect-libdir.patch"
+)
+
+if [[ ${PV} == 9999 ]]; then
+src_unpack() {
+       default
+       git-r3_src_unpack
+}
+fi
+
+src_configure() {
+       local mycmakeargs=(
+               -DDISABLE_HTTP_TWITCH="$(usex !twitch)"
+               -DDISABLE_NETWORK="$(usex !multiplayer)"
+               -DDISABLE_OPENGL="$(usex !opengl)"
+               -DDISABLE_TTF="$(usex !truetype)"
+               -DWITH_TESTS="$(usex test)"
+               -DDOWNLOAD_TITLE_SEQUENCES=OFF
+               -DDISABLE_RCT2_TESTS=ON
+       )
+
+       cmake-utils_src_configure
+}
+
+src_install() {
+       cmake-utils_src_install
+
+       insinto /usr/share/openrct2/title
+       doins "${WORKDIR}"/*.parkseq
+}
+
+pkg_postinst() {
+       if [[ -z ${REPLACING_VERSIONS} ]]; then
+               ewarn ""
+               ewarn "You need the original RollerCoaster Tycoon 2 files to 
play this game."
+               ewarn "See: 
https://github.com/OpenRCT2/OpenRCT2/wiki/Required-RCT2-files#how-to-retrieve";
+               ewarn ""
+       fi
+       gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+       gnome2_icon_cache_update
+}

diff --git a/games-simulation/openrct2/openrct2-9999.ebuild 
b/games-simulation/openrct2/openrct2-9999.ebuild
new file mode 100644
index 00000000000..a0f3e627052
--- /dev/null
+++ b/games-simulation/openrct2/openrct2-9999.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils gnome2-utils
+
+DESCRIPTION="An open source re-implementation of RollerCoaster Tycoon 2"
+HOMEPAGE="https://openrct2.website/";
+if [[ ${PV} == 9999 ]]; then
+       EGIT_REPO_URI="https://github.com/OpenRCT2/OpenRCT2.git";
+       EGIT_BRANCH="develop"
+       inherit git-r3
+       SRC_URI=""
+else
+       KEYWORDS="~amd64 ~x86"
+       SRC_URI="https://github.com/OpenRCT2/OpenRCT2/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+       S="${WORKDIR}/OpenRCT2-${PV}"
+fi
+
+TSV="0.1.0"
+SRC_URI+=" 
https://github.com/OpenRCT2/title-sequences/releases/download/v${TSV}/title-sequence-v${TSV}.zip
 -> ${PN}-title-sequence-v${TSV}.zip "
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE="libressl +multiplayer opengl test truetype +twitch"
+
+# This is needed because of this bug: 
https://github.com/OpenRCT2/OpenRCT2/issues/5469
+REQUIRED_USE="multiplayer? ( twitch )"
+
+RDEPEND="
+       >=dev-libs/jansson-2.5
+       >=dev-libs/libzip-1.0
+       media-libs/libpng:0=
+       media-libs/libsdl2
+       || (
+               media-libs/speexdsp
+               <media-libs/speex-1.2.0
+       )
+       multiplayer? (
+               libressl? ( dev-libs/libressl:0= )
+               !libressl? ( dev-libs/openssl:0= )
+       )
+       opengl? ( virtual/opengl )
+       truetype? (
+               media-libs/sdl2-ttf
+               media-libs/fontconfig
+       )
+       twitch? ( net-misc/curl[ssl] )
+"
+DEPEND="${RDEPEND}
+       test? ( dev-cpp/gtest )
+"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-0.1.0-remove-external-gtest.patch"
+       "${FILESDIR}/${PN}-0.1.0-respect-libdir.patch"
+)
+
+if [[ ${PV} == 9999 ]]; then
+src_unpack() {
+       default
+       git-r3_src_unpack
+}
+fi
+
+src_configure() {
+       local mycmakeargs=(
+               -DDISABLE_HTTP_TWITCH="$(usex !twitch)"
+               -DDISABLE_NETWORK="$(usex !multiplayer)"
+               -DDISABLE_OPENGL="$(usex !opengl)"
+               -DDISABLE_TTF="$(usex !truetype)"
+               -DWITH_TESTS="$(usex test)"
+               -DDOWNLOAD_TITLE_SEQUENCES=OFF
+               -DDISABLE_RCT2_TESTS=ON
+       )
+
+       cmake-utils_src_configure
+}
+
+src_install() {
+       cmake-utils_src_install
+
+       insinto /usr/share/openrct2/title
+       doins "${WORKDIR}"/*.parkseq
+}
+
+pkg_postinst() {
+       if [[ -z ${REPLACING_VERSIONS} ]]; then
+               ewarn ""
+               ewarn "You need the original RollerCoaster Tycoon 2 files to 
play this game."
+               ewarn "See: 
https://github.com/OpenRCT2/OpenRCT2/wiki/Required-RCT2-files#how-to-retrieve";
+               ewarn ""
+       fi
+       gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+       gnome2_icon_cache_update
+}

Reply via email to