kimageannotator, new recipe (#10216)

This commit is contained in:
Schrijvers Luc
2024-03-14 17:50:30 +01:00
committed by GitHub
parent 0ce4d7d741
commit 3b954cf3d9
2 changed files with 132 additions and 0 deletions

View File

@@ -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
}

View File

@@ -0,0 +1,44 @@
From a2f15d667cefe67aca9466c9fac0a66f9a6ebe42 Mon Sep 17 00:00:00 2001
From: Schrijvers Luc <begasus@gmail.com>
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