From 3b954cf3d90e50375faa842cfc82528ac32fa75c Mon Sep 17 00:00:00 2001 From: Schrijvers Luc Date: Thu, 14 Mar 2024 17:50:30 +0100 Subject: [PATCH] kimageannotator, new recipe (#10216) --- .../kimageannotator-0.7.1.recipe | 88 +++++++++++++++++++ .../patches/kimageannotator-0.7.1.patchset | 44 ++++++++++ 2 files changed, 132 insertions(+) create mode 100644 media-libs/kimageannotator/kimageannotator-0.7.1.recipe create mode 100644 media-libs/kimageannotator/patches/kimageannotator-0.7.1.patchset diff --git a/media-libs/kimageannotator/kimageannotator-0.7.1.recipe b/media-libs/kimageannotator/kimageannotator-0.7.1.recipe new file mode 100644 index 000000000..88790753d --- /dev/null +++ b/media-libs/kimageannotator/kimageannotator-0.7.1.recipe @@ -0,0 +1,88 @@ +SUMMARY="Tool for annotating images" +DESCRIPTION="Library and a tool for annotating images. Part of KSnip project." +HOMEPAGE="https://github.com/ksnip/kImageAnnotator" +COPYRIGHT="2021 Antonio Prcela + 2018-2022 Damir Porobi" +LICENSE="GNU LGPL v3" +REVISION="1" +SOURCE_URI="$HOMEPAGE/archive/refs/tags/v$portVersion.tar.gz" +CHECKSUM_SHA256="2335c5be15a5dde34c3333c10a6339da114e2232e4c4642dea1793e491e09677" +SOURCE_DIR="kImageAnnotator-$portVersion" +PATCHES="kimageannotator-$portVersion.patchset" + +ARCHITECTURES="all x86_gcc2" +SECONDARY_ARCHITECTURES="x86" + +libVersion="$portVersion" +libVersionCompat="$libVersion compat >= ${libVersion%.*}" + +PROVIDES=" + kimageannotator$secondaryArchSuffix = $portVersion + lib:libkImageAnnotator$secondaryArchSuffix = $libVersionCompat + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libkColorPicker$secondaryArchSuffix + lib:libQt5Core$secondaryArchSuffix + lib:libQt5Gui$secondaryArchSuffix + lib:libQt5Svg$secondaryArchSuffix + lib:libQt5Widgets$secondaryArchSuffix +# lib:libX11$secondaryArchSuffix + " + +PROVIDES_devel=" + kimageannotator${secondaryArchSuffix}_devel = $portVersion + devel:libkImageAnnotator$secondaryArchSuffix = $libVersionCompat + " +REQUIRES_devel=" + kimageannotator$secondaryArchSuffix == $portVersion base + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libkColorPicker$secondaryArchSuffix + devel:libgtest$secondaryArchSuffix + devel:libQt5Core$secondaryArchSuffix + devel:libQt5Svg$secondaryArchSuffix + devel:libQt5UiTools$secondaryArchSuffix +# devel:libX11$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:cmake + cmd:gcc$secondaryArchSuffix + cmd:make + " + +TEST_REQUIRES=" + qthaikuplugins$secondaryArchSuffix + " + +defineDebugInfoPackage kimageannotator$secondaryArchSuffix \ + $libDir/libkImageAnnotator.so.$libVersion + +BUILD() +{ + cmake -Bbuild -S. $cmakeDirArgs \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_SHARED_LIBS=ON \ + -DBUILD_TESTS=ON + make -C build $jobArgs +} + +INSTALL() +{ + make -C build install + + prepareInstalledDevelLib \ + libkImageAnnotator + + packageEntries devel \ + $developDir \ + $libDir/cmake +} + +TEST() +{ +# manual tests, individual tests pass + build/tests/ColorPickerTest +} diff --git a/media-libs/kimageannotator/patches/kimageannotator-0.7.1.patchset b/media-libs/kimageannotator/patches/kimageannotator-0.7.1.patchset new file mode 100644 index 000000000..dcd8a5b66 --- /dev/null +++ b/media-libs/kimageannotator/patches/kimageannotator-0.7.1.patchset @@ -0,0 +1,44 @@ +From a2f15d667cefe67aca9466c9fac0a66f9a6ebe42 Mon Sep 17 00:00:00 2001 +From: Schrijvers Luc +Date: Wed, 13 Mar 2024 19:19:19 +0100 +Subject: Disable X11 + + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8f3516e..e047a4f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -37,7 +37,7 @@ endif() + + find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED Widgets Svg) + +-if (UNIX AND NOT APPLE) ++if (UNIX AND NOT APPLE AND NOT HAIKU) + find_package(X11 REQUIRED) + endif () + +@@ -78,7 +78,7 @@ target_include_directories(kImageAnnotator + + target_link_libraries(kImageAnnotator PUBLIC Qt${QT_MAJOR_VERSION}::Widgets Qt${QT_MAJOR_VERSION}::Svg PRIVATE kColorPicker::kColorPicker) + +-if (UNIX AND NOT APPLE) ++if (UNIX AND NOT APPLE AND NOT HAIKU) + # X11::X11 imported target only available with sufficiently new CMake + if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.14.0) + target_link_libraries(kImageAnnotator PRIVATE X11::X11) +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt +index fe2d1da..0f862e7 100644 +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -74,7 +74,7 @@ target_link_libraries(KIMAGEANNOTATOR_STATIC + kColorPicker::kColorPicker + Qt${QT_MAJOR_VERSION}::Svg) + +-if (UNIX AND NOT APPLE) ++if (UNIX AND NOT APPLE AND NOT HAIKU) + # X11::X11 imported target only available with sufficiently new CMake + if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.14.0) + target_link_libraries(KIMAGEANNOTATOR_STATIC X11::X11) +-- +2.43.2 +