kimageannotator, re-instate package (#11072)

This commit is contained in:
Schrijvers Luc
2024-09-06 18:30:56 +02:00
committed by GitHub
parent af5190c7d3
commit d04bcdbc9a
2 changed files with 141 additions and 0 deletions

View File

@@ -0,0 +1,97 @@
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"
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
libVersion="$portVersion"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
PROVIDES="
kimageannotator$secondaryArchSuffix = $portVersion
lib:libkImageAnnotator$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libGL$secondaryArchSuffix
lib:libkColorPicker$secondaryArchSuffix
lib:libQt6Core$secondaryArchSuffix
lib:libQt6Gui$secondaryArchSuffix
lib:libQt6Svg$secondaryArchSuffix
lib:libQt6Widgets$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:libgtest$secondaryArchSuffix
devel:libkColorPicker$secondaryArchSuffix
devel:libQt6Core$secondaryArchSuffix
devel:libQt6Svg$secondaryArchSuffix
devel:libQt6UiTools$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_WITH_QT6=ON \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTS=OFF
make -C build $jobArgs
}
INSTALL()
{
make -C build install
prepareInstalledDevelLib \
libkImageAnnotator
packageEntries devel \
$developDir \
$libDir/cmake
}
TEST()
{
# export LIBRARY_PATH="$sourceDir/build/tests${LIBRARY_PATH:+:$LIBRARY_PATH}"
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