gwenview: Add recipe

Signed-off-by: Luis Gustavo S. Barreto <gustavo@ossystems.com.br>
This commit is contained in:
Luis Gustavo S. Barreto
2016-04-06 19:54:57 +00:00
parent faf42a24a7
commit 5bb16f8ca0
4 changed files with 209 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
From 05433a8b4bc65af592726c3ed482b9770526a6e1 Mon Sep 17 00:00:00 2001
From: "Luis Gustavo S. Barreto" <gustavo@ossystems.com.br>
Date: Wed, 6 Apr 2016 18:34:58 +0000
Subject: [PATCH 1/3] Fix package name
The properties of Exiv2 package are not being set properly
due to incorrect package name.
Upstream-Status: Pending
Signed-off-by: Luis Gustavo S. Barreto <gustavo@ossystems.com.br>
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0f528ae..a18ca16 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -69,7 +69,7 @@ find_package(PNG)
set_package_properties(PNG PROPERTIES URL "http://www.libpng.org" DESCRIPTION "PNG image manipulation support" TYPE REQUIRED)
find_package(Exiv2)
-set_package_properties(EXIV2 PROPERTIES URL "http://www.exiv2.org" DESCRIPTION "image metadata support" TYPE REQUIRED)
+set_package_properties(Exiv2 PROPERTIES URL "http://www.exiv2.org" DESCRIPTION "image metadata support" TYPE REQUIRED)
find_package(KF5Kipi)
if (KF5Kipi_FOUND)
--
2.1.4

View File

@@ -0,0 +1,30 @@
From 06f07a9b331bec4ff51c2a5174e758b1bffba10c Mon Sep 17 00:00:00 2001
From: "Luis Gustavo S. Barreto" <gustavo@ossystems.com.br>
Date: Wed, 6 Apr 2016 19:23:55 +0000
Subject: [PATCH 2/3] Set Kipi package properties
This change make Kipi optional.
Upstream-Status: Pending
Signed-off-by: Luis Gustavo S. Barreto <gustavo@ossystems.com.br>
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a18ca16..d855192 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -75,7 +75,7 @@ find_package(KF5Kipi)
if (KF5Kipi_FOUND)
set(KIPI_FOUND true)
endif()
-# set_package_properties(Kipi PROPERTIES URL"http://www.kipi-plugins.org" DESCRIPTION "Provides various image manipulation and export features" TYPE OPTIONAL)
+set_package_properties(KF5Kipi PROPERTIES URL "http://www.kipi-plugins.org" DESCRIPTION "Provides various image manipulation and export features" TYPE OPTIONAL)
find_package(LCMS2)
set_package_properties(LCMS2 PROPERTIES URL "http://www.littlecms.com" DESCRIPTION "Color management engine" TYPE REQUIRED)
--
2.1.4

View File

@@ -0,0 +1,106 @@
From e5170c60d0443d8f50b5bf6a85bea64bea29fbc0 Mon Sep 17 00:00:00 2001
From: "Luis Gustavo S. Barreto" <gustavo@ossystems.com.br>
Date: Wed, 6 Apr 2016 19:42:07 +0000
Subject: [PATCH 3/3] Avoid try_run
When cross compiling, the executable compiled in the first step usually
cannot be run on the build host. For this reason, we use try_compile()
to determine what version of libjpeg is available.
Upstream-Status: Pending
Signed-off-by: Luis Gustavo S. Barreto <gustavo@ossystems.com.br>
---
lib/CMakeLists.txt | 68 +++++++++++++++++++++++++++++++++---------------------
1 file changed, 42 insertions(+), 26 deletions(-)
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index cd2dbcb..0adbd3c 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -10,40 +10,56 @@ message(STATUS "Looking for libjpeg version in ${JPEG_INCLUDE_DIR}/jpeglib.h")
# found in (between libjpeg, libjpeg-turbo and various multilib header
# forwarding schemes seen in distros), have a simple program print out the
# right version.
-set(JPEGLIB_VERSION_CHECK_PATH "${CMAKE_CURRENT_BINARY_DIR}/jpeglib-version-check.c")
-file(WRITE ${JPEGLIB_VERSION_CHECK_PATH} "
-#include <stdio.h>
-#include <stdlib.h>
-#include <jpeglib.h>
-int main(void) { printf(\"%d\\\n\", JPEG_LIB_VERSION); }
-")
+function(JPEGVersionCheck Ret Op Version)
+ set(JPEGLIB_VERSION_CHECK_PATH "${CMAKE_CURRENT_BINARY_DIR}/jpeglib-version-check.c")
+ file(WRITE ${JPEGLIB_VERSION_CHECK_PATH} "
+ #include <stddef.h>
+ #include <stdio.h>
+ #include <jpeglib.h>
+ int main()
+ {
+ #if (JPEG_LIB_VERSION ${Op} ${Version})
+ #error JPEG_LIB_VERSION ${Op} ${Version}
+ #endif
+ return 0;
+ }
+ ")
-try_run(JPEGLIB_RUN_RESULT JPEGLIB_COMPILE_RESULT
- ${CMAKE_CURRENT_BINARY_DIR} ${JPEGLIB_VERSION_CHECK_PATH}
- RUN_OUTPUT_VARIABLE jpeglib_version)
+ try_compile(COMPILE_RESULT_VAR
+ "${CMAKE_BINARY_DIR}" "${JPEGLIB_VERSION_CHECK_PATH}"
+ COMPILE_DEFINITIONS "${COMPILE_DEFINITIONS}"
+ OUTPUT_VARIABLE COMPILE_OUT)
-if ((${JPEGLIB_COMPILE_RESULT} EQUAL FALSE) OR ("${JPEGLIB_RUN_RESULT}" EQUAL FAILED_TO_RUN) OR "${jpeglib_version}" STREQUAL "")
- message(FATAL_ERROR "Could not find jpeglib.h. This file comes with libjpeg.")
-endif()
+ set(${Ret} ${COMPILE_OUT} PARENT_SCOPE)
+endfunction()
-if ("${jpeglib_version}" LESS 80)
- set(GV_JPEG_DIR libjpeg-62)
-endif()
+find_package(JPEG REQUIRED)
-if ("${jpeglib_version}" EQUAL 80)
- set(GV_JPEG_DIR libjpeg-80)
-endif()
+if(JPEG_FOUND)
+ JPEGVersionCheck(JPEG_LIB_VERSION < 80)
+ if (${JPEG_LIB_VERSION} MATCHES "#error")
+ set(GV_JPEG_DIR libjpeg-62)
+ endif()
-if ("${jpeglib_version}" EQUAL 90)
- set(GV_JPEG_DIR libjpeg-90)
-endif()
+ JPEGVersionCheck(JPEG_LIB_VERSION == 80)
+ if (${JPEG_LIB_VERSION} MATCHES "#error")
+ set(GV_JPEG_DIR libjpeg-80)
+ endif()
-if ("${GV_JPEG_DIR}" STREQUAL "")
- message(FATAL_ERROR "Unknown libjpeg version: ${jpeglib_version}")
-endif()
+ JPEGVersionCheck(JPEG_LIB_VERSION == 90)
+ if (${JPEG_LIB_VERSION} MATCHES "#error")
+ set(GV_JPEG_DIR libjpeg-90)
+ endif()
-message(STATUS "libjpeg version: ${jpeglib_version}")
+ if ("${GV_JPEG_DIR}" STREQUAL "")
+ message(FATAL_ERROR "Unknown libjpeg version")
+ else()
+ message(STATUS "using ${GV_JPEG_DIR}")
+ endif()
+else(JPEG_FOUND)
+ message(FATAL_ERROR "Could not find jpeglib.h. This file comes with libjpeg.")
+endif()
add_definitions(-Dlibjpeg_EXPORTS)
include_directories(
--
2.1.4

View File

@@ -0,0 +1,42 @@
SUMMARY = "A fast and easy to use image viewer for KDE"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=5a3169a2d39a757efd8b7aa66a69d97b"
inherit kde-apps
DEPENDS += " \
jpeg \
exiv2 \
lcms \
phonon \
kdelibs4support \
kded \
kactivities \
kcoreaddons \
kxmlgui \
kfilemetadata \
baloo \
"
PV = "${KDE_APP_VERSION}"
SRC_URI[md5sum] = "c82fab391765ce803490ea93ddc899ed"
SRC_URI[sha256sum] = "c9b6248d748a3e6bef9a6fea100b15caa502c14a71ab38d5c2ae7328e9509187"
SRC_URI += " \
file://0001-Fix-package-name.patch \
file://0002-Set-Kipi-package-properties.patch \
file://0003-Avoid-try_run.patch \
"
CXXFLAGS += "-isystem ${STAGING_INCDIR}/phonon4qt5/KDE"
FILES_${PN} += " \
${datadir}/k*5 \
${datadir}/icons \
${datadir}/appdata \
${OE_QMAKE_PATH_PLUGINS} \
"
FILES_${PN}-dbg += " \
${OE_QMAKE_PATH_PLUGINS}/.debug \
"