logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

love-0.10.2.ebuild (1728B)


  1. # Copyright 1999-2021 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=7
  4. LUA_COMPAT=( lua5-{1..3} luajit )
  5. inherit lua-single xdg-utils
  6. if [[ ${PV} == 9999* ]]; then
  7. inherit git-r3
  8. EGIT_REPO_URI="https://github.com/love2d/${PN}.git"
  9. else
  10. SRC_URI="https://github.com/love2d/${PN}/releases/download/${PV}/${P}-linux-src.tar.gz"
  11. KEYWORDS="~amd64 ~arm ~x86"
  12. fi
  13. DESCRIPTION="A framework for 2D games in Lua"
  14. HOMEPAGE="https://love2d.org/"
  15. LICENSE="ZLIB"
  16. SLOT="0.10"
  17. REQUIRED_USE="${LUA_REQUIRED_USE}"
  18. RDEPEND="sys-libs/zlib
  19. ${LUA_DEPS}
  20. media-libs/freetype
  21. media-libs/libmodplug
  22. media-libs/libsdl2[joystick,opengl]
  23. media-libs/libogg
  24. media-libs/libtheora
  25. media-libs/libvorbis
  26. media-libs/openal
  27. media-sound/mpg123
  28. virtual/opengl"
  29. DEPEND="${RDEPEND}"
  30. DOCS=( "readme.md" "changes.txt" )
  31. src_prepare() {
  32. default
  33. if [[ ${PV} == 9999* ]]; then
  34. ./platform/unix/automagic || die
  35. fi
  36. }
  37. src_configure() {
  38. econf --with-lua=$(usex lua_single_target_luajit luajit lua) \
  39. --with-luaversion=$(ver_cut 1-2 $(lua_get_version))
  40. }
  41. src_install() {
  42. default
  43. find "${D}" -name '*.la' -delete || die
  44. if [[ ${SLOT} != 0 ]]; then
  45. mv "${ED}/usr/bin/${PN}" "${ED}/usr/bin/${PN}-${SLOT}" || die
  46. mv "${ED}"/usr/share/applications/love{,"-$SLOT"}.desktop || die
  47. sed -i -e "/^Name=/s/$/ ($SLOT)/" -e "s|/usr/bin/love|/usr/bin/love-$SLOT|" "${ED}/usr/share/applications/love-$SLOT.desktop" || die
  48. rm -r "${ED}"/usr/{lib64/liblove.so,share/{mime/,pixmaps/,icons/,man/}} || die
  49. fi
  50. }
  51. pkg_postinst() {
  52. xdg_desktop_database_update
  53. xdg_icon_cache_update
  54. xdg_mimeinfo_database_update
  55. }
  56. pkg_postrm() {
  57. xdg_desktop_database_update
  58. xdg_icon_cache_update
  59. xdg_mimeinfo_database_update
  60. }