dev-util/itstool: remove old
[gentoo.git] / games-engines / love / love-0.10.2.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 inherit gnome2-utils xdg-utils
6
7 if [[ ${PV} == 9999* ]]; then
8         inherit mercurial
9         EHG_REPO_URI="https://bitbucket.org/rude/${PN}"
10         SRC_URI=""
11         KEYWORDS=""
12 else
13         SRC_URI="https://www.bitbucket.org/rude/${PN}/downloads/${P}-linux-src.tar.gz"
14         KEYWORDS="~amd64 ~arm ~x86"
15 fi
16
17 DESCRIPTION="A framework for 2D games in Lua"
18 HOMEPAGE="http://love2d.org/"
19
20 LICENSE="ZLIB"
21 SLOT="0.10"
22 IUSE="+luajit"
23
24 RDEPEND="sys-libs/zlib
25         dev-games/physfs
26         !luajit? ( dev-lang/lua:0[deprecated] )
27         luajit? ( dev-lang/luajit:2 )
28         media-libs/freetype
29         media-libs/libmodplug
30         media-libs/libsdl2[joystick,opengl]
31         media-libs/libogg
32         media-libs/libtheora
33         media-libs/libvorbis
34         media-libs/openal
35         media-sound/mpg123
36         virtual/opengl"
37 DEPEND="${RDEPEND}"
38
39 DOCS=( "readme.md" "changes.txt" )
40
41 src_prepare() {
42         default
43         if [[ ${PV} == 9999* ]]; then
44                 ./platform/unix/automagic || die
45         fi
46 }
47
48 src_configure() {
49         econf --with-lua=$(usex luajit luajit lua)
50 }
51
52 src_install() {
53         default
54
55         find "${D}" -name '*.la' -delete || die
56         if [[ ${SLOT} != 0 ]]
57         then
58                 mv "${ED}/usr/bin/${PN}" "${ED}/usr/bin/${PN}-${SLOT}" || die
59                 mv "${ED}"/usr/share/applications/love{,"-$SLOT"}.desktop || die
60                 sed -i -e "/^Name=/s/$/ ($SLOT)/" -e "s|/usr/bin/love|/usr/bin/love-$SLOT|" "${ED}/usr/share/applications/love-$SLOT.desktop" || die
61                 rm -r "${ED}"/usr/{lib64/liblove.so,share/{mime/,pixmaps/,icons/,man/}} || die
62         fi
63 }
64
65 pkg_postinst() {
66         gnome2_icon_cache_update
67         xdg_desktop_database_update
68         xdg_mimeinfo_database_update
69 }
70
71 pkg_postrm() {
72         gnome2_icon_cache_update
73         xdg_desktop_database_update
74         xdg_mimeinfo_database_update
75 }