diff --git a/japanese/fcitx5-cskk/Makefile b/japanese/fcitx5-cskk/Makefile index a8ef88a75fa2..af7f8db61fb1 100644 --- a/japanese/fcitx5-cskk/Makefile +++ b/japanese/fcitx5-cskk/Makefile @@ -1,34 +1,35 @@ PORTNAME= fcitx5-cskk DISTVERSIONPREFIX= v DISTVERSION= 1.2.0 +PORTREVISION= 1 CATEGORIES= japanese textproc MAINTAINER= syobon@syobon.net COMMENT= SKK input method plugin for fcitx5 that uses LibCSKK WWW= https://github.com/fcitx/fcitx5-cskk LICENSE= GPLv3 LICENSE_FILE= ${WRKSRC}/LICENSE LIB_DEPENDS= libcskk.so:japanese/cskk \ libFcitx5Core.so:textproc/fcitx5 RUN_DEPENDS= ${LOCALBASE}/share/skk/SKK-JISYO.L:japanese/skk-jisyo USES= cmake gettext pkgconfig USE_GITHUB= yes GH_ACCOUNT= fcitx CMAKE_ARGS+= -DSKK_DICT_DEFAULT_PATH="${LOCALBASE}/share/skk/SKK-JISYO.L" OPTIONS_SUB= yes OPTIONS_DEFINE= QT5 OPTIONS_DEFAULT= QT5 QT5_DESC= Enable Qt for GUI configuration QT5_LIB_DEPENDS+= libFcitx5Qt5WidgetsAddons.so:textproc/fcitx5-qt@qt5 QT5_CMAKE_BOOL= ENABLE_QT QT5_USES= kde:5 qt:5 QT5_USE= KDE=ecm \ QT=core,gui,widgets,buildtools:build,qmake:build .include diff --git a/japanese/fcitx5-cskk/files/patch-api b/japanese/fcitx5-cskk/files/patch-api new file mode 100644 index 000000000000..1a056cb5d070 --- /dev/null +++ b/japanese/fcitx5-cskk/files/patch-api @@ -0,0 +1,128 @@ +--- gui/adddictdialog.cpp.orig 2023-02-04 23:41:16 UTC ++++ gui/adddictdialog.cpp +@@ -15,7 +15,7 @@ + #include + #include + #include +-#include ++#include + #include + + #define FCITX_CONFIG_DIR "$FCITX_CONFIG_DIR" +@@ -95,17 +95,17 @@ void AddDictDialog::browseClicked() { + path = QFileDialog::getOpenFileName(this, _("Select Dictionary File"), + info.path()); + } else { +- auto fcitxBasePath = stringutils::joinPath( +- StandardPath::global().userDirectory(StandardPath::Type::PkgData), +- "cskk"); ++ auto fcitxBasePath = ++ StandardPaths::global().userDirectory(StandardPathsType::PkgData) / ++ "cskk"; + fs::makePath(fcitxBasePath); + QString fcitxConfigBasePath = + QDir::cleanPath(QString::fromStdString(fcitxBasePath)); + + if (path.isEmpty()) { +- auto baseDataPath = stringutils::joinPath( +- StandardPath::global().userDirectory(StandardPath::Type::Data), +- "fcitx5-cskk"); ++ auto baseDataPath = ++ StandardPaths::global().userDirectory(StandardPathsType::Data) / ++ "fcitx5-cskk"; + fs::makePath(baseDataPath); + QString basePath = QDir::cleanPath(QString::fromStdString(baseDataPath)); + path = basePath; +--- gui/dictmodel.cpp.orig 2023-02-04 23:41:16 UTC ++++ gui/dictmodel.cpp +@@ -12,7 +12,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + +@@ -23,16 +23,16 @@ void SkkDictModel::defaults() { + SkkDictModel::SkkDictModel(QObject *parent) : QAbstractListModel(parent) {} + + void SkkDictModel::defaults() { +- auto path = StandardPath::fcitxPath("pkgdatadir", config_path.c_str()); +- QFile f(path.data()); ++ auto path = StandardPaths::fcitxPath("pkgdatadir", config_path.c_str()); ++ QFile f(path.c_str()); + if (f.open(QIODevice::ReadOnly)) { + load(f); + } + } + + void SkkDictModel::load() { +- auto file = StandardPath::global().open(StandardPath::Type::PkgData, +- config_path, O_RDONLY); ++ auto file = ++ StandardPaths::global().open(StandardPathsType::PkgData, config_path); + if (file.fd() < 0) { + return; + } +@@ -61,8 +61,8 @@ bool SkkDictModel::save() { + } + + bool SkkDictModel::save() { +- return StandardPath::global().safeSave( +- StandardPath::Type::PkgData, config_path, [this](int fd) { ++ return StandardPaths::global().safeSave( ++ StandardPathsType::PkgData, config_path, [this](int fd) { + QFile tempFile; + if (!tempFile.open(fd, QIODevice::WriteOnly)) { + return false; +--- gui/dictwidget.cpp.orig 2023-02-04 23:41:16 UTC ++++ gui/dictwidget.cpp +@@ -10,7 +10,7 @@ + #include "dictmodel.h" + #include + #include +-#include ++#include + #include + #include + +@@ -21,9 +21,9 @@ SkkDictWidget::SkkDictWidget(QWidget *parent) + m_ui(std::make_unique()) { + m_ui->setupUi(this); + m_dictModel = new SkkDictModel(this); +- auto fcitxBasePath = stringutils::joinPath( +- StandardPath::global().userDirectory(StandardPath::Type::PkgData), +- "cskk"); ++ auto fcitxBasePath = ++ StandardPaths::global().userDirectory(StandardPathsType::PkgData) / ++ "cskk"; + fs::makePath(fcitxBasePath); + + m_dictModel->load(); +--- src/cskk.cpp.orig 2023-02-04 23:41:16 UTC ++++ src/cskk.cpp +@@ -109,8 +109,8 @@ void FcitxCskkEngine::loadDictionary() { + void FcitxCskkEngine::loadDictionary() { + freeDictionaries(); + +- auto dict_config_file = StandardPath::global().open( +- StandardPath::Type::PkgData, "cskk/dictionary_list", O_RDONLY); ++ auto dict_config_file = StandardPaths::global().open( ++ StandardPathsType::PkgData, "cskk/dictionary_list"); + + UniqueFilePtr fp(fdopen(dict_config_file.fd(), "rb")); + if (!fp) { +@@ -196,9 +196,9 @@ void FcitxCskkEngine::loadDictionary() { + constexpr auto var_len = sizeof(configDir) - 1; + std::string realpath = path; + if (stringutils::startsWith(path, configDir)) { +- realpath = stringutils::joinPath( +- StandardPath::global().userDirectory(StandardPath::Type::PkgData), +- path.substr(var_len)); ++ realpath = ++ StandardPaths::global().userDirectory(StandardPathsType::PkgData) / ++ path.substr(var_len); + } + auto *userdict = + skk_user_dict_new(realpath.c_str(), encoding.c_str(), complete);