summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEduardo Bart2016-08-03 15:10:30 -0300
committerEduardo Bart2016-08-03 15:10:30 -0300
commit8976c03dea76b995b68a4a0340d3edbf55e82f8c (patch)
tree6da81d0ba01ae4eadbc31f1ecbf04e5c71f62dff
downloadaur-8976c03dea76b995b68a4a0340d3edbf55e82f8c.tar.gz
first commit
-rw-r--r--.SRCINFO17
-rw-r--r--PKGBUILD55
-rw-r--r--luacpp.patch32
3 files changed, 104 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..5860489ffc5d
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,17 @@
+pkgbase = mingw-w64-lua51
+ pkgdesc = LUA 5.1
+ pkgver = 5.1.5
+ pkgrel = 1
+ url = http://www.lua.org/
+ arch = x86_64
+ license = MIT
+ makedepends = mingw-w64-gcc
+ depends = mingw-w64-crt
+ options = !strip
+ options = !buildflags
+ source = http://www.lua.org/ftp/lua-5.1.5.tar.gz
+ source = luacpp.patch
+ md5sums = 2e115fe26e435e33b0d5c022e4490567
+ md5sums = 71a8472a0116a7639ce6c157b7f13d57
+
+pkgname = mingw-w64-lua51 \ No newline at end of file
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..f8b3cfbd087b
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,55 @@
+# Maintainer: edub4rt <edub4rt@gmail.com>
+pkgname=mingw-w64-lua51
+pkgver=5.1.5
+pkgrel=1
+pkgdesc='LUA 5.1'
+arch=('x86_64')
+url='http://www.lua.org/'
+depends=('mingw-w64-crt')
+makedepends=("mingw-w64-gcc")
+license=('MIT')
+options=(!strip !buildflags)
+source=("http://www.lua.org/ftp/lua-$pkgver.tar.gz"
+ luacpp.patch)
+
+md5sums=('2e115fe26e435e33b0d5c022e4490567'
+ '71a8472a0116a7639ce6c157b7f13d57')
+
+_targets="i686-w64-mingw32 x86_64-w64-mingw32"
+
+build() {
+ unset LDFLAGS
+
+ for _target in ${_targets}; do
+ mkdir -p ${srcdir}/lua51-build-${_target} && cd ${srcdir}/lua51-build-${_target}
+ cp -R $srcdir/lua-$pkgver/* .
+ cd src
+ patch -p1 -i "$srcdir/luacpp.patch"
+ cd ..
+ sed -e 's:llua:llua5.1:' -e 's:/include:/include/lua5.1:' -i etc/lua.pc
+ sed -r -e '/^LUA_(SO|A|T)=/ s/lua/lua5.1/' -e '/^LUAC_T=/ s/luac/luac5.1/' -i src/Makefile
+ make -j1 AR="${_target}-ar rcu" RANLIB="${_target}-ranlib" STRIP="${_target}-strip" CC="${_target}-g++" mingw
+ done
+}
+
+package() {
+ for _target in ${_targets}; do
+ cd ${srcdir}/lua51-build-${_target}
+ make -j1 \
+ TO_BIN="lua.exe luac.exe lua51.dll" \
+ TO_LIB="liblua5.1.a" \
+ INSTALL_TOP="${pkgdir}/usr/${_target}" \
+ INSTALL_INC="${pkgdir}/usr/${_target}/include/lua5.1" \
+ INSTALL_MAN="${pkgdir}/usr/${_target}/share/man/man1" \
+ install
+ install -D -m644 etc/lua.pc "${pkgdir}/usr/${_target}/lib/pkgconfig/lua5.1.pc"
+ # fixups
+ cd "${pkgdir}/usr/${_target}/bin"
+ mv lua.exe lua51.exe
+ mv luac.exe luac51.exe
+ cp -p lua51.dll "${pkgdir}/usr/${_target}/lib/liblua5.1.dll"
+ rm -rf "${pkgdir}/usr/${_target}/share"
+ done
+}
+
+# vim:set ts=4 sw=4 et: \ No newline at end of file
diff --git a/luacpp.patch b/luacpp.patch
new file mode 100644
index 000000000000..3a2e83cd1154
--- /dev/null
+++ b/luacpp.patch
@@ -0,0 +1,32 @@
+diff -crB a/luaconf.h b/luaconf.h
+*** a/luaconf.h 2012-08-18 13:49:21.807416507 -0300
+--- b/luaconf.h 2012-08-18 13:51:41.487416022 -0300
+***************
+*** 154,167 ****
+--- 154,179 ----
+ #if defined(LUA_BUILD_AS_DLL)
+
+ #if defined(LUA_CORE) || defined(LUA_LIB)
++ #ifdef __cplusplus
++ #define LUA_API extern "C" __declspec(dllexport)
++ #else
+ #define LUA_API __declspec(dllexport)
++ #endif
++ #else
++ #ifdef __cplusplus
++ #define LUA_API extern "C" __declspec(dllimport)
+ #else
+ #define LUA_API __declspec(dllimport)
+ #endif
++ #endif
+
+ #else
+
++ #ifdef __cplusplus
++ #define LUA_API extern "C"
++ #else
+ #define LUA_API extern
++ #endif
+
+ #endif
+