aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-luaxml
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2019-06-22 23:39:38 +0200
committerJakub Jirutka <jakub@jirutka.cz>2019-06-22 23:41:39 +0200
commit13776313a2989b0088bfbc70fb4301179865ca0c (patch)
tree796136284e2132ce4fba07d64effcc1493f87bcc /main/lua-luaxml
parentd30eaa157bcea65eab6ac6723b37380d1d29bcdb (diff)
downloadaports-13776313a2989b0088bfbc70fb4301179865ca0c.tar.bz2
aports-13776313a2989b0088bfbc70fb4301179865ca0c.tar.xz
main/lua-xml: rename to lua-luaxml to follow the rock name
This library is named "luaxml" on LuaRocks. The problem is that there's also a library named just "xml" on LuaRocks.
Diffstat (limited to 'main/lua-luaxml')
-rw-r--r--main/lua-luaxml/0001-Fix-error-where-TAG-should-be-xml.TAG.patch44
-rw-r--r--main/lua-luaxml/APKBUILD82
2 files changed, 126 insertions, 0 deletions
diff --git a/main/lua-luaxml/0001-Fix-error-where-TAG-should-be-xml.TAG.patch b/main/lua-luaxml/0001-Fix-error-where-TAG-should-be-xml.TAG.patch
new file mode 100644
index 0000000000..8b6763b910
--- /dev/null
+++ b/main/lua-luaxml/0001-Fix-error-where-TAG-should-be-xml.TAG.patch
@@ -0,0 +1,44 @@
+From 5c266ff6effbb1c89c3798b7332ed21685cf6acb Mon Sep 17 00:00:00 2001
+From: Ted Trask <ttrask01@yahoo.com>
+Date: Wed, 30 Dec 2015 20:36:52 +0000
+Subject: [PATCH] Fix error where TAG should be xml.TAG
+
+---
+ LuaXml.lua | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/LuaXml.lua b/LuaXml.lua
+index 8a10a2d..2ebc0ae 100644
+--- a/LuaXml.lua
++++ b/LuaXml.lua
+@@ -8,9 +8,9 @@ xml.TAG = 0
+ function xml.tag(var,tag)
+ if base.type(var)~="table" then return end
+ if base.type(tag)=="nil" then
+- return var[TAG]
++ return var[xml.TAG]
+ end
+- var[TAG] = tag
++ var[xml.TAG] = tag
+ end
+
+ -- creates a new LuaXML object either by setting the metatable of an existing Lua table or by setting its tag
+@@ -21,7 +21,7 @@ function xml.new(arg)
+ end
+ local var={}
+ base.setmetatable(var,{__index=xml, __tostring=xml.str})
+- if base.type(arg)=="string" then var[TAG]=arg end
++ if base.type(arg)=="string" then var[xml.TAG]=arg end
+ return var
+ end
+
+@@ -115,4 +115,4 @@ function xml.find(var, tag, attributeKey,attributeValue)
+ end
+ end
+
+-return xml
+\ No newline at end of file
++return xml
+--
+2.6.4
+
diff --git a/main/lua-luaxml/APKBUILD b/main/lua-luaxml/APKBUILD
new file mode 100644
index 0000000000..93b686314d
--- /dev/null
+++ b/main/lua-luaxml/APKBUILD
@@ -0,0 +1,82 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=lua-luaxml
+_pkgname=luaxml
+pkgver=130610
+_pkgver=$pkgver-1
+pkgrel=5
+pkgdesc="A minimal set of functions for the processing of XML data in Lua"
+url="https://github.com/LuaDist2/luaxml"
+arch="all"
+license="MIT"
+makedepends=""
+subpackages=""
+replaces="lua-xml"
+source="$pkgname-$pkgver.tar.gz::https://github.com/LuaDist2/$_pkgname/archive/$_pkgver.tar.gz
+ 0001-Fix-error-where-TAG-should-be-xml.TAG.patch"
+builddir="$srcdir/$_pkgname-$_pkgver"
+
+_luaversions="5.2 5.3"
+for _v in $_luaversions; do
+ makedepends="$makedepends lua$_v-dev"
+ subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage"
+done
+
+prepare() {
+ default_prepare || return 1
+ cd "$builddir"
+
+ # Remove garbage.
+ rm -f *.dll *.so *.zip
+
+ local lver; for lver in $_luaversions; do
+ cp -r "$builddir" "$builddir-$lver" || return 1
+ done
+}
+
+build() {
+ local lver; for lver in $_luaversions; do
+ msg "Building for Lua $lver..."
+
+ make -C "$builddir-$lver" \
+ CFLAGS="$CFLAGS -fPIC" \
+ LFLAGS="$LDFLAGS -fPIC -shared" \
+ INCDIR=$(pkg-config --cflags lua$lver) \
+ LIBS=$(pkg-config --libs lua$lver) \
+ || return 1
+ done
+}
+
+check() {
+ local lver; for lver in $_luaversions; do
+ msg "Testing on Lua $lver"
+
+ cd "$builddir-$lver"
+ lua$lver test.lua || return 1
+ done
+}
+
+package() {
+ mkdir -p "$pkgdir"
+}
+
+_subpackage() {
+ local lver="${subpkgname:3:3}"
+ pkgdesc="$pkgdesc $lver"
+ depends="lua$lver"
+ replaces="lua$lver-xml" # for backward compatibility
+ install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
+ local rockdir="$subpkgdir/usr/lib/luarocks/rocks-$lver/$_pkgname/$_pkgver"
+
+ cd "$builddir-$lver"
+
+ install -m 755 -D LuaXML_lib.so \
+ "$subpkgdir"/usr/lib/lua/$lver/LuaXML_lib.so || return 1
+ install -m 755 -D LuaXml.lua \
+ "$subpkgdir"/usr/share/lua/$lver/LuaXml.lua
+
+ mkdir -p "$rockdir"
+ echo 'rock_manifest = {}' > "$rockdir"/rock_manifest
+}
+
+sha512sums="aabac62b5e748c04cd3591e5c2e6b417909c7a9efa1ff6c3dd1f546a2387220eb7fa1ffa56d3be0718a84a6fed51f287b68c7d334661c66787f7024d76142dfc lua-luaxml-130610.tar.gz
+60ba65a0d47065e2609ca4d5c8d994fc29b9d4c6b5b0a060fa7f83612c71937999648e48dd26063f6528811eb053fe912ee5b6c4465576912c9dacb9bb406cae 0001-Fix-error-where-TAG-should-be-xml.TAG.patch"