aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Brazhnikov <makc@FreeBSD.org>2022-02-09 21:47:29 +0000
committerMax Brazhnikov <makc@FreeBSD.org>2022-02-09 21:47:29 +0000
commit160358b8d28b1fd286c6ddfb3b3ac9427a3d0a55 (patch)
treeca250d8ea5e27341e95c3f7e55f326a823884229
parentbfe6fa95a03eafa36b5177f0ae910f8eeafd881d (diff)
downloadports-160358b8d28b1fd286c6ddfb3b3ac9427a3d0a55.tar.gz
ports-160358b8d28b1fd286c6ddfb3b3ac9427a3d0a55.zip
archivers/ark: switch from p7zip to 7-zip
Add support for original 7-Zip and use it instead of p7zip. Full patch has been submitted upstream: https://invent.kde.org/utilities/ark/-/merge_requests/90 PR: 260866 261368
-rw-r--r--archivers/ark/Makefile11
-rw-r--r--archivers/ark/files/patch-7zip76
-rw-r--r--archivers/ark/pkg-message2
3 files changed, 87 insertions, 2 deletions
diff --git a/archivers/ark/Makefile b/archivers/ark/Makefile
index d7a9ac2a2516..97639f0e54de 100644
--- a/archivers/ark/Makefile
+++ b/archivers/ark/Makefile
@@ -1,5 +1,6 @@
PORTNAME= ark
DISTVERSION= ${KDE_APPLICATIONS_VERSION}
+PORTREVISION= 1
CATEGORIES= archivers kde kde-applications
MAINTAINER= kde@FreeBSD.org
@@ -19,6 +20,8 @@ USE_QT= concurrent core dbus gui network widgets xml \
USE_LDCONFIG= yes
+PATCH_STRIP= -p1
+
OPTIONS_DEFINE= 7ZIP RAR ZIP DOCS
OPTIONS_DEFAULT= 7ZIP ZIP DOCS
OPTIONS_DEFAULT_i386= RAR
@@ -28,7 +31,7 @@ OPTIONS_SUB= YES
# The 7ZIP and RAR options only need runtime dependencies;
# the port builds identically with or without them.
7ZIP_DESC= Support for 7-Zip archives (runtime)
-7ZIP_RUN_DEPENDS= 7z:archivers/p7zip
+7ZIP_RUN_DEPENDS= 7zz:archivers/7-zip
RAR_DESC= Support for RAR archives (runtime)
RAR_RUN_DEPENDS= unrar:archivers/unrar \
@@ -41,4 +44,10 @@ ZIP_CMAKE_BOOL_OFF= CMAKE_DISABLE_FIND_PACKAGE_LibZip
# Override shared library version
KDE_APPLICATIONS_SHLIB_VER= ${KDE_APPLICATIONS_VERSION}
+post-patch:
+ ${REINPLACE_CMD} '/Program/s,"7z","7zz",' \
+ ${WRKSRC}/plugins/cli7zplugin/cliplugin.cpp
+ ${REINPLACE_CMD} 's,"7z","7zz",' \
+ ${WRKSRC}/plugins/cli7zplugin/kerfuffle_cli7z.json.cmake
+
.include <bsd.port.mk>
diff --git a/archivers/ark/files/patch-7zip b/archivers/ark/files/patch-7zip
new file mode 100644
index 000000000000..2f642beb1791
--- /dev/null
+++ b/archivers/ark/files/patch-7zip
@@ -0,0 +1,76 @@
+diff --git a/plugins/cli7zplugin/CMakeLists.txt b/plugins/cli7zplugin/CMakeLists.txt
+index 735c833a..3450a504 100644
+--- a/plugins/cli7zplugin/CMakeLists.txt
++++ b/plugins/cli7zplugin/CMakeLists.txt
+@@ -7,7 +7,7 @@ set(kerfuffle_cli7z_SRCS cliplugin.cpp)
+ ecm_qt_declare_logging_category(kerfuffle_cli7z_SRCS
+ HEADER ark_debug.h
+ IDENTIFIER ARK
+- CATEGORY_NAME ark.cli7z DESCRIPTION "Ark p7zip" EXPORT ARK)
++ CATEGORY_NAME ark.cli7z DESCRIPTION "Ark 7-Zip" EXPORT ARK)
+
+ # NOTE: the first double-quotes of the first mime and the last
+ # double-quotes of the last mime must NOT be escaped.
+@@ -24,9 +24,9 @@ kerfuffle_add_plugin(kerfuffle_cli7z ${kerfuffle_cli7z_SRCS})
+ set(SUPPORTED_ARK_MIMETYPES "${SUPPORTED_ARK_MIMETYPES}${SUPPORTED_CLI7Z_MIMETYPES}" PARENT_SCOPE)
+ set(INSTALLED_KERFUFFLE_PLUGINS "${INSTALLED_KERFUFFLE_PLUGINS}kerfuffle_cli7z;" PARENT_SCOPE)
+
+-find_program(P7ZIP 7z)
+-if(P7ZIP)
+- message(STATUS "Found p7zip executable: ${P7ZIP}")
++find_program(7ZIP 7z)
++if(7ZIP)
++ message(STATUS "Found 7-Zip executable: ${7ZIP}")
+ else()
+ message(WARNING "Could not find the 7z executable. Ark won't be able to handle the 7z archive format.")
+ endif()
+diff --git a/plugins/cli7zplugin/cliplugin.cpp b/plugins/cli7zplugin/cliplugin.cpp
+index 1781117a..3450ad22 100644
+--- a/plugins/cli7zplugin/cliplugin.cpp
++++ b/plugins/cli7zplugin/cliplugin.cpp
+@@ -50,8 +50,7 @@ void CliPlugin::setupCliProperties()
+ m_cliProps->setProperty("captureProgress", false);
+
+ m_cliProps->setProperty("addProgram", QStringLiteral("7z"));
+- m_cliProps->setProperty("addSwitch", QStringList{QStringLiteral("a"),
+- QStringLiteral("-l")});
++ m_cliProps->setProperty("addSwitch", QStringLiteral("a"));
+
+ m_cliProps->setProperty("deleteProgram", QStringLiteral("7z"));
+ m_cliProps->setProperty("deleteSwitch", QStringLiteral("d"));
+@@ -111,7 +110,7 @@ bool CliPlugin::readListLine(const QString& line)
+ return false;
+ }
+
+- const QRegularExpression rxVersionLine(QStringLiteral("^p7zip Version ([\\d\\.]+) .*$"));
++ const QRegularExpression rxVersionLine(QStringLiteral("^7-Zip .* ([\\d\\.]+) .*$"));
+ QRegularExpressionMatch matchVersion;
+
+ switch (m_parseState) {
+@@ -120,7 +119,7 @@ bool CliPlugin::readListLine(const QString& line)
+ if (matchVersion.hasMatch()) {
+ m_parseState = ParseStateHeader;
+ const QString p7zipVersion = matchVersion.captured(1);
+- qCDebug(ARK) << "p7zip version" << p7zipVersion << "detected";
++ qCDebug(ARK) << "7-Zip version" << p7zipVersion << "detected";
+ }
+ break;
+
+@@ -294,7 +293,7 @@ bool CliPlugin::readDeleteLine(const QString &line)
+ {
+ if (line.startsWith(QLatin1String("Error: ")) &&
+ line.endsWith(QLatin1String(" is not supported archive"))) {
+- Q_EMIT error(i18n("Delete operation failed. Try upgrading p7zip or disabling the p7zip plugin in the configuration dialog."));
++ Q_EMIT error(i18n("Delete operation failed. Try upgrading 7-Zip or disabling the 7-Zip plugin in the configuration dialog."));
+ return false;
+ }
+
+@@ -333,7 +332,7 @@ void CliPlugin::handleMethods(const QStringList &methods)
+
+ bool CliPlugin::isPasswordPrompt(const QString &line)
+ {
+- return line.startsWith(QLatin1String("Enter password (will not be echoed):"));
++ return line.startsWith(QLatin1String("Enter password"));
+ }
+
+ bool CliPlugin::isWrongPasswordMsg(const QString &line)
diff --git a/archivers/ark/pkg-message b/archivers/ark/pkg-message
index efe88273d6d6..1a56cbe9881f 100644
--- a/archivers/ark/pkg-message
+++ b/archivers/ark/pkg-message
@@ -3,7 +3,7 @@
message: <<EOM
Support for 7zip and rar archives requires the appropriate executables.
If ark has been packaged without options 7ZIP or RAR, you can install
-archivers/p7zip (for 7ZIP) or archivers/unrar and archivers/rar (for RAR)
+archivers/7-zip (for 7ZIP) or archivers/unrar and archivers/rar (for RAR)
to allow ark to handle those archives.
EOM
}