Skip to content

Commit

Permalink
Support system distro version of exiv2 0.28 with includes C++17 suppo…
Browse files Browse the repository at this point in the history
…rt (#878)

Support system distro version of exiv2 0.28 with includes C++17 support.

The C++17 support was supposed to be in the 1.0 release, but was
pulled forward in to the 0.28 release.

1) Update configure/cmake to test for version 0.28 instead of 0.99/1.0.

2) 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.

---------

Co-authored-by: David Hampton <mythtv@love2code.net>
  • Loading branch information
garybuhrmaster and linuxdude42 authored Mar 22, 2024
1 parent abfbd29 commit f0a9b1f
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 16 deletions.
11 changes: 7 additions & 4 deletions cmake/externallibs/FindOrBuildExiv2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
9 changes: 6 additions & 3 deletions mythtv/cmake/MythFindPackages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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" REQUIRED IMPORTED_TARGET)
endif()

#
# If not provided by the system, this is currently built as part of mythtv (not
Expand Down
2 changes: 1 addition & 1 deletion mythtv/configure
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mythtv/external/external.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f0a9b1f

Please sign in to comment.