Skip to content

Commit

Permalink
unlock dl
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj committed Feb 1, 2025
1 parent 65d5f3f commit 4897853
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 69 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: |
C:/msys64/usr/bin/pacman -Syu --noconfirm
C:/msys64/usr/bin/pacman -S --noconfirm `
mingw-w64-ucrt-x86_64-extra-cmake-modules `
mingw-w64-clang-x86_64-extra-cmake-modules `
cmake `
fmt `
gcc `
Expand All @@ -40,7 +40,7 @@ jobs:
run: |
C:/msys64/usr/bin/pacman -Syu --noconfirm
C:/msys64/usr/bin/pacman -S --noconfirm `
mingw-w64-ucrt-x86_64-extra-cmake-modules `
mingw-w64-clang-x86_64-extra-cmake-modules `
mingw-w64-clang-x86_64-clang `
mingw-w64-clang-x86_64-cmake `
mingw-w64-clang-x86_64-fmt `
Expand All @@ -54,10 +54,13 @@ jobs:
git apply --directory=fcitx5 patches/fcitx5.patch
- name: Build
env:
DESTDIR: dist
run: |
cmake -B build -G Ninja `
-DCMAKE_BUILD_TYPE=Release
cmake --build build
cmake --install build
- name: Setup tmate session
if: ${{ failure() }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
build
dist
.cache
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

set(CMAKE_CXX_STANDARD 17)

set(CMAKE_INSTALL_PREFIX C:)

option(ENABLE_TESTING_ADDONS "" OFF)
option(ENABLE_TEST "" OFF)
option(ENABLE_COVERAGE "" OFF)
Expand All @@ -23,10 +25,10 @@ option(ENABLE_LIBUUID "" OFF)
option(BUILD_SPELL_DICT "" ${CYGWIN})

if (CYGWIN)
set(ECM_DIR /ucrt64/share/ECM/cmake)
set(ECM_DIR /clang64/share/ECM/cmake)
add_compile_definitions(-D_GNU_SOURCE)
else()
set(ECM_DIR C:/msys64/ucrt64/share/ECM/cmake)
set(ECM_DIR C:/msys64/clang64/share/ECM/cmake)
set(GETTEXT_MSGMERGE_EXECUTABLE C:/msys64/usr/bin/msgmerge.exe)
set(GETTEXT_MSGFMT_EXECUTABLE C:/msys64/usr/bin/msgfmt.exe)
endif()
Expand Down
2 changes: 1 addition & 1 deletion fcitx5
Submodule fcitx5 updated 84 files
+1 −0 .clang-format
+1 −1 .github/ISSUE_TEMPLATE/bug_report.yml
+1 −0 data/org.fcitx.Fcitx5.metainfo.xml.in
+106 −98 po/ca.po
+108 −100 po/da.po
+106 −98 po/de.po
+106 −98 po/es.po
+106 −98 po/fcitx5.pot
+106 −98 po/fr.po
+106 −98 po/he.po
+128 −115 po/ja.po
+111 −103 po/ko.po
+122 −107 po/ru.po
+106 −98 po/vi.po
+116 −103 po/zh_CN.po
+112 −104 po/zh_TW.po
+2 −1 src/frontend/waylandim/waylandim.cpp
+15 −5 src/frontend/xim/xim.cpp
+7 −1 src/im/keyboard/keyboard.cpp
+8 −4 src/im/keyboard/xkbrules.cpp
+2 −2 src/lib/fcitx-config/rawconfig.h
+15 −22 src/lib/fcitx-utils/cutf8.h
+2 −2 src/lib/fcitx-utils/dbus/variant.h
+16 −22 src/lib/fcitx-utils/i18n.h
+3 −3 src/lib/fcitx-utils/semver.cpp
+1 −2 src/lib/fcitx-utils/stringutils.h
+3 −1 src/lib/fcitx-wayland/blur/org_kde_kwin_blur_manager.cpp
+3 −1 src/lib/fcitx-wayland/core/wl_buffer.cpp
+6 −2 src/lib/fcitx-wayland/core/wl_callback.cpp
+3 −1 src/lib/fcitx-wayland/core/wl_compositor.cpp
+9 −3 src/lib/fcitx-wayland/core/wl_data_device.cpp
+3 −1 src/lib/fcitx-wayland/core/wl_data_device_manager.cpp
+9 −3 src/lib/fcitx-wayland/core/wl_data_offer.cpp
+18 −6 src/lib/fcitx-wayland/core/wl_data_source.cpp
+9 −3 src/lib/fcitx-wayland/core/wl_keyboard.cpp
+9 −3 src/lib/fcitx-wayland/core/wl_output.cpp
+21 −7 src/lib/fcitx-wayland/core/wl_pointer.cpp
+9 −3 src/lib/fcitx-wayland/core/wl_registry.cpp
+6 −2 src/lib/fcitx-wayland/core/wl_seat.cpp
+3 −1 src/lib/fcitx-wayland/core/wl_shell.cpp
+12 −4 src/lib/fcitx-wayland/core/wl_shell_surface.cpp
+6 −2 src/lib/fcitx-wayland/core/wl_shm.cpp
+18 −6 src/lib/fcitx-wayland/core/wl_touch.cpp
+3 −1 src/lib/fcitx-wayland/fractional-scale-v1/wp_fractional_scale_v1.cpp
+9 −3 src/lib/fcitx-wayland/input-method-v2/zwp_input_method_keyboard_grab_v2.cpp
+21 −7 src/lib/fcitx-wayland/input-method-v2/zwp_input_method_v2.cpp
+3 −1 src/lib/fcitx-wayland/input-method-v2/zwp_input_popup_surface_v2.cpp
+3 −1 src/lib/fcitx-wayland/input-method-v2/zwp_virtual_keyboard_manager_v1.cpp
+18 −6 src/lib/fcitx-wayland/input-method/zwp_input_method_context_v1.cpp
+3 −1 src/lib/fcitx-wayland/input-method/zwp_input_method_v1.cpp
+3 −1 src/lib/fcitx-wayland/input-method/zwp_input_panel_surface_v1.cpp
+3 −1 src/lib/fcitx-wayland/input-method/zwp_input_panel_v1.cpp
+48 −16 src/lib/fcitx-wayland/plasma-window-management/org_kde_plasma_window.cpp
+18 −6 src/lib/fcitx-wayland/plasma-window-management/org_kde_plasma_window_management.cpp
+12 −4 src/lib/fcitx-wayland/tablet-v2/zwp_tablet_pad_group_v2.cpp
+12 −4 src/lib/fcitx-wayland/tablet-v2/zwp_tablet_pad_ring_v2.cpp
+12 −4 src/lib/fcitx-wayland/tablet-v2/zwp_tablet_pad_strip_v2.cpp
+15 −5 src/lib/fcitx-wayland/tablet-v2/zwp_tablet_pad_v2.cpp
+54 −18 src/lib/fcitx-wayland/tablet-v2/zwp_tablet_tool_v2.cpp
+15 −5 src/lib/fcitx-wayland/tablet-v2/zwp_tablet_v2.cpp
+3 −1 src/lib/fcitx-wayland/wlr-data-control/zwlr_data_control_device_v1.cpp
+3 −1 src/lib/fcitx-wayland/wlr-data-control/zwlr_data_control_offer_v1.cpp
+6 −2 src/lib/fcitx-wayland/wlr-data-control/zwlr_data_control_source_v1.cpp
+15 −5 src/lib/fcitx-wayland/wlr-foreign-toplevel-management-unstable-v1/zwlr_foreign_toplevel_handle_v1.cpp
+6 −2 src/lib/fcitx-wayland/wlr-foreign-toplevel-management-unstable-v1/zwlr_foreign_toplevel_manager_v1.cpp
+3 −4 src/lib/fcitx/addoninstance.h
+10 −3 src/lib/fcitx/globalconfig.cpp
+16 −0 src/lib/fcitx/icontheme.cpp
+2 −1 src/lib/fcitx/instance.cpp
+21 −9 src/lib/fcitx/misc_p.h
+2 −3 src/lib/fcitx/surroundingtext.h
+2 −1 src/modules/notificationitem/dbusmenu.cpp
+12 −8 src/modules/notificationitem/notificationitem.cpp
+41 −6 src/modules/quickphrase/quickphrase.cpp
+4 −0 src/modules/quickphrase/quickphrase.h
+10 −0 src/modules/quickphrase/quickphrase_public.h
+29 −9 src/modules/wayland/waylandmodule.cpp
+1 −1 src/modules/wayland/waylandmodule.h
+2 −0 test/CMakeLists.txt
+2 −1 test/testinstance.cpp
+2 −4 test/testlibrary.cpp
+24 −0 test/testquickphrase.cpp
+10 −4 test/testxim.cpp
+1 −0 testing/testfrontend/testfrontend_public.h
116 changes: 52 additions & 64 deletions patches/fcitx5.patch
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d3ab20d4..4b63da23 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -116,7 +116,7 @@ endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "BSD|DragonFly")
find_package(LibKVM REQUIRED)
endif()
-find_package(DL REQUIRED)
+# find_package(DL REQUIRED)

if (NOT TARGET LibIntl::LibIntl)
find_package(LibIntl REQUIRED)
diff --git a/src/lib/fcitx-utils/CMakeLists.txt b/src/lib/fcitx-utils/CMakeLists.txt
index 9eb64046..a6122746 100644
index 9eb64046..5050e5d5 100644
--- a/src/lib/fcitx-utils/CMakeLists.txt
+++ b/src/lib/fcitx-utils/CMakeLists.txt
@@ -38,13 +38,13 @@ endif()
@@ -38,7 +38,7 @@ endif()

list(APPEND FCITX_UTILS_SOURCES
stringutils.cpp
Expand All @@ -24,22 +11,6 @@ index 9eb64046..a6122746 100644
key.cpp
cutf8.cpp
color.cpp
i18nstring.cpp
eventdispatcher.cpp
- library.cpp
+ # library.cpp
fs.cpp
standardpath.cpp
unixfd.cpp
@@ -129,7 +129,7 @@ target_include_directories(Fcitx5Utils PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/..>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_FULL_INCLUDEDIR}/Fcitx5/Utils>)
-target_link_libraries(Fcitx5Utils PRIVATE DL::DL LibIntl::LibIntl Pthread::Pthread ${FMT_TARGET})
+target_link_libraries(Fcitx5Utils PRIVATE LibIntl::LibIntl Pthread::Pthread ${FMT_TARGET})
if(LIBKVM_FOUND)
target_link_libraries(Fcitx5Utils PRIVATE LibKVM::LibKVM)
endif()
diff --git a/src/lib/fcitx-utils/endian_p.h b/src/lib/fcitx-utils/endian_p.h
index 332043b8..15b349f3 100644
--- a/src/lib/fcitx-utils/endian_p.h
Expand Down Expand Up @@ -189,6 +160,56 @@ index da9dfdd6..3d78a18b 100644
namespace fcitx {
const std::string &I18NString::match(const std::string &locale_) const {
std::string locale = locale_;
diff --git a/src/lib/fcitx-utils/library.cpp b/src/lib/fcitx-utils/library.cpp
index 4dbe80c3..4474436f 100644
--- a/src/lib/fcitx-utils/library.cpp
+++ b/src/lib/fcitx-utils/library.cpp
@@ -8,7 +8,9 @@
#include "library.h"
#include <dlfcn.h>
#include <fcntl.h>
+#ifndef _WIN32
#include <sys/mman.h>
+#endif
#include <sys/stat.h>
#include <unistd.h>
#include <cerrno>
@@ -62,9 +64,11 @@ bool Library::load(Flags<fcitx::LibraryLoadHint> hint) {
flag |= RTLD_LAZY;
}

+#ifndef _WIN32
if (hint & LibraryLoadHint::PreventUnloadHint) {
flag |= RTLD_NODELETE;
}
+#endif

if (hint & LibraryLoadHint::ExportExternalSymbolsHint) {
flag |= RTLD_GLOBAL;
@@ -143,7 +147,11 @@ bool Library::findData(const char *slug, const char *magic, size_t lenOfMagic,
}
void *needunmap = nullptr;
void *data = needunmap =
+#ifdef _WIN32
+ nullptr;
+#else
mmap(nullptr, statbuf.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
+#endif
if (!data) {
data = malloc(statbuf.st_size);
needfree.reset(data);
@@ -163,9 +171,11 @@ bool Library::findData(const char *slug, const char *magic, size_t lenOfMagic,
parser(pos);
}
result = true;
+#ifndef _WIN32
if (needunmap) {
munmap(needunmap, statbuf.st_size);
}
+#endif
} while (false);

close(fd);
diff --git a/src/lib/fcitx-utils/misc.cpp b/src/lib/fcitx-utils/misc.cpp
index ef5eb415..b356550d 100644
--- a/src/lib/fcitx-utils/misc.cpp
Expand Down Expand Up @@ -352,39 +373,6 @@ index 927d1676..6ce9b0f4 100644
inputmethodengine.cpp
)

diff --git a/src/lib/fcitx/addonloader.cpp b/src/lib/fcitx/addonloader.cpp
index a069b6a1..2991a4bf 100644
--- a/src/lib/fcitx/addonloader.cpp
+++ b/src/lib/fcitx/addonloader.cpp
@@ -24,6 +24,7 @@ namespace fcitx {

AddonLoader::~AddonLoader() {}

+/*
SharedLibraryLoader::~SharedLibraryLoader() {}

AddonInstance *SharedLibraryLoader::load(const AddonInfo &info,
@@ -99,6 +100,7 @@ AddonInstance *SharedLibraryLoader::load(const AddonInfo &info,
}
return nullptr;
}
+*/

StaticLibraryLoader::StaticLibraryLoader(StaticAddonRegistry *registry_)
: registry(registry_) {}
diff --git a/src/lib/fcitx/addonmanager.cpp b/src/lib/fcitx/addonmanager.cpp
index 55269f33..6e6e1b88 100644
--- a/src/lib/fcitx/addonmanager.cpp
+++ b/src/lib/fcitx/addonmanager.cpp
@@ -250,7 +250,7 @@ void AddonManager::unregisterLoader(const std::string &name) {
}

void AddonManager::registerDefaultLoader(StaticAddonRegistry *registry) {
- registerLoader(std::make_unique<SharedLibraryLoader>());
+ // registerLoader(std::make_unique<SharedLibraryLoader>());
if (registry) {
registerLoader(std::make_unique<StaticLibraryLoader>(registry));
}
diff --git a/src/lib/fcitx/instance.cpp b/src/lib/fcitx/instance.cpp
index de27cd9b..d3e9c3f9 100644
--- a/src/lib/fcitx/instance.cpp
Expand Down
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
add_executable(Fcitx5 main.cpp)
target_link_libraries(Fcitx5 Fcitx5::Core)

install(TARGETS Fcitx5 DESTINATION "${FCITX_INSTALL_BINDIR}")

0 comments on commit 4897853

Please sign in to comment.