commit:     ee7266495040420fbf29d310f1e3f6df4802e4cb
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 13 07:20:28 2021 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 13 08:07:08 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee726649

games-action/nighthawk: add 4.0

Brand new ebuild, upstream migrated to cmake which also
fixes clang issues wrt bug #730840.

Closes: https://bugs.gentoo.org/730840
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 games-action/nighthawk/Manifest                    |  1 +
 .../nighthawk/files/nighthawk-4.0-cmake.patch      | 25 ++++++++++
 games-action/nighthawk/nighthawk-4.0.ebuild        | 56 ++++++++++++++++++++++
 3 files changed, 82 insertions(+)

diff --git a/games-action/nighthawk/Manifest b/games-action/nighthawk/Manifest
index ce5f6e0b6b6..cc8ef8758c7 100644
--- a/games-action/nighthawk/Manifest
+++ b/games-action/nighthawk/Manifest
@@ -1 +1,2 @@
 DIST nighthawk-2.2-1.tar.gz 1079706 BLAKE2B 
38b9e2fe6f9fe4b373ddae05f0277eea1dd65f921f99e0f728ca47630378ad865117846945ba5c708cef7120dbda8c5c1ac5a032738d974f2687be34fe561556
 SHA512 
dca5d0c01ed651dee0c29b939c832ae343ca70ff0eb7779e7c13007881cf75d96cadafbbac6b431cd473ce9b9e1347dd4ba90502627059439b5a9a557cbc3fcf
+DIST nighthawk-4.0.tar.xz 3212124 BLAKE2B 
ccd8d97ac03e6d984bdb56cad49ceabb7e6f61dd182d359e1410ff081e3fc456d2a844bc513238d6b10ba8c479661fb890a6c1e41815b7ac6f8f7f761209feb2
 SHA512 
f1d10026df3a2ab274b81c4e8f28c79c2ba21d6ccab59b217308b076fc7ed3ef4fa5f2b895b72902f72a652c950faa15e43f2e7c91bfc0e2c988ef1aee6859a6

diff --git a/games-action/nighthawk/files/nighthawk-4.0-cmake.patch 
b/games-action/nighthawk/files/nighthawk-4.0-cmake.patch
new file mode 100644
index 00000000000..83722b1e621
--- /dev/null
+++ b/games-action/nighthawk/files/nighthawk-4.0-cmake.patch
@@ -0,0 +1,25 @@
+Fix OpenGL underlink, man dir, and skip installing in $HOME.
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -111,5 +111,6 @@
+ # Check for OpenGL and GLU
+ #
+-pkg_check_modules (OPENGL glu)
++set(OpenGL_GL_PREFERENCE GLVND)
++find_package(OpenGL)
+ if (NOT OPENGL_FOUND)
+       message(FATAL_ERROR "OpenGL/GLU devel library not installed.")
+@@ -277,5 +278,5 @@
+ # Install nighthawk in games section of man page tree (iaw "man man")
+ #
+-install(FILES man/nighthawk.6 DESTINATION man/man6)
++install(FILES man/nighthawk.6 DESTINATION share/man/man6)
+ 
+ # From investigation work and a strong recommendation by GCB (aka wotnot),
+@@ -287,5 +288,5 @@
+ # risk that install will break on future distributions. JN, 08NOV20
+ #
+-if (UNIX AND NOT APPLE)
++if (0)
+       install(FILES ${CMAKE_BINARY_DIR}/nighthawk.desktop DESTINATION 
${HOME_PATH}/Desktop)
+       install(CODE "execute_process(COMMAND chown ${USERNAME}.${USERNAME} 
${HOME_PATH}/Desktop/nighthawk.desktop)")

diff --git a/games-action/nighthawk/nighthawk-4.0.ebuild 
b/games-action/nighthawk/nighthawk-4.0.ebuild
new file mode 100644
index 00000000000..7eb83211734
--- /dev/null
+++ b/games-action/nighthawk/nighthawk-4.0.ebuild
@@ -0,0 +1,56 @@
+# Copyright 2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake desktop
+
+DESCRIPTION="Tribute to Paradroid by Andrew Braybrook"
+HOMEPAGE="https://night-hawk.sourceforge.io/";
+SRC_URI="mirror://sourceforge/night-hawk/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="
+       acct-group/gamestat
+       media-libs/freeglut
+       media-libs/libglvnd
+       media-libs/libpng:=
+       media-libs/libvorbis
+       media-libs/openal
+       virtual/glu"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-cmake.patch
+)
+
+src_prepare() {
+       cmake_src_prepare
+
+       sed -i '/SCORES_PATH/s|/var/tmp|${EPREFIX}/var/games|' CMakeLists.txt 
|| die
+}
+
+src_configure() {
+       local mycmakeargs=( -DBUILD_NED=yes )
+
+       cmake_src_configure
+}
+
+src_install() {
+       cmake_src_install
+
+       dodoc WHATS_NEW
+
+       dodir /var/games
+       > ${ED}/var/games/${PN}.scores || die
+
+       fowners :gamestat /usr/bin/${PN} /var/games/${PN}.scores
+       fperms g+s /usr/bin/${PN}
+       fperms 660 /var/games/${PN}.scores
+
+       newicon data/xpm/v4/nighthawk_desktop_icon.png ${PN}.png
+       make_desktop_entry ${PN} ${PN^}
+}

Reply via email to