git: 19f7624a2c06 - main - multimedia/mkvtoolnix: Update to upstream release 66.0.0

From: Thomas Zander <riggs_at_FreeBSD.org>
Date: Sun, 10 Apr 2022 10:07:24 UTC
The branch main has been updated by riggs:

URL: https://cgit.FreeBSD.org/ports/commit/?id=19f7624a2c060ef061a26ae24250304c12f1d2c3

commit 19f7624a2c060ef061a26ae24250304c12f1d2c3
Author:     Thomas Zander <riggs@FreeBSD.org>
AuthorDate: 2022-04-09 21:49:06 +0000
Commit:     Thomas Zander <riggs@FreeBSD.org>
CommitDate: 2022-04-10 10:07:21 +0000

    multimedia/mkvtoolnix: Update to upstream release 66.0.0
    
    Details:
    - Bugfixes and enhancements, see
      https://mkvtoolnix.download/doc/NEWS.md
    
    MFH:            2022Q2
---
 multimedia/mkvtoolnix/Makefile                     | 16 +-----
 multimedia/mkvtoolnix/distinfo                     |  6 +--
 .../mkvtoolnix/files/patch-rake.d_extensions.rb    | 23 +++++++++
 .../files/patch-src_common_fs__sys__helpers.h      | 10 ++++
 .../patch-src_common_fs__sys__helpers_common.cpp   | 58 ++++++++++++++++++++++
 ...jobs_program__runner_linux__program__runner.cpp | 33 ++++++++++++
 ...i_jobs_program__runner_linux__program__runner.h | 17 +++++++
 ...ch-src_mkvtoolnix-gui_util_sleep__inhibitor.cpp | 20 --------
 8 files changed, 145 insertions(+), 38 deletions(-)

diff --git a/multimedia/mkvtoolnix/Makefile b/multimedia/mkvtoolnix/Makefile
index 0a50c8c55bd2..f23f73693cf1 100644
--- a/multimedia/mkvtoolnix/Makefile
+++ b/multimedia/mkvtoolnix/Makefile
@@ -1,7 +1,7 @@
 # Created by: Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
 
 PORTNAME=	mkvtoolnix
-PORTVERSION=	65.0.0
+PORTVERSION=	66.0.0
 CATEGORIES=	multimedia audio
 MASTER_SITES=	https://www.bunkus.org/videotools/mkvtoolnix/sources/ \
 		https://mkvtoolnix.download/sources/
@@ -32,9 +32,6 @@ USE_QT=		buildtools_build concurrent core linguisttools_build multimedia
 GNU_CONFIGURE=	yes
 CONFIGURE_ENV+=	ac_cv_path_PO4A=no
 CONFIGURE_ARGS=	--with-boost=${LOCALBASE} \
-		--with-boost-filesystem=boost_filesystem \
-		--with-boost-system=boost_system \
-		--with-boost-regex=boost_regex \
 		--with-docbook-xsl-root=${PREFIX}/share/xsl/docbook \
 		--disable-qt6
 MAKE_ENV=	V=1
@@ -75,15 +72,4 @@ MANTRANS_BUILD_DEPENDS=	po4a:textproc/po4a
 USE_CXXSTD=	c++17
 .endif
 
-post-patch:
-	@${REINPLACE_CMD} -e '/LIBS="-lintl/s,-liconv,$$ICONV_LIBS,' \
-		${WRKSRC}/configure
-
-post-configure-NLS-off:
-# https://github.com/mbunkus/mkvtoolnix/issues/1501
-# Fixed in 8.6.0
-	@${REINPLACE_CMD} -e 's|LIBINTL_LIBS =|#LIBINTL_LIBS =|g' ${WRKSRC}/build-config
-	@${REINPLACE_CMD} -e 's|#define HAVE_LIBINTL_H|//#define HAVE_LIBINTL_H|g' ${WRKSRC}/config.h
-	@${REINPLACE_CMD} -e 's|S["LIBINTL_LIBS"]=|#S["LIBINTL_LIBS"]=|g' ${WRKSRC}/config.status
-
 .include <bsd.port.post.mk>
diff --git a/multimedia/mkvtoolnix/distinfo b/multimedia/mkvtoolnix/distinfo
index a2bd3501d1ed..3c488d6ee807 100644
--- a/multimedia/mkvtoolnix/distinfo
+++ b/multimedia/mkvtoolnix/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1644349235
-SHA256 (mkvtoolnix-65.0.0.tar.xz) = 0dddc9cc1bae26ceaac3a184482c50e6bb8add2d62e06ef08b55f9f0108bb92e
-SIZE (mkvtoolnix-65.0.0.tar.xz) = 7709588
+TIMESTAMP = 1649518643
+SHA256 (mkvtoolnix-66.0.0.tar.xz) = 73a3f6c39b3580f28233f93555d282d07d5f51a8bbeb8b0bee09b820de80692c
+SIZE (mkvtoolnix-66.0.0.tar.xz) = 7752240
diff --git a/multimedia/mkvtoolnix/files/patch-rake.d_extensions.rb b/multimedia/mkvtoolnix/files/patch-rake.d_extensions.rb
new file mode 100644
index 000000000000..ed8b289f3481
--- /dev/null
+++ b/multimedia/mkvtoolnix/files/patch-rake.d_extensions.rb
@@ -0,0 +1,23 @@
+--- rake.d/extensions.rb.orig	2022-03-13 12:54:56 UTC
++++ rake.d/extensions.rb
+@@ -62,14 +62,14 @@ class Array
+       :windows => %w{linux macos unix         x11},
+     }
+ 
+-    reject.each do |os, types|
+-      next if !$building_for[os]
++    # Treat other OS (e.g. FreeBSD) the same as Linux wrt. which files to compile
++    os    = $building_for.keys.select { |key| $building_for[key] }.first
++    types = reject[os || :linux]
+ 
+-      re = '(?:' + types.join('|') + ')'
+-      re = %r{(?:/|^)#{re}[_.]}
++    re    = '(?:' + types.join('|') + ')'
++    re    = %r{(?:/|^)#{re}[_.]}
+ 
+-      self.reject! { |f| re.match f }
+-    end
++    self.reject! { |f| re.match f }
+ 
+     return self
+   end
diff --git a/multimedia/mkvtoolnix/files/patch-src_common_fs__sys__helpers.h b/multimedia/mkvtoolnix/files/patch-src_common_fs__sys__helpers.h
new file mode 100644
index 000000000000..fe414bdeec99
--- /dev/null
+++ b/multimedia/mkvtoolnix/files/patch-src_common_fs__sys__helpers.h
@@ -0,0 +1,10 @@
+--- src/common/fs_sys_helpers.h.orig	2022-03-13 12:54:56 UTC
++++ src/common/fs_sys_helpers.h
+@@ -26,6 +26,7 @@ void determine_path_to_current_executable(std::string 
+ std::filesystem::path get_current_exe_path(std::string const &argv0);
+ std::filesystem::path get_application_data_folder();
+ std::filesystem::path get_installation_path();
++std::filesystem::path find_exe_in_path(std::filesystem::path const &exe);
+ uint64_t get_memory_usage();
+ 
+ bool is_installed();
diff --git a/multimedia/mkvtoolnix/files/patch-src_common_fs__sys__helpers_common.cpp b/multimedia/mkvtoolnix/files/patch-src_common_fs__sys__helpers_common.cpp
new file mode 100644
index 000000000000..e0c80719a6c8
--- /dev/null
+++ b/multimedia/mkvtoolnix/files/patch-src_common_fs__sys__helpers_common.cpp
@@ -0,0 +1,58 @@
+--- src/common/fs_sys_helpers/common.cpp.orig	2022-03-13 12:54:56 UTC
++++ src/common/fs_sys_helpers/common.cpp
+@@ -14,12 +14,36 @@
+ #include "common/common_pch.h"
+ 
+ #include "common/fs_sys_helpers.h"
++#include "common/path.h"
++#include "common/strings/parsing.h"
+ 
+ namespace mtx::sys {
+ 
+-static std::filesystem::path s_current_executable_path;
++namespace {
+ 
++std::filesystem::path s_current_executable_path;
++std::unordered_map<std::string, std::filesystem::path> s_exes_in_path;
++
+ std::filesystem::path
++find_exe_in_path_worker(std::filesystem::path const &exe) {
++  auto paths = mtx::string::split(get_environment_variable("PATH"), ":");
++
++  for (auto const &path : paths) {
++    auto potential_exe = mtx::fs::to_path(path) / exe;
++    if (std::filesystem::exists(potential_exe))
++      return potential_exe;
++
++    potential_exe += mtx::fs::to_path(".exe");
++    if (std::filesystem::exists(potential_exe))
++      return potential_exe;
++  }
++
++  return {};
++}
++
++} // anonymous
++
++std::filesystem::path
+ get_installation_path() {
+   return s_current_executable_path;
+ }
+@@ -27,6 +51,17 @@ get_installation_path() {
+ void
+ determine_path_to_current_executable(std::string const &argv0) {
+   s_current_executable_path = get_current_exe_path(argv0);
++}
++
++std::filesystem::path
++find_exe_in_path(std::filesystem::path const &exe) {
++  auto const exe_str = exe.u8string();
++  auto const itr     = s_exes_in_path.find(exe_str);
++
++  if (itr == s_exes_in_path.end())
++    s_exes_in_path[exe_str] = find_exe_in_path_worker(exe);
++
++  return s_exes_in_path[exe_str];
+ }
+ 
+ }
diff --git a/multimedia/mkvtoolnix/files/patch-src_mkvtoolnix-gui_jobs_program__runner_linux__program__runner.cpp b/multimedia/mkvtoolnix/files/patch-src_mkvtoolnix-gui_jobs_program__runner_linux__program__runner.cpp
new file mode 100644
index 000000000000..e237b325f69a
--- /dev/null
+++ b/multimedia/mkvtoolnix/files/patch-src_mkvtoolnix-gui_jobs_program__runner_linux__program__runner.cpp
@@ -0,0 +1,33 @@
+--- src/mkvtoolnix-gui/jobs/program_runner/linux_program_runner.cpp.orig	2022-03-13 12:54:56 UTC
++++ src/mkvtoolnix-gui/jobs/program_runner/linux_program_runner.cpp
+@@ -1,11 +1,13 @@
+ #include "common/common_pch.h"
+ 
+-#if defined(SYS_LINUX)
++#if !defined(SYS_APPLE) && !defined(SYS_WINDOWS)
+ 
+ #include <QDebug>
+ #include <QProcess>
+ 
++#include "common/fs_sys_helpers.h"
+ #include "common/list_utils.h"
++#include "common/path.h"
+ #include "common/qt.h"
+ #include "mkvtoolnix-gui/jobs/program_runner/linux_program_runner.h"
+ 
+@@ -24,6 +26,9 @@ LinuxProgramRunner::isRunProgramTypeSupported(Util::Se
+   if (ProgramRunner::isRunProgramTypeSupported(type))
+     return true;
+ 
++  if (mtx::sys::find_exe_in_path(mtx::fs::to_path("systemctl")).empty())
++    return false;
++
+   return mtx::included_in(type, Util::Settings::RunProgramType::ShutDownComputer, Util::Settings::RunProgramType::HibernateComputer, Util::Settings::RunProgramType::SleepComputer);
+ }
+ 
+@@ -57,4 +62,4 @@ LinuxProgramRunner::sleepComputer(Util::Settings::RunP
+ 
+ }
+ 
+-#endif  // SYS_LINUX
++#endif  // !SYS_APPLE && !SYS_WINDOWS
diff --git a/multimedia/mkvtoolnix/files/patch-src_mkvtoolnix-gui_jobs_program__runner_linux__program__runner.h b/multimedia/mkvtoolnix/files/patch-src_mkvtoolnix-gui_jobs_program__runner_linux__program__runner.h
new file mode 100644
index 000000000000..a279e0ead1be
--- /dev/null
+++ b/multimedia/mkvtoolnix/files/patch-src_mkvtoolnix-gui_jobs_program__runner_linux__program__runner.h
@@ -0,0 +1,17 @@
+--- src/mkvtoolnix-gui/jobs/program_runner/linux_program_runner.h.orig	2022-03-13 12:54:56 UTC
++++ src/mkvtoolnix-gui/jobs/program_runner/linux_program_runner.h
+@@ -2,7 +2,7 @@
+ 
+ #include "common/common_pch.h"
+ 
+-#if defined(SYS_LINUX)
++#if !defined(SYS_APPLE) && !defined(SYS_WINDOWS)
+ 
+ #include "mkvtoolnix-gui/jobs/program_runner.h"
+ 
+@@ -28,4 +28,4 @@ class LinuxProgramRunner: public ProgramRunner { (prot
+ 
+ }}
+ 
+-#endif  // SYS_LINUX
++#endif  // !SYS_APPLE && !SYS_WINDOWS
diff --git a/multimedia/mkvtoolnix/files/patch-src_mkvtoolnix-gui_util_sleep__inhibitor.cpp b/multimedia/mkvtoolnix/files/patch-src_mkvtoolnix-gui_util_sleep__inhibitor.cpp
deleted file mode 100644
index ea58f2e4c8d3..000000000000
--- a/multimedia/mkvtoolnix/files/patch-src_mkvtoolnix-gui_util_sleep__inhibitor.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
---- src/mkvtoolnix-gui/util/sleep_inhibitor.cpp.orig	2018-12-01 11:15:36 UTC
-+++ src/mkvtoolnix-gui/util/sleep_inhibitor.cpp
-@@ -6,7 +6,7 @@
- # include "mkvtoolnix-gui/util/sleep_inhibitor/windows.h"
- #elif defined(SYS_APPLE)
- # include "mkvtoolnix-gui/util/sleep_inhibitor/macos.h"
--#elif defined(HAVE_QTDBUS)
-+#elif defined(SYS_LINUX)
- # include "mkvtoolnix-gui/util/sleep_inhibitor/linux_logind.h"
- #endif
- 
-@@ -66,7 +66,7 @@ BasicSleepInhibitor::create() {
-   inhibitor->addInhibitor(std::make_shared<WindowsSleepInhibitor>());
- #elif defined(SYS_APPLE)
-   inhibitor->addInhibitor(std::make_shared<MacOSSleepInhibitor>());
--#elif defined(HAVE_QTDBUS)
-+#elif defined(SYS_LINUX)
-   inhibitor->addInhibitor(std::make_shared<LogindSleepInhibitor>());
- #endif
-