mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-23 04:00:05 +02:00
GMIC: use cmake for build
* build libgmic shared lib * add devel package * add haiku icons
This commit is contained in:
@@ -8,12 +8,15 @@ volumetric images, hence including 2D color images."
|
||||
HOMEPAGE="https://gmic.eu"
|
||||
COPYRIGHT="Sébastien Fourey"
|
||||
LICENSE="GNU GPL v3"
|
||||
REVISION="1"
|
||||
REVISION="2"
|
||||
SOURCE_URI="https://gmic.eu/files/source/gmic_$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="9f053338752ec96a6b619718037767682c5fd58e2471c08f3740fdb070605bc0"
|
||||
SOURCE_DIR="gmic-$portVersion"
|
||||
ADDITIONAL_FILES="gmic.rdef.in"
|
||||
PATCHES="gmic-$portVersion.patchset"
|
||||
ADDITIONAL_FILES="
|
||||
gmic.rdef.in
|
||||
icons.zip
|
||||
"
|
||||
|
||||
ARCHITECTURES="all !x86_gcc2"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
@@ -41,13 +44,28 @@ REQUIRES="
|
||||
lib:libz$secondaryArchSuffix
|
||||
"
|
||||
|
||||
PROVIDES_devel="
|
||||
gmic${secondaryArchSuffix}_devel = $portVersion
|
||||
devel:libgmic${secondaryArchSuffix} = $portVersion
|
||||
"
|
||||
REQUIRES_devel="
|
||||
gmic$secondaryArchSuffix == $portVersion base
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
devel:libavcodec$secondaryArchSuffix
|
||||
devel:libavformat$secondaryArchSuffix
|
||||
devel:libcurl$secondaryArchSuffix
|
||||
devel:libfftw3$secondaryArchSuffix
|
||||
devel:libGL$secondaryArchSuffix
|
||||
devel:libGraphicsMagick$secondaryArchSuffix
|
||||
devel:libGraphicsMagickWand$secondaryArchSuffix
|
||||
devel:libiconv$secondaryArchSuffix
|
||||
devel:libjpeg$secondaryArchSuffix
|
||||
devel:libOpenEXR_3_0$secondaryArchSuffix
|
||||
devel:libOpenEXRUtil_3_0$secondaryArchSuffix
|
||||
devel:libopencv_core$secondaryArchSuffix
|
||||
devel:libpng16$secondaryArchSuffix
|
||||
devel:libQt5Core$secondaryArchSuffix
|
||||
devel:libQt5Gui$secondaryArchSuffix
|
||||
@@ -58,25 +76,71 @@ BUILD_REQUIRES="
|
||||
devel:libz$secondaryArchSuffix
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:cmake
|
||||
cmd:g++$secondaryArchSuffix
|
||||
cmd:lrelease$secondaryArchSuffix >= 5
|
||||
cmd:make
|
||||
cmd:pkg_config$secondaryArchSuffix
|
||||
cmd:qmake$secondaryArchSuffix >= 5
|
||||
cmd:unzip
|
||||
"
|
||||
|
||||
PATCH()
|
||||
{
|
||||
unzip -o $sourceDir/../../additional-files/icons.zip -d $sourceDir/gmic-qt/icons
|
||||
unzip -o $sourceDir/../../additional-files/icons.zip -d $sourceDir/gmic-qt/icons/dark
|
||||
}
|
||||
|
||||
BUILD()
|
||||
{
|
||||
cd gmic-qt
|
||||
qmake HOST=none
|
||||
make $jobArgs
|
||||
export DISABLE_ASLR=1
|
||||
|
||||
cmake $cmakeDirArgs \
|
||||
-B build -S . \
|
||||
-DCMAKE_CXX_FLAGS="-O3" \
|
||||
-DCUSTOM_CFLAGS=ON \
|
||||
-DBUILD_BASH_COMPLETION=OFF \
|
||||
-DBUILD_CLI=OFF \
|
||||
-DBUILD_LIB=ON \
|
||||
-DBUILD_LIB_STATIC=OFF \
|
||||
-DBUILD_MAN=OFF \
|
||||
-DENABLE_CURL=ON \
|
||||
-DENABLE_DYNAMIC_LINKING=ON \
|
||||
-DENABLE_FFMPEG=ON \
|
||||
-DENABLE_FFTW=ON \
|
||||
-DENABLE_GRAPHICSMAGICK=ON \
|
||||
-DENABLE_OPENCV=ON \
|
||||
-DENABLE_OPENEXR=ON \
|
||||
-DENABLE_OPENMP=ON \
|
||||
-DENABLE_PNG=ON \
|
||||
-DENABLE_TIFF=ON \
|
||||
-DENABLE_ZLIB=ON \
|
||||
-DENABLE_LTO=OFF
|
||||
|
||||
cmake --build build
|
||||
|
||||
export LDFLAGS="$LDFLAGS -L../build"
|
||||
|
||||
cmake -B build-qt -S ./gmic-qt \
|
||||
-DCMAKE_CXX_FLAGS="-O3" \
|
||||
-DCUSTOM_CFLAGS=ON \
|
||||
-DGMIC_PATH=$sourceDir/src \
|
||||
-DGMIC_QT_HOST=none \
|
||||
-DENABLE_ASAN=OFF \
|
||||
-DENABLE_CURL=ON \
|
||||
-DENABLE_DYNAMIC_LINKING=ON \
|
||||
-DENABLE_FFTW3=ON \
|
||||
-DENABLE_LTO=OFF
|
||||
|
||||
cmake --build build-qt
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
cmake --install build
|
||||
|
||||
mkdir -p "$appsDir/G'MIC"
|
||||
cp gmic-qt/gmic_qt "$appsDir/G'MIC/G'MIC"
|
||||
cp README "$appsDir/G'MIC/"
|
||||
cp build-qt/gmic_qt "$appsDir/G'MIC/G'MIC"
|
||||
cp README "$appsDir/G'MIC"
|
||||
|
||||
local APP_SIGNATURE="application/x-vnd.gmic"
|
||||
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
|
||||
@@ -91,7 +155,13 @@ INSTALL()
|
||||
-e "s|@LONG_INFO@|$LONG_INFO|" \
|
||||
$portDir/additional-files/gmic.rdef.in > gmic.rdef
|
||||
|
||||
addResourcesToBinaries gmic.rdef $appsDir/G\'MIC/G\'MIC
|
||||
addResourcesToBinaries gmic.rdef "$appsDir/G'MIC/G'MIC"
|
||||
|
||||
addAppDeskbarSymlink $appsDir/G\'MIC/G\'MIC
|
||||
addAppDeskbarSymlink "$appsDir/G'MIC/G'MIC"
|
||||
|
||||
prepareInstalledDevelLibs libgmic
|
||||
|
||||
packageEntries devel \
|
||||
$developDir \
|
||||
$libDir/cmake
|
||||
}
|
||||
|
||||
@@ -1,22 +1,9 @@
|
||||
From b73254d460e1eb24ca0713197b24ca144b46cb3b Mon Sep 17 00:00:00 2001
|
||||
From 8571f5d46af6675f7c23b9fcd4e95c0577de9320 Mon Sep 17 00:00:00 2001
|
||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
||||
Date: Fri, 1 Oct 2021 20:50:15 +1000
|
||||
Subject: Fix for Haiku
|
||||
Subject: Fix build for Haiku
|
||||
|
||||
|
||||
diff --git a/gmic-qt/gmic_qt.pro b/gmic-qt/gmic_qt.pro
|
||||
index 9a0d1ee..1313934 100644
|
||||
--- a/gmic-qt/gmic_qt.pro
|
||||
+++ b/gmic-qt/gmic_qt.pro
|
||||
@@ -141,7 +141,7 @@ message("CImg version is" $$CIMG_VERSION)
|
||||
|
||||
!win32 {
|
||||
LIBS += -lfftw3_threads
|
||||
- DEFINES += cimg_display=1
|
||||
+ DEFINES += cimg_display=0
|
||||
}
|
||||
|
||||
win32 {
|
||||
diff --git a/src/gmic.h b/src/gmic.h
|
||||
index 6698bc0..1546281 100644
|
||||
--- a/src/gmic.h
|
||||
@@ -32,7 +19,31 @@ index 6698bc0..1546281 100644
|
||||
+
|
||||
#ifndef gmic_version
|
||||
#define gmic_version 299
|
||||
|
||||
diff --git a/gmic-qt/CMakeLists.txt b/gmic-qt/CMakeLists.txt
|
||||
index 93119fa..149a61b 100644
|
||||
--- a/gmic-qt/CMakeLists.txt
|
||||
+++ b/gmic-qt/CMakeLists.txt
|
||||
@@ -240,7 +240,7 @@ add_definitions(-Dgmic_gui)
|
||||
add_definitions(-Dcimg_use_abort)
|
||||
add_definitions(-Dcimg_appname=\"gmic\")
|
||||
|
||||
-if (UNIX AND NOT APPLE)
|
||||
+if (UNIX AND NOT APPLE AND NOT HAIKU)
|
||||
add_definitions(-Dcimg_display=1)
|
||||
add_definitions(-D_IS_LINUX_)
|
||||
add_definitions(-Dcimg_use_vt100)
|
||||
@@ -261,6 +261,10 @@ if (APPLE)
|
||||
add_definitions(-mmacosx-version-min=10.9 -Wno-macro-redefined -Wno-deprecated-register)
|
||||
endif()
|
||||
|
||||
+if (HAIKU)
|
||||
+ add_definitions(-Dcimg_display=0)
|
||||
+endif()
|
||||
+
|
||||
if (WIN32)
|
||||
add_definitions(-Dcimg_display=2)
|
||||
add_definitions(-DPSAPI_VERSION=1)
|
||||
--
|
||||
2.30.2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user