blob: 6be738728bfb9964f1a0764bffdfb3d9f19edbec [file] [log] [blame] [edit]
# Maintainer: Rui Abreu Ferreira <raf-ep@gmx.com>
_realname=mpack
pkgbase=mingw-w64-lua-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-lua51-${_realname}"
"${MINGW_PACKAGE_PREFIX}-lua-${_realname}")
pkgver=1.0.8
pkgrel=2
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
url='https://github.com/libmpack/libmpack'
license=('MIT')
makedepends=("${MINGW_PACKAGE_PREFIX}-lua51"
"${MINGW_PACKAGE_PREFIX}-lua"
"${MINGW_PACKAGE_PREFIX}-gcc"
"${MINGW_PACKAGE_PREFIX}-libmpack"
"${MINGW_PACKAGE_PREFIX}-pkg-config")
source=("${_realname}-${pkgver}.tar.gz"::"https://github.com/libmpack/libmpack-lua/archive/${pkgver}.tar.gz")
sha256sums=('6d84d272bff27800ba1d7b718d1005ac6bfe35c5f3a5bf5d07e6ffd7e341d560')
build() {
cd libmpack-lua-${pkgver}
gcc -O2 -fPIC -DMPACK_USE_SYSTEM $(pkg-config --cflags lua) -shared -o mpack.dll lmpack.c $(pkg-config --libs lua) -lmpack
gcc -O2 -fPIC -DMPACK_USE_SYSTEM $(pkg-config --cflags lua5.1) -shared -o mpack.dll.5.1 lmpack.c $(pkg-config --libs lua5.1) -lmpack
}
package_lua-mpack() {
pkgdesc='Msgpack serialization library for Lua (mingw-w64)'
depends=("${MINGW_PACKAGE_PREFIX}-lua" "${MINGW_PACKAGE_PREFIX}-libmpack")
cd libmpack-lua-${pkgver}
local luaver=$(pkg-config lua --modversion | sed -r 's/^([0-9]+[.][0-9]+)[.][0-9]+$/\1/')
install -Dm755 mpack.dll "${pkgdir}${MINGW_PREFIX}/lib/lua/${luaver}/mpack.dll"
install -Dm644 LICENSE-MIT "${pkgdir}${MINGW_PREFIX}/share/licenses/lua-lmpack/LICENSE"
}
package_lua51-mpack() {
pkgdesc='Msgpack serialization library for Lua 5.1 (mingw-w64)'
depends=("${MINGW_PACKAGE_PREFIX}-lua51" "${MINGW_PACKAGE_PREFIX}-libmpack")
cd libmpack-lua-${pkgver}
install -Dm755 mpack.dll.5.1 "${pkgdir}${MINGW_PREFIX}/lib/lua/5.1/mpack.dll"
install -Dm644 LICENSE-MIT "${pkgdir}${MINGW_PREFIX}/share/licenses/lua51-mpack/LICENSE"
}
# template start; name=mingw-w64-splitpkg-wrappers; version=1.0;
# vim: set ft=bash :
# generate wrappers
for _name in "${pkgname[@]}"; do
_short="package_${_name#${MINGW_PACKAGE_PREFIX}-}"
_func="$(declare -f "${_short}")"
eval "${_func/#${_short}/package_${_name}}"
done
# template end;