games-arcade/asteroid: update EAPI 7 -> 8, fix build

with gcc 15, cmake 4

Closes: https://bugs.gentoo.org/944250
Signed-off-by: Alexey Sokolov <alexey+gentoo@asokolov.org>
Part-of: https://github.com/gentoo/gentoo/pull/41781
Closes: https://github.com/gentoo/gentoo/pull/41781
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Alexey Sokolov 2025-04-27 01:03:25 +01:00 committed by Sam James
parent 2807ec6f31
commit 3aa0fa647d
No known key found for this signature in database
GPG Key ID: 738409F520DF9190
3 changed files with 62 additions and 0 deletions

View File

@ -0,0 +1,37 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake
DESCRIPTION="Modern version of the arcade classic that uses OpenGL"
HOMEPAGE="https://chazomaticus.github.io/asteroid/"
SRC_URI="https://github.com/chazomaticus/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
RDEPEND="
media-libs/freeglut
media-libs/libsdl
media-libs/sdl-mixer
virtual/glu
virtual/opengl
x11-libs/gtk+:2
"
DEPEND="${RDEPEND}"
PATCHES=(
"${FILESDIR}"/${P}-libm.patch
"${FILESDIR}"/${P}-cmake4.patch
"${FILESDIR}"/${P}-gcc15.patch
)
src_configure() {
local mycmakeargs=(
-DOpenGL_GL_PREFERENCE=GLVND
)
cmake_src_configure
}

View File

@ -0,0 +1,12 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,8 +1,8 @@
+cmake_minimum_required(VERSION 3.31)
project(Asteroid)
set(Asteroid_BUILD_VERSION "1.2.1")
# Dependencies
-cmake_minimum_required(VERSION 2.6)
find_package(OpenGL REQUIRED)
if(NOT OPENGL_FOUND)
message(FATAL_ERROR "Error: OpenGL not found")

View File

@ -0,0 +1,13 @@
https://bugs.gentoo.org/944250
--- a/src/main.c
+++ b/src/main.c
@@ -244,7 +244,7 @@ void GameTimer(int v)
}
#ifdef CFG_GTK
-static gboolean DisplayDialog()
+static gboolean DisplayDialog(void* a)
{
GtkWidget * dialog = gtk_message_dialog_new(NULL,
GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, ASTEROIDS_ABOUT);