From 732f4f91d4d0292cb43a17ad05f80e9162144651 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sat, 27 Feb 2016 20:36:31 +0100 Subject: [PATCH] games-engines/love: add alternatives --- packages/games-engines/love/love.exlib | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/games-engines/love/love.exlib b/packages/games-engines/love/love.exlib index 777585b0..2e66de3f 100644 --- a/packages/games-engines/love/love.exlib +++ b/packages/games-engines/love/love.exlib @@ -1,13 +1,14 @@ # Copyright 2016 Julian Ospald # Distributed under the terms of the GNU General Public License v2 +require alternatives require lua [ whitelist="5.1" multibuild="false" ] if [[ -n ${LOVE_AUTOCONF} ]]; then require autotools [ supported_autoconf=[ 2.5 ] supported_automake=[ 1.15 ] ] fi -export_exlib_phases src_prepare src_install +export_exlib_phases src_prepare src_install pkg_postinst SUMMARY="A framework for 2D games in Lua" HOMEPAGE="http://love2d.org/" @@ -57,5 +58,16 @@ love_src_prepare() { love_src_install() { newbin src/${PN} ${PN}-${SLOT} emagicdocs + + 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 +} + +love_pkg_postinst() { + alternatives_pkg_postinst }