On Sat Mar 26, 2022 at 10:10:16AM +0100, ~Ricardo wrote: > Hey ports@ > > I have been improving my porting knowledge by updating python ports, go ports > and simple C ports. I learned a lot from the FAQ, bcallah@'s workshop and all > the knowledge sthen@, kmos@, ajacoutot@ share on this mailing list every now > and then. > After seeing keepassxc outdated on portroach, this seemed to be a good > opportunity to play with it. > > So, after a few coffees and a headache, I believe that I have a working .diff. > I faced a few issues and this was my approach: > > make makesum [OK] > make extract [OK] > make configure [NOK -> OK] > > | ERR | sed: core/ScreenLockListenerPrivate.cpp: No such file or > directory > | FIX | file removed from post-patch directive > > [ERR] CMake Error at > /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 > (message): > Could NOT find Botan2 (missing: BOTAN2_LIBRARY > BOTAN2_INCLUDE_DIR) > Call Stack (most recent call first): > > /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 > (_FPHSA_FAILURE_MESSAGE) > cmake/FindBotan2.cmake:76 (find_package_handle_standard_args) > CMakeLists.txt:493 (find_package) > | ERR |CMake Error at > /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 > (message): > Could NOT find Minizip (missing: MINIZIP_LIBRARIES > MINIZIP_INCLUDE_DIR) > Call Stack (most recent call first): > > /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 > (_FPHSA_FAILURE_MESSAGE) > cmake/FindMinizip.cmake:9 (find_package_handle_standard_args) > src/keeshare/CMakeLists.txt:16 (find_package) > | FIX | minizip and botan2 added to WANTED_LIBS and LIB_DEPENDS > > make build [NOK -> OK] > > | ERR | FAILED: src/keeshare/CMakeFiles/keeshare.dir/ShareExport.cpp.o > /usr/ports/pobj/keepassxc-2.7.0/bin/c++ -DQT_CORE_LIB -DQT_GUI_LIB > -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_DEPRECATED_WARNINGS > -DQT_NO_EXCEPTIONS -DQT_STRICT_ITERATORS -DQT_WIDGETS_LIB > -DWITH_APP_BUNDLE -Isrc/keeshare/keeshare_autogen/include > -I/usr/ports/pobj/keepassxc-2.7.0/keepassxc-2.7.0/src -Isrc > -I/usr/ports/pobj/keepassxc-2.7.0/keepassxc-2.7.0/src/zxcvbn > -I/usr/ports/pobj/keepassxc-2.7.0/keepassxc-2.7.0/src/keeshare -Isrc/keeshare > -isystem /usr/local/include/botan-2 -isystem /usr/local/include -isystem > /usr/local/include/minizip -isystem /usr/local/include/X11/qt5 -isystem > /usr/local/include/X11/qt5/QtCore -isystem > /usr/local/lib/qt5/./mkspecs/openbsd-clang -isystem > /usr/local/include/X11/qt5/QtWidgets -isystem > /usr/local/include/X11/qt5/QtGui -isystem /usr/X11R6/include -O2 -pipe > -fno-common -Wall -Wextra -Wundef -Wpointer-arith -Wno-long-long -Wformat=2 > -Wmissing-format-attribute -fvisibility=hidden -fvisibility-inlines-hidden > -fstack-protector-strong -Wnon-virtual-dtor -Wold-style-cast > -Woverloaded-virtual -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 > -Werror=format-security -Wcast-align -Qunused-arguments -fsized-deallocation > -Wno-deprecated-declarations -DNDEBUG -fPIC -fPIC -std=gnu++17 -MD -MT > src/keeshare/CMakeFiles/keeshare.dir/ShareExport.cpp.o -MF > src/keeshare/CMakeFiles/keeshare.dir/ShareExport.cpp.o.d -o > src/keeshare/CMakeFiles/keeshare.dir/ShareExport.cpp.o -c > /usr/ports/pobj/keepassxc-2.7.0/keepassxc-2.7.0/src/keeshare/ShareExport.cpp > /usr/ports/pobj/keepassxc-2.7.0/keepassxc-2.7.0/src/keeshare/ShareExport.cpp:120:31: > error: use of undeclared identifier 'Z_BEST_COMPRESSION' > Z_BEST_COMPRESSION, > ^ > 1 error generated. > > | FIX | #include <zlib.h> added to src/keeshare/ShareExport.cpp (patch > created) > > | ERR |FAILED: src/keeshare/CMakeFiles/keeshare.dir/ShareExport.cpp.o > /usr/ports/pobj/keepassxc-2.7.0/bin/c++ -DQT_CORE_LIB -DQT_GUI_LIB > -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_DEPRECATED_WARNINGS > -DQT_NO_EXCEPTIONS -DQT_STRICT_ITERATORS -DQT_WIDGETS_LIB -DWITH_APP_BUNDLE > -Isrc/keeshare/keeshare_autogen/include > -I/usr/ports/pobj/keepassxc-2.7.0/keepassxc-2.7.0/src -Isrc > -I/usr/ports/pobj/keepassxc-2.7.0/keepassxc-2.7.0/src/zxcvbn > -I/usr/ports/pobj/keepassxc-2.7.0/keepassxc-2.7.0/src/keeshare -Isrc/keeshare > -isystem /usr/local/include/botan-2 -isystem /usr/local/include -isystem > /usr/local/include/minizip -isystem /usr/local/include/X11/qt5 -isystem > /usr/local/include/X11/qt5/QtCore -isystem > /usr/local/lib/qt5/./mkspecs/openbsd-clang -isystem > /usr/local/include/X11/qt5/QtWidgets -isystem > /usr/local/include/X11/qt5/QtGui -isystem /usr/X11R6/include -O2 -pipe > -fno-common -Wall -Wextra -Wundef -Wpointer-arith -Wno-long-long -Wformat=2 > -Wmissing-format-attribute -fvisibility=hidden -fvisibility-inlines-hidden > -fstack-protector-strong -Wnon-virtual-dtor -Wold-style-cast > -Woverloaded-virtual -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 > -Werror=format-security -Wcast-align -Qunused-arguments -fsized-deallocation > -Wno-deprecated-declarations -DNDEBUG -fPIC -fPIC -std=gnu++17 -MD -MT > src/keeshare/CMakeFiles/keeshare.dir/ShareExport.cpp.o -MF > src/keeshare/CMakeFiles/keeshare.dir/ShareExport.cpp.o.d -o > src/keeshare/CMakeFiles/keeshare.dir/ShareExport.cpp.o -c > /usr/ports/pobj/keepassxc-2.7.0/keepassxc-2.7.0/src/keeshare/ShareExport.cpp > /usr/ports/pobj/keepassxc-2.7.0/keepassxc-2.7.0/src/keeshare/ShareExport.cpp:112:9: > error: use of undeclared identifier 'zipOpenNewFileInZip64'; did you mean > 'zipOpenNewFileInZip_64'? > zipOpenNewFileInZip64(zf, > ^~~~~~~~~~~~~~~~~~~~~ > zipOpenNewFileInZip_64 > /usr/local/include/minizip/mz_compat.h:177:17: note: 'zipOpenNewFileInZip_64' > declared here > ZEXPORT int zipOpenNewFileInZip_64(zipFile file, const char *filename, > const zip_fileinfo *zipfi, > ^ > 1 error generated. > > | FIX | zipOpenNewFileInZip64 replaced with zipOpenNewFileInZip_64)on > src/keeshare/ShareExport.cpp (patch created) > > make test [NOK] > > 90% tests passed, 4 tests failed out of 39 > Total Test time (real) = 74.52 sec > > The following tests FAILED: > 36 - testcli (Subprocess aborted) > 37 - testgui (Subprocess aborted) > 38 - testguipixmaps (Subprocess aborted) > 39 - testguifdosecrets (Failed) > > make fake [OK] > make update-plist [OK} > make package [OK} > make port-lib-depends-check [OK] > make install|deinstall [OK] > > > I tested almost every feature/option except with yubikey module on amd64 and > didn't face any issue, but more eyes would be appreciated. > Any feedback? This works but I'm not sure if this is the best approach or if > needs some tweaks. > > CC maintainer (rsadowski@) > > Obrigado e boa semana. > ~Ricardo >
Thanks Ricardo for your work here. It doesn't look bad. A few small flaws here and there but Josh Grosse has described them well. Here is my work, tested with yubikey and browser plugin as well with password based KDBX dbs. Thank you for your work here, it has made things easier for me. Other tests, feedback? Rafael diff --git a/security/keepassxc/Makefile b/security/keepassxc/Makefile index c3523af26d2..01dbb7b9c1b 100644 --- a/security/keepassxc/Makefile +++ b/security/keepassxc/Makefile @@ -1,6 +1,6 @@ COMMENT = management tool for password and sensitive data -V = 2.6.6 +V = 2.7.0 DISTNAME = keepassxc-${V} CATEGORIES = security @@ -13,9 +13,8 @@ MAINTAINER = Rafael Sadowski <rsadow...@openbsd.org> PERMIT_PACKAGE = Yes WANTLIB += ${COMPILER_LIBCXX} Qt5Concurrent Qt5Core Qt5DBus Qt5Gui -WANTLIB += Qt5Network Qt5Svg Qt5Widgets Qt5X11Extras X11 Xi Xtst -WANTLIB += argon2 c gcrypt gpg-error m qrencode quazip5 readline -WANTLIB += sodium z +WANTLIB += Qt5Network Qt5Svg Qt5Widgets Qt5X11Extras X11 Xtst +WANTLIB += argon2 botan-2 c m minizip qrencode readline z MASTER_SITES = \ https://github.com/keepassxreboot/keepassxc/releases/download/${V}/ @@ -24,10 +23,9 @@ EXTRACT_SUFX = -src.tar.xz MODULES = x11/qt5 \ devel/cmake -LIB_DEPENDS = archivers/quazip \ - security/libgcrypt \ - security/libsodium \ +LIB_DEPENDS = archivers/minizip \ security/argon2 \ + security/botan2 \ graphics/libqrencode \ x11/qt5/qtsvg \ x11/qt5/qtx11extras # needed for auto-type @@ -52,10 +50,11 @@ FLAVORS = browser yubikey FLAVOR ?= .if ${FLAVOR:Myubikey} -LIB_DEPENDS += security/yubico/yubico-c \ +LIB_DEPENDS += devel/libusb1 \ + security/yubico/yubico-c \ security/yubico/yubikey-personalization CONFIGURE_ARGS += -DWITH_XC_YUBIKEY=ON -WANTLIB += yubikey ykpers-1 +WANTLIB += yubikey ykpers-1 usb-1.0 .endif .if ${FLAVOR:Mbrowser} @@ -65,12 +64,13 @@ CONFIGURE_ARGS += -DWITH_XC_BROWSER=ON \ -DWITH_XC_NETWORKING=ON .endif +FIX_CRLF_FILES = src/keeshare/ShareExport.cpp + # ld: error: unable to find library -lX11 CONFIGURE_ARGS += -DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS} -L${X11BASE}/lib" post-patch: cd ${WRKSRC}/src/; sed -i -e 's/Q_OS_LINUX/Q_OS_UNIX/g' \ - core/ScreenLockListenerPrivate.cpp \ gui/MainWindow.cpp \ main.cpp \ browser/BrowserSettingsWidget.cpp \ diff --git a/security/keepassxc/distinfo b/security/keepassxc/distinfo index b3b13f3daf4..b9a04b17d52 100644 --- a/security/keepassxc/distinfo +++ b/security/keepassxc/distinfo @@ -1,2 +1,2 @@ -SHA256 (keepassxc-2.6.6-src.tar.xz) = NgOxGsObKJxH+sd/oVDgX9ZLOT2M/fVzLcPvEGZQpOI= -SIZE (keepassxc-2.6.6-src.tar.xz) = 7640532 +SHA256 (keepassxc-2.7.0-src.tar.xz) = g752iQkEzWcDND+gl9aLz92Zu1Jc9Rj6YqffkpMCaqc= +SIZE (keepassxc-2.7.0-src.tar.xz) = 8846780 diff --git a/security/keepassxc/patches/patch-src_keeshare_ShareExport_cpp b/security/keepassxc/patches/patch-src_keeshare_ShareExport_cpp new file mode 100644 index 00000000000..3cba142a43d --- /dev/null +++ b/security/keepassxc/patches/patch-src_keeshare_ShareExport_cpp @@ -0,0 +1,22 @@ +Index: src/keeshare/ShareExport.cpp +--- src/keeshare/ShareExport.cpp.orig ++++ src/keeshare/ShareExport.cpp +@@ -27,7 +27,8 @@ + + #include <QBuffer> + #include <botan/pubkey.h> +-#include <zip.h> ++#include <minizip/zip.h> ++#include <zlib.h> + + namespace + { +@@ -108,7 +109,7 @@ namespace + + bool writeZipFile(void* zf, const QString& fileName, const QByteArray& data) + { +- zipOpenNewFileInZip64(zf, ++ zipOpenNewFileInZip_64(zf, + fileName.toLatin1().data(), + nullptr, + nullptr, diff --git a/security/keepassxc/pkg/PLIST b/security/keepassxc/pkg/PLIST index cfd22927893..1896a3c2876 100644 --- a/security/keepassxc/pkg/PLIST +++ b/security/keepassxc/pkg/PLIST @@ -2,7 +2,7 @@ @bin bin/keepassxc-cli %%browser%% lib/keepassxc/ -@so lib/keepassxc/libkeepassx-autotype-xcb.so +@so lib/keepassxc/libkeepassxc-autotype-xcb.so @man man/man1/keepassxc-cli.1 @man man/man1/keepassxc.1 share/applications/org.keepassxc.KeePassXC.desktop @@ -27,44 +27,45 @@ share/keepassxc/icons/application/256x256/ share/keepassxc/icons/application/256x256/apps/ share/keepassxc/icons/application/256x256/apps/keepassxc.png share/keepassxc/translations/ -share/keepassxc/translations/keepassx_ar.qm -share/keepassxc/translations/keepassx_bg.qm -share/keepassxc/translations/keepassx_ca.qm -share/keepassxc/translations/keepassx_cs.qm -share/keepassxc/translations/keepassx_da.qm -share/keepassxc/translations/keepassx_de.qm -share/keepassxc/translations/keepassx_el.qm -share/keepassxc/translations/keepassx_en.qm -share/keepassxc/translations/keepassx_en_GB.qm -share/keepassxc/translations/keepassx_en_US.qm -share/keepassxc/translations/keepassx_es.qm -share/keepassxc/translations/keepassx_et.qm -share/keepassxc/translations/keepassx_fi.qm -share/keepassxc/translations/keepassx_fr.qm -share/keepassxc/translations/keepassx_fr_CA.qm -share/keepassxc/translations/keepassx_hr_HR.qm -share/keepassxc/translations/keepassx_hu.qm -share/keepassxc/translations/keepassx_id.qm -share/keepassxc/translations/keepassx_it.qm -share/keepassxc/translations/keepassx_ja.qm -share/keepassxc/translations/keepassx_ko.qm -share/keepassxc/translations/keepassx_lt.qm -share/keepassxc/translations/keepassx_nb.qm -share/keepassxc/translations/keepassx_nl_NL.qm -share/keepassxc/translations/keepassx_pl.qm -share/keepassxc/translations/keepassx_pt_BR.qm -share/keepassxc/translations/keepassx_pt_PT.qm -share/keepassxc/translations/keepassx_ro.qm -share/keepassxc/translations/keepassx_ru.qm -share/keepassxc/translations/keepassx_sk.qm -share/keepassxc/translations/keepassx_sl_SI.qm -share/keepassxc/translations/keepassx_sr.qm -share/keepassxc/translations/keepassx_sv.qm -share/keepassxc/translations/keepassx_th.qm -share/keepassxc/translations/keepassx_tr.qm -share/keepassxc/translations/keepassx_uk.qm -share/keepassxc/translations/keepassx_zh_CN.qm -share/keepassxc/translations/keepassx_zh_TW.qm +share/keepassxc/translations/keepassxc_ar.qm +share/keepassxc/translations/keepassxc_bg.qm +share/keepassxc/translations/keepassxc_ca.qm +share/keepassxc/translations/keepassxc_cs.qm +share/keepassxc/translations/keepassxc_da.qm +share/keepassxc/translations/keepassxc_de.qm +share/keepassxc/translations/keepassxc_el.qm +share/keepassxc/translations/keepassxc_en.qm +share/keepassxc/translations/keepassxc_en_GB.qm +share/keepassxc/translations/keepassxc_en_US.qm +share/keepassxc/translations/keepassxc_es.qm +share/keepassxc/translations/keepassxc_et.qm +share/keepassxc/translations/keepassxc_fi.qm +share/keepassxc/translations/keepassxc_fr.qm +share/keepassxc/translations/keepassxc_fr_CA.qm +share/keepassxc/translations/keepassxc_he.qm +share/keepassxc/translations/keepassxc_hr.qm +share/keepassxc/translations/keepassxc_hu.qm +share/keepassxc/translations/keepassxc_id.qm +share/keepassxc/translations/keepassxc_it.qm +share/keepassxc/translations/keepassxc_ja.qm +share/keepassxc/translations/keepassxc_ko.qm +share/keepassxc/translations/keepassxc_my.qm +share/keepassxc/translations/keepassxc_nb.qm +share/keepassxc/translations/keepassxc_nl.qm +share/keepassxc/translations/keepassxc_pl.qm +share/keepassxc/translations/keepassxc_pt_BR.qm +share/keepassxc/translations/keepassxc_pt_PT.qm +share/keepassxc/translations/keepassxc_ro.qm +share/keepassxc/translations/keepassxc_ru.qm +share/keepassxc/translations/keepassxc_sk.qm +share/keepassxc/translations/keepassxc_sl.qm +share/keepassxc/translations/keepassxc_sr.qm +share/keepassxc/translations/keepassxc_sv.qm +share/keepassxc/translations/keepassxc_th.qm +share/keepassxc/translations/keepassxc_tr.qm +share/keepassxc/translations/keepassxc_uk.qm +share/keepassxc/translations/keepassxc_zh_CN.qm +share/keepassxc/translations/keepassxc_zh_TW.qm share/keepassxc/wordlists/ share/keepassxc/wordlists/eff_large.wordlist share/metainfo/