From e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 10 Apr 2024 22:34:10 +0200 Subject: Adding upstream version 4.2.2. Signed-off-by: Daniel Baumann --- .../lua52/0001-Add-an-install-static-target.patch | 28 +++++++++++++ cmake/external/lua52/Lua52.cmake | 47 ++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 cmake/external/lua52/0001-Add-an-install-static-target.patch create mode 100644 cmake/external/lua52/Lua52.cmake (limited to 'cmake/external') diff --git a/cmake/external/lua52/0001-Add-an-install-static-target.patch b/cmake/external/lua52/0001-Add-an-install-static-target.patch new file mode 100644 index 0000000..0f16192 --- /dev/null +++ b/cmake/external/lua52/0001-Add-an-install-static-target.patch @@ -0,0 +1,28 @@ +From f9430b91ae6957f9b77e03e3ce1edfbce99b5019 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= +Date: Sat, 10 Jun 2023 19:16:51 +0100 +Subject: [PATCH] Add an install-static target + +--- + Makefile | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/Makefile b/Makefile +index b2a62cf..7134775 100644 +--- a/Makefile ++++ b/Makefile +@@ -64,6 +64,11 @@ install: dummy + cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB) + cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN) + ++install-static: dummy ++ cd src && $(MKDIR) $(INSTALL_INC) $(INSTALL_LIB) ++ cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC) ++ cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB) ++ + uninstall: + cd src && cd $(INSTALL_BIN) && $(RM) $(TO_BIN) + cd src && cd $(INSTALL_INC) && $(RM) $(TO_INC) +-- +2.41.0 + diff --git a/cmake/external/lua52/Lua52.cmake b/cmake/external/lua52/Lua52.cmake new file mode 100644 index 0000000..864f223 --- /dev/null +++ b/cmake/external/lua52/Lua52.cmake @@ -0,0 +1,47 @@ +# +find_program(MAKE_EXE NAMES gmake nmake make) +include(ExternalProject) + +message(DEBUG "Compiler: ${CMAKE_C_COMPILER} Ar: ${CMAKE_AR} Ranlib: ${CMAKE_RANLIB}") + +set(_staging_dir "${CMAKE_BINARY_DIR}/staging") + +if(MINGW) + set(_target mingw) +elseif(APPLE) + set(_target macosx) +elseif(CMAKE_SYSTEM_NAME MATCHES Linux) + set(_target linux) +elseif(UNIX) + set(_target posix) +else() + set(_target generic) +endif() + +set(HAVE_LUA TRUE) +set(LUA_INCLUDE_DIRS "${_staging_dir}/include") +set(LUA_LIBRARIES "${_staging_dir}/lib/liblua.a") +set(LUA_FOUND TRUE CACHE INTERNAL "") +set(Lua_FOUND TRUE CACHE INTERNAL "") + +set(_lua52_cflags "-fPIC") +if(APPLE) + set(_lua52_cflags "${lua52_cflags} -isysroot ${CMAKE_OSX_SYSROOT}") +endif() + +# +# The install patch isn't strictly necessary for Lua but it's cleaner to install +# external projects to a staging directory first, and the normal install target +# does not work with MinGW. +# +ExternalProject_Add(lua52 + URL https://gitlab.com/wireshark/wireshark-development-libraries/-/raw/main/public/src/lua/lua-5.2.4.tar.gz + URL https://www.lua.org/ftp/lua-5.2.4.tar.gz + URL_HASH SHA256=b9e2e4aad6789b3b63a056d442f7b39f0ecfca3ae0f1fc0ae4e9614401b69f4b + PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_LIST_DIR}/0001-Add-an-install-static-target.patch + CONFIGURE_COMMAND "" + BUILD_COMMAND ${MAKE_EXE} MYCFLAGS=${_lua52_cflags} CC=${CMAKE_C_COMPILER} AR=${CMAKE_AR}\ rcu RANLIB=${CMAKE_RANLIB} ${_target} + BUILD_IN_SOURCE True + BUILD_BYPRODUCTS ${LUA_LIBRARIES} + INSTALL_COMMAND ${MAKE_EXE} INSTALL_TOP=${_staging_dir} install-static +) -- cgit v1.2.3