hasufell-repository/packages/games-engines/love/love.exlib

85 lines
2.3 KiB
Bash
Raw Permalink Normal View History

2016-02-27 19:24:07 +00:00
# Copyright 2016 Julian Ospald <hasufell@posteo.de>
# Distributed under the terms of the GNU General Public License v2
# Purpose: an exlib dealing with installation of the love engine
# Maintainer: Julian Ospald <hasufell@posteo.de>
# Exports: src_prepare src_install
# Side-effects: - adds build and runtime dependencies
# - sets $SUMMARY, $HOMEPAGE, $DOWNLOADS, $LICENCES,
# $DEFAULT_SRC_CONFIGURE_PARAMS,
# $DEFAULT_SRC_INSTALL_EXTRA_DOCS,
# - imports alternatives, lua, bitbucket
# autotools depending on $LOVE_AUTOCONF
#
# Usage
# Set LOVE_AUTOCONF before 'require' to force autoreconf
2016-02-27 19:36:31 +00:00
require alternatives
2016-02-27 19:24:07 +00:00
require lua [ whitelist="5.1" multibuild="false" ]
require bitbucket [ user=rude pn=love download=love-${PV}-linux-src ]
2016-02-27 19:24:07 +00:00
if [[ -n ${LOVE_AUTOCONF} ]]; then
require autotools [ supported_autoconf=[ 2.5 ] supported_automake=[ 1.15 ] ]
fi
export_exlib_phases src_prepare src_install
2016-02-27 19:24:07 +00:00
SUMMARY="A framework for 2D games in Lua"
HOMEPAGE="http://love2d.org/"
LICENCES="ZLIB"
DEPENDENCIES="
build:
virtual/pkg-config
build+run:
dev-games/physfs
dev-lang/lua:5.1
media-libs/DevIL[mng][tiff]
media-libs/SDL:2[X]
media-libs/freetype:2
media-libs/libmodplug
media-libs/libtheora
media-libs/libvorbis
media-libs/openal
media-sound/mpg123
x11-dri/mesa
"
DEFAULT_SRC_CONFIGURE_PARAMS=(
--disable-shared
--enable-static
)
if ever at_least 0.9.0; then
DEFAULT_SRC_CONFIGURE_PARAMS+=( --with-lua=lua )
fi
DEFAULT_SRC_INSTALL_EXTRA_DOCS=( "readme.md" "changes.txt" )
# Exported 'src_prepare'.
2016-02-27 19:24:07 +00:00
love_src_prepare() {
if [[ -n ${LOVE_AUTOCONF} ]]; then
edo cp platform/unix/{configure.ac,Makefile.am} .
edo bash platform/unix/genmodules
eautoreconf
else
default
fi
}
# Exported 'src_install'.
2016-02-27 19:24:07 +00:00
love_src_install() {
newbin src/${PN} ${PN}-${SLOT}
emagicdocs
2016-02-27 19:36:31 +00:00
# set up alternatives based on SLOT
2016-02-27 19:36:31 +00:00
local host=$(exhost --target)
local binaries=( love love-${SLOT} )
for (( i = 0; i < ${#binaries[@]}; i++ )); do
alternatives_for _${host}_love ${SLOT} ${SLOT} /usr/${host}/bin/${binaries[i]} /usr/${host}/bin/${binaries[++i]}
done
}