games-fps/freedm: Drop old 0.11.3-r1
[gentoo.git] / games-fps / gzdoom / gzdoom-4.2.1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit cmake-utils desktop xdg
7
8 DESCRIPTION="A modder-friendly OpenGL source port based on the DOOM engine"
9 HOMEPAGE="https://zdoom.org"
10 SRC_URI="https://github.com/coelckers/${PN}/archive/g${PV}.tar.gz -> ${P}.tar.gz"
11
12 LICENSE="BSD BZIP2 DUMB-0.9.3 GPL-3 LGPL-3 MIT
13         nonfree? ( Activision ChexQuest3 DOOM-COLLECTORS-EDITION freedist )"
14 SLOT="0"
15 KEYWORDS="~amd64 ~arm ~x86"
16 IUSE="gtk gtk2 +nonfree openmp"
17
18 DEPEND="
19         media-libs/libsdl2[opengl]
20         media-libs/libsndfile
21         media-libs/openal
22         media-sound/fluidsynth:=
23         media-sound/mpg123
24         sys-libs/zlib
25         virtual/jpeg:0
26         gtk? (
27                 gtk2? ( x11-libs/gtk+:2 )
28                 !gtk2? ( x11-libs/gtk+:3 )
29         )"
30 RDEPEND="${DEPEND}"
31
32 S="${WORKDIR}/${PN}-g${PV}"
33 PATCHES=(
34         "${FILESDIR}/${P}-install_soundfonts.patch"
35         "${FILESDIR}/${P}-Introduce-the-BUILD_NONFREE-option.patch"
36 )
37
38 src_prepare() {
39         rm -rf docs/licenses || die
40         if ! use nonfree ; then
41                 rm -rf wadsrc_bm wadsrc_extra || die
42         fi
43
44         cmake-utils_src_prepare
45 }
46
47 src_configure() {
48         local mycmakeargs=(
49                 -DINSTALL_DOCS_PATH="${EPREFIX}/usr/share/doc/${PF}"
50                 -DINSTALL_PK3_PATH="${EPREFIX}/usr/share/doom"
51                 -DINSTALL_SOUNDFONT_PATH="${EPREFIX}/usr/share/doom"
52                 -DDYN_FLUIDSYNTH=OFF
53                 -DDYN_OPENAL=OFF
54                 -DDYN_SNDFILE=OFF
55                 -DDYN_MPG123=OFF
56                 -DNO_GTK="$(usex !gtk)"
57                 -DNO_OPENAL=OFF
58                 -DNO_OPENMP="$(usex !openmp)"
59                 -DBUILD_NONFREE="$(usex nonfree)"
60         )
61         cmake-utils_src_configure
62 }
63
64 src_install() {
65         newicon src/posix/zdoom.xpm "${PN}.xpm"
66         make_desktop_entry "${PN}" "GZDoom" "${PN}" "Game;ActionGame"
67         cmake-utils_src_install
68 }
69
70 pkg_postinst() {
71         xdg_pkg_postinst
72
73         if ! use nonfree ; then
74                 ewarn
75                 ewarn "GZDoom installed without nonfree components."
76                 ewarn "Note: The nonfree game_support.pk3 file is needed to play"
77                 ewarn "      games natively supported by GZDoom."
78                 ewarn "A list of games natively supported by GZDoom may be found"
79                 ewarn "on the ZDoom wiki: https://zdoom.org/wiki/IWAD"
80                 ewarn
81         fi
82 }