From 34a085f98788f3293df396ca40f4cdd0eb2f016e Mon Sep 17 00:00:00 2001 From: Schrijvers Luc Date: Mon, 11 Aug 2025 16:41:39 +0200 Subject: [PATCH] exiv2, bump to 0.28.5 (#12730) strip and keep 0.27.7 for backwords compatibility --- ...xiv2-0.27.7.recipe => exiv2-0.28.5.recipe} | 51 +++++++++---- media-gfx/exiv2/exiv2_0.27-0.27.7.recipe | 74 +++++++++++++++++++ media-gfx/exiv2/patches/exiv2-0.28.5.patchset | 46 ++++++++++++ 3 files changed, 155 insertions(+), 16 deletions(-) rename media-gfx/exiv2/{exiv2-0.27.7.recipe => exiv2-0.28.5.recipe} (64%) create mode 100644 media-gfx/exiv2/exiv2_0.27-0.27.7.recipe create mode 100644 media-gfx/exiv2/patches/exiv2-0.28.5.patchset diff --git a/media-gfx/exiv2/exiv2-0.27.7.recipe b/media-gfx/exiv2/exiv2-0.28.5.recipe similarity index 64% rename from media-gfx/exiv2/exiv2-0.27.7.recipe rename to media-gfx/exiv2/exiv2-0.28.5.recipe index 31639e1d9..936ab986b 100644 --- a/media-gfx/exiv2/exiv2-0.27.7.recipe +++ b/media-gfx/exiv2/exiv2-0.28.5.recipe @@ -3,34 +3,47 @@ DESCRIPTION="Exiv2 provides fast and easy read and write access to the Exif, \ IPTC and XMP metadata of images in various formats. Exiv2 is available as \ free software and with a commercial license, and is used in many projects." HOMEPAGE="https://www.exiv2.org/" -COPYRIGHT="2004-2021 Exiv2 authors +COPYRIGHT="2004-2025 Exiv2 authors 2004-2013 Andreas Huggel 2009 Brad Schick" LICENSE="GNU GPL v2" -REVISION="2" +REVISION="1" SOURCE_URI="https://github.com/Exiv2/exiv2/archive/v$portVersion.tar.gz" -CHECKSUM_SHA256="551b1266e3aabd321f6d555dccd776128ee449d5039feafee927a1f33f7a9753" +CHECKSUM_SHA256="e1671f744e379a87ba0c984617406fdf8c0ad0c594e5122f525b2fb7c28d394d" PATCHES="exiv2-$portVersion.patchset" ARCHITECTURES="all !x86_gcc2" SECONDARY_ARCHITECTURES="x86" +# On x86_gcc2 we don't want to install the commands in bin//, but in bin/. +commandBinDir=$binDir +commandSuffix=$secondaryArchSuffix +if [ "$targetArchitecture" = x86_gcc2 ]; then + commandSuffix= + commandBinDir=$prefix/bin +fi + +libVersion="$portVersion" +libVersionCompat="$libVersion compat >= ${libVersion%.*}" + PROVIDES=" exiv2$secondaryArchSuffix = $portVersion - lib:libexiv2$secondaryArchSuffix = $portVersion + lib:libexiv2$secondaryArchSuffix = $libVersionCompat " REQUIRES=" haiku$secondaryArchSuffix + lib:libbrotlicommon$secondaryArchSuffix + lib:libbrotlidec$secondaryArchSuffix lib:libexpat$secondaryArchSuffix lib:libiconv$secondaryArchSuffix + lib:libinih$secondaryArchSuffix lib:libpng16$secondaryArchSuffix lib:libz$secondaryArchSuffix " PROVIDES_devel=" exiv2${secondaryArchSuffix}_devel = $portVersion - devel:libexiv2${secondaryArchSuffix} = $portVersion - devel:libexiv2_xmp${secondaryArchSuffix} = $portVersion + devel:libexiv2$secondaryArchSuffix = $libVersionCompat " REQUIRES_devel=" exiv2$secondaryArchSuffix == $portVersion base @@ -38,7 +51,7 @@ REQUIRES_devel=" PROVIDES_tools=" exiv2${secondaryArchSuffix}_tools = $portVersion - cmd:exiv2$secondaryArchSuffix = $portVersion + cmd:exiv2$commandSuffix = $portVersion " REQUIRES_tools=" $REQUIRES @@ -50,16 +63,17 @@ ARCHITECTURES_doc="any" PROVIDES_doc=" exiv2_doc = $portVersion " - REPLACES_doc=" exiv2_x86_doc " BUILD_REQUIRES=" haiku${secondaryArchSuffix}_devel + devel:libbrotlidec$secondaryArchSuffix devel:libcurl$secondaryArchSuffix devel:libexpat$secondaryArchSuffix devel:libiconv$secondaryArchSuffix + devel:libinih$secondaryArchSuffix devel:libpng16$secondaryArchSuffix devel:libz$secondaryArchSuffix " @@ -68,7 +82,7 @@ BUILD_PREREQUIRES=" cmd:dot cmd:doxygen cmd:gcc$secondaryArchSuffix - cmd:gettext + cmd:gettext$secondaryArchSuffix cmd:grep cmd:make cmd:pkg_config$secondaryArchSuffix @@ -82,10 +96,14 @@ BUILD() cmake -Bbuild -S. -DCMAKE_BUILD_TYPE=Release \ $cmakeDirArgs \ + -DCMAKE_INSTALL_BINDIR=$commandBinDir \ + -DCMAKE_INSTALL_DOCDIR=$documentationDir/packages/exiv2 \ -DEXIV2_ENABLE_CURL=ON \ -DEXIV2_ENABLE_VIDEO=ON \ -DEXIV2_BUILD_SAMPLES=OFF \ - -DEXIV2_BUILD_DOC=ON + -DEXIV2_BUILD_DOC=ON \ + -DBUILD_WITH_STACK_PROTECTOR=OFF \ + -DCMAKE_SKIP_RPATH=YES make -C build $jobArgs make -C build doc @@ -95,14 +113,9 @@ INSTALL() { make -C build install - prepareInstalledDevelLibs libexiv2 libexiv2-xmp + prepareInstalledDevelLib libexiv2 fixPkgconfig - sed -i "s,\/$relativeLibDir/libexiv2-xmp.a,\/$relativeDevelopLibDir/libexiv2-xmp.a,g" \ - $libDir/cmake/exiv2/exiv2Config-release.cmake - sed -i "s,\/include,\/$relativeIncludeDir,g" \ - $libDir/cmake/exiv2/exiv2Config.cmake - packageEntries devel \ $developDir \ $libDir/cmake @@ -114,3 +127,9 @@ INSTALL() packageEntries doc \ $documentationDir } + +TEST() +{ + # 60% tests passed, 2 tests failed out of 5 + ctest --test-dir build --output-on-failure +} diff --git a/media-gfx/exiv2/exiv2_0.27-0.27.7.recipe b/media-gfx/exiv2/exiv2_0.27-0.27.7.recipe new file mode 100644 index 000000000..f97207829 --- /dev/null +++ b/media-gfx/exiv2/exiv2_0.27-0.27.7.recipe @@ -0,0 +1,74 @@ +SUMMARY="A C++ library and command line utility to manage image metadata" +DESCRIPTION="Exiv2 provides fast and easy read and write access to the Exif, \ +IPTC and XMP metadata of images in various formats. Exiv2 is available as \ +free software and with a commercial license, and is used in many projects." +HOMEPAGE="https://www.exiv2.org/" +COPYRIGHT="2004-2021 Exiv2 authors + 2004-2013 Andreas Huggel + 2009 Brad Schick" +LICENSE="GNU GPL v2" +REVISION="2" +SOURCE_URI="https://github.com/Exiv2/exiv2/archive/v$portVersion.tar.gz" +CHECKSUM_SHA256="551b1266e3aabd321f6d555dccd776128ee449d5039feafee927a1f33f7a9753" +SOURCE_DIR="exiv2-$portVersion" +PATCHES="exiv2-$portVersion.patchset" + +ARCHITECTURES="all !x86_gcc2" +SECONDARY_ARCHITECTURES="x86" + +PROVIDES=" + exiv2_0.27$secondaryArchSuffix = $portVersion + lib:libexiv2$secondaryArchSuffix = $portVersion + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libexpat$secondaryArchSuffix + lib:libiconv$secondaryArchSuffix + lib:libpng16$secondaryArchSuffix + lib:libz$secondaryArchSuffix + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libcurl$secondaryArchSuffix + devel:libexpat$secondaryArchSuffix + devel:libiconv$secondaryArchSuffix + devel:libpng16$secondaryArchSuffix + devel:libz$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:cmake + cmd:gcc$secondaryArchSuffix +# cmd:gettext$secondaryArchSuffix + cmd:grep + cmd:make + cmd:pkg_config$secondaryArchSuffix + cmd:sed + " + +BUILD() +{ + export CXXFLAGS="-D_BSD_SOURCE" + export LDFLAGS="-lbsd -lnetwork" + + cmake -Bbuild -S. -DCMAKE_BUILD_TYPE=Release \ + $cmakeDirArgs \ + -DCMAKE_INSTALL_DOCDIR=$documentationDir/packages/exiv2 \ + -DEXIV2_ENABLE_CURL=ON \ + -DEXIV2_ENABLE_VIDEO=ON \ + -DEXIV2_BUILD_EXIV2_COMMAND=OFF \ + -DEXIV2_BUILD_SAMPLES=OFF \ + -DEXIV2_BUILD_DOC=OFF + + make -C build $jobArgs +} + +INSTALL() +{ + make -C build install + + prepareInstalledDevelLibs libexiv2 libexiv2-xmp + fixPkgconfig + + rm -rf $developDir $libDir/cmake +} diff --git a/media-gfx/exiv2/patches/exiv2-0.28.5.patchset b/media-gfx/exiv2/patches/exiv2-0.28.5.patchset new file mode 100644 index 000000000..c21c10454 --- /dev/null +++ b/media-gfx/exiv2/patches/exiv2-0.28.5.patchset @@ -0,0 +1,46 @@ +From 6a69ca158bf2d3780cdbf4d33b50ef7fb9fddcc4 Mon Sep 17 00:00:00 2001 +From: Luc Schrijvers +Date: Sun, 10 Aug 2025 19:06:23 +0200 +Subject: Fix: error: 'path' was not declared in this scope +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Joachim Mairböck + +diff --git a/src/futils.cpp b/src/futils.cpp +index 1797c1b..123375c 100644 +--- a/src/futils.cpp ++++ b/src/futils.cpp +@@ -58,6 +58,10 @@ namespace fs = std::experimental::filesystem; + // clang-format on + #endif + ++#if defined(__HAIKU__) ++#include ++#endif ++ + #ifndef _MAX_PATH + #define _MAX_PATH 1024 + #endif +@@ -386,6 +390,17 @@ std::string getProcessPath() { + auto path = fs::path(pathbuf); + #elif defined(__sun__) + auto path = fs::read_symlink(Internal::stringFormat("/proc/%d/path/a.out", getpid())); ++#elif defined(__HAIKU__) ++ int32 cookie = 0; ++ image_info info; ++ while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) ++ { ++ if (info.type == B_APP_IMAGE) ++ { ++ break; ++ } ++ } ++ auto path = fs::path(info.name); + #elif defined(__unix__) + auto path = fs::read_symlink("/proc/self/exe"); + #endif +-- +2.50.1 +