luacom for lua5.1 (#1804)

* luacom for lua5.1

* add pkgbase for luacom
This commit is contained in:
Ricky Wu
2016-10-11 17:03:50 +08:00
committed by Алексей
parent 211c53a49c
commit b945d8c7e2
7 changed files with 161 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
Binary files luacom-org/.git/index and luacom/.git/index differ
diff -rup luacom-org/cmake/lua.cmake luacom/cmake/lua.cmake
--- luacom-org/cmake/lua.cmake 2016-01-07 13:09:07.004304800 +0800
+++ luacom/cmake/lua.cmake 2016-01-07 12:30:43.228024000 +0800
@@ -251,7 +251,7 @@ endmacro ()
# [1] http://lua-users.org/wiki/BinToCee
# [2] http://lua-users.org/wiki/LuaCompilerInLua
function ( add_lua_bin2c _target _source )
- find_program ( LUA NAMES lua lua.bat )
+ find_program ( LUA NAMES lua lua.bat lua5.1)
execute_process ( COMMAND ${LUA} -e "string.dump(function()end)"
RESULT_VARIABLE _LUA_DUMP_RESULT ERROR_QUIET )
if ( NOT ${_LUA_DUMP_RESULT} )

View File

@@ -0,0 +1,14 @@
Binary files luacom-org/.git/index and luacom/.git/index differ
diff -rup luacom-org/CMakeLists.txt luacom/CMakeLists.txt
--- luacom-org/CMakeLists.txt 2016-01-07 13:09:06.994305000 +0800
+++ luacom/CMakeLists.txt 2016-01-08 08:07:54.227239700 +0800
@@ -63,6 +63,9 @@ if ( HAVE_HTMLHELP )
set ( LIBS ${LIBS} htmlhelp )
endif ( )
+SET(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR>")
+SET(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR>")
+
add_lua_bin2c ( ${CMAKE_CURRENT_BINARY_DIR}/luacom5.loh src/library/luacom5.lua ${CMAKE_CURRENT_SOURCE_DIR}/mak/bin2c.lua
${CMAKE_CURRENT_SOURCE_DIR}/mak/luac.lua )
set_source_files_properties ( src/library/luacom.cpp PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/luacom5.loh )

View File

@@ -0,0 +1,16 @@
Binary files luacom-org/.git/index and luacom/.git/index differ
diff -rup luacom-org/cmake/lua.cmake luacom/cmake/lua.cmake
--- luacom-org/cmake/lua.cmake 2016-01-07 13:09:07.004304800 +0800
+++ luacom/cmake/lua.cmake 2016-01-08 08:37:51.345072900 +0800
@@ -6,9 +6,9 @@
# For details see the COPYRIGHT file distributed with LuaDist.
# Please note that the package source code is licensed under its own license.
-set ( INSTALL_LMOD ${INSTALL_LIB}/lua
+set ( INSTALL_LMOD ${INSTALL_LIB}/lua/5.1
CACHE PATH "Directory to install Lua modules." )
-set ( INSTALL_CMOD ${INSTALL_LIB}/lua
+set ( INSTALL_CMOD ${INSTALL_LIB}/lua/5.1
CACHE PATH "Directory to install Lua binary modules." )
option ( SKIP_LUA_WRAPPER

View File

@@ -0,0 +1,32 @@
diff --git a/src/dll/luacom_dll.cpp b/src/dll/luacom_dll.cpp
index d56b477..e5b5158 100644
--- a/src/dll/luacom_dll.cpp
+++ b/src/dll/luacom_dll.cpp
@@ -1,9 +1,9 @@
#include <windows.h>
extern "C" {
- #include "lua.h"
- #include "lualib.h"
- #include "lauxlib.h"
+ #include "lua5.1/lua.h"
+ #include "lua5.1/lualib.h"
+ #include "lua5.1/lauxlib.h"
#ifdef IUP
#include "iup.h"
#ifndef NO_CPICONTROLS
diff --git a/src/library/luacom.cpp b/src/library/luacom.cpp
index e8ea9d9..7349fa8 100644
--- a/src/library/luacom.cpp
+++ b/src/library/luacom.cpp
@@ -23,8 +23,8 @@ static char const * const rcsid = "$Id: luacom$";
extern "C"
{
-#include "lua.h"
-#include "lauxlib.h"
+#include "lua5.1/lua.h"
+#include "lua5.1/lauxlib.h"
}
#include "LuaCompat.h"

View File

@@ -0,0 +1,69 @@
# Maintainer: Ricky Wu <rickleaf.wu@gmail.com>
_realname=luacom
pkgbase=mingw-w64-${_realname}-git
pkgname="${MINGW_PACKAGE_PREFIX}-lua51-${_realname}-git"
pkgver=v1.4.1.4.g8f818f5
pkgrel=1
pkgdesc="Microsoft's Component Object Model (COM) Lua interface"
arch=('any')
url="http://luaforge.net/projects/luacom/"
license=("LGPL")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-cmake")
depends=("${MINGW_PACKAGE_PREFIX}-lua51")
options=('staticlibs' 'strip')
source=("${_realname}"::"git+https://github.com/davidm/${_realname}.git"
"luacom.def"
"luacom.pc"
"001-Fix-Lua51-prefix.patch"
"002-CMake-AR.patch"
"003-Lua_51_PATH.patch"
"004-Lua_51_INC.patch")
sha256sums=('SKIP'
'59d441b5cd0220d1048ca9e35bde2ba14dae0e5e3b671d53ac6f6d919ca94e60'
'658379536b0481dba9848f436abc88b7f2beea68259e5ef8184c95aa55411a14'
'7da5b2ad84bd06777a1d89e2ee4579adac7cfe41dbccc4ae9aeda5a303486a36'
'70159ab03aa9f52175572339648d31db519beb5f2b89827d668268f7462a732d'
'1512f081025ee54d5d3144c530de89c1ce90ff6e7d1e5e861833fc044fe605ff'
'a2944c3cdc37053f7c0d58913a3f7db64387f8f24718b71d3b417a863dfef58e')
pkgver() {
cd "${srcdir}/${_realname}"
git describe --tags | sed 's|-|.|g'
}
prepare() {
cd "${srcdir}"/${_realname}
patch -p1 -i ${srcdir}/001-Fix-Lua51-prefix.patch
patch -p1 -i ${srcdir}/002-CMake-AR.patch
patch -p1 -i ${srcdir}/003-Lua_51_PATH.patch
patch -p1 -i ${srcdir}/004-Lua_51_INC.patch
}
build() {
mkdir -p "${srcdir}/${_realname}/build-${MINGW_CHOST}"
cd "${srcdir}/${_realname}/build-${MINGW_CHOST}"
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake \
-G"MSYS Makefiles" \
-DCMAKE_INSTALL_PREFIX="${MINGW_PREFIX}" \
..
make
dlltool -d ../../luacom.def -l libluacom.dll.a
}
package() {
cd "${srcdir}/${_realname}/build-${MINGW_CHOST}"
make destdir=${pkgdir} install
install -Dm644 libluacom.dll.a "${pkgdir}${MINGW_PREFIX}"/lib/libluacom.dll.a
install -d "${pkgdir}${MINGW_PREFIX}"/bin
install -Dm644 luacom.dll "${pkgdir}${MINGW_PREFIX}"/bin/luacom.dll
install -d "${pkgdir}${MINGW_PREFIX}"/include
install -Dm644 "${srcdir}/${_realname}"/include/luacom.h "${pkgdir}${MINGW_PREFIX}"/include/lua5.1/luacom.h
install -d "${pkgdir}${MINGW_PREFIX}"/lib/pkgconfig
install -Dm644 "${srcdir}"/luacom.pc "${pkgdir}${MINGW_PREFIX}"/lib/pkgconfig/luacom.pc
}

View File

@@ -0,0 +1,6 @@
LIBRARY luacom.dll
EXPORTS
luacom_open
luacom_close
luacom_IDispatch2LuaCOM
luacom_detectAutomation

View File

@@ -0,0 +1,11 @@
prefix=/mingw64
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: LuaCom
Description: Lua COM
Version: 1.4
Libs: -L${libdir} -lluacom
Cflags: -I${includedir}