From c609ce07211c6129a5f8b87ec1b26616f4715af0 Mon Sep 17 00:00:00 2001 From: Keeyou Date: Sat, 15 Jun 2024 10:44:47 +0800 Subject: [PATCH] net-proxy/yass: add 1.11.2, drop 1.11.1-r1 Signed-off-by: Keeyou --- net-proxy/yass/Manifest | 2 +- net-proxy/yass/files/build-qt5.patch | 189 --------------------- .../{yass-1.11.1-r1.ebuild => yass-1.11.2.ebuild} | 4 - 3 files changed, 1 insertion(+), 194 deletions(-) delete mode 100644 net-proxy/yass/files/build-qt5.patch rename net-proxy/yass/{yass-1.11.1-r1.ebuild => yass-1.11.2.ebuild} (98%) diff --git a/net-proxy/yass/Manifest b/net-proxy/yass/Manifest index f6ef485d0..1ccb39574 100644 --- a/net-proxy/yass/Manifest +++ b/net-proxy/yass/Manifest @@ -1,2 +1,2 @@ DIST yass-1.10.6.tar.bz2 76068260 BLAKE2B 0a6e193bff03ea593040bce7c893d9e788cdf68f8c6f4814e0f1611ebfb1ab3456b119a3bc60b66b812bdc2d3e08f8861951adce6261d9e0f3237f2ede6f3dbf SHA512 af255a1260d75657d419e5c64756ea282790db7dcf447db6d0f797b480f6b272709ce04caff9054400b02a770704c6b224a0cd3628899b0e89ccc3cf0011a32c -DIST yass-1.11.1.tar.bz2 76441272 BLAKE2B ab6b8aa2f8847ca36f69adade92544235accf99ad473f06742fceef5f07dd67314119b477ffa46f7f6fd829c858b98bdbd53cc32acb9e7049de41cec192ee8b7 SHA512 d5cf6e9b7c27524c8f7799557985296fb4b87620c5a8863a93b2a940d2608c5e185a3a67b178e2e0e8dcc6773600e5ebd1aa205f95f72bf357006eb9ff21410a +DIST yass-1.11.2.tar.bz2 76461345 BLAKE2B 2f76b8e497e7c6786eb919edb622564fd66d55771d1bdacafb2a9cf552203855eaaa83ae6bc06477f80fa9764005de5e29fd9df3c609191ce60f96ef70f535c2 SHA512 c634599df683bc0d0169472e2e6d246847c8221d799b89cca97c157b644779152ed08c85339abfe23ba3eef6e793e37264613ddd99bcc95ab20e0638c2b1c684 diff --git a/net-proxy/yass/files/build-qt5.patch b/net-proxy/yass/files/build-qt5.patch deleted file mode 100644 index f26c8426f..000000000 --- a/net-proxy/yass/files/build-qt5.patch +++ /dev/null @@ -1,189 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 56e46299..e4af455c 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -504,9 +504,13 @@ cmake_dependent_option(USE_QT6 - "Build with Qt6 (GUI)" OFF - "GUI AND NOT WIN32 AND NOT APPLE AND NOT OHOS AND NOT ANDROID" OFF) - -+cmake_dependent_option(USE_QT5 -+ "Build with qt5 (GUI)" OFF -+ "GUI AND NOT USE_QT6 AND NOT WIN32 AND NOT APPLE AND NOT OHOS AND NOT ANDROID" OFF) -+ - cmake_dependent_option(USE_GTK4 - "Build with gtk4 (GUI)" OFF -- "GUI AND NOT USE_QT6 AND NOT WIN32 AND NOT APPLE AND NOT OHOS AND NOT ANDROID" OFF) -+ "GUI AND NOT USE_QT6 AND NOT USE_QT5 AND NOT WIN32 AND NOT APPLE AND NOT OHOS AND NOT ANDROID" OFF) - - # Dynamic users are supported from version 235 - # see https://0pointer.net/blog/dynamic-users-with-systemd.html -@@ -2149,8 +2153,21 @@ elseif (GUI) - set(GUI_DEFINITIONS "") - set(GUI_C_CXX_FLAGS "") - set(GUI_LIBRARY_DIRS "") -- set(GUI_LIBRARIES Qt::Widgets Qt::Gui) -+ set(GUI_LIBRARIES Qt6::Widgets Qt6::Gui) - set(GUI_FLAVOUR "qt6") -+ elseif(USE_QT5) -+ find_package(Qt5 REQUIRED Core Widgets Gui) -+ set(GUI_USE_FILE "") -+ set(GUI_INCLUDE_DIRS "") -+ set(GUI_DEFINITIONS "") -+ set(GUI_C_CXX_FLAGS "") -+ set(GUI_LIBRARY_DIRS "") -+ set(GUI_LIBRARIES Qt5::Core Qt5::Widgets Qt5::Gui) -+ set(GUI_FLAVOUR "qt5") -+ # suppress some warnings on old qt5 < 5.9 -+ if (COMPILER_CLANG AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0) -+ set(GUI_C_CXX_FLAGS ${GUI_C_CXX_FLAGS} -Wno-error=enum-constexpr-conversion) -+ endif() - else() - pkg_check_modules(FONTCONFIG fontconfig) - if (NOT FONTCONFIG_FOUND) -@@ -4635,6 +4652,23 @@ if (GUI) - src/freedesktop/utils.cpp - ${CMAKE_CURRENT_BINARY_DIR}/yass.qrc - ) -+ elseif(GUI_FLAVOUR STREQUAL "qt5") -+ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/src/qt6/yass.qrc -+ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) -+ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/src/freedesktop/yass.png -+ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/images) -+ list(APPEND SRC_FILES -+ src/qt6/yass_window.hpp -+ src/qt6/yass_window.cpp -+ src/qt6/yass.hpp -+ src/qt6/yass.cpp -+ src/qt6/option_dialog.hpp -+ src/qt6/option_dialog.cpp -+ src/qt6/tray_icon.hpp -+ src/qt6/tray_icon.cpp -+ src/freedesktop/utils.cpp -+ ${CMAKE_CURRENT_BINARY_DIR}/yass.qrc -+ ) - elseif(GUI_FLAVOUR STREQUAL "gtk3") - list(APPEND SRC_FILES - src/gtk/yass.cpp -@@ -4695,7 +4729,7 @@ if (GUI) - target_link_libraries(${APP_NAME} PRIVATE tun2proxy) - set_target_properties(${APP_NAME} PROPERTIES - LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/harmony/export.lds -u RegisterEntryModule") -- elseif(GUI_FLAVOUR STREQUAL "qt6") -+ elseif(GUI_FLAVOUR STREQUAL "qt6" OR GUI_FLAVOUR STREQUAL "qt5") - add_executable(${APP_NAME} - ${SRC_FILES} - ${GUI_USE_FILE} -@@ -4706,14 +4740,14 @@ if (GUI) - # Depends on Qt's LinguistTools - get_target_property(QT_LUPDATE_EXECUTABLE Qt::lupdate IMPORTED_LOCATION) - add_custom_target(update-ts -- COMMAND ${QT_LUPDATE_EXECUTABLE} -extensions cc,cpp,hpp -- -locations none -- -I "${CMAKE_CURRENT_SOURCE_DIR}/src" -- "${CMAKE_CURRENT_SOURCE_DIR}/src/qt6" -- -ts ${TS_FILES} -- WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/qt6" -- VERBATIM -- COMMAND_EXPAND_LISTS) -+ COMMAND ${QT_LUPDATE_EXECUTABLE} -extensions cc,cpp,hpp -+ -locations none -+ -I "${CMAKE_CURRENT_SOURCE_DIR}/src" -+ "${CMAKE_CURRENT_SOURCE_DIR}/src/qt6" -+ -ts ${TS_FILES} -+ WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/qt6" -+ VERBATIM -+ COMMAND_EXPAND_LISTS) - # Based on https://gist.github.com/giraldeau/546ba5512a74dfe9d8ea0862d66db412 - set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/src/qt6/lang") - qt_add_translation(QM_FILES ${TS_FILES} OPTIONS -removeidentical -silent) -@@ -4761,7 +4795,7 @@ if (GUI) - elseif(GUI_FLAVOUR STREQUAL "ios") - target_include_directories(${APP_NAME} PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/src/ios) -- elseif(GUI_FLAVOUR STREQUAL "qt6") -+ elseif(GUI_FLAVOUR STREQUAL "qt6" OR GUI_FLAVOUR STREQUAL "qt5") - target_include_directories(${APP_NAME} PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/src/qt6) - set_target_properties( -@@ -5085,7 +5119,7 @@ if (GUI) - install(TARGETS ${APP_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - endif() - -- if (GUI_FLAVOUR STREQUAL "qt6" OR GUI_FLAVOUR STREQUAL "gtk3" OR GUI_FLAVOUR STREQUAL "gtk4") -+ if (GUI_FLAVOUR STREQUAL "qt6" OR GUI_FLAVOUR STREQUAL "qt5" OR GUI_FLAVOUR STREQUAL "gtk3" OR GUI_FLAVOUR STREQUAL "gtk4") - install(FILES - ${CMAKE_CURRENT_SOURCE_DIR}/src/freedesktop/it.gui.yass.desktop - DESTINATION share/applications) -diff --git a/src/qt6/option_dialog.cpp b/src/qt6/option_dialog.cpp -index 1a723bc3..5727b573 100644 ---- a/src/qt6/option_dialog.cpp -+++ b/src/qt6/option_dialog.cpp -@@ -78,11 +78,13 @@ void OptionDialog::OnCancelButtonClicked() { - void OptionDialog::LoadChanges() { - tcp_keep_alive_->setChecked(absl::GetFlag(FLAGS_tcp_keep_alive)); - auto tcp_keep_alive_cnt_str = std::to_string(absl::GetFlag(FLAGS_tcp_keep_alive_cnt)); -- tcp_keep_alive_cnt_->setText(QString::fromUtf8(tcp_keep_alive_cnt_str)); -+ tcp_keep_alive_cnt_->setText(QString::fromUtf8(tcp_keep_alive_cnt_str.c_str(), tcp_keep_alive_cnt_str.size())); - auto tcp_keep_alive_idle_timeout_str = std::to_string(absl::GetFlag(FLAGS_tcp_keep_alive_idle_timeout)); -- tcp_keep_alive_idle_timeout_->setText(QString::fromUtf8(tcp_keep_alive_idle_timeout_str)); -+ tcp_keep_alive_idle_timeout_->setText( -+ QString::fromUtf8(tcp_keep_alive_idle_timeout_str.c_str(), tcp_keep_alive_idle_timeout_str.size())); - auto tcp_keep_alive_interval_str = std::to_string(absl::GetFlag(FLAGS_tcp_keep_alive_interval)); -- tcp_keep_alive_interval_->setText(QString::fromUtf8(tcp_keep_alive_interval_str)); -+ tcp_keep_alive_interval_->setText( -+ QString::fromUtf8(tcp_keep_alive_interval_str.c_str(), tcp_keep_alive_interval_str.size())); - - enable_post_quantum_kyber_->setChecked(absl::GetFlag(FLAGS_enable_post_quantum_kyber)); - } -diff --git a/src/qt6/yass.cpp b/src/qt6/yass.cpp -index 613c5204..cfcdbe9d 100644 ---- a/src/qt6/yass.cpp -+++ b/src/qt6/yass.cpp -@@ -101,7 +101,9 @@ YASSApp::YASSApp(int& argc, char** argv) : QApplication(argc, argv) { - bool YASSApp::Init() { - setApplicationVersion(YASS_APP_TAG); - setWindowIcon(QIcon::fromTheme("yass", QIcon(":/res/images/yass.png"))); -+#if (QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)) - setDesktopFileName("it.gui.yass"); -+#endif - - QObject::connect(this, &QCoreApplication::aboutToQuit, this, &YASSApp::OnQuit); - -@@ -113,7 +115,11 @@ bool YASSApp::Init() { - #if defined(_WIN32) - (void)qt_translator_->load("qt_" + locale.name()); - #else -+#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) - (void)qt_translator_->load("qt_" + locale.name(), QLibraryInfo::path(QLibraryInfo::TranslationsPath)); -+#else -+ (void)qt_translator_->load("qt_" + locale.name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath)); -+#endif - #endif - - if (!my_translator_->load(QString(":/lang/yass_%1.qm").arg(locale.name()))) { -diff --git a/src/qt6/yass_window.cpp b/src/qt6/yass_window.cpp -index ab15bea8..1f07e60d 100644 ---- a/src/qt6/yass_window.cpp -+++ b/src/qt6/yass_window.cpp -@@ -19,6 +19,7 @@ - #include - #include - #include -+#include - - #include "cli/cli_connection_stats.hpp" - #include "config/config.hpp" -@@ -183,8 +184,13 @@ YASSWindow::YASSWindow(QWidget* parent) : QMainWindow(parent) { - LoadChanges(); - } - -+// see https://github.com/qt/qtbase/commit/b455a863a1df61337f36f2e8b43101ca21514697 - void YASSWindow::moveToCenter() { -+#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) - move(screen()->geometry().center() - frameGeometry().center()); -+#else -+ move(windowHandle()->screen()->geometry().center() - frameGeometry().center()); -+#endif - } - - void YASSWindow::showWindow() { diff --git a/net-proxy/yass/yass-1.11.1-r1.ebuild b/net-proxy/yass/yass-1.11.2.ebuild similarity index 98% rename from net-proxy/yass/yass-1.11.1-r1.ebuild rename to net-proxy/yass/yass-1.11.2.ebuild index e2e2d1df4..02964718a 100644 --- a/net-proxy/yass/yass-1.11.1-r1.ebuild +++ b/net-proxy/yass/yass-1.11.2.ebuild @@ -60,10 +60,6 @@ BDEPEND=" virtual/pkgconfig " -PATCHES=( - "${FILESDIR}"/build-qt5.patch -) - src_prepare() { cmake_src_prepare # some tests require network access, comment it out if not supported -- 2.11.4.GIT