Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package fcitx5-lua for openSUSE:Factory checked in at 2022-03-12 17:15:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/fcitx5-lua (Old) and /work/SRC/openSUSE:Factory/.fcitx5-lua.new.25692 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "fcitx5-lua" Sat Mar 12 17:15:27 2022 rev:3 rq:961196 version:5.0.7 Changes: -------- --- /work/SRC/openSUSE:Factory/fcitx5-lua/fcitx5-lua.changes 2022-02-15 23:57:38.736273042 +0100 +++ /work/SRC/openSUSE:Factory/.fcitx5-lua.new.25692/fcitx5-lua.changes 2022-03-12 17:16:10.474354019 +0100 @@ -1,0 +2,14 @@ +Sat Mar 12 09:13:07 UTC 2022 - Marguerite Su <i...@marguerite.su> + +- update version 5.0.7 + * local im should be False by default + * Only resolve lua soname if USE_DLOPEN + * Use the same old trick in fcitx 4 to resolve the SONAME and + use soname for dlopen + * Add config component + * Do not load lua library when dlopen is not used. This should + fix for static lua library + * Add include protection to base.lua.h.in +- drop fcitx5-lua-5.0.5-soname.patch, upstreamed + +------------------------------------------------------------------- Old: ---- fcitx5-lua-5.0.5-soname.patch fcitx5-lua-5.0.5.tar.xz New: ---- fcitx5-lua-5.0.7.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ fcitx5-lua.spec ++++++ --- /var/tmp/diff_new_pack.lLNTeX/_old 2022-03-12 17:16:10.970354593 +0100 +++ /var/tmp/diff_new_pack.lLNTeX/_new 2022-03-12 17:16:10.974354597 +0100 @@ -17,14 +17,12 @@ Name: fcitx5-lua -Version: 5.0.5 +Version: 5.0.7 Release: 0 Summary: Lua support for fcitx License: LGPL-2.1-or-later URL: https://github.com/fcitx/fcitx5-lua Source: https://download.fcitx-im.org/fcitx5/%{name}/%{name}-%{version}.tar.xz -#PATCH-FIX-UPSTREAM dlopen liblua.so.5.4 -Patch: %{name}-5.0.5-soname.patch BuildRequires: cmake BuildRequires: extra-cmake-modules BuildRequires: fcitx5-devel @@ -52,7 +50,6 @@ %prep %setup -q -%patch -p1 %build %cmake @@ -67,7 +64,7 @@ %doc README.md %dir %{_fcitx5_datadir}/lua %dir %{_fcitx5_datadir}/lua/imeapi -%{_fcitx5_libdir}/luaaddonloader.so +%{_fcitx5_libdir}/libluaaddonloader.so %{_fcitx5_addondir}/imeapi.conf %{_fcitx5_addondir}/luaaddonloader.conf %{_fcitx5_datadir}/lua/imeapi/imeapi.lua ++++++ fcitx5-lua-5.0.5.tar.xz -> fcitx5-lua-5.0.7.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-lua-5.0.5/CMakeLists.txt new/fcitx5-lua-5.0.7/CMakeLists.txt --- old/fcitx5-lua-5.0.5/CMakeLists.txt 2021-05-04 17:20:57.951634200 +0200 +++ new/fcitx5-lua-5.0.7/CMakeLists.txt 2022-03-09 19:25:58.267041200 +0100 @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.10) -project(fcitx5-lua VERSION 5.0.5) +project(fcitx5-lua VERSION 5.0.7) find_package(ECM REQUIRED 1.0.0) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) @@ -16,9 +16,9 @@ find_package(Fcitx5Module REQUIRED COMPONENTS TestFrontend TestIM QuickPhrase) option(USE_DLOPEN "Use dlopen to load lua library." On) +option(ENABLE_TEST "Build Test" On) include("${FCITX_INSTALL_CMAKECONFIG_DIR}/Fcitx5Utils/Fcitx5CompilerSettings.cmake") -include(Helper) if (NOT TARGET Lua::_LuaLibrary) if (USE_DLOPEN) @@ -33,16 +33,42 @@ endif() endif() +function(_RESOLVE_LIBRARY_PATH _FILE_NAME _LIBRARY_PATH) + if (CMAKE_OBJDUMP) + execute_process ( + COMMAND ${CMAKE_OBJDUMP} -p "${_LIBRARY_PATH}" + RESULT_VARIABLE STATUS + OUTPUT_VARIABLE OBJDUMP_RESULT + ERROR_QUIET + ) + string(REGEX REPLACE ".*SONAME +([^ ]+)\n.*$" "\\1" SONAME_OUT "${OBJDUMP_RESULT}") + if (SONAME_OUT) + set(_FILE_NAME_OUT "${SONAME_OUT}") + endif () + endif() + if (NOT _FILE_NAME_OUT) + get_filename_component(_FILE_NAME_OUT "${_LIBRARY_PATH}" NAME) + endif() + set(${_FILE_NAME} ${_FILE_NAME_OUT} PARENT_SCOPE) +endfunction() + +if(USE_DLOPEN) + _RESOLVE_LIBRARY_PATH(LUA_LIBRARY_PATH ${LUA_LIBRARY}) +endif() + configure_file(config.h.in config.h) include_directories(${CMAKE_CURRENT_BINARY_DIR}) add_definitions(-DFCITX_GETTEXT_DOMAIN=\"fcitx5-lua\") fcitx5_add_i18n_definition() -enable_testing() add_subdirectory(src) -add_subdirectory(test) add_subdirectory(po) +if (ENABLE_TEST) + enable_testing() + add_subdirectory(test) +endif() + fcitx5_translate_desktop_file(org.fcitx.Fcitx5.Addon.Lua.metainfo.xml.in org.fcitx.Fcitx5.Addon.Lua.metainfo.xml XML) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.fcitx.Fcitx5.Addon.Lua.metainfo.xml" DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-lua-5.0.5/cmake/Helper.cmake new/fcitx5-lua-5.0.7/cmake/Helper.cmake --- old/fcitx5-lua-5.0.5/cmake/Helper.cmake 2020-03-23 17:25:06.523902400 +0100 +++ new/fcitx5-lua-5.0.7/cmake/Helper.cmake 1970-01-01 01:00:00.000000000 +0100 @@ -1,9 +0,0 @@ - -function(file2cstring tgt_name ifile) - get_filename_component(ifile "${ifile}" ABSOLUTE) - set(output_file "${CMAKE_CURRENT_BINARY_DIR}/${tgt_name}.h") - add_custom_command(OUTPUT "${output_file}" - COMMAND file2cstring "${tgt_name}" "${ifile}" > "${output_file}" - DEPENDS file2cstring ${ifile}) - add_custom_target("${tgt_name}" ALL DEPENDS "${output_file}") -endfunction() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-lua-5.0.5/config.h.in new/fcitx5-lua-5.0.7/config.h.in --- old/fcitx5-lua-5.0.5/config.h.in 2020-05-17 07:02:03.974142800 +0200 +++ new/fcitx5-lua-5.0.7/config.h.in 2022-02-14 00:20:00.535803800 +0100 @@ -7,7 +7,7 @@ #ifndef _FCITX5_LUA_CONFIG_H_ #define _FCITX5_LUA_CONFIG_H_ -#cmakedefine LUA_LIBRARY "@LUA_LIBRARY@" +#cmakedefine LUA_LIBRARY_PATH "@LUA_LIBRARY_PATH@" #cmakedefine USE_DLOPEN #endif // _FCITX5_LUA_CONFIG_H_ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-lua-5.0.5/org.fcitx.Fcitx5.Addon.Lua.metainfo.xml.in new/fcitx5-lua-5.0.7/org.fcitx.Fcitx5.Addon.Lua.metainfo.xml.in --- old/fcitx5-lua-5.0.5/org.fcitx.Fcitx5.Addon.Lua.metainfo.xml.in 2021-05-04 17:20:58.034968100 +0200 +++ new/fcitx5-lua-5.0.7/org.fcitx.Fcitx5.Addon.Lua.metainfo.xml.in 2022-03-09 19:25:58.370377000 +0100 @@ -10,6 +10,8 @@ <url type="bugtracker">https://github.com/fcitx/fcitx5-lua/issues</url> <project_group>Fcitx</project_group> <releases> + <release version="5.0.7" date="2022-03-09"/> + <release version="5.0.6" date="2022-02-01"/> <release version="5.0.5" date="2021-05-04"/> <release version="5.0.4" date="2021-03-21"/> <release version="5.0.3" date="2021-02-18"/> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-lua-5.0.5/po/LINGUAS new/fcitx5-lua-5.0.7/po/LINGUAS --- old/fcitx5-lua-5.0.5/po/LINGUAS 2020-12-05 00:50:40.466112600 +0100 +++ new/fcitx5-lua-5.0.7/po/LINGUAS 2022-01-20 23:22:23.013823000 +0100 @@ -2,5 +2,6 @@ da ja ko +ru zh_CN zh_TW diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-lua-5.0.5/po/ru.po new/fcitx5-lua-5.0.7/po/ru.po --- old/fcitx5-lua-5.0.5/po/ru.po 1970-01-01 01:00:00.000000000 +0100 +++ new/fcitx5-lua-5.0.7/po/ru.po 2022-01-20 23:22:23.013823000 +0100 @@ -0,0 +1,40 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the fcitx5-lua package. +# +# Translators: +# Dmitry <dmitrydmitry...@gmail.com>, 2022 +# +msgid "" +msgstr "" +"Project-Id-Version: fcitx5-lua\n" +"Report-Msgid-Bugs-To: fcitx-...@googlegroups.com\n" +"POT-Creation-Date: 2022-01-15 20:24+0000\n" +"PO-Revision-Date: 2020-04-01 16:17+0000\n" +"Last-Translator: Dmitry <dmitrydmitry...@gmail.com>, 2022\n" +"Language-Team: Russian (https://www.transifex.com/fcitx/teams/12005/ru/)\n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n" +"%100>=11 && n%100<=14)? 2 : 3);\n" + +#: src/addonloader/luaaddonloader.conf.in:3 +#: src/addonloader/luaaddonloader.conf.in.in:3 +msgid "Lua Addon Loader" +msgstr "?????????????????? ?????????????? Lua" + +#: src/addonloader/luaaddonloader.conf.in:4 +#: src/addonloader/luaaddonloader.conf.in.in:4 +msgid "Lua Addon support" +msgstr "?????????????????? ?????????????? Lua" + +#: src/imeapi/imeapi.conf.in:3 src/imeapi/imeapi.conf.in.in:3 +msgid "Lua IME API" +msgstr "Lua IME API" + +#: src/imeapi/imeapi.conf.in:4 src/imeapi/imeapi.conf.in.in:4 +msgid "Lua IME API support" +msgstr "?????????????????? Lua IME API" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-lua-5.0.5/src/CMakeLists.txt new/fcitx5-lua-5.0.7/src/CMakeLists.txt --- old/fcitx5-lua-5.0.5/src/CMakeLists.txt 2020-03-23 17:10:39.650563500 +0100 +++ new/fcitx5-lua-5.0.7/src/CMakeLists.txt 2022-02-11 02:55:39.135089000 +0100 @@ -1,3 +1,2 @@ add_subdirectory(addonloader) -add_subdirectory(file2cstring) add_subdirectory(imeapi) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-lua-5.0.5/src/addonloader/CMakeLists.txt new/fcitx5-lua-5.0.7/src/addonloader/CMakeLists.txt --- old/fcitx5-lua-5.0.5/src/addonloader/CMakeLists.txt 2021-03-31 23:53:39.233317600 +0200 +++ new/fcitx5-lua-5.0.7/src/addonloader/CMakeLists.txt 2022-02-12 03:31:44.533992000 +0100 @@ -1,13 +1,14 @@ -add_library(luaaddonloader MODULE luastate.cpp luaaddonstate.cpp luaaddonloader.cpp luaaddon.cpp luahelper.cpp ${CMAKE_CURRENT_BINARY_DIR}/baselua.h) +add_library(luaaddonloader MODULE luastate.cpp luaaddonstate.cpp luaaddonloader.cpp luaaddon.cpp luahelper.cpp) target_link_libraries(luaaddonloader Lua::_LuaLibrary Fcitx5::Core Fcitx5::Module::QuickPhrase) target_include_directories(luaaddonloader PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) -set_target_properties(luaaddonloader PROPERTIES PREFIX "") install(TARGETS luaaddonloader DESTINATION "${CMAKE_INSTALL_LIBDIR}/fcitx5") -file2cstring(baselua base.lua) +file(READ "base.lua" BASE_LUA_CONTENT) +configure_file(base.lua.h.in ${CMAKE_CURRENT_BINARY_DIR}/base.lua.h @ONLY) configure_file(luaaddonloader.conf.in.in luaaddonloader.conf.in) fcitx5_translate_desktop_file("${CMAKE_CURRENT_BINARY_DIR}/luaaddonloader.conf.in" luaaddonloader.conf) -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/luaaddonloader.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon") +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/luaaddonloader.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" + COMPONENT config) fcitx5_export_module(LuaAddonLoader TARGET luaaddonloader BUILD_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" HEADERS luaaddon_public.h INSTALL) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-lua-5.0.5/src/addonloader/base.lua new/fcitx5-lua-5.0.7/src/addonloader/base.lua --- old/fcitx5-lua-5.0.5/src/addonloader/base.lua 2021-01-31 16:12:57.154323600 +0100 +++ new/fcitx5-lua-5.0.7/src/addonloader/base.lua 2022-03-08 02:54:16.749470000 +0100 @@ -118,7 +118,7 @@ local oldsetCurrentInputMethod=fcitx.setCurrentInputMethod local function setCurrentInputMethod(name,local_im) if(local_im == nil) then - local_im = true + local_im = false end oldsetCurrentInputMethod(name,local_im) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-lua-5.0.5/src/addonloader/base.lua.h.in new/fcitx5-lua-5.0.7/src/addonloader/base.lua.h.in --- old/fcitx5-lua-5.0.5/src/addonloader/base.lua.h.in 1970-01-01 01:00:00.000000000 +0100 +++ new/fcitx5-lua-5.0.7/src/addonloader/base.lua.h.in 2022-02-11 03:06:06.596897400 +0100 @@ -0,0 +1,14 @@ +/* + * SPDX-FileCopyrightText: 2022~2022 CSSlayer <wen...@gmail.com> + * + * SPDX-License-Identifier: LGPL-2.1-or-later + * + */ +#ifndef _FCITX5_LUA_ADDONLOADER_BASE_LUA_H_IN_ +#define _FCITX5_LUA_ADDONLOADER_BASE_LUA_H_IN_ + +constexpr char baseLua[] = R"foo( +@BASE_LUA_CONTENT@ +)foo"; + +#endif // _FCITX5_LUA_ADDONLOADER_BASE_LUA_H_IN_ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-lua-5.0.5/src/addonloader/luaaddon.cpp new/fcitx5-lua-5.0.7/src/addonloader/luaaddon.cpp --- old/fcitx5-lua-5.0.5/src/addonloader/luaaddon.cpp 2020-05-17 01:42:54.599178800 +0200 +++ new/fcitx5-lua-5.0.7/src/addonloader/luaaddon.cpp 2022-02-11 04:22:36.482415700 +0100 @@ -8,17 +8,17 @@ namespace fcitx { -LuaAddon::LuaAddon(Library &luaLibrary, const AddonInfo &info, +LuaAddon::LuaAddon(Library *luaLibrary, const AddonInfo &info, AddonManager *manager) : instance_(manager->instance()), name_(info.uniqueName()), library_(info.library()), state_(std::make_unique<LuaAddonState>( luaLibrary, name_, library_, manager)), - luaLibrary_(&luaLibrary) {} + luaLibrary_(luaLibrary) {} void LuaAddon::reloadConfig() { try { auto newState = std::make_unique<LuaAddonState>( - *luaLibrary_, name_, library_, &instance_->addonManager()); + luaLibrary_, name_, library_, &instance_->addonManager()); state_ = std::move(newState); } catch (const std::exception &e) { FCITX_LUA_ERROR() << e.what(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-lua-5.0.5/src/addonloader/luaaddon.h new/fcitx5-lua-5.0.7/src/addonloader/luaaddon.h --- old/fcitx5-lua-5.0.5/src/addonloader/luaaddon.h 2020-05-17 01:42:54.599178800 +0200 +++ new/fcitx5-lua-5.0.7/src/addonloader/luaaddon.h 2022-02-11 04:22:36.482415700 +0100 @@ -22,7 +22,7 @@ class LuaAddon : public AddonInstance { public: - LuaAddon(Library &luaLibrary, const AddonInfo &info, AddonManager *manager); + LuaAddon(Library *luaLibrary, const AddonInfo &info, AddonManager *manager); void reloadConfig() override; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-lua-5.0.5/src/addonloader/luaaddonloader.conf.in.in new/fcitx5-lua-5.0.7/src/addonloader/luaaddonloader.conf.in.in --- old/fcitx5-lua-5.0.5/src/addonloader/luaaddonloader.conf.in.in 2021-03-05 04:18:50.167990200 +0100 +++ new/fcitx5-lua-5.0.7/src/addonloader/luaaddonloader.conf.in.in 2022-02-12 03:31:44.520659400 +0100 @@ -6,7 +6,7 @@ Type=SharedLibrary OnDemand=True Configurable=False -Library=luaaddonloader +Library=libluaaddonloader [Addon/OptionalDependencies] 0=quickphrase diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-lua-5.0.5/src/addonloader/luaaddonloader.cpp new/fcitx5-lua-5.0.7/src/addonloader/luaaddonloader.cpp --- old/fcitx5-lua-5.0.5/src/addonloader/luaaddonloader.cpp 2021-03-31 23:54:00.026725000 +0200 +++ new/fcitx5-lua-5.0.7/src/addonloader/luaaddonloader.cpp 2022-02-14 00:20:22.769271100 +0100 @@ -14,22 +14,23 @@ LuaAddonLoader::LuaAddonLoader() { #ifdef USE_DLOPEN - luaLibrary_.load( + luaLibrary_ = std::make_unique<Library>(LUA_LIBRARY_PATH); + luaLibrary_->load( {LibraryLoadHint::NewNameSpace, LibraryLoadHint::DefaultHint}); - if (!luaLibrary_.loaded()) { + if (!luaLibrary_->loaded()) { FCITX_LUA_ERROR() << "Failed to load lua library: " - << luaLibrary_.error(); + << luaLibrary_->error(); } _fcitx_lua_getglobal = reinterpret_cast<decltype(_fcitx_lua_getglobal)>( - luaLibrary_.resolve("lua_getglobal")); + luaLibrary_->resolve("lua_getglobal")); _fcitx_lua_touserdata = reinterpret_cast<decltype(_fcitx_lua_touserdata)>( - luaLibrary_.resolve("lua_touserdata")); + luaLibrary_->resolve("lua_touserdata")); _fcitx_lua_settop = reinterpret_cast<decltype(_fcitx_lua_settop)>( - luaLibrary_.resolve("lua_settop")); + luaLibrary_->resolve("lua_settop")); _fcitx_lua_close = reinterpret_cast<decltype(_fcitx_lua_close)>( - luaLibrary_.resolve("lua_close")); + luaLibrary_->resolve("lua_close")); _fcitx_luaL_newstate = reinterpret_cast<decltype(_fcitx_luaL_newstate)>( - luaLibrary_.resolve("luaL_newstate")); + luaLibrary_->resolve("luaL_newstate")); #else _fcitx_lua_getglobal = &::lua_getglobal; _fcitx_lua_touserdata = &::lua_touserdata; @@ -44,19 +45,20 @@ } // Create test state to ensure the function can be resolved. - LuaState testState(luaLibrary_); + LuaState testState(luaLibrary_.get()); } AddonInstance *LuaAddonLoader::load(const AddonInfo &info, AddonManager *manager) { #ifdef USE_DLOPEN - if (!luaLibrary_.loaded()) { + if (!luaLibrary_->loaded()) { return nullptr; } #endif if (info.category() == AddonCategory::Module) { try { - auto addon = std::make_unique<LuaAddon>(luaLibrary_, info, manager); + auto addon = + std::make_unique<LuaAddon>(luaLibrary_.get(), info, manager); return addon.release(); } catch (const std::exception &e) { FCITX_LUA_ERROR() << "Loading lua addon " << info.uniqueName() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-lua-5.0.5/src/addonloader/luaaddonloader.h new/fcitx5-lua-5.0.7/src/addonloader/luaaddonloader.h --- old/fcitx5-lua-5.0.5/src/addonloader/luaaddonloader.h 2021-03-23 01:10:19.809094400 +0100 +++ new/fcitx5-lua-5.0.7/src/addonloader/luaaddonloader.h 2022-02-11 04:22:36.482415700 +0100 @@ -22,7 +22,7 @@ AddonInstance *load(const AddonInfo &info, AddonManager *manager) override; private: - Library luaLibrary_{LUA_LIBRARY}; + std::unique_ptr<Library> luaLibrary_; }; class LuaAddonLoaderAddon : public AddonInstance { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-lua-5.0.5/src/addonloader/luaaddonstate.cpp new/fcitx5-lua-5.0.7/src/addonloader/luaaddonstate.cpp --- old/fcitx5-lua-5.0.5/src/addonloader/luaaddonstate.cpp 2021-04-25 23:32:56.462895900 +0200 +++ new/fcitx5-lua-5.0.7/src/addonloader/luaaddonstate.cpp 2022-02-11 04:22:36.482415700 +0100 @@ -5,7 +5,7 @@ * */ #include "luaaddonstate.h" -#include "baselua.h" +#include "base.lua.h" #include <fcitx-utils/standardpath.h> #include <fcitx-utils/utf8.h> #include <fcitx/addonmanager.h> @@ -46,7 +46,7 @@ } } -LuaAddonState::LuaAddonState(Library &luaLibrary, const std::string &name, +LuaAddonState::LuaAddonState(Library *luaLibrary, const std::string &name, const std::string &library, AddonManager *manager) : instance_(manager->instance()), state_(std::make_unique<LuaState>(luaLibrary)) { @@ -92,7 +92,7 @@ }; auto open_fcitx = [](lua_State *state) { auto s = GetLuaAddonState(state)->state_.get(); - if (int rv = luaL_loadstring(s, baselua) || + if (int rv = luaL_loadstring(s, baseLua) || lua_pcallk(s, 0, LUA_MULTRET, 0, 0, nullptr); rv != LUA_OK) { LuaPError(rv, "luaL_loadbuffer() failed"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-lua-5.0.5/src/addonloader/luaaddonstate.h new/fcitx5-lua-5.0.7/src/addonloader/luaaddonstate.h --- old/fcitx5-lua-5.0.5/src/addonloader/luaaddonstate.h 2021-01-31 16:31:27.728191600 +0100 +++ new/fcitx5-lua-5.0.7/src/addonloader/luaaddonstate.h 2022-02-11 04:22:36.482415700 +0100 @@ -78,7 +78,7 @@ class LuaAddonState { public: - LuaAddonState(Library &luaLibrary, const std::string &name, + LuaAddonState(Library *luaLibrary, const std::string &name, const std::string &library, AddonManager *manager); operator LuaState *() { return state_.get(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-lua-5.0.5/src/addonloader/luastate.cpp new/fcitx5-lua-5.0.7/src/addonloader/luastate.cpp --- old/fcitx5-lua-5.0.5/src/addonloader/luastate.cpp 2020-08-02 05:40:32.769193400 +0200 +++ new/fcitx5-lua-5.0.7/src/addonloader/luastate.cpp 2022-02-11 04:22:36.482415700 +0100 @@ -18,8 +18,8 @@ #define FILL_LUA_API(FUNCTION) FUNCTION##_ = GET_LUA_API(FUNCTION) namespace fcitx { -LuaState::LuaState(Library &library) - : luaLibrary_(&library), state_(nullptr, _fcitx_lua_close) { +LuaState::LuaState(Library *library) + : luaLibrary_(library), state_(nullptr, _fcitx_lua_close) { // Resolve all required lua function first. #define FOREACH_LUA_FUNCTION(NAME) \ FILL_LUA_API(NAME); \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-lua-5.0.5/src/addonloader/luastate.h new/fcitx5-lua-5.0.7/src/addonloader/luastate.h --- old/fcitx5-lua-5.0.5/src/addonloader/luastate.h 2020-11-23 16:34:41.071123100 +0100 +++ new/fcitx5-lua-5.0.7/src/addonloader/luastate.h 2022-02-11 04:22:36.482415700 +0100 @@ -16,7 +16,7 @@ struct LuaState { public: - LuaState(Library &library); + LuaState(Library *library); #define FOREACH_LUA_FUNCTION DEFINE_LUA_API_FUNCTION #include "luafunc.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-lua-5.0.5/src/file2cstring/CMakeLists.txt new/fcitx5-lua-5.0.7/src/file2cstring/CMakeLists.txt --- old/fcitx5-lua-5.0.5/src/file2cstring/CMakeLists.txt 2020-03-23 17:10:25.300563300 +0100 +++ new/fcitx5-lua-5.0.7/src/file2cstring/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -add_executable(file2cstring file2cstring.cpp) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-lua-5.0.5/src/file2cstring/file2cstring.cpp new/fcitx5-lua-5.0.7/src/file2cstring/file2cstring.cpp --- old/fcitx5-lua-5.0.5/src/file2cstring/file2cstring.cpp 2020-05-09 02:06:35.350460000 +0200 +++ new/fcitx5-lua-5.0.7/src/file2cstring/file2cstring.cpp 1970-01-01 01:00:00.000000000 +0100 @@ -1,49 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020~2020 CSSlayer <wen...@gmail.com> - * - * SPDX-License-Identifier: LGPL-2.1-or-later - * - */ -#include <cstring> -#include <fstream> -#include <iostream> - -int main(int argc, char *argv[]) { - if (argc < 3) { - return 1; - } - - if (strlen(argv[1]) == 0) { - return 1; - } - - std::ifstream in(argv[2], std::ios::in | std::ios::binary); - if (!in) { - return 1; - } - - char buffer[1024]; - size_t totalBytes = 0; - - std::cout << "char " << argv[1] << "[] = {"; - const size_t lineLength = 16; - while (!in.eof()) { - in.read(buffer, sizeof(buffer)); - auto bytes = in.gcount(); - for (auto i = 0; i < bytes; i++) { - if (i % lineLength == 0) { - std::cout << std::endl; - } - std::cout << " 0x" << std::hex << static_cast<int>(buffer[i]) - << ","; - } - totalBytes += bytes; - } - - std::cout << std::endl - << "0x00};" << std::endl - << "unsigned int " << argv[1] << "Length = " << std::dec - << totalBytes << ";" << std::endl; - - return 0; -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-lua-5.0.5/src/imeapi/CMakeLists.txt new/fcitx5-lua-5.0.7/src/imeapi/CMakeLists.txt --- old/fcitx5-lua-5.0.5/src/imeapi/CMakeLists.txt 2021-03-05 04:19:43.828785000 +0100 +++ new/fcitx5-lua-5.0.7/src/imeapi/CMakeLists.txt 2022-02-12 03:31:44.533992000 +0100 @@ -1,6 +1,7 @@ configure_file(imeapi.conf.in.in imeapi.conf.in) fcitx5_translate_desktop_file("${CMAKE_CURRENT_BINARY_DIR}/imeapi.conf.in" imeapi.conf) -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/imeapi.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon") - -install(FILES imeapi.lua DESTINATION "${FCITX_INSTALL_PKGDATADIR}/lua/imeapi") +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/imeapi.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" + COMPONENT config) +install(FILES imeapi.lua DESTINATION "${FCITX_INSTALL_PKGDATADIR}/lua/imeapi" + COMPONENT config)