From 9124495d1809ec29d277462976b6de4e3093f23e Mon Sep 17 00:00:00 2001 From: Gary Buhrmaster Date: Tue, 5 Mar 2024 04:27:10 +0000 Subject: [PATCH 1/3] Support system distro version of exiv2 0.28 with includes C++17 support --- cmake/externallibs/FindOrBuildExiv2.cmake | 11 +++++++---- mythtv/cmake/MythFindPackages.cmake | 9 ++++++--- mythtv/configure | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/cmake/externallibs/FindOrBuildExiv2.cmake b/cmake/externallibs/FindOrBuildExiv2.cmake index c1dd661c20b..1cf658e65cc 100644 --- a/cmake/externallibs/FindOrBuildExiv2.cmake +++ b/cmake/externallibs/FindOrBuildExiv2.cmake @@ -13,13 +13,16 @@ # # A comment from 2023-01-18 in a github Exiv issue #2406 discussing releases: # -# Dear folks, Exiv2 v0.27.6 has been released! I'll start working on the v1.0.0 -# major release based on 9ca161d. +# Dear folks, Exiv2 v0.27.6 has been released! I'll start working on the v1.0.0 +# major release based on 9ca161d. +# +# However, Exiv2 v0.28 was released with C++17 support included, so we can use +# that version if the distro includes it. # function(find_or_build_exiv2) - pkg_check_modules(EXIV2 "exiv2>=1.0" QUIET IMPORTED_TARGET) + pkg_check_modules(EXIV2 "exiv2>=0.28" QUIET IMPORTED_TARGET) if(NOT EXIV2_FOUND) - pkg_check_modules(EXIV2 "mythexiv2>=0.99" QUIET IMPORTED_TARGET) + pkg_check_modules(EXIV2 "mythexiv2>=0.28" QUIET IMPORTED_TARGET) endif() if(TARGET PkgConfig::EXIV2) message(STATUS "Found Exiv2 ${EXIV2_VERSION} ${EXIV2_LINK_LIBRARIES}") diff --git a/mythtv/cmake/MythFindPackages.cmake b/mythtv/cmake/MythFindPackages.cmake index b5e1b74789c..0d5efdaf0d6 100644 --- a/mythtv/cmake/MythFindPackages.cmake +++ b/mythtv/cmake/MythFindPackages.cmake @@ -55,10 +55,13 @@ endif() pkg_check_modules(LIBUDFREAD "libudfread>=1.1.1" REQUIRED IMPORTED_TARGET) # -# Find an exiv2 that has c++17 support. The current version number is 0.28 and -# the c++17 based version is supposed to be 1.0. +# Find an exiv2 that has c++17 support. The current version number is 0.27 and +# the c++17 based version is supposed to be 1.0 but is included in 0.28 # -pkg_check_modules(EXIV2 "mythexiv2>=0.99" REQUIRED IMPORTED_TARGET) +pkg_check_modules(EXIV2 "exiv2>=0.28" QUIET IMPORTED_TARGET) +if(NOT EXIV2_FOUND) + pkg_check_modules(EXIV2 "mythexiv2>=0.28" QUIET IMPORTED_TARGET) +endif() # # If not provided by the system, this is currently built as part of mythtv (not diff --git a/mythtv/configure b/mythtv/configure index 64608345cb9..4452ff06284 100755 --- a/mythtv/configure +++ b/mythtv/configure @@ -5435,7 +5435,7 @@ enabled libudev && check_lib udev libudev.h udev_new -ludev || disable libudev # libexiv2 if enabled system_libexiv2 ; then - if $(pkg-config --atleast-version="0.99" exiv2); then + if $(pkg-config --atleast-version="0.28" exiv2); then use_pkg_config exiv2 exiv2 exiv2/exiv2.hpp versionNumber elif [ $target_os != "android" ] ; then disable system_libexiv2 From 7e77106520ec5bb97b0dd9c738d6def8666de6a8 Mon Sep 17 00:00:00 2001 From: Gary Buhrmaster Date: Sat, 16 Mar 2024 15:48:28 +0000 Subject: [PATCH 2/3] cmake: mythexiv2 should be REQUIRED if exiv2 is not found --- mythtv/cmake/MythFindPackages.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mythtv/cmake/MythFindPackages.cmake b/mythtv/cmake/MythFindPackages.cmake index 0d5efdaf0d6..fb0d5a92c6e 100644 --- a/mythtv/cmake/MythFindPackages.cmake +++ b/mythtv/cmake/MythFindPackages.cmake @@ -60,7 +60,7 @@ pkg_check_modules(LIBUDFREAD "libudfread>=1.1.1" REQUIRED IMPORTED_TARGET) # pkg_check_modules(EXIV2 "exiv2>=0.28" QUIET IMPORTED_TARGET) if(NOT EXIV2_FOUND) - pkg_check_modules(EXIV2 "mythexiv2>=0.28" QUIET IMPORTED_TARGET) + pkg_check_modules(EXIV2 "mythexiv2>=0.28" REQUIRED IMPORTED_TARGET) endif() # From 8183a6a9c8253ddfa6af9a19b12ff30e5a1e629b Mon Sep 17 00:00:00 2001 From: David Hampton Date: Thu, 21 Mar 2024 20:26:52 -0400 Subject: [PATCH 3/3] Use the right variable for choosing system vs local exiv2. The configure file uses the label using_system_libexiv2, while a number of the test.pro files use some variation on this name. This never mattered before because everything had to use the local exiv2. Now that some builds are using the local exiv2 and others are using the system exiv2, this needs to be corrected. --- mythtv/external/external.pro | 2 +- mythtv/libs/libmythmetadata/test/test_lyrics/test_lyrics.pro | 2 +- .../test/test_metadatagrabber/test_metadatagrabber.pro | 2 +- .../test/test_musicmetadata/test_musicmetadata.pro | 2 +- .../libmythmetadata/test/test_musicutils/test_musicutils.pro | 2 +- .../test/test_videometadata/test_videometadata.pro | 2 +- .../test/test_recordingextender/test_recordingextender.pro | 2 +- .../mythfrontend/test/test_videolist/test_videolist.pro | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mythtv/external/external.pro b/mythtv/external/external.pro index ec5e909c121..377de008dbe 100644 --- a/mythtv/external/external.pro +++ b/mythtv/external/external.pro @@ -6,7 +6,7 @@ win32-msvc* { # Libraries without dependencies -!using_system_exiv2: SUBDIRS += libexiv2 +!using_system_libexiv2: SUBDIRS += libexiv2 !using_system_libbluray: SUBDIRS += libmythbluray SUBDIRS += libmythdvdnav !using_system_libudfread: SUBDIRS += libudfread diff --git a/mythtv/libs/libmythmetadata/test/test_lyrics/test_lyrics.pro b/mythtv/libs/libmythmetadata/test/test_lyrics/test_lyrics.pro index a87b78738ee..d27bf5a89b2 100644 --- a/mythtv/libs/libmythmetadata/test/test_lyrics/test_lyrics.pro +++ b/mythtv/libs/libmythmetadata/test/test_lyrics/test_lyrics.pro @@ -29,7 +29,7 @@ LIBS += -L../../../../external/FFmpeg/libpostproc -lmythpostproc LIBS += -L../.. -lmythmetadata-$$LIBVERSION -using_system_exiv2 { +using_system_libexiv2 { LIBS += -lexiv2 } else { LIBS += -L../../../../external/libexiv2 -lmythexiv2-0.28 diff --git a/mythtv/libs/libmythmetadata/test/test_metadatagrabber/test_metadatagrabber.pro b/mythtv/libs/libmythmetadata/test/test_metadatagrabber/test_metadatagrabber.pro index 9368d5716df..f304c6d1da3 100644 --- a/mythtv/libs/libmythmetadata/test/test_metadatagrabber/test_metadatagrabber.pro +++ b/mythtv/libs/libmythmetadata/test/test_metadatagrabber/test_metadatagrabber.pro @@ -27,7 +27,7 @@ LIBS += -L../../../../external/FFmpeg/libpostproc -lmythpostproc LIBS += -L../.. -lmythmetadata-$$LIBVERSION -using_system_exiv2 { +using_system_libexiv2 { LIBS += -lexiv2 } else { LIBS += -L../../../../external/libexiv2 -lmythexiv2-0.28 diff --git a/mythtv/libs/libmythmetadata/test/test_musicmetadata/test_musicmetadata.pro b/mythtv/libs/libmythmetadata/test/test_musicmetadata/test_musicmetadata.pro index c897ee09bd7..f906d3785b5 100644 --- a/mythtv/libs/libmythmetadata/test/test_musicmetadata/test_musicmetadata.pro +++ b/mythtv/libs/libmythmetadata/test/test_musicmetadata/test_musicmetadata.pro @@ -27,7 +27,7 @@ LIBS += -L../../../../external/FFmpeg/libpostproc -lmythpostproc LIBS += -L../.. -lmythmetadata-$$LIBVERSION -using_system_exiv2 { +using_system_libexiv2 { LIBS += -lexiv2 } else { LIBS += -L../../../../external/libexiv2 -lmythexiv2-0.28 diff --git a/mythtv/libs/libmythmetadata/test/test_musicutils/test_musicutils.pro b/mythtv/libs/libmythmetadata/test/test_musicutils/test_musicutils.pro index 919ea569f6e..471336bb853 100644 --- a/mythtv/libs/libmythmetadata/test/test_musicutils/test_musicutils.pro +++ b/mythtv/libs/libmythmetadata/test/test_musicutils/test_musicutils.pro @@ -27,7 +27,7 @@ LIBS += -L../../../../external/FFmpeg/libpostproc -lmythpostproc LIBS += -L../.. -lmythmetadata-$$LIBVERSION -using_system_exiv2 { +using_system_libexiv2 { LIBS += -lexiv2 } else { LIBS += -L../../../../external/libexiv2 -lmythexiv2-0.28 diff --git a/mythtv/libs/libmythmetadata/test/test_videometadata/test_videometadata.pro b/mythtv/libs/libmythmetadata/test/test_videometadata/test_videometadata.pro index 5c79b5e4e22..cb16eff5faf 100644 --- a/mythtv/libs/libmythmetadata/test/test_videometadata/test_videometadata.pro +++ b/mythtv/libs/libmythmetadata/test/test_videometadata/test_videometadata.pro @@ -41,7 +41,7 @@ QMAKE_LFLAGS += -Wl,$$_RPATH_$(PWD)/../../../libmythservicecontracts QMAKE_LFLAGS += -Wl,$$_RPATH_$(PWD)/../../../libmythtv QMAKE_LFLAGS += -Wl,$$_RPATH_$(PWD)/../../../libmythfreemheg -!using_system_libexiv { +!using_system_libexiv2 { LIBS += -L../../../../external/libexiv2 -lmythexiv2-0.28 QMAKE_LFLAGS += -Wl,$$_RPATH_$(PWD)/../../../../external/libexiv2 -lexpat freebsd: LIBS += -lprocstat -liconv diff --git a/mythtv/programs/mythbackend/test/test_recordingextender/test_recordingextender.pro b/mythtv/programs/mythbackend/test/test_recordingextender/test_recordingextender.pro index 5ec80d4f1ee..4f192973098 100644 --- a/mythtv/programs/mythbackend/test/test_recordingextender/test_recordingextender.pro +++ b/mythtv/programs/mythbackend/test/test_recordingextender/test_recordingextender.pro @@ -47,7 +47,7 @@ QMAKE_LFLAGS += -Wl,$$_RPATH_$(PWD)/../../../../external/FFmpeg/libpostproc QMAKE_LFLAGS += -Wl,$$_RPATH_$(PWD)/../../../../external/FFmpeg/libswresample QMAKE_LFLAGS += -Wl,$$_RPATH_$(PWD)/../../ -!using_system_libexiv { +!using_system_libexiv2 { LIBS += -L../../../../external/libexiv2 -lmythexiv2-0.28 QMAKE_LFLAGS += -Wl,$$_RPATH_$(PWD)/../../../../external/libexiv2 -lexpat freebsd: LIBS += -lprocstat -liconv diff --git a/mythtv/programs/mythfrontend/test/test_videolist/test_videolist.pro b/mythtv/programs/mythfrontend/test/test_videolist/test_videolist.pro index 1ffe11daf4e..ef988441083 100644 --- a/mythtv/programs/mythfrontend/test/test_videolist/test_videolist.pro +++ b/mythtv/programs/mythfrontend/test/test_videolist/test_videolist.pro @@ -48,7 +48,7 @@ QMAKE_LFLAGS += -Wl,$$_RPATH_$(PWD)/../../../../external/FFmpeg/libpostproc QMAKE_LFLAGS += -Wl,$$_RPATH_$(PWD)/../../../../external/FFmpeg/libswresample QMAKE_LFLAGS += -Wl,$$_RPATH_$(PWD)/../../ -!using_system_libexiv { +!using_system_libexiv2 { LIBS += -L../../../../external/libexiv2 -lmythexiv2-0.28 QMAKE_LFLAGS += -Wl,$$_RPATH_$(PWD)/../../../../external/libexiv2 -lexpat freebsd: LIBS += -lprocstat -liconv