Gentoo Archives: gentoo-commits

From: James Le Cuirot <chewi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-fps/freedoom-data/files/, games-fps/freedoom-data/
Date: Sat, 07 Sep 2019 17:47:02
Message-Id: 1567878391.6e1214a616443a221efb504663087ee6976d02c1.chewi@gentoo
1 commit: 6e1214a616443a221efb504663087ee6976d02c1
2 Author: William Breathitt Gray <vilhelm.gray <AT> gmail <DOT> com>
3 AuthorDate: Fri Sep 6 07:42:00 2019 +0000
4 Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 7 17:46:31 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6e1214a6
7
8 games-fps/freedoom-data: Set DOOMWADPATH in freedoom launch script
9
10 Package-Manager: Portage-2.3.73, Repoman-2.3.17
11 Signed-off-by: William Breathitt Gray <vilhelm.gray <AT> gmail.com>
12 Closes: https://github.com/gentoo/gentoo/pull/12871
13 Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
14
15 .../freedoom-data-0.11.3-Set-DOOMWADPATH.patch | 38 ++++++++++++++
16 .../freedoom-data/freedoom-data-0.11.3-r2.ebuild | 61 ++++++++++++++++++++++
17 2 files changed, 99 insertions(+)
18
19 diff --git a/games-fps/freedoom-data/files/freedoom-data-0.11.3-Set-DOOMWADPATH.patch b/games-fps/freedoom-data/files/freedoom-data-0.11.3-Set-DOOMWADPATH.patch
20 new file mode 100644
21 index 00000000000..0998cc45ebd
22 --- /dev/null
23 +++ b/games-fps/freedoom-data/files/freedoom-data-0.11.3-Set-DOOMWADPATH.patch
24 @@ -0,0 +1,38 @@
25 +From 19b8fe33843b1e431fb0737a57087f58c168952c Mon Sep 17 00:00:00 2001
26 +From: William Breathitt Gray <vilhelm.gray@×××××.com>
27 +Date: Fri, 6 Sep 2019 16:20:49 +0900
28 +Subject: [PATCH] dist/freedoom: Set DOOMWADPATH with sensible default value if
29 + unset
30 +
31 +Engines such as Odamex may not have a default search path and simply
32 +search for freedoom1.wad relative to the current directory. This can
33 +cause an unexpected WAD file not found error when executing the freedoom
34 +script.
35 +
36 +This issue is mitigated by setting a default DOOMWADPATH environment
37 +variable with sensible search paths, if it is not already set. All
38 +engines listed in the PORTS variable support the DOOMWADPATH environment
39 +variable, which makes it a simple and convenient way of helping prevent
40 +this error.
41 +---
42 + dist/freedoom | 4 ++++
43 + 1 file changed, 4 insertions(+)
44 +
45 +diff --git a/dist/freedoom b/dist/freedoom
46 +index 62e3c4d5..0c0961a5 100755
47 +--- a/dist/freedoom
48 ++++ b/dist/freedoom
49 +@@ -31,6 +31,10 @@ case "$(basename "$0")" in
50 + ;;
51 + esac
52 +
53 ++if [ -z "$DOOMWADPATH" ]; then
54 ++ export DOOMWADPATH="/usr/share/doom:/usr/share/games/doom:/usr/local/share/doom:/usr/local/share/games/doom"
55 ++fi
56 ++
57 + if [ -z "$PORT" ] && [ -h "$HOME"/.doomport ]; then
58 + if [ -f "$(readlink -f "$HOME"/.doomport)" ] \
59 + && [ -x "$(readlink -f "$HOME"/.doomport)" ]; then
60 +--
61 +2.23.0
62 +
63
64 diff --git a/games-fps/freedoom-data/freedoom-data-0.11.3-r2.ebuild b/games-fps/freedoom-data/freedoom-data-0.11.3-r2.ebuild
65 new file mode 100644
66 index 00000000000..83aced1b3be
67 --- /dev/null
68 +++ b/games-fps/freedoom-data/freedoom-data-0.11.3-r2.ebuild
69 @@ -0,0 +1,61 @@
70 +# Copyright 1999-2019 Gentoo Authors
71 +# Distributed under the terms of the GNU General Public License v2
72 +
73 +EAPI=7
74 +
75 +PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
76 +
77 +inherit prefix python-any-r1 xdg
78 +
79 +DESCRIPTION="Game resources for Freedoom: Phase 1+2"
80 +HOMEPAGE="https://freedoom.github.io"
81 +SRC_URI="https://github.com/freedoom/freedoom/archive/v${PV}.tar.gz -> freedoom-${PV}.tar.gz"
82 +
83 +LICENSE="BSD"
84 +SLOT="0"
85 +KEYWORDS="~amd64 ~x86"
86 +
87 +BDEPEND="
88 + $(python_gen_any_dep 'dev-python/pillow[${PYTHON_USEDEP}]')
89 + app-text/asciidoc
90 + games-util/deutex
91 + virtual/imagemagick-tools[png]"
92 +
93 +S="${WORKDIR}/freedoom-${PV}"
94 +
95 +PATCHES="${FILESDIR}/${P}-Set-DOOMWADPATH.patch"
96 +
97 +DOOMWADPATH=share/doom
98 +
99 +python_check_deps() {
100 + has_version -b "dev-python/pillow[${PYTHON_USEDEP}]"
101 +}
102 +
103 +src_prepare() {
104 + # This is to enable usage of the 'PS' coder, which is
105 + # disabled by default (https://bugs.gentoo.org/664236)
106 + install -D -t ~/.config/ImageMagick "${FILESDIR}"/ImageMagick/policy.xml || die
107 +
108 + xdg_src_prepare
109 + eapply_user
110 +
111 + hprefixify dist/freedoom
112 +}
113 +
114 +src_compile() {
115 + emake wads/freedoom{1,2}.wad
116 +}
117 +
118 +src_install() {
119 + emake install-freedoom{1,2} \
120 + prefix="${ED}/usr/" \
121 + bindir="bin/" \
122 + mandir="share/man/" \
123 + waddir="${DOOMWADPATH}/"
124 +}
125 +
126 +pkg_postinst() {
127 + xdg_pkg_postinst
128 +
129 + elog "Freedoom WAD files installed into ${EPREFIX}/usr/${DOOMWADPATH} directory."
130 +}