# SPDX-License-Identifier: CC0-1.0
#
# SPDX-FileContributor: Adrian "asie" Siekierka, 2023

pkgname=(wf-lua-cjson)
_pkgver=2.10.14
pkgver=2.10.14.r310.35bac3c
pkgrock=lua-cjson-2.1.0.14-1
pkgrel=1
epoch=
pkgdesc="Lua JSON library"
arch=("i686" "x86_64" "armv6h" "aarch64")
url="https://github.com/openresty/lua-cjson"
license=("MIT")
source=("$pkgname::git+https://github.com/openresty/lua-cjson#branch=master")
depends=(wf-lua)
makedepends=(wf-lua-dev)
sha256sums=("SKIP")

. "/wf/config/runtime-env-vars.sh"

. "../templates/git-pkgver.PKGBUILD"
. "../templates/luarocks-package.PKGBUILD"

build() {
	cd "$pkgname"
	build_luarocks
}

package() {
	cd "$pkgname"

	mkdir -p "$pkgdir$WF_DESTDIR"/lib/lua/5.4
	cp -aR build/lib/lua/5.4/* "$pkgdir$WF_DESTDIR"/lib/lua/5.4/
}

