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-rpg/openglad/
Date: Sun, 18 Jul 2021 09:35:25
Message-Id: 1626600857.de5530983b6c1e7fa9bbaade0d924671123c1466.ionen@gentoo
1 commit: de5530983b6c1e7fa9bbaade0d924671123c1466
2 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jul 18 08:36:23 2021 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Sun Jul 18 09:34:17 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de553098
7
8 games-rpg/openglad: add 0.98_p20200907 snapshot
9
10 openglad-0.98 dates back to 2003, is prone to segfaults,
11 and stuck on SDL1. With no release in sight, use snapshot
12 of seemingly stable SDL2 version.
13
14 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
15
16 games-rpg/openglad/Manifest | 1 +
17 games-rpg/openglad/openglad-0.98_p20200907.ebuild | 73 +++++++++++++++++++++++
18 2 files changed, 74 insertions(+)
19
20 diff --git a/games-rpg/openglad/Manifest b/games-rpg/openglad/Manifest
21 index cf749afecb0..031d8ed8b48 100644
22 --- a/games-rpg/openglad/Manifest
23 +++ b/games-rpg/openglad/Manifest
24 @@ -1,2 +1,3 @@
25 DIST openglad-0.98.tar.gz 724106 BLAKE2B 6cd9df5fd260af9902997bc0708c8285e48081e52fff7af05f432ae94f2f6fdbfba162c664ac4f531796a0372f1be3be064843dad75163e68b7e324b9b6d506d SHA512 3f9165fbf8fff081a862bfe81401a3b2ac227da58b84409beee8b0441f88b1a6deb3d24a1af6e71bd3a3484fc90de5574950fd54be82d837021a07f06302f0e1
26 +DIST openglad-0.98_p20200907.tar.gz 2060013 BLAKE2B 5ea16c0ab13e45f1723ceb0b4167fcbf5863d040e1fc54cd27fa59df14200f84e0e22c0cba87f9ad3294a90850d5b36199cba8e78804d1994fb2dea6ea493fff SHA512 b3bf582a780d90408fc585b28418f462602ec35434c018d6315fb8b119b34cb0dceabcd6b5a6450ba6beb2ab5dc931d6e21ecf46e76853c7f5051c9b3be9014c
27 DIST openglad.png 5593 BLAKE2B 1fbc5a32861dc4cc5bb4aae4b1b42e92411756618ccfa4172e1494c4f98eb527f6bd36273a250cd7ce721baa76ba80548d75ec1e89b3da134c78d0a7b415b6bd SHA512 27419fcbbbf8640718968304a4824101860736c2091f494defcd111b5cc252856b5373c0e7a2bca1c79f9c7551012b0ba04577f9ed97769e436637ee25f5caeb
28
29 diff --git a/games-rpg/openglad/openglad-0.98_p20200907.ebuild b/games-rpg/openglad/openglad-0.98_p20200907.ebuild
30 new file mode 100644
31 index 00000000000..132a5ea3979
32 --- /dev/null
33 +++ b/games-rpg/openglad/openglad-0.98_p20200907.ebuild
34 @@ -0,0 +1,73 @@
35 +# Copyright 1999-2021 Gentoo Authors
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=8
39 +
40 +inherit desktop flag-o-matic toolchain-funcs
41 +
42 +MY_COMMIT="80e33b15cfa6d7d288b4b3db4dcca0349f13691f"
43 +
44 +DESCRIPTION="SDL clone of Gladiator, a classic RPG game"
45 +HOMEPAGE="http://snowstorm.sourceforge.net/"
46 +SRC_URI="
47 + https://github.com/openglad/openglad/archive/${MY_COMMIT}.tar.gz -> ${P}.tar.gz
48 + mirror://gentoo/${PN}.png"
49 +S="${WORKDIR}/${PN}-${MY_COMMIT}"
50 +
51 +LICENSE="Boost-1.0 GPL-2+ ZLIB"
52 +SLOT="0"
53 +KEYWORDS="~amd64 ~x86"
54 +
55 +RDEPEND="
56 + dev-libs/libyaml
57 + dev-libs/libzip:=
58 + media-libs/libpng:=
59 + media-libs/libsdl2[joystick,opengl,sound,video]
60 + media-libs/sdl2-mixer"
61 +DEPEND="${RDEPEND}"
62 +BDEPEND="
63 + dev-util/premake:4
64 + virtual/pkgconfig"
65 +
66 +src_prepare() {
67 + default
68 +
69 + # game uses the binary's location for assets even with a wrapper
70 + sed -e '/^std::string get_asset_path/!b;n' \
71 + -e "a\\return \"${EPREFIX}/usr/share/${PN}/\";" \
72 + -i src/io.cpp || die
73 +
74 + # unbundle (delete + add to pkg-config below is enough)
75 + # physfs: need missing physfsrwops.h matching system's to unbundle
76 + rm -r src/external/{libyaml,libzip} || die
77 +
78 + # cleanup not to install
79 + rm sound/Makefile.am || die
80 +}
81 +
82 +src_configure() {
83 + # premake4.lua assumes a lot (e.g. no SDL2 include path), check ourselves
84 + local pkgs=( SDL2_mixer libpng libzip sdl2 yaml-0.1 )
85 + append-cppflags $($(tc-getPKG_CONFIG) --cflags "${pkgs[@]}" || die)
86 + append-libs $($(tc-getPKG_CONFIG) --libs "${pkgs[@]}" || die)
87 +
88 + premake4 gmake || die
89 +}
90 +
91 +src_compile() {
92 + emake verbose=y ARCH= CC="$(tc-getCC)" CXX="$(tc-getCXX)" LIBS="${LIBS}"
93 +}
94 +
95 +src_install() {
96 + dobin ${PN}
97 +
98 + insinto /usr/share/${PN}
99 + doins -r builtin cfg extra_campaigns pix sound
100 + # note: extra_campaigns not directly used, but users may want them
101 +
102 + dodoc {cheats,classes,scen}.txt
103 + einstalldocs
104 +
105 + doicon "${DISTDIR}"/${PN}.png
106 + make_desktop_entry openglad Openglad
107 +}