# Copyright 2016 Niels Ole Salscheider # Distributed under the terms of the GNU General Public License v2 require github [ user='mwild1' tag=v${PV} ] \ flag-o-matic \ lua [ multiunpack=true whitelist="5.1 5.2 5.3 5.4" ] SUMMARY="LuaDBI is a database interface library for Lua." LICENCES="MIT" SLOT="0" PLATFORMS="~amd64" MYOPTIONS=" mysql [[ description = [ Build MySQL backend ] ]] postgresql [[ description = [ Build PostgreSQL backend ] ]] sqlite [[ description = [ Build SQLite3 backend ] ]] ( mysql postgresql sqlite ) [[ number-selected = at-least-one ]] " DEPENDENCIES=" build+run: mysql? ( virtual/mysql ) postgresql? ( dev-db/postgresql:= ) sqlite? ( dev-db/sqlite:3 ) " DEFAULT_SRC_COMPILE_PARAMS=( CC=$(exhost --tool-prefix)cc AR=$(exhost --tool-prefix)ar RANLIB=$(exhost --tool-prefix)ranlib COMMON_LDFLAGS=${LDFLAGS} ) prepare_one_multibuild() { default append-flags -shared -fpic -I . \ -I /usr/$(exhost --target)/include/lua$(lua_get_abi) \ -I /usr/$(exhost --target)/include/mysql \ -I /usr/$(exhost --target)/include/postgresql/server append-ldflags -L /usr/$(exhost --target)/lib/mysql } compile_one_multibuild() { if option mysql ; then emake mysql "${DEFAULT_SRC_COMPILE_PARAMS[@]}" fi if option postgresql ; then emake psql "${DEFAULT_SRC_COMPILE_PARAMS[@]}" fi if option sqlite ; then emake sqlite3 "${DEFAULT_SRC_COMPILE_PARAMS[@]}" fi } install_one_multibuild() { lua_install_cmodule dbd/*.so lua_install_module DBI.lua emagicdocs }