1 |
1 |
# Copyright 1999-2022 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
|
EAPI=7
|
|
4 |
EAPI=8
|
5 |
5 |
|
6 |
|
LUA_COMPAT=( lua5-1 )
|
7 |
|
LUA_REQ_USE="deprecated"
|
|
6 |
LUA_COMPAT=( lua5-{1..4} luajit )
|
8 |
7 |
|
9 |
|
inherit flag-o-matic lua-single
|
|
8 |
inherit flag-o-matic lua-single xdg-utils
|
|
9 |
|
|
10 |
if [[ ${PV} == 9999* ]]; then
|
|
11 |
inherit git-r3
|
|
12 |
EGIT_REPO_URI="https://github.com/love2d/${PN}.git"
|
|
13 |
else
|
|
14 |
SRC_URI="https://github.com/love2d/${PN}/releases/download/${PV}/${P}-linux-src.tar.gz"
|
|
15 |
KEYWORDS="~amd64 ~arm ~x86"
|
|
16 |
fi
|
10 |
17 |
|
11 |
18 |
DESCRIPTION="A framework for 2D games in Lua"
|
12 |
19 |
HOMEPAGE="https://love2d.org/"
|
13 |
|
SRC_URI="https://github.com/love2d/${PN}/releases/download/${PV}/${P}-linux-src.tar.gz"
|
14 |
20 |
|
15 |
21 |
LICENSE="ZLIB"
|
16 |
|
SLOT="0.8"
|
17 |
|
KEYWORDS="~amd64 ~arm ~x86"
|
|
22 |
SLOT="0"
|
|
23 |
IUSE="gme"
|
18 |
24 |
|
19 |
25 |
REQUIRED_USE="${LUA_REQUIRED_USE}"
|
20 |
26 |
|
21 |
|
RDEPEND="${LUA_DEPS}
|
22 |
|
dev-games/physfs
|
23 |
|
media-libs/devil[mng,png,tiff]
|
24 |
|
media-libs/freetype:2
|
|
27 |
RDEPEND="sys-libs/zlib
|
|
28 |
${LUA_DEPS}
|
|
29 |
media-libs/freetype
|
25 |
30 |
media-libs/libmodplug
|
26 |
|
media-libs/libsdl[joystick,opengl,video]
|
|
31 |
media-libs/libsdl2[joystick,opengl]
|
|
32 |
media-libs/libtheora
|
27 |
33 |
media-libs/libvorbis
|
28 |
34 |
media-libs/openal
|
29 |
35 |
media-sound/mpg123
|
30 |
36 |
virtual/opengl
|
31 |
|
"
|
32 |
|
DEPEND="${RDEPEND}
|
33 |
|
media-libs/libmng:0
|
34 |
|
media-libs/tiff:0
|
35 |
|
"
|
36 |
|
|
37 |
|
PATCHES=(
|
38 |
|
"${FILESDIR}"/${PN}-0.8.0-freetype2.patch
|
39 |
|
"${FILESDIR}"/${PN}-0.8.0-opengl_glext_prototypes.patch
|
40 |
|
)
|
|
37 |
gme? ( media-libs/game-music-emu )"
|
|
38 |
DEPEND="${RDEPEND}"
|
|
39 |
|
|
40 |
DOCS=( "readme.md" "changes.txt" )
|
41 |
41 |
|
42 |
42 |
src_prepare() {
|
43 |
43 |
default
|
44 |
|
append-cppflags -DLUA_COMPAT_OPENLIB
|
|
44 |
if [[ ${PV} == 9999* ]]; then
|
|
45 |
./platform/unix/automagic || die
|
|
46 |
fi
|
|
47 |
}
|
|
48 |
|
|
49 |
src_configure() {
|
|
50 |
# Bug #858719
|
|
51 |
append-flags -fno-strict-aliasing
|
|
52 |
|
|
53 |
local myeconfargs=(
|
|
54 |
$(use_enable gme)
|
|
55 |
--with-lua=$(usex lua_single_target_luajit luajit lua)
|
|
56 |
--with-luaversion=$(ver_cut 1-2 $(lua_get_version))
|
|
57 |
)
|
|
58 |
econf "${myeconfargs[@]}"
|
45 |
59 |
}
|
46 |
60 |
|
47 |
61 |
src_install() {
|
48 |
|
DOCS="readme.md changes.txt" \
|
49 |
|
default
|
|
62 |
default
|
|
63 |
|
|
64 |
find "${D}" -name '*.la' -delete || die
|
|
65 |
}
|
|
66 |
|
|
67 |
pkg_postinst() {
|
|
68 |
xdg_desktop_database_update
|
|
69 |
xdg_icon_cache_update
|
|
70 |
xdg_mimeinfo_database_update
|
|
71 |
}
|
50 |
72 |
|
51 |
|
mv "${ED}/usr/bin/${PN}" "${ED}/usr/bin/${PN}-${SLOT}" || die
|
|
73 |
pkg_postrm() {
|
|
74 |
xdg_desktop_database_update
|
|
75 |
xdg_icon_cache_update
|
|
76 |
xdg_mimeinfo_database_update
|
52 |
77 |
}
|