Gentoo Archives: gentoo-commits

From: Ionen Wolkens <ionen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-action/nighthawk/files/, games-action/nighthawk/
Date: Mon, 13 Sep 2021 08:07:40
Message-Id: 1631520428.ee7266495040420fbf29d310f1e3f6df4802e4cb.ionen@gentoo
1 commit: ee7266495040420fbf29d310f1e3f6df4802e4cb
2 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
3 AuthorDate: Mon Sep 13 07:20:28 2021 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 13 08:07:08 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee726649
7
8 games-action/nighthawk: add 4.0
9
10 Brand new ebuild, upstream migrated to cmake which also
11 fixes clang issues wrt bug #730840.
12
13 Closes: https://bugs.gentoo.org/730840
14 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
15
16 games-action/nighthawk/Manifest | 1 +
17 .../nighthawk/files/nighthawk-4.0-cmake.patch | 25 ++++++++++
18 games-action/nighthawk/nighthawk-4.0.ebuild | 56 ++++++++++++++++++++++
19 3 files changed, 82 insertions(+)
20
21 diff --git a/games-action/nighthawk/Manifest b/games-action/nighthawk/Manifest
22 index ce5f6e0b6b6..cc8ef8758c7 100644
23 --- a/games-action/nighthawk/Manifest
24 +++ b/games-action/nighthawk/Manifest
25 @@ -1 +1,2 @@
26 DIST nighthawk-2.2-1.tar.gz 1079706 BLAKE2B 38b9e2fe6f9fe4b373ddae05f0277eea1dd65f921f99e0f728ca47630378ad865117846945ba5c708cef7120dbda8c5c1ac5a032738d974f2687be34fe561556 SHA512 dca5d0c01ed651dee0c29b939c832ae343ca70ff0eb7779e7c13007881cf75d96cadafbbac6b431cd473ce9b9e1347dd4ba90502627059439b5a9a557cbc3fcf
27 +DIST nighthawk-4.0.tar.xz 3212124 BLAKE2B ccd8d97ac03e6d984bdb56cad49ceabb7e6f61dd182d359e1410ff081e3fc456d2a844bc513238d6b10ba8c479661fb890a6c1e41815b7ac6f8f7f761209feb2 SHA512 f1d10026df3a2ab274b81c4e8f28c79c2ba21d6ccab59b217308b076fc7ed3ef4fa5f2b895b72902f72a652c950faa15e43f2e7c91bfc0e2c988ef1aee6859a6
28
29 diff --git a/games-action/nighthawk/files/nighthawk-4.0-cmake.patch b/games-action/nighthawk/files/nighthawk-4.0-cmake.patch
30 new file mode 100644
31 index 00000000000..83722b1e621
32 --- /dev/null
33 +++ b/games-action/nighthawk/files/nighthawk-4.0-cmake.patch
34 @@ -0,0 +1,25 @@
35 +Fix OpenGL underlink, man dir, and skip installing in $HOME.
36 +--- a/CMakeLists.txt
37 ++++ b/CMakeLists.txt
38 +@@ -111,5 +111,6 @@
39 + # Check for OpenGL and GLU
40 + #
41 +-pkg_check_modules (OPENGL glu)
42 ++set(OpenGL_GL_PREFERENCE GLVND)
43 ++find_package(OpenGL)
44 + if (NOT OPENGL_FOUND)
45 + message(FATAL_ERROR "OpenGL/GLU devel library not installed.")
46 +@@ -277,5 +278,5 @@
47 + # Install nighthawk in games section of man page tree (iaw "man man")
48 + #
49 +-install(FILES man/nighthawk.6 DESTINATION man/man6)
50 ++install(FILES man/nighthawk.6 DESTINATION share/man/man6)
51 +
52 + # From investigation work and a strong recommendation by GCB (aka wotnot),
53 +@@ -287,5 +288,5 @@
54 + # risk that install will break on future distributions. JN, 08NOV20
55 + #
56 +-if (UNIX AND NOT APPLE)
57 ++if (0)
58 + install(FILES ${CMAKE_BINARY_DIR}/nighthawk.desktop DESTINATION ${HOME_PATH}/Desktop)
59 + install(CODE "execute_process(COMMAND chown ${USERNAME}.${USERNAME} ${HOME_PATH}/Desktop/nighthawk.desktop)")
60
61 diff --git a/games-action/nighthawk/nighthawk-4.0.ebuild b/games-action/nighthawk/nighthawk-4.0.ebuild
62 new file mode 100644
63 index 00000000000..7eb83211734
64 --- /dev/null
65 +++ b/games-action/nighthawk/nighthawk-4.0.ebuild
66 @@ -0,0 +1,56 @@
67 +# Copyright 2021 Gentoo Authors
68 +# Distributed under the terms of the GNU General Public License v2
69 +
70 +EAPI=8
71 +
72 +inherit cmake desktop
73 +
74 +DESCRIPTION="Tribute to Paradroid by Andrew Braybrook"
75 +HOMEPAGE="https://night-hawk.sourceforge.io/"
76 +SRC_URI="mirror://sourceforge/night-hawk/${P}.tar.xz"
77 +
78 +LICENSE="GPL-2"
79 +SLOT="0"
80 +KEYWORDS="~amd64 ~x86"
81 +
82 +RDEPEND="
83 + acct-group/gamestat
84 + media-libs/freeglut
85 + media-libs/libglvnd
86 + media-libs/libpng:=
87 + media-libs/libvorbis
88 + media-libs/openal
89 + virtual/glu"
90 +DEPEND="${RDEPEND}"
91 +
92 +PATCHES=(
93 + "${FILESDIR}"/${P}-cmake.patch
94 +)
95 +
96 +src_prepare() {
97 + cmake_src_prepare
98 +
99 + sed -i '/SCORES_PATH/s|/var/tmp|${EPREFIX}/var/games|' CMakeLists.txt || die
100 +}
101 +
102 +src_configure() {
103 + local mycmakeargs=( -DBUILD_NED=yes )
104 +
105 + cmake_src_configure
106 +}
107 +
108 +src_install() {
109 + cmake_src_install
110 +
111 + dodoc WHATS_NEW
112 +
113 + dodir /var/games
114 + > ${ED}/var/games/${PN}.scores || die
115 +
116 + fowners :gamestat /usr/bin/${PN} /var/games/${PN}.scores
117 + fperms g+s /usr/bin/${PN}
118 + fperms 660 /var/games/${PN}.scores
119 +
120 + newicon data/xpm/v4/nighthawk_desktop_icon.png ${PN}.png
121 + make_desktop_entry ${PN} ${PN^}
122 +}