summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2021-02-27 12:13:27 +0100
committerAndreas Sturmlechner <asturm@gentoo.org>2021-02-28 13:26:08 +0100
commit1984a8d01f6c7739bbc95a85cfbd6a5ef8cf346f (patch)
tree8d19e03ec02e02a64089bc4d010323ed5b5bd5a5 /games-arcade
parentgames-arcade/jvgs: Drop 0.5-r1 (diff)
downloadgentoo-1984a8d01f6c7739bbc95a85cfbd6a5ef8cf346f.tar.gz
gentoo-1984a8d01f6c7739bbc95a85cfbd6a5ef8cf346f.tar.bz2
gentoo-1984a8d01f6c7739bbc95a85cfbd6a5ef8cf346f.zip
games-arcade/opensonic: EAPI-7 bump, switch to cmake.eclass, fix build
Closes: https://bugs.gentoo.org/711542 Package-Manager: Portage-3.0.15, Repoman-3.0.2 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'games-arcade')
-rw-r--r--games-arcade/opensonic/Manifest1
-rw-r--r--games-arcade/opensonic/files/opensonic-0.1.4-allegro-4.4.2-loggcompat.patch46
-rw-r--r--games-arcade/opensonic/files/opensonic-0.1.4-cmake.patch107
-rw-r--r--games-arcade/opensonic/opensonic-0.1.4-r3.ebuild57
4 files changed, 211 insertions, 0 deletions
diff --git a/games-arcade/opensonic/Manifest b/games-arcade/opensonic/Manifest
index 53807ee7a677..223b8148355e 100644
--- a/games-arcade/opensonic/Manifest
+++ b/games-arcade/opensonic/Manifest
@@ -1 +1,2 @@
+DIST loggcompat-4.4.2.tar.gz 3105 BLAKE2B 846430f7a7252ee4de168274b21c9ffd18e9ba40733aaa45def8a8a4a7a938d00ab61267712008bc599ce91d5a283ab586a4dae77c3cd33af10e2dc641b8be12 SHA512 4d704f999fc3ae3caa094a8a32d5285549c40485c7af9015dc67f832255f2d3963ae1d0db9194b101d66a168b85609ec4926b8ebb39fb7ce7986f7df40f293af
DIST opensnc-src-0.1.4.tar.gz 10525059 BLAKE2B d5cb825512dfeb614d146e6e7ec45cc3eb56dae0f2cf6c2582e022a1e8ac54e6c87f7bee8795b0e520fa6c24433cb7a748889892cd288f122d7b885e6e91c790 SHA512 239c7b4c7f9663e4d46c54d8bdaefed8d12274b71feaf9c637feb04f3567465f265c50bf3419f4c881ae3fa48a62ab339fe8a0b005c2b080b53d54ebf1e2f29d
diff --git a/games-arcade/opensonic/files/opensonic-0.1.4-allegro-4.4.2-loggcompat.patch b/games-arcade/opensonic/files/opensonic-0.1.4-allegro-4.4.2-loggcompat.patch
new file mode 100644
index 000000000000..1289e846fe2b
--- /dev/null
+++ b/games-arcade/opensonic/files/opensonic-0.1.4-allegro-4.4.2-loggcompat.patch
@@ -0,0 +1,46 @@
+Source: FreeBSD
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -82,12 +82,6 @@ IF(NOT LJPGALLEG)
+ MESSAGE(FATAL_ERROR "Fatal error: libjpgalleg not found! ${RTFM}")
+ ENDIF(NOT LJPGALLEG)
+
+-# LOGG: liblogg, libogg, libvorbis, libvorbisfile
+-FIND_LIBRARY(LLOGG NAMES logg PATH "${CMAKE_LIBRARY_PATH}")
+-IF(NOT LLOGG)
+- MESSAGE(FATAL_ERROR "Fatal error: liblogg not found! ${RTFM}")
+-ENDIF(NOT LLOGG)
+-
+ FIND_LIBRARY(LOGG NAMES ogg PATH "${CMAKE_LIBRARY_PATH}")
+ IF(NOT LOGG)
+ MESSAGE(FATAL_ERROR "Fatal error: libogg not found! ${RTFM}")
+@@ -150,6 +144,7 @@ SET(
+ src/core/util.c
+ src/core/v2d.c
+ src/core/video.c
++ loggcompat-4.4.2/logg-4.4.2.c
+
+ src/scenes/util/editorgrp.c
+ src/scenes/util/grouptree.c
+@@ -250,7 +245,8 @@ IF(UNIX)
+ IF(UNIX)
+ SET(GAME_SRCS ${GAME_SRCS} src/misc/iconlin.c)
+ ADD_EXECUTABLE(${GAME_UNIXNAME} ${GAME_SRCS})
+- TARGET_LINK_LIBRARIES(${GAME_UNIXNAME} m logg vorbisfile vorbis ogg jpgalleg z png loadpng ${ALLEGRO_UNIX_LIBS})
++ INCLUDE_DIRECTORIES(loggcompat-4.4.2)
++ TARGET_LINK_LIBRARIES(${GAME_UNIXNAME} m vorbisfile vorbis ogg jpgalleg z png loadpng ${ALLEGRO_UNIX_LIBS})
+ SET_TARGET_PROPERTIES(${GAME_UNIXNAME} PROPERTIES COMPILE_FLAGS "-Wall")
+ ENDIF(UNIX)
+
+--- a/src/core/audio.c
++++ b/src/core/audio.c
+@@ -18,7 +18,7 @@
+ */
+
+ #include <allegro.h>
+-#include <logg.h>
++#include <logg-4.4.2.h>
+ #include <stdlib.h>
+ #include "audio.h"
+ #include "osspec.h"
diff --git a/games-arcade/opensonic/files/opensonic-0.1.4-cmake.patch b/games-arcade/opensonic/files/opensonic-0.1.4-cmake.patch
new file mode 100644
index 000000000000..53d76faafae2
--- /dev/null
+++ b/games-arcade/opensonic/files/opensonic-0.1.4-cmake.patch
@@ -0,0 +1,107 @@
+From: hasufell <julian.ospald@googlemail.com>
+Date: Sat Apr 28 16:38:56 UTC 2012
+Subject: build system
+
+use allegro-config
+remove "-O2" from pre-defined CFLAGS
+make paths modifiable
+add rules for icon, desktop-file and game-wrapper
+fix compilation for as-needed
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -35,16 +35,14 @@
+ MESSAGE("Using CFLAGS='${CFLAGS}'")
+
+ IF(UNIX)
+- SET(ALLEGRO_UNIX_LIBS "$ENV{_ALLEGRO_LIBS}")
++ exec_program(allegro-config ARGS --libs OUTPUT_VARIABLE ALLEGRO_LIBRARY)
++ SET(ALLEGRO_UNIX_LIBS "${ALLEGRO_LIBRARY}")
+ IF(NOT ALLEGRO_UNIX_LIBS)
+- MESSAGE(FATAL_ERROR "Please do not invoke CMake directly. Run ./configure instead.")
++ MESSAGE(FATAL_ERROR "Allegro libs not found!")
+ ENDIF(NOT ALLEGRO_UNIX_LIBS)
+ ENDIF(UNIX)
+
+
+-
+-
+-
+ # Finding the required libraries:
+
+ # Allegro: liballeg
+@@ -53,7 +51,8 @@
+ MESSAGE(FATAL_ERROR "Fatal error: couldn't find the Allegro game programming library (liballeg)! ${RTFM}")
+ ELSE(NOT LALLEG)
+ IF(UNIX)
+- SET(ALLEGRO_UNIX_VERSION "$ENV{_ALLEGRO_VERSION}")
++ exec_program(allegro-config ARGS --version OUTPUT_VARIABLE ALLEGRO_VERSION)
++ SET(ALLEGRO_UNIX_VERSION "${ALLEGRO_VERSION}")
+ IF(NOT ALLEGRO_UNIX_VERSION STREQUAL ALLEGRO_RECOMMENDED_VERSION)
+ MESSAGE("\nWARNING: your Allegro version is ${ALLEGRO_UNIX_VERSION}. The recommended version is ${ALLEGRO_RECOMMENDED_VERSION}.\n ${GAME_NAME} may not compile properly!.\n")
+ ENDIF(NOT ALLEGRO_UNIX_VERSION STREQUAL ALLEGRO_RECOMMENDED_VERSION)
+@@ -249,9 +248,8 @@
+ IF(UNIX)
+ SET(GAME_SRCS ${GAME_SRCS} src/misc/iconlin.c)
+ ADD_EXECUTABLE(${GAME_UNIXNAME} ${GAME_SRCS})
+- SET_TARGET_PROPERTIES(${GAME_UNIXNAME} PROPERTIES LINK_FLAGS ${ALLEGRO_UNIX_LIBS})
+- TARGET_LINK_LIBRARIES(${GAME_UNIXNAME} m logg vorbisfile vorbis ogg jpgalleg z png loadpng)
+- SET_TARGET_PROPERTIES(${GAME_UNIXNAME} PROPERTIES COMPILE_FLAGS "-Wall -O2 ${CFLAGS} ${CFLAGS_EXTRA}")
++ TARGET_LINK_LIBRARIES(${GAME_UNIXNAME} m logg vorbisfile vorbis ogg jpgalleg z png loadpng ${ALLEGRO_UNIX_LIBS})
++ SET_TARGET_PROPERTIES(${GAME_UNIXNAME} PROPERTIES COMPILE_FLAGS "-Wall")
+ ENDIF(UNIX)
+
+
+@@ -407,19 +405,43 @@
+ SET_TARGET_PROPERTIES(${GAME_UNIXNAME} PROPERTIES PROJECT_NAME "${GAME_NAME}")
+
+
+-
+ # Installing on *nix
+ IF(UNIX)
+- SET(GAME_INSTALL_DIR "/usr/share/${GAME_UNIXNAME}")
+- SET(GAME_FINAL_DIR "/usr/bin")
++ SET(GAME_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/${GAME_UNIXNAME}" CACHE PATH "")
++ SET(GAME_FINAL_DIR "bin" CACHE PATH "")
++ SET(GAME_LIBDIR "games/lib" CACHE PATH "")
++ SET(GAME_DOCDIR "share/doc/${GAME_UNIXNAME}-${GAME_VERSION}" CACHE PATH "")
++ SET(GAME_HTMLDIR "share/doc/${GAME_UNIXNAME}-${GAME_VERSION}/html" CACHE PATH "")
++ SET(GAME_ICONDIR "share/pixmaps" CACHE PATH "")
++ SET(GAME_DESKTOPDIR "share/applications" CACHE PATH "")
++
++ FILE(WRITE ${GAME_UNIXNAME}.sh
++"#!/bin/sh
++cd ${GAME_LIBDIR}
++exec ./${GAME_UNIXNAME} \"$@\"
++"
++)
+
+- INSTALL(CODE "MESSAGE(\"Installing ${GAME_NAME} ${GAME_VERSION}... Make sure you have root privileges.\")")
+- INSTALL(TARGETS ${GAME_UNIXNAME} RUNTIME DESTINATION ${GAME_INSTALL_DIR})
+- INSTALL(FILES license.txt readme.html DESTINATION ${GAME_INSTALL_DIR})
+- INSTALL(DIRECTORY objects sprites config images levels licenses musics quests samples screenshots themes languages DESTINATION ${GAME_INSTALL_DIR} PATTERN ".svn" EXCLUDE)
++ FILE(WRITE ${GAME_UNIXNAME}.desktop
++"[Desktop Entry]
++Name=${GAME_NAME}
++Type=Application
++Comment=A free open-source clone of the Sonic the Hedgehog universe
++Exec=${GAME_UNIXNAME}
++TryExec=${GAME_UNIXNAME}
++Icon=${GAME_UNIXNAME}
++Categories=Game;ArcadeGame;
++"
++)
+
+- INSTALL(CODE "MESSAGE(\"Creating files at ${GAME_FINAL_DIR}...\")")
+- INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"cmake\" \"-E\" \"copy\" \"${GAME_INSTALL_DIR}/${GAME_UNIXNAME}\" \"${GAME_FINAL_DIR}/${GAME_UNIXNAME}\")")
++ INSTALL(CODE "MESSAGE(\"Installing ${GAME_NAME} ${GAME_VERSION}... Make sure you have root privileges.\")")
++ INSTALL(TARGETS ${GAME_UNIXNAME} RUNTIME DESTINATION ${GAME_LIBDIR})
++# INSTALL(FILES license.txt DESTINATION ${GAME_DOCDIR})
++ INSTALL(FILES readme.html DESTINATION ${GAME_HTMLDIR})
++ INSTALL(FILES icon.png DESTINATION ${GAME_ICONDIR} RENAME ${GAME_UNIXNAME}.png)
++ INSTALL(FILES ${GAME_UNIXNAME}.desktop DESTINATION ${GAME_DESKTOPDIR})
++ INSTALL(DIRECTORY objects sprites config images levels musics quests samples themes languages DESTINATION ${GAME_INSTALL_DIR} PATTERN ".svn" EXCLUDE)
++ INSTALL(PROGRAMS ${GAME_UNIXNAME}.sh DESTINATION ${GAME_FINAL_DIR} RENAME ${GAME_UNIXNAME})
+
+ INSTALL(CODE "MESSAGE(\"Done! Please run ${GAME_UNIXNAME} to start ${GAME_NAME}.\")")
+ ENDIF(UNIX)
diff --git a/games-arcade/opensonic/opensonic-0.1.4-r3.ebuild b/games-arcade/opensonic/opensonic-0.1.4-r3.ebuild
new file mode 100644
index 000000000000..3aee65163017
--- /dev/null
+++ b/games-arcade/opensonic/opensonic-0.1.4-r3.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake
+
+DESCRIPTION="Free open-source game based on the Sonic the Hedgehog universe"
+HOMEPAGE="http://opensnc.sourceforge.net/home/index.php"
+SRC_URI="https://sourceforge.net/projects/opensnc/files/Open%20Sonic/${PV}/opensnc-src-${PV}.tar.gz
+ https://github.com/t6/loggcompat/archive/4.4.2.tar.gz -> loggcompat-4.4.2.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+RESTRICT="mirror" # unsure about legality of graphics
+
+DEPEND="
+ media-libs/allegro:0=[X,jpeg,png,vorbis]
+ media-libs/libogg:=
+ media-libs/libpng:0=
+ media-libs/libvorbis:=
+ sys-libs/zlib:=
+ virtual/jpeg:0"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/opensnc-src-${PV}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-cmake.patch
+ "${FILESDIR}"/${P}-allegro-4.4.2-loggcompat.patch # bug 711542
+)
+
+src_prepare() {
+ mv "${WORKDIR}"/loggcompat-4.4.2 . || die
+ cmake_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DGAME_INSTALL_DIR="${EPREFIX}"/usr/share/${PN}
+ -DGAME_FINAL_DIR="${EPREFIX}"/usr/bin
+ -DGAME_LIBDIR="${EPREFIX}"/usr/$(get_libdir)/${PN}
+ -DGAME_HTMLDIR="${EPREFIX}"/usr/share/doc/${PF}/html
+ )
+ cmake_src_configure
+}
+
+src_install() {
+ cmake_src_install
+
+ local f
+ while IFS="" read -d $'\0' -r f; do
+ dosym ../../share/${PN}/${f##*/} /usr/$(get_libdir)/${PN}/${f##*/}
+ done < <(find "${ED}"/usr/share/${PN}/ -mindepth 1 -maxdepth 1 -type d -print0)
+}