From nobody Fri Aug 18 07:43:11 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RRv4J2KJWz4qrZY; Fri, 18 Aug 2023 07:43:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RRv4J154Sz3JjR; Fri, 18 Aug 2023 07:43:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692344592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rOe9Mmx4xS6J+G7Svzc0GBp/IR4EdlP6EDLVWt7jLjU=; b=CtFCx+Nd/z5bWv0UDqvrmkSg3LYul8wLZZ1aU6Wu2V/DY/C0WPbSaGuV6UslCVDMecuTtO 0nd6yyElDHCgqJcwGoyEgRKgGQQ2xSQ85Fdu3l3OyQFOF+ixN3DvywbuSCle7qzP/LGyQC 8ihm/iBvBVlIeCbB6Tl3CUT2NBnQ5Z39CWDJdC/d+3AfwnAkp506lrweGbnC2TQf3F1zIV 0wQYjX6EOj4Rz2LeIRyXbLTXZ9IdnBolvVr0tQG5RtXRcrozDUaDcUQgXITiQ+2jduRmUy ZnXdXCPoNd1YZ4yfW/Ye32AbYXCDNrTr1WndeDCun+hFjLILkysGw0X7XIULVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692344592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rOe9Mmx4xS6J+G7Svzc0GBp/IR4EdlP6EDLVWt7jLjU=; b=lxj99YLo4NBI7+4zgccv9T5iKrbpFe9CEn7rY7I0fSMSqIyRR0SYvqyo4R6+OalEZ8+bQA mH0iZl1FygNRfdOba7ro7qmagd/TTuWwZEcRn/ASVQG5AiWNknixgXNrp5nZDN6RFJ/HgO RW9XKPbBFbq1jvrYLka6FF/KAbN/5H6Bz2jwR2NFdpeUwEGFsGtaC/s6+XLteguHQsYqEf Bx71doRk7HDdLUx0ZXElJqufLnXARWI4GD5/4vc9UahG/z0bSUmicYCrE3D0pkBGrzcPXv 9GRMK1dg5ePDqt6ujc+Tx8FIcZDNnNENxeafmmgK9n/AOh57INqp1lJGbAy0BQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692344592; a=rsa-sha256; cv=none; b=WmOs2q0NIVuY/YZTEegYcSC5TsTg5eO9rb/Jv3BfwPJHMeYDE19p89EBMwXii/L57fNAzm EAPXz6VNvZVcXkj65LmC48YCQf1ZMY6YlVxZbqLfyhbK96nHBdgIL5Cyi9nqadaq9TqJTf JxdloperISeDmOspR6fN7U5LRykUdORN8hzNNPdF+SzJbTFrrhmWFnRyAbhHu7Z/VGPrtQ u0eMwKQ0qxwVpQLk8quig6Ox7Q5jIf3+hS1sewKbWi9xYFwnmVjLJ/DP3qEaav/LJcr5g8 v2xaAyBOMTKW9V2AvrVKG07rfWTslr1rScCPSJAlEfljsUztxX3+gd269Xn3GA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RRv4J07gJz16lQ; Fri, 18 Aug 2023 07:43:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37I7hBoN067365; Fri, 18 Aug 2023 07:43:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37I7hBm9067362; Fri, 18 Aug 2023 07:43:11 GMT (envelope-from git) Date: Fri, 18 Aug 2023 07:43:11 GMT Message-Id: <202308180743.37I7hBm9067362@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Gleb Popov Subject: git: 2e217b7dc6ae - main - x11/plasma5-plasma-workspace: Restore a patch for kcm_regionandlang. List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2e217b7dc6ae43089fcccd7783ae900ae78f98df Auto-Submitted: auto-generated The branch main has been updated by arrowd: URL: https://cgit.FreeBSD.org/ports/commit/?id=2e217b7dc6ae43089fcccd7783ae900ae78f98df commit 2e217b7dc6ae43089fcccd7783ae900ae78f98df Author: Gleb Popov AuthorDate: 2023-08-18 07:42:04 +0000 Commit: Gleb Popov CommitDate: 2023-08-18 07:43:08 +0000 x11/plasma5-plasma-workspace: Restore a patch for kcm_regionandlang. Sponsored by: Serenity Cybersecurity, LLC --- x11/plasma5-plasma-workspace/Makefile | 1 + .../files/patch-regionandlang | 322 +++++++++++++++++++++ 2 files changed, 323 insertions(+) diff --git a/x11/plasma5-plasma-workspace/Makefile b/x11/plasma5-plasma-workspace/Makefile index 684e7fec59eb..f0d6fb6851ec 100644 --- a/x11/plasma5-plasma-workspace/Makefile +++ b/x11/plasma5-plasma-workspace/Makefile @@ -1,5 +1,6 @@ PORTNAME= plasma-workspace DISTVERSION= ${KDE_PLASMA_VERSION} +PORTREVISION= 1 CATEGORIES= x11 kde kde-plasma MAINTAINER= kde@FreeBSD.org diff --git a/x11/plasma5-plasma-workspace/files/patch-regionandlang b/x11/plasma5-plasma-workspace/files/patch-regionandlang new file mode 100644 index 000000000000..23113c2e722d --- /dev/null +++ b/x11/plasma5-plasma-workspace/files/patch-regionandlang @@ -0,0 +1,322 @@ +From 6fff5ebf2eb9ec2def4f7b5f0569b48c36061844 Mon Sep 17 00:00:00 2001 +From: Gleb Popov <6yearold@gmail.com> +Date: Fri, 28 Jul 2023 10:59:40 +0300 +Subject: [PATCH 1/2] Rename REGION_LANG_GENERATE_LOCALE to + REGION_LANG_GENERATE_LOCALE_HELPER + +(cherry picked from commit 09d0b42a9) +--- + CMakeLists.txt | 6 +++--- + kcms/region_language/CMakeLists.txt | 2 +- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/CMakeLists.txt CMakeLists.txt +index afd3bdcf22..54da6be721 100644 +--- a/CMakeLists.txt ++++ CMakeLists.txt +@@ -253,19 +253,19 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + set(GLIBC_LOCALE TRUE) + endif() + if(UBUNTU_PACKAGEKIT OR GLIBC_LOCALE_GEN) +- set(REGION_LANG_GENERATE_LOCALE TRUE) ++ set(REGION_LANG_GENERATE_LOCALE_HELPER TRUE) + endif() + + option(GLIBC_LOCALE_GENERATED "Systems that don't require locale generation. Such as openSUSE or Fedora" OFF) + if(GLIBC_LOCALE_GENERATED) + set(LOCALE_GENERATED TRUE) + endif() +- if(REGION_LANG_GENERATE_LOCALE AND GLIBC_LOCALE_GENERATED) ++ if(REGION_LANG_GENERATE_LOCALE_HELPER AND GLIBC_LOCALE_GENERATED) + message(FATAL_ERROR "(UBUNTU_PACKAGEKIT || GLIBC_LOCALE_GEN) and GLIBC_LOCALE_GENERATED both enabled") + endif() + + ################## Find libraries ################### +- if(REGION_LANG_GENERATE_LOCALE) ++ if(REGION_LANG_GENERATE_LOCALE_HELPER) + find_package(PolkitQt${QT_MAJOR_VERSION}-1) + set_package_properties(PolkitQt${QT_MAJOR_VERSION}-1 + PROPERTIES DESCRIPTION "DBus interface wrapper for Polkit" +diff --git a/kcms/region_language/CMakeLists.txt kcms/region_language/CMakeLists.txt +index d134937b77..56ccec7cba 100644 +--- a/kcms/region_language/CMakeLists.txt ++++ kcms/region_language/CMakeLists.txt +@@ -47,7 +47,7 @@ ecm_qt_declare_logging_category( + ) + + ################ Build helper and add additional source files ############# +-if(REGION_LANG_GENERATE_LOCALE) ++if(REGION_LANG_GENERATE_LOCALE_HELPER) + add_subdirectory("localegenhelper") + qt_generate_dbus_interface( + ${CMAKE_CURRENT_SOURCE_DIR}/localegenhelper/localegenhelper.h +-- +GitLab + + +From 0d53975b637620cc7619a67df3397fd43f710eba Mon Sep 17 00:00:00 2001 +From: Gleb Popov <6yearold@gmail.com> +Date: Mon, 26 Jun 2023 08:46:23 +0300 +Subject: [PATCH 2/2] region_language KCM: Guard glibc-related code with + ifdefs. + +This introduces GLIBC_LOCALE_AUTO and GLIBC_LOCALE_GENERATED to differentiate +between Linux distributions. The GLIBC_LOCALE define is set for both cases. + +The change unbreaks the KCM on FreeBSD. + +Sponsored by: Serenity Cybersecurity, LLC + +(cherry picked from commit e8eabb689f82f99a362b6860915a8269b8e1268c) +--- + CMakeLists.txt | 14 +++++++------- + config-workspace.h.cmake | 8 ++++++-- + kcms/region_language/kcmregionandlang.cpp | 16 ++++++++++++++-- + kcms/region_language/kcmregionandlang.h | 7 +++++++ + kcms/region_language/languagelistmodel.cpp | 6 ++++++ + kcms/region_language/localegenerator.cpp | 6 +++--- + 6 files changed, 43 insertions(+), 14 deletions(-) + +diff --git a/CMakeLists.txt CMakeLists.txt +index 54da6be721..af371f8455 100644 +--- a/CMakeLists.txt ++++ CMakeLists.txt +@@ -209,7 +209,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + # + # For Glibc systems that come with pre-generated locales, such as Fedora and openSUSE + # a note to let user install fonts themselves if required is displayed +- # You should enable GLIBC_LOCALE_GENERATED option ++ # You should enable GLIBC_LOCALE_PREGENERATED option + # + # For non-glibc systems such as VoidLinux and *BSD + # A warning of configure locale manually is displayed (although the relevant ENVs are set by Plasma) +@@ -250,18 +250,18 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + message(FATAL_ERROR "UBUNTU_PACKAGEKIT and GLIBC_LOCALE_GEN both enabled, only UBUNTU_PACKEGKIT will be used") + endif() + if(GLIBC_LOCALE_GEN) +- set(GLIBC_LOCALE TRUE) ++ set(GLIBC_LOCALE_AUTO TRUE) + endif() + if(UBUNTU_PACKAGEKIT OR GLIBC_LOCALE_GEN) + set(REGION_LANG_GENERATE_LOCALE_HELPER TRUE) + endif() + +- option(GLIBC_LOCALE_GENERATED "Systems that don't require locale generation. Such as openSUSE or Fedora" OFF) +- if(GLIBC_LOCALE_GENERATED) +- set(LOCALE_GENERATED TRUE) ++ option(GLIBC_LOCALE_PREGENERATED "Systems that don't require locale generation. Such as openSUSE or Fedora" OFF) ++ if(GLIBC_LOCALE_PREGENERATED) ++ set(GLIBC_LOCALE_GENERATED TRUE) + endif() +- if(REGION_LANG_GENERATE_LOCALE_HELPER AND GLIBC_LOCALE_GENERATED) +- message(FATAL_ERROR "(UBUNTU_PACKAGEKIT || GLIBC_LOCALE_GEN) and GLIBC_LOCALE_GENERATED both enabled") ++ if(REGION_LANG_GENERATE_LOCALE_HELPER AND GLIBC_LOCALE_PREGENERATED) ++ message(FATAL_ERROR "(UBUNTU_PACKAGEKIT || GLIBC_LOCALE_GEN) and GLIBC_LOCALE_PREGENERATED both enabled") + endif() + + ################## Find libraries ################### +diff --git a/config-workspace.h.cmake config-workspace.h.cmake +index d7cf5fe7ed..b696cd8fa5 100644 +--- a/config-workspace.h.cmake ++++ config-workspace.h.cmake +@@ -12,5 +12,9 @@ + #define WORKSPACE_VERSION_STRING "${PROJECT_VERSION}" + + #cmakedefine OS_UBUNTU 1 +-#cmakedefine GLIBC_LOCALE 1 +-#cmakedefine LOCALE_GENERATED 1 ++#cmakedefine01 GLIBC_LOCALE_AUTO ++#cmakedefine01 GLIBC_LOCALE_GENERATED ++ ++#if defined(GLIBC_LOCALE_AUTO) || defined(GLIBC_LOCALE_GENERATED) ++#define GLIBC_LOCALE ++#endif +diff --git a/kcms/region_language/kcmregionandlang.cpp kcms/region_language/kcmregionandlang.cpp +index 9e99466a40..364b8767cd 100644 +--- a/kcms/region_language/kcmregionandlang.cpp ++++ kcms/region_language/kcmregionandlang.cpp +@@ -2,10 +2,11 @@ + kcmregionandlang.cpp + SPDX-FileCopyrightText: 2014 Sebastian Kügler + SPDX-FileCopyrightText: 2021 Han Young ++ SPDX-FileCopyrightText: 2023 Serenity Cybersecurity, LLC ++ Author: Gleb Popov + + SPDX-License-Identifier: GPL-2.0-or-later + */ +-#include "config-workspace.h" + + #include "kcmregionandlang.h" + +@@ -60,6 +61,7 @@ KCMRegionAndLang::KCMRegionAndLang(QObject *parent, const KPluginMetaData &data, + qRegisterMetaType(); + qmlRegisterUncreatableMetaObject(KCM_RegionAndLang::staticMetaObject, "kcmregionandlang", 1, 0, "SettingType", "Error: SettingType is an enum"); + ++#ifdef GLIBC_LOCALE_GENERATED + // fedora pre generate locales, fetch available locales from localectl. /usr/share/i18n/locales is empty in fedora + QDir glibcLocaleDir(localeFileDirPath()); + if (glibcLocaleDir.isEmpty()) { +@@ -80,6 +82,9 @@ KCMRegionAndLang::KCMRegionAndLang(QObject *parent, const KPluginMetaData &data, + } else { + m_enabled = true; + } ++#else ++ m_enabled = true; ++#endif + } + + QString KCMRegionAndLang::failedFindLocalesMessage() +@@ -124,6 +129,7 @@ void KCMRegionAndLang::save() + if (!settings()->isDefaultSetting(SettingType::PhoneNumbers)) { + locales.append(settings()->phoneNumbers()); + } ++#ifdef GLIBC_LOCALE + if (!settings()->language().isEmpty()) { + QStringList languages = settings()->language().split(QLatin1Char(':')); + for (const QString &lang : languages) { +@@ -133,6 +139,7 @@ void KCMRegionAndLang::save() + } + } + } ++#endif + + auto setLangCall = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.Accounts"), + QStringLiteral("/org/freedesktop/Accounts/User%1").arg(getuid()), +@@ -214,7 +221,7 @@ bool KCMRegionAndLang::isGlibc() + { + #ifdef OS_UBUNTU + return true; +-#elif GLIBC_LOCALE ++#elif defined(GLIBC_LOCALE) + return true; + #else + return false; +@@ -226,6 +233,7 @@ bool KCMRegionAndLang::enabled() const + return m_enabled; + } + ++#ifdef GLIBC_LOCALE + std::optional KCMRegionAndLang::toGlibcLocale(const QString &lang) + { + static std::unordered_map map = constructGlibcLocaleMap(); +@@ -235,6 +243,7 @@ std::optional KCMRegionAndLang::toGlibcLocale(const QString &lang) + } + return std::nullopt; + } ++#endif + + QString KCMRegionAndLang::toUTF8Locale(const QString &locale) + { +@@ -252,6 +261,7 @@ QString KCMRegionAndLang::toUTF8Locale(const QString &locale) + return locale + QLatin1String(".UTF-8"); + } + ++#ifdef GLIBC_LOCALE + std::unordered_map KCMRegionAndLang::constructGlibcLocaleMap() + { + std::unordered_map localeMap; +@@ -338,5 +348,7 @@ std::unordered_map KCMRegionAndLang::constructGlibcLocaleMap() + } + return localeMap; + } ++#endif ++ + #include "kcmregionandlang.moc" + #include "moc_kcmregionandlang.cpp" +diff --git a/kcms/region_language/kcmregionandlang.h kcms/region_language/kcmregionandlang.h +index bdf9d19dbb..4649983b03 100644 +--- a/kcms/region_language/kcmregionandlang.h ++++ kcms/region_language/kcmregionandlang.h +@@ -2,6 +2,8 @@ + kcmregionandlang.h + SPDX-FileCopyrightText: 2014 Sebastian Kügler + SPDX-FileCopyrightText: 2021 Han Young ++ SPDX-FileCopyrightText: 2023 Serenity Cybersecurity, LLC ++ Author: Gleb Popov + + SPDX-License-Identifier: GPL-2.0-or-later + */ +@@ -11,6 +13,7 @@ + #include + #include + ++#include "config-workspace.h" + #include "settingtype.h" + + #include +@@ -36,7 +39,9 @@ public: + OptionsModel *optionsModel() const; + bool enabled() const; + static bool isGlibc(); ++#ifdef GLIBC_LOCALE + std::optional toGlibcLocale(const QString &lang); ++#endif + Q_INVOKABLE void unset(KCM_RegionAndLang::SettingType setting); + Q_INVOKABLE void reboot(); + Q_SIGNALS: +@@ -53,7 +58,9 @@ private Q_SLOTS: + void saveToConfigFile(); + + private: ++#ifdef GLIBC_LOCALE + std::unordered_map constructGlibcLocaleMap(); ++#endif + static QString failedFindLocalesMessage(); + static QString localeFileDirPath(); + static QString toUTF8Locale(const QString &locale); +diff --git a/kcms/region_language/languagelistmodel.cpp kcms/region_language/languagelistmodel.cpp +index d9846226da..cc73178f86 100644 +--- a/kcms/region_language/languagelistmodel.cpp ++++ kcms/region_language/languagelistmodel.cpp +@@ -2,6 +2,8 @@ + languagelistmodel.h + SPDX-FileCopyrightText: 2021 Han Young + SPDX-FileCopyrightText: 2019 Kevin Ottens ++ SPDX-FileCopyrightText: 2023 Serenity Cybersecurity, LLC ++ Author: Gleb Popov + SPDX-License-Identifier: GPL-2.0-or-later + */ + +@@ -384,10 +386,14 @@ void SelectedLanguageModel::saveLanguages() + Q_EMIT unsupportedLanguageChanged(); + } + ++#ifdef GLIBC_LOCALE + auto glibcLang = m_kcm->toGlibcLocale(m_selectedLanguages.front()); + if (glibcLang.has_value()) { + m_settings->setLang(glibcLang.value()); + } ++#else ++ m_settings->setLang(m_selectedLanguages.front()); ++#endif + } + QString languages; + for (auto i = m_selectedLanguages.cbegin(); i != m_selectedLanguages.cend(); i++) { +diff --git a/kcms/region_language/localegenerator.cpp kcms/region_language/localegenerator.cpp +index 2da02617a4..fb8033c95d 100644 +--- a/kcms/region_language/localegenerator.cpp ++++ kcms/region_language/localegenerator.cpp +@@ -15,7 +15,7 @@ + + #ifdef OS_UBUNTU + #include "localegeneratorubuntu.h" +-#elif GLIBC_LOCALE ++#elif GLIBC_LOCALE_AUTO + #include "localegeneratorglibc.h" + #endif + +@@ -23,9 +23,9 @@ LocaleGeneratorBase *LocaleGenerator::getGenerator() + { + #ifdef OS_UBUNTU + static LocaleGeneratorUbuntu singleton; +-#elif GLIBC_LOCALE ++#elif GLIBC_LOCALE_AUTO + static LocaleGeneratorGlibc singleton; +-#elif LOCALE_GENERATED ++#elif GLIBC_LOCALE_GENERATED + static LocaleGeneratorGeneratedGlibc singleton; + #else + static LocaleGeneratorBase singleton; +-- +GitLab +