-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix QuaZip find module on macOS and clean up code. #3088
Conversation
880575f
to
39b1835
Compare
cmake/FindQuaZip.cmake
Outdated
# in cache already | ||
SET(QUAZIP_FOUND TRUE) | ||
else() | ||
if(Qt5Core_FOUND AND NOT APPLE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AND NOT APPLE
is not quite correct. quazip from Homebrew has libquazip.dylib
and quazip/quazip.h
as it's built with qmake, while quazip from MacPorts has libquazip5.dylib
and quazip5/quazip.h
as it's built with cmake. The difference between qmake/cmake is a upstream issue - stachenov/quazip#28. Before the upstream issue is fixed, I suggest FindQuaZip.cmake
in keepassxc should be able to find both libquazip.dylib
and libquazip5.dylib
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not officially support building with Macports, but I do agree on this. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for considering my suggestion! Here's a patch on top of the hotfix/quazip-macos
branch that allows building KeePassXC with quazip from MacPorts:
diff --git a/cmake/FindQuaZip.cmake b/cmake/FindQuaZip.cmake
index 66285fce..bd8fda1a 100644
--- a/cmake/FindQuaZip.cmake
+++ b/cmake/FindQuaZip.cmake
@@ -8,7 +8,7 @@ if(QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES)
# in cache already
SET(QUAZIP_FOUND TRUE)
else()
- if(Qt5Core_FOUND AND NOT APPLE)
+ if(Qt5Core_FOUND)
set(QUAZIP_LIB_VERSION_SUFFIX 5)
endif()
if(WIN32)
@@ -21,12 +21,12 @@ else()
find_path(QUAZIP_ZLIB_INCLUDE_DIR NAMES zlib.h)
else()
find_library(QUAZIP_LIBRARIES
- NAMES quazip${QUAZIP_LIB_VERSION_SUFFIX}
+ NAMES quazip quazip${QUAZIP_LIB_VERSION_SUFFIX}
HINTS /usr/lib /usr/lib64 /usr/local/lib
)
find_path(QUAZIP_INCLUDE_DIR quazip.h
HINTS /usr/include /usr/local/include
- PATH_SUFFIXES quazip${QUAZIP_LIB_VERSION_SUFFIX}
+ PATH_SUFFIXES quazip quazip${QUAZIP_LIB_VERSION_SUFFIX}
)
find_path(QUAZIP_ZLIB_INCLUDE_DIR zlib.h HINTS /usr/include /usr/local/include)
endif()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I submitted a different version, though, that also simplifies some other things.
Finding libquazip failed on macOS due to path differences. This patch also cleans up the find module's code, aligns it with the coding style of the other CMake files and removes clutter that is not needed for KeePassXC such as non-Msys builds on Windows.
39b1835
to
7f686d2
Compare
The updated |
- Improve resilience against memory attacks - overwrite memory before free [#3020] - Prevent infinite save loop when location is unavailable [#3026] - Attempt to fix quitting application when shutdown or logout issued [#3199] - Support merging database custom data [#3002] - Fix opening URL's with non-http schemes [#3153] - Fix data loss due to not reading all database attachments if duplicates exist [#3180] - Fix entry context menu disabling when using keyboard navigation [#3199] - Fix behaviors when canceling an entry edit [#3199] - Fix processing of tray icon click and doubleclick [#3112] - Update group in preview widget when focused [#3199] - Prefer DuckDuckGo service over direct icon download (increases resolution) [#2996] - Remove apply button in application settings [#3019] - Use winqtdeploy on Windows to correct deployment issues [#3025] - Don't mark entry edit as modified when attribute selection changes [#3041] - Use console code page CP_UTF8 on Windows if supported [#3050] - Snap: Fix locking database with session lock [#3046] - Snap: Fix theming across Linux distributions [#3057] - Snap: Use SNAP_USER_COMMON and SNAP_USER_DATA directories [#3131] - KeeShare: Automatically enable WITH_XC_KEESHARE_SECURE if quazip is found [#3088] - macOS: Fix toolbar text when in dark mode [#2998] - macOS: Lock database on switching user [#3097] - macOS: Fix global Auto-Type when the database is locked [#3138] - Browser: Close popups when database is locked [#3093] - Browser: Add tests [#3016] - Browser: Don't create default group if custom group is enabled [#3127]
Type of change
Description and Context
Finding libquazip failed on macOS due to path differences.
This patch also cleans up the find module's code, aligns it with the coding style of the other CMake files and removes clutter that is not needed for KeePassXC such as non-Msys builds on Windows.
Testing Strategy:
CMake found QuaZip on macOS, Windows and Ubuntu.
KeeShare signature panel was available on macOS after compilation.
Checklist:
-DWITH_ASAN=ON
. [REQUIRED]