Merge pull request #2301 from groni/master
add lensfun, darktable, pugixml, pugixml is a dependency for darktable
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Licensed under the GNU General Public License, version 3.
|
||||
# See the file http://www.gnu.org/copyleft/gpl.txt.
|
||||
|
||||
from pisi.actionsapi import cmaketools
|
||||
from pisi.actionsapi import shelltools
|
||||
from pisi.actionsapi import pisitools
|
||||
from pisi.actionsapi import get
|
||||
|
||||
def setup():
|
||||
pisitools.ldflags.add("-lgs")
|
||||
shelltools.makedirs("build")
|
||||
shelltools.cd("build")
|
||||
cmaketools.configure("-DDONT_INSTALL_GCONF_SCHEMAS=1 \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DBINARY_PACKAGE_BUILD=1 \
|
||||
-DBUILD_USERMANUAL=False \
|
||||
-DUSE_LIBSECRET=On \
|
||||
-DUSE_COLORD=On \
|
||||
-DBUILD_USERMANUAL=0", sourceDir="..")
|
||||
|
||||
def build():
|
||||
shelltools.cd("build")
|
||||
cmaketools.make()
|
||||
|
||||
def install():
|
||||
shelltools.cd("build")
|
||||
cmaketools.install()
|
||||
@@ -0,0 +1,920 @@
|
||||
From 74ca29440e46136504ed6fc811ccd60da8af8abc Mon Sep 17 00:00:00 2001
|
||||
From: David Bremner <david@tethera.net>
|
||||
Date: Wed, 26 Oct 2016 22:18:48 -0300
|
||||
Subject: [PATCH 1/3] debcherry fixup patch
|
||||
|
||||
88800f7 J2K: use g_strlcpy() instead of g_snprintf()
|
||||
- no changes against upstream or conflicts
|
||||
c6e0b7c FindOpenJPEG.cmake: use HINTS, not PATHS. NO_DEFAULT_PATH is not needed.
|
||||
- no changes against upstream or conflicts
|
||||
5cf698f Port to OpenJPEG2
|
||||
- extra changes or conflicts
|
||||
6f48d69 FindOpenJPEG.cmake: pick right include path if multiple headers.
|
||||
- extra changes or conflicts
|
||||
acf974a Update cmake stuff to look for OpenJPEG2 (openjpeg >= 2.0.0 aka openjp2)
|
||||
- extra changes or conflicts
|
||||
ecef362 restore upstream TODO
|
||||
- no changes against upstream or conflicts
|
||||
898199a debian: cleanup useless / missing docs
|
||||
- extra changes or conflicts
|
||||
31da456 remove dcraw.c again
|
||||
- no changes against upstream or conflicts
|
||||
4c3f916 remove dcraw.c
|
||||
- no changes against upstream or conflicts
|
||||
3b395b6 "undelete" some files now shipped in upstream tarball
|
||||
- extra changes or conflicts
|
||||
7d30472 remove version.h from git; generate it at build time
|
||||
- no changes against upstream or conflicts
|
||||
7441226 remove version.sh, unneeded for build
|
||||
- no changes against upstream or conflicts
|
||||
b0be4a0 commit version.h, version.sh for new version
|
||||
- extra changes or conflicts
|
||||
b5784e1 commit version.sh for current upstream snapshot
|
||||
- extra changes or conflicts
|
||||
cea1f68 remove generated files that are no longer carried in upstream branch (since we are not going to import them from tarballs.
|
||||
- extra changes or conflicts
|
||||
f67ef8e Revert "As a workaround, add files to POTFILES.skip"
|
||||
- extra changes or conflicts
|
||||
f6a4d09 As a workaround, add files to POTFILES.skip
|
||||
- extra changes or conflicts
|
||||
1eb15b3 Imported Upstream version 0.5
|
||||
- extra changes or conflicts
|
||||
---
|
||||
cmake/modules/FindOpenJPEG.cmake | 112 ++++---------------
|
||||
src/CMakeLists.txt | 17 +--
|
||||
src/common/imageio_j2k.c | 228 ++++++++++++++++++++++----------------
|
||||
src/imageio/format/CMakeLists.txt | 4 +-
|
||||
src/imageio/format/j2k.c | 130 +++++++++++-----------
|
||||
5 files changed, 224 insertions(+), 267 deletions(-)
|
||||
|
||||
diff --git a/cmake/modules/FindOpenJPEG.cmake b/cmake/modules/FindOpenJPEG.cmake
|
||||
index b80f922..da6d275 100644
|
||||
--- a/cmake/modules/FindOpenJPEG.cmake
|
||||
+++ b/cmake/modules/FindOpenJPEG.cmake
|
||||
@@ -1,101 +1,29 @@
|
||||
-# - Find OpenJPEG library
|
||||
-# Find the native OpenJPEG includes and library
|
||||
-# This module defines
|
||||
-# OPENJPEG_INCLUDE_DIRS, where to find openjpeg.h, Set when
|
||||
-# OPENJPEG_INCLUDE_DIR is found.
|
||||
-# OPENJPEG_LIBRARIES, libraries to link against to use OpenJPEG.
|
||||
-# OPENJPEG_ROOT_DIR, The base directory to search for OpenJPEG.
|
||||
-# This can also be an environment variable.
|
||||
-# OPENJPEG_FOUND, If false, do not try to use OpenJPEG.
|
||||
+# - Try to find OpenJPEG
|
||||
+# Once done, this will define
|
||||
#
|
||||
-# also defined, but not for general use are
|
||||
-# OPENJPEG_LIBRARY, where to find the OpenJPEG library.
|
||||
-
|
||||
-#=============================================================================
|
||||
-# Copyright 2011 Blender Foundation.
|
||||
-#
|
||||
-# Distributed under the OSI-approved BSD License (the "License");
|
||||
-# see accompanying file Copyright.txt for details.
|
||||
-#
|
||||
-# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
-# See the License for more information.
|
||||
-#=============================================================================
|
||||
-
|
||||
-# If OPENJPEG_ROOT_DIR was defined in the environment, use it.
|
||||
-IF(NOT OPENJPEG_ROOT_DIR AND NOT $ENV{OPENJPEG_ROOT_DIR} STREQUAL "")
|
||||
- SET(OPENJPEG_ROOT_DIR $ENV{OPENJPEG_ROOT_DIR})
|
||||
-ENDIF()
|
||||
+# OpenJPEG_FOUND - system has OpenJPEG
|
||||
+# OpenJPEG_INCLUDE_DIRS - the OpenJPEG include directories
|
||||
+# OpenJPEG_LIBRARIES - link these to use OpenJPEG
|
||||
|
||||
include(LibFindMacros)
|
||||
|
||||
-libfind_pkg_check_modules(PC_OPENJPEG libopenjpeg1)
|
||||
+# Use pkg-config to get hints about paths
|
||||
+libfind_pkg_check_modules(OpenJPEG_PKGCONF libopenjp2)
|
||||
|
||||
-SET(_openjpeg_SEARCH_DIRS
|
||||
- ${OPENJPEG_ROOT_DIR}
|
||||
- /usr/local
|
||||
- /sw # Fink
|
||||
- /opt/local # DarwinPorts
|
||||
- /opt/csw # Blastwave
|
||||
+# Include dir
|
||||
+find_path(OpenJPEG_INCLUDE_DIR
|
||||
+ NAMES openjpeg.h
|
||||
+ HINTS ${OpenJPEG_PKGCONF_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
-FIND_PATH(OPENJPEG_INCLUDE_DIR
|
||||
- NAMES
|
||||
- openjpeg.h
|
||||
- HINTS
|
||||
- ${PC_OPENJPEG_INCLUDEDIR}
|
||||
- ${PC_OPENJPEG_INCLUDE_DIRS}
|
||||
- ${_openjpeg_SEARCH_DIRS}
|
||||
- PATH_SUFFIXES
|
||||
- include
|
||||
+# Finally the library itself
|
||||
+find_library(OpenJPEG_LIBRARY
|
||||
+ NAMES openjp2
|
||||
+ HINTS ${OpenJPEG_PKGCONF_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
-FIND_LIBRARY(OPENJPEG_LIBRARY
|
||||
- NAMES
|
||||
- openjpeg
|
||||
- HINTS
|
||||
- ${PC_OPENJPEG_LIBDIR}
|
||||
- ${PC_OPENJPEG_LIBRARY_DIRS}
|
||||
- ${_openjpeg_SEARCH_DIRS}
|
||||
- PATH_SUFFIXES
|
||||
- lib64 lib
|
||||
- )
|
||||
-
|
||||
-# handle the QUIETLY and REQUIRED arguments and set OPENJPEG_FOUND to TRUE if
|
||||
-# all listed variables are TRUE
|
||||
-INCLUDE(FindPackageHandleStandardArgs)
|
||||
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenJPEG DEFAULT_MSG
|
||||
- OPENJPEG_LIBRARY OPENJPEG_INCLUDE_DIR)
|
||||
-
|
||||
-IF(OPENJPEG_FOUND)
|
||||
- SET(OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARY})
|
||||
- SET(OPENJPEG_INCLUDE_DIRS ${OPENJPEG_INCLUDE_DIR})
|
||||
-
|
||||
- # 1.3 didn't have pkg-config support, so we can't use that to get the version.
|
||||
- # 1.5 no longer has the #define OPENJPEG_VERSION ... in openjpeg.h so we can't use that either.
|
||||
- # Thus we might have to compile a smalltest program to get the version string. Could someone please kill me?
|
||||
-
|
||||
- # see if pkg-config found the library. this should succeed for cross compiles as they are harder to run test programs
|
||||
- if(NOT "${PC_OPENJPEG_VERSION}" STREQUAL "")
|
||||
- # use the version as found by pkg-config
|
||||
- set(OPENJPEG_VERSION ${PC_OPENJPEG_VERSION})
|
||||
- else(NOT "${PC_OPENJPEG_VERSION}" STREQUAL "")
|
||||
- # too bad, we have to run our test code
|
||||
- try_run(run_var result_var
|
||||
- ${CMAKE_BINARY_DIR}/CMakeTmp
|
||||
- ${CMAKE_SOURCE_DIR}/cmake/modules/openjpeg_version.c
|
||||
- CMAKE_FLAGS "-DLINK_LIBRARIES:STRING=${OPENJPEG_LIBRARIES}"
|
||||
- "-DINCLUDE_DIRECTORIES:STRING=${OPENJPEG_INCLUDE_DIRS}"
|
||||
- RUN_OUTPUT_VARIABLE rout_var
|
||||
- )
|
||||
- if(result_var)
|
||||
- set(OPENJPEG_VERSION ${rout_var})
|
||||
- endif(result_var)
|
||||
- endif(NOT "${PC_OPENJPEG_VERSION}" STREQUAL "")
|
||||
-
|
||||
-ENDIF(OPENJPEG_FOUND)
|
||||
-
|
||||
-MARK_AS_ADVANCED(
|
||||
- OPENJPEG_INCLUDE_DIR
|
||||
- OPENJPEG_LIBRARY
|
||||
-)
|
||||
+# Set the include dir variables and the libraries and let libfind_process do the rest.
|
||||
+# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
|
||||
+set(OpenJPEG_PROCESS_INCLUDES OpenJPEG_INCLUDE_DIR)
|
||||
+set(OpenJPEG_PROCESS_LIBS OpenJPEG_LIBRARY)
|
||||
+libfind_process(OpenJPEG)
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index 9278d91..7d29528 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -225,18 +225,13 @@ endif(USE_FLICKR)
|
||||
|
||||
if(USE_OPENJPEG)
|
||||
find_package(OpenJPEG)
|
||||
- if(OPENJPEG_FOUND)
|
||||
- list(APPEND SOURCES "common/imageio_j2k.c")
|
||||
- include_directories(SYSTEM ${OPENJPEG_INCLUDE_DIRS})
|
||||
- list(APPEND LIBS ${OPENJPEG_LIBRARIES})
|
||||
- add_definitions(${OPENJPEG_DEFINITIONS})
|
||||
+ if(OpenJPEG_FOUND)
|
||||
add_definitions("-DHAVE_OPENJPEG")
|
||||
- if(OPENJPEG_VERSION VERSION_LESS "1.5.0")
|
||||
- message(STATUS "OpenJPEG version ${OPENJPEG_VERSION} found. Only 1.5 and newer support reading of icc profiles.")
|
||||
- else()
|
||||
- add_definitions("-DHAVE_OPENJPEG_ICC")
|
||||
- endif()
|
||||
- endif(OPENJPEG_FOUND)
|
||||
+ list(APPEND SOURCES "common/imageio_j2k.c")
|
||||
+
|
||||
+ include_directories(SYSTEM ${OpenJPEG_INCLUDE_DIRS})
|
||||
+ list(APPEND LIBS ${OpenJPEG_LIBRARIES})
|
||||
+ endif(OpenJPEG_FOUND)
|
||||
endif(USE_OPENJPEG)
|
||||
|
||||
#
|
||||
diff --git a/src/common/imageio_j2k.c b/src/common/imageio_j2k.c
|
||||
index 84bcd28..7f60e7f 100644
|
||||
--- a/src/common/imageio_j2k.c
|
||||
+++ b/src/common/imageio_j2k.c
|
||||
@@ -36,6 +36,7 @@
|
||||
#define JPT_CFMT 2
|
||||
|
||||
static char JP2_HEAD[] = { 0x0, 0x0, 0x0, 0x0C, 0x6A, 0x50, 0x20, 0x20, 0x0D, 0x0A, 0x87, 0x0A };
|
||||
+static char JP2_MAGIC[] = { 0x0d, 0x0a, 0x87, 0x0a };
|
||||
static char J2K_HEAD[] = { 0xFF, 0x4F, 0xFF, 0x51, 0x00 };
|
||||
// there seems to be no JPIP/JPT magic string, so we can't load it ...
|
||||
|
||||
@@ -74,7 +75,7 @@ static int get_file_format(const char *filename)
|
||||
char *ext = strrchr(filename, '.');
|
||||
if(ext == NULL) return -1;
|
||||
ext++;
|
||||
- if(ext)
|
||||
+ if(*ext)
|
||||
{
|
||||
for(i = 0; i < sizeof(format) / sizeof(*format); i++)
|
||||
{
|
||||
@@ -91,100 +92,116 @@ static int get_file_format(const char *filename)
|
||||
dt_imageio_retval_t dt_imageio_open_j2k(dt_image_t *img, const char *filename, dt_mipmap_buffer_t *mbuf)
|
||||
{
|
||||
opj_dparameters_t parameters; /* decompression parameters */
|
||||
- opj_event_mgr_t event_mgr; /* event manager */
|
||||
opj_image_t *image = NULL;
|
||||
FILE *fsrc = NULL;
|
||||
- unsigned char *src = NULL;
|
||||
- size_t file_length;
|
||||
- opj_dinfo_t *dinfo = NULL; /* handle to a decompressor */
|
||||
- opj_cio_t *cio = NULL;
|
||||
+ unsigned char src_header[12] = { 0 };
|
||||
+ opj_codec_t *d_codec = NULL;
|
||||
OPJ_CODEC_FORMAT codec;
|
||||
+ opj_stream_t *d_stream = NULL; /* Stream */
|
||||
int ret = DT_IMAGEIO_FILE_CORRUPTED;
|
||||
|
||||
- int file_format = get_file_format(filename);
|
||||
- if(file_format == -1) return DT_IMAGEIO_FILE_CORRUPTED;
|
||||
+ /* set decoding parameters to default values */
|
||||
+ opj_set_default_decoder_parameters(¶meters);
|
||||
+
|
||||
+ g_strlcpy(parameters.infile, filename, sizeof(parameters.infile));
|
||||
+
|
||||
+ parameters.decod_format = get_file_format(filename);
|
||||
+ if(parameters.decod_format == -1) return DT_IMAGEIO_FILE_CORRUPTED;
|
||||
|
||||
if(!img->exif_inited) (void)dt_exif_read(img, filename);
|
||||
|
||||
- /* read the input file and put it in memory */
|
||||
- /* ---------------------------------------- */
|
||||
fsrc = fopen(filename, "rb");
|
||||
if(!fsrc)
|
||||
{
|
||||
fprintf(stderr, "[j2k_open] Error: failed to open `%s' for reading\n", filename);
|
||||
return DT_IMAGEIO_FILE_NOT_FOUND;
|
||||
}
|
||||
- fseek(fsrc, 0, SEEK_END);
|
||||
- file_length = ftell(fsrc);
|
||||
- fseek(fsrc, 0, SEEK_SET);
|
||||
- src = (unsigned char *)malloc(file_length);
|
||||
- if(fread(src, 1, file_length, fsrc) != file_length)
|
||||
+ if(fread(src_header, 1, 12, fsrc) != 12)
|
||||
{
|
||||
- free(src);
|
||||
fclose(fsrc);
|
||||
fprintf(stderr, "[j2k_open] Error: fread returned a number of elements different from the expected.\n");
|
||||
return DT_IMAGEIO_FILE_NOT_FOUND;
|
||||
}
|
||||
fclose(fsrc);
|
||||
|
||||
- if(memcmp(JP2_HEAD, src, sizeof(JP2_HEAD)) == 0)
|
||||
+ if(memcmp(JP2_HEAD, src_header, sizeof(JP2_HEAD)) == 0 || memcmp(JP2_MAGIC, src_header, sizeof(JP2_MAGIC)) == 0)
|
||||
{
|
||||
- file_format = JP2_CFMT; // just in case someone used the wrong extension
|
||||
+ parameters.decod_format = JP2_CFMT; // just in case someone used the wrong extension
|
||||
}
|
||||
- else if(memcmp(J2K_HEAD, src, sizeof(J2K_HEAD)) == 0)
|
||||
+ else if(memcmp(J2K_HEAD, src_header, sizeof(J2K_HEAD)) == 0)
|
||||
{
|
||||
- file_format = J2K_CFMT; // just in case someone used the wrong extension
|
||||
+ parameters.decod_format = J2K_CFMT; // just in case someone used the wrong extension
|
||||
}
|
||||
else // this will also reject jpt files.
|
||||
{
|
||||
- free(src);
|
||||
fprintf(stderr, "[j2k_open] Error: `%s' has unsupported file format.\n", filename);
|
||||
return DT_IMAGEIO_FILE_CORRUPTED;
|
||||
}
|
||||
|
||||
- /* configure the event callbacks (not required) */
|
||||
- memset(&event_mgr, 0, sizeof(opj_event_mgr_t));
|
||||
- event_mgr.error_handler = error_callback;
|
||||
- // event_mgr.warning_handler = warning_callback;
|
||||
- // event_mgr.info_handler = info_callback;
|
||||
-
|
||||
- /* set decoding parameters to default values */
|
||||
- opj_set_default_decoder_parameters(¶meters);
|
||||
|
||||
/* decode the code-stream */
|
||||
/* ---------------------- */
|
||||
- if(file_format == J2K_CFMT) /* JPEG-2000 codestream */
|
||||
- codec = CODEC_J2K;
|
||||
- else if(file_format == JP2_CFMT) /* JPEG 2000 compressed image data */
|
||||
- codec = CODEC_JP2;
|
||||
- else if(file_format == JPT_CFMT) /* JPEG 2000, JPIP */
|
||||
- codec = CODEC_JPT;
|
||||
+ if(parameters.decod_format == J2K_CFMT) /* JPEG-2000 codestream */
|
||||
+ codec = OPJ_CODEC_J2K;
|
||||
+ else if(parameters.decod_format == JP2_CFMT) /* JPEG 2000 compressed image data */
|
||||
+ codec = OPJ_CODEC_JP2;
|
||||
+ else if(parameters.decod_format == JPT_CFMT) /* JPEG 2000, JPIP */
|
||||
+ codec = OPJ_CODEC_JPT;
|
||||
else
|
||||
{
|
||||
- free(src);
|
||||
return DT_IMAGEIO_FILE_CORRUPTED; // can't happen
|
||||
}
|
||||
|
||||
- /* get a decoder handle */
|
||||
- dinfo = opj_create_decompress(codec);
|
||||
+ d_codec = opj_create_decompress(codec);
|
||||
+ if(!d_codec)
|
||||
+ {
|
||||
+ fprintf(stderr, "[j2k_open] Error: failed to create the decoder\n");
|
||||
+ return DT_IMAGEIO_FILE_CORRUPTED;
|
||||
+ }
|
||||
|
||||
/* catch events using our callbacks and give a local context */
|
||||
- opj_set_event_mgr((opj_common_ptr)dinfo, &event_mgr, stderr);
|
||||
+ opj_set_error_handler(d_codec, error_callback, stderr);
|
||||
+ // opj_set_warning_handler(d_codec, error_callback, stderr);
|
||||
+ // opj_set_info_handler(d_codec, error_callback, stderr);
|
||||
|
||||
/* setup the decoder decoding parameters using user parameters */
|
||||
- opj_setup_decoder(dinfo, ¶meters);
|
||||
+ if(!opj_setup_decoder(d_codec, ¶meters))
|
||||
+ {
|
||||
+ fprintf(stderr, "[j2k_open] Error: failed to setup the decoder %s\n", parameters.infile);
|
||||
+ opj_destroy_codec(d_codec);
|
||||
+ return DT_IMAGEIO_FILE_CORRUPTED;
|
||||
+ }
|
||||
|
||||
- /* open a byte stream */
|
||||
- cio = opj_cio_open((opj_common_ptr)dinfo, src, file_length);
|
||||
+ d_stream = opj_stream_create_default_file_stream(parameters.infile, 1);
|
||||
+ if(!d_stream)
|
||||
+ {
|
||||
+ fprintf(stderr, "[j2k_open] Error: failed to create the stream from the file %s\n", parameters.infile);
|
||||
+ opj_destroy_codec(d_codec);
|
||||
+ return DT_IMAGEIO_FILE_CORRUPTED;
|
||||
+ }
|
||||
|
||||
- /* decode the stream and fill the image structure */
|
||||
- image = opj_decode(dinfo, cio);
|
||||
+ /* Read the main header of the codestream and if necessary the JP2 boxes*/
|
||||
+ if(!opj_read_header(d_stream, d_codec, &image))
|
||||
+ {
|
||||
+ fprintf(stderr, "[j2k_open] Error: failed to read the header\n");
|
||||
+ opj_stream_destroy(d_stream);
|
||||
+ opj_destroy_codec(d_codec);
|
||||
+ opj_image_destroy(image);
|
||||
+ return EXIT_FAILURE;
|
||||
+ }
|
||||
|
||||
- /* close the byte stream */
|
||||
- opj_cio_close(cio);
|
||||
+ /* Get the decoded image */
|
||||
+ if(!(opj_decode(d_codec, d_stream, image) && opj_end_decompress(d_codec, d_stream)))
|
||||
+ {
|
||||
+ fprintf(stderr, "[j2k_open] Error: failed to decode image!\n");
|
||||
+ opj_destroy_codec(d_codec);
|
||||
+ opj_stream_destroy(d_stream);
|
||||
+ opj_image_destroy(image);
|
||||
+ return DT_IMAGEIO_FILE_CORRUPTED;
|
||||
+ }
|
||||
|
||||
- /* free the memory containing the code-stream */
|
||||
- free(src);
|
||||
+ /* Close the byte stream */
|
||||
+ opj_stream_destroy(d_stream);
|
||||
|
||||
if(!image)
|
||||
{
|
||||
@@ -193,14 +210,11 @@ dt_imageio_retval_t dt_imageio_open_j2k(dt_image_t *img, const char *filename, d
|
||||
goto end_of_the_world;
|
||||
}
|
||||
|
||||
- if(image->color_space == CLRSPC_SYCC)
|
||||
+ if(image->color_space == OPJ_CLRSPC_SYCC)
|
||||
{
|
||||
color_sycc_to_rgb(image);
|
||||
}
|
||||
|
||||
-// FIXME: openjpeg didn't have support for icc profiles before version 1.5
|
||||
-// this needs some #ifdef magic and proper implementation
|
||||
-#ifdef HAVE_OPENJPEG_ICC
|
||||
if(image->icc_profile_buf)
|
||||
{
|
||||
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
|
||||
@@ -211,7 +225,6 @@ dt_imageio_retval_t dt_imageio_open_j2k(dt_image_t *img, const char *filename, d
|
||||
image->icc_profile_buf = NULL;
|
||||
image->icc_profile_len = 0;
|
||||
}
|
||||
-#endif
|
||||
|
||||
/* create output image */
|
||||
/* ------------------- */
|
||||
@@ -289,7 +302,7 @@ dt_imageio_retval_t dt_imageio_open_j2k(dt_image_t *img, const char *filename, d
|
||||
|
||||
end_of_the_world:
|
||||
/* free remaining structures */
|
||||
- if(dinfo) opj_destroy_decompress(dinfo);
|
||||
+ opj_destroy_codec(d_codec);
|
||||
|
||||
/* free image data structure */
|
||||
opj_image_destroy(image);
|
||||
@@ -299,83 +312,113 @@ end_of_the_world:
|
||||
|
||||
int dt_imageio_j2k_read_profile(const char *filename, uint8_t **out)
|
||||
{
|
||||
-#ifdef HAVE_OPENJPEG_ICC
|
||||
opj_dparameters_t parameters; /* decompression parameters */
|
||||
opj_image_t *image = NULL;
|
||||
FILE *fsrc = NULL;
|
||||
- unsigned char *src = NULL;
|
||||
- size_t file_length;
|
||||
- opj_dinfo_t *dinfo = NULL; /* handle to a decompressor */
|
||||
- opj_cio_t *cio = NULL;
|
||||
+ unsigned char src_header[12] = { 0 };
|
||||
+ opj_codec_t *d_codec = NULL;
|
||||
OPJ_CODEC_FORMAT codec;
|
||||
+ opj_stream_t *d_stream = NULL; /* Stream */
|
||||
gboolean res = FALSE;
|
||||
unsigned int length = 0;
|
||||
*out = NULL;
|
||||
|
||||
+ /* set decoding parameters to default values */
|
||||
+ opj_set_default_decoder_parameters(¶meters);
|
||||
+
|
||||
+ g_strlcpy(parameters.infile, filename, sizeof(parameters.infile));
|
||||
+
|
||||
+ parameters.decod_format = get_file_format(filename);
|
||||
+ if(parameters.decod_format == -1) return DT_IMAGEIO_FILE_CORRUPTED;
|
||||
+
|
||||
/* read the input file and put it in memory */
|
||||
/* ---------------------------------------- */
|
||||
fsrc = fopen(filename, "rb");
|
||||
if(!fsrc)
|
||||
{
|
||||
- fprintf(stderr, "[j2k_open] Error: failed to open `%s' for reading\n", filename);
|
||||
+ fprintf(stderr, "[j2k_read_profile] Error: failed to open `%s' for reading\n", filename);
|
||||
goto another_end_of_the_world;
|
||||
}
|
||||
- fseek(fsrc, 0, SEEK_END);
|
||||
- file_length = ftell(fsrc);
|
||||
- fseek(fsrc, 0, SEEK_SET);
|
||||
- src = (unsigned char *)malloc(file_length);
|
||||
- if(fread(src, 1, file_length, fsrc) != file_length)
|
||||
+ if(fread(src_header, 1, 12, fsrc) != 12)
|
||||
{
|
||||
- free(src);
|
||||
fclose(fsrc);
|
||||
- fprintf(stderr, "[j2k_open] Error: fread returned a number of elements different from the expected.\n");
|
||||
+ fprintf(stderr,
|
||||
+ "[j2k_read_profile] Error: fread returned a number of elements different from the expected.\n");
|
||||
goto another_end_of_the_world;
|
||||
}
|
||||
fclose(fsrc);
|
||||
|
||||
- if(memcmp(JP2_HEAD, src, sizeof(JP2_HEAD)) == 0)
|
||||
+ if(memcmp(JP2_HEAD, src_header, sizeof(JP2_HEAD)) == 0 || memcmp(JP2_MAGIC, src_header, sizeof(JP2_MAGIC)) == 0)
|
||||
{
|
||||
- codec = CODEC_JP2;
|
||||
+ codec = OPJ_CODEC_JP2;
|
||||
}
|
||||
- else if(memcmp(J2K_HEAD, src, sizeof(J2K_HEAD)) == 0)
|
||||
+ else if(memcmp(J2K_HEAD, src_header, sizeof(J2K_HEAD)) == 0)
|
||||
{
|
||||
- codec = CODEC_J2K;
|
||||
+ codec = OPJ_CODEC_J2K;
|
||||
}
|
||||
else // this will also reject jpt files.
|
||||
{
|
||||
- free(src);
|
||||
- fprintf(stderr, "[j2k_open] Error: `%s' has unsupported file format.\n", filename);
|
||||
+ fprintf(stderr, "[j2k_read_profile] Error: `%s' has unsupported file format.\n", filename);
|
||||
goto another_end_of_the_world;
|
||||
}
|
||||
|
||||
- /* set decoding parameters to default values */
|
||||
- opj_set_default_decoder_parameters(¶meters);
|
||||
- parameters.cp_limit_decoding = LIMIT_TO_MAIN_HEADER;
|
||||
-
|
||||
/* decode the code-stream */
|
||||
/* ---------------------- */
|
||||
|
||||
/* get a decoder handle */
|
||||
- dinfo = opj_create_decompress(codec);
|
||||
+ d_codec = opj_create_decompress(codec);
|
||||
+ if(!d_codec)
|
||||
+ {
|
||||
+ fprintf(stderr, "[j2k_read_profile] Error: failed to create the decoder\n");
|
||||
+ return DT_IMAGEIO_FILE_CORRUPTED;
|
||||
+ }
|
||||
|
||||
/* setup the decoder decoding parameters using user parameters */
|
||||
- opj_setup_decoder(dinfo, ¶meters);
|
||||
+ opj_setup_decoder(d_codec, ¶meters);
|
||||
+ if(!d_codec)
|
||||
+ {
|
||||
+ fprintf(stderr, "[j2k_read_profile] Error: failed to setup the decoder %s\n", parameters.infile);
|
||||
+ return DT_IMAGEIO_FILE_CORRUPTED;
|
||||
+ }
|
||||
|
||||
- /* open a byte stream */
|
||||
- cio = opj_cio_open((opj_common_ptr)dinfo, src, file_length);
|
||||
+ d_stream = opj_stream_create_default_file_stream(parameters.infile, 1);
|
||||
+ if(!d_stream)
|
||||
+ {
|
||||
+ fprintf(stderr, "[j2k_read_profile] Error: failed to create the stream from the file %s\n", parameters.infile);
|
||||
+ return DT_IMAGEIO_FILE_CORRUPTED;
|
||||
+ }
|
||||
|
||||
- /* decode the stream and fill the image structure */
|
||||
- image = opj_decode(dinfo, cio);
|
||||
+ /* Read the main header of the codestream and if necessary the JP2 boxes*/
|
||||
+ if(!opj_read_header(d_stream, d_codec, &image))
|
||||
+ {
|
||||
+ fprintf(stderr, "[j2k_read_profile] Error: failed to read the header\n");
|
||||
+ opj_stream_destroy(d_stream);
|
||||
+ opj_destroy_codec(d_codec);
|
||||
+ opj_image_destroy(image);
|
||||
+ return EXIT_FAILURE;
|
||||
+ }
|
||||
|
||||
- /* close the byte stream */
|
||||
- opj_cio_close(cio);
|
||||
+ /* Get the decoded image */
|
||||
+ if(!(opj_decode(d_codec, d_stream, image) && opj_end_decompress(d_codec, d_stream)))
|
||||
+ {
|
||||
+ fprintf(stderr, "[j2k_read_profile] Error: failed to decode image!\n");
|
||||
+ opj_destroy_codec(d_codec);
|
||||
+ opj_stream_destroy(d_stream);
|
||||
+ opj_image_destroy(image);
|
||||
+ return DT_IMAGEIO_FILE_CORRUPTED;
|
||||
+ }
|
||||
|
||||
- /* free the memory containing the code-stream */
|
||||
- free(src);
|
||||
+ // FIXME: how to do it without fully-decoding the whole image?
|
||||
+ // opj_jp2_decode() copies the icc_profile_{buf,len}
|
||||
+ // from opj_codec_t *d_codec d_codec->color into opj_image_t *image, but
|
||||
+ // opj_codec_t is private type.
|
||||
+
|
||||
+ /* Close the byte stream */
|
||||
+ opj_stream_destroy(d_stream);
|
||||
|
||||
if(!image)
|
||||
{
|
||||
- fprintf(stderr, "[j2k_open] Error: failed to decode image `%s'\n", filename);
|
||||
+ fprintf(stderr, "[j2k_read_profile] Error: failed to decode image `%s'\n", filename);
|
||||
goto another_end_of_the_world;
|
||||
}
|
||||
|
||||
@@ -391,15 +434,12 @@ int dt_imageio_j2k_read_profile(const char *filename, uint8_t **out)
|
||||
|
||||
another_end_of_the_world:
|
||||
/* free remaining structures */
|
||||
- if(dinfo) opj_destroy_decompress(dinfo);
|
||||
+ opj_destroy_codec(d_codec);
|
||||
|
||||
/* free image data structure */
|
||||
opj_image_destroy(image);
|
||||
|
||||
return res ? length : 0;
|
||||
-#else
|
||||
- return 0;
|
||||
-#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -632,7 +672,7 @@ static void color_sycc_to_rgb(opj_image_t *img)
|
||||
{
|
||||
if(img->numcomps < 3)
|
||||
{
|
||||
- img->color_space = CLRSPC_GRAY;
|
||||
+ img->color_space = OPJ_CLRSPC_GRAY;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -658,7 +698,7 @@ static void color_sycc_to_rgb(opj_image_t *img)
|
||||
fprintf(stderr, "%s:%d:color_sycc_to_rgb\n\tCAN NOT CONVERT\n", __FILE__, __LINE__);
|
||||
return;
|
||||
}
|
||||
- img->color_space = CLRSPC_SRGB;
|
||||
+ img->color_space = OPJ_CLRSPC_SRGB;
|
||||
} /* color_sycc_to_rgb() */
|
||||
|
||||
// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.sh
|
||||
diff --git a/src/imageio/format/CMakeLists.txt b/src/imageio/format/CMakeLists.txt
|
||||
index e328cb8..a79f3ee 100644
|
||||
--- a/src/imageio/format/CMakeLists.txt
|
||||
+++ b/src/imageio/format/CMakeLists.txt
|
||||
@@ -22,10 +22,10 @@ if(OPENEXR_FOUND)
|
||||
add_library(exr MODULE "exr.cc")
|
||||
endif(OPENEXR_FOUND)
|
||||
|
||||
-if(OPENJPEG_FOUND)
|
||||
+if(OpenJPEG_FOUND)
|
||||
list(APPEND MODULES "j2k")
|
||||
add_library(j2k MODULE "j2k.c")
|
||||
-endif(OPENJPEG_FOUND)
|
||||
+endif(OpenJPEG_FOUND)
|
||||
|
||||
foreach(module ${MODULES})
|
||||
target_link_libraries(${module} ${LIBS})
|
||||
diff --git a/src/imageio/format/j2k.c b/src/imageio/format/j2k.c
|
||||
index 0344b75..44a995c 100644
|
||||
--- a/src/imageio/format/j2k.c
|
||||
+++ b/src/imageio/format/j2k.c
|
||||
@@ -63,11 +63,6 @@
|
||||
|
||||
#include <openjpeg.h>
|
||||
|
||||
-#define CINEMA_24_CS 1302083 /*Codestream length for 24fps*/
|
||||
-#define CINEMA_48_CS 651041 /*Codestream length for 48fps*/
|
||||
-#define COMP_24_CS 1041666 /*Maximum size per color component for 2K & 4K @ 24fps*/
|
||||
-#define COMP_48_CS 520833 /*Maximum size per color component for 2K @ 48fps*/
|
||||
-
|
||||
typedef enum
|
||||
{
|
||||
J2K_CFMT = 0,
|
||||
@@ -168,14 +163,14 @@ static int initialise_4K_poc(opj_poc_t *POC, int numres)
|
||||
POC[0].layno1 = 1;
|
||||
POC[0].resno1 = numres - 1;
|
||||
POC[0].compno1 = 3;
|
||||
- POC[0].prg1 = CPRL;
|
||||
+ POC[0].prg1 = OPJ_CPRL;
|
||||
POC[1].tile = 1;
|
||||
POC[1].resno0 = numres - 1;
|
||||
POC[1].compno0 = 0;
|
||||
POC[1].layno1 = 1;
|
||||
POC[1].resno1 = numres;
|
||||
POC[1].compno1 = 3;
|
||||
- POC[1].prg1 = CPRL;
|
||||
+ POC[1].prg1 = OPJ_CPRL;
|
||||
return 2;
|
||||
}
|
||||
|
||||
@@ -201,7 +196,7 @@ static void cinema_parameters(opj_cparameters_t *parameters)
|
||||
parameters->csty |= 0x01;
|
||||
|
||||
/*The progression order shall be CPRL*/
|
||||
- parameters->prog_order = CPRL;
|
||||
+ parameters->prog_order = OPJ_CPRL;
|
||||
|
||||
/* No ROI */
|
||||
parameters->roi_compno = -1;
|
||||
@@ -220,9 +215,9 @@ static void cinema_setup_encoder(opj_cparameters_t *parameters, opj_image_t *ima
|
||||
|
||||
switch(parameters->cp_cinema)
|
||||
{
|
||||
- case CINEMA2K_24:
|
||||
- case CINEMA2K_48:
|
||||
- parameters->cp_rsiz = CINEMA2K;
|
||||
+ case OPJ_CINEMA2K_24:
|
||||
+ case OPJ_CINEMA2K_48:
|
||||
+ parameters->cp_rsiz = OPJ_CINEMA2K;
|
||||
if(parameters->numresolution > 6)
|
||||
{
|
||||
parameters->numresolution = 6;
|
||||
@@ -233,12 +228,12 @@ static void cinema_setup_encoder(opj_cparameters_t *parameters, opj_image_t *ima
|
||||
"Image coordinates %d x %d is not 2K compliant.\nJPEG Digital Cinema Profile-3 "
|
||||
"(2K profile) compliance requires that at least one of coordinates match 2048 x 1080\n",
|
||||
image->comps[0].w, image->comps[0].h);
|
||||
- parameters->cp_rsiz = STD_RSIZ;
|
||||
+ parameters->cp_rsiz = OPJ_STD_RSIZ;
|
||||
}
|
||||
break;
|
||||
|
||||
- case CINEMA4K_24:
|
||||
- parameters->cp_rsiz = CINEMA4K;
|
||||
+ case OPJ_CINEMA4K_24:
|
||||
+ parameters->cp_rsiz = OPJ_CINEMA4K;
|
||||
if(parameters->numresolution < 1)
|
||||
{
|
||||
parameters->numresolution = 1;
|
||||
@@ -253,7 +248,7 @@ static void cinema_setup_encoder(opj_cparameters_t *parameters, opj_image_t *ima
|
||||
"Image coordinates %d x %d is not 4K compliant.\nJPEG Digital Cinema Profile-4"
|
||||
"(4K profile) compliance requires that at least one of coordinates match 4096 x 2160\n",
|
||||
image->comps[0].w, image->comps[0].h);
|
||||
- parameters->cp_rsiz = STD_RSIZ;
|
||||
+ parameters->cp_rsiz = OPJ_STD_RSIZ;
|
||||
}
|
||||
parameters->numpocs = initialise_4K_poc(parameters->POC, parameters->numresolution);
|
||||
break;
|
||||
@@ -263,26 +258,26 @@ static void cinema_setup_encoder(opj_cparameters_t *parameters, opj_image_t *ima
|
||||
|
||||
switch(parameters->cp_cinema)
|
||||
{
|
||||
- case CINEMA2K_24:
|
||||
- case CINEMA4K_24:
|
||||
+ case OPJ_CINEMA2K_24:
|
||||
+ case OPJ_CINEMA4K_24:
|
||||
for(i = 0; i < parameters->tcp_numlayers; i++)
|
||||
{
|
||||
if(rates[i] == 0)
|
||||
{
|
||||
parameters->tcp_rates[0]
|
||||
= ((float)(image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec))
|
||||
- / (CINEMA_24_CS * 8 * image->comps[0].dx * image->comps[0].dy);
|
||||
+ / (OPJ_CINEMA_24_CS * 8 * image->comps[0].dx * image->comps[0].dy);
|
||||
}
|
||||
else
|
||||
{
|
||||
temp_rate
|
||||
= ((float)(image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec))
|
||||
/ (rates[i] * 8 * image->comps[0].dx * image->comps[0].dy);
|
||||
- if(temp_rate > CINEMA_24_CS)
|
||||
+ if(temp_rate > OPJ_CINEMA_24_CS)
|
||||
{
|
||||
parameters->tcp_rates[i]
|
||||
= ((float)(image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec))
|
||||
- / (CINEMA_24_CS * 8 * image->comps[0].dx * image->comps[0].dy);
|
||||
+ / (OPJ_CINEMA_24_CS * 8 * image->comps[0].dx * image->comps[0].dy);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -290,28 +285,28 @@ static void cinema_setup_encoder(opj_cparameters_t *parameters, opj_image_t *ima
|
||||
}
|
||||
}
|
||||
}
|
||||
- parameters->max_comp_size = COMP_24_CS;
|
||||
+ parameters->max_comp_size = OPJ_CINEMA_24_COMP;
|
||||
break;
|
||||
|
||||
- case CINEMA2K_48:
|
||||
+ case OPJ_CINEMA2K_48:
|
||||
for(i = 0; i < parameters->tcp_numlayers; i++)
|
||||
{
|
||||
if(rates[i] == 0)
|
||||
{
|
||||
parameters->tcp_rates[0]
|
||||
= ((float)(image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec))
|
||||
- / (CINEMA_48_CS * 8 * image->comps[0].dx * image->comps[0].dy);
|
||||
+ / (OPJ_CINEMA_48_CS * 8 * image->comps[0].dx * image->comps[0].dy);
|
||||
}
|
||||
else
|
||||
{
|
||||
temp_rate
|
||||
= ((float)(image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec))
|
||||
/ (rates[i] * 8 * image->comps[0].dx * image->comps[0].dy);
|
||||
- if(temp_rate > CINEMA_48_CS)
|
||||
+ if(temp_rate > OPJ_CINEMA_48_CS)
|
||||
{
|
||||
parameters->tcp_rates[0]
|
||||
= ((float)(image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec))
|
||||
- / (CINEMA_48_CS * 8 * image->comps[0].dx * image->comps[0].dy);
|
||||
+ / (OPJ_CINEMA_48_CS * 8 * image->comps[0].dx * image->comps[0].dy);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -319,7 +314,7 @@ static void cinema_setup_encoder(opj_cparameters_t *parameters, opj_image_t *ima
|
||||
}
|
||||
}
|
||||
}
|
||||
- parameters->max_comp_size = COMP_48_CS;
|
||||
+ parameters->max_comp_size = OPJ_CINEMA_48_COMP;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -334,19 +329,9 @@ int write_image(dt_imageio_module_data_t *j2k_tmp, const char *filename, const v
|
||||
dt_imageio_j2k_t *j2k = (dt_imageio_j2k_t *)j2k_tmp;
|
||||
opj_cparameters_t parameters; /* compression parameters */
|
||||
float *rates = NULL;
|
||||
- opj_event_mgr_t event_mgr; /* event manager */
|
||||
opj_image_t *image = NULL;
|
||||
const int quality = CLAMP(j2k->quality, 1, 100);
|
||||
|
||||
- /*
|
||||
- configure the event callbacks (not required)
|
||||
- setting of each callback is optional
|
||||
- */
|
||||
- memset(&event_mgr, 0, sizeof(opj_event_mgr_t));
|
||||
- event_mgr.error_handler = error_callback;
|
||||
- event_mgr.warning_handler = warning_callback;
|
||||
- event_mgr.info_handler = info_callback;
|
||||
-
|
||||
/* set encoding parameters to default values */
|
||||
opj_set_default_encoder_parameters(¶meters);
|
||||
|
||||
@@ -357,7 +342,7 @@ int write_image(dt_imageio_module_data_t *j2k_tmp, const char *filename, const v
|
||||
|
||||
parameters.tcp_numlayers = 1; /* only one resolution */
|
||||
parameters.cp_disto_alloc = 1;
|
||||
- parameters.cp_rsiz = STD_RSIZ;
|
||||
+ parameters.cp_rsiz = OPJ_STD_RSIZ;
|
||||
|
||||
parameters.cod_format = j2k->format;
|
||||
parameters.cp_cinema = (OPJ_CINEMA_MODE)j2k->preset;
|
||||
@@ -397,7 +382,7 @@ int write_image(dt_imageio_module_data_t *j2k_tmp, const char *filename, const v
|
||||
cmptparm[i].w = w;
|
||||
cmptparm[i].h = h;
|
||||
}
|
||||
- image = opj_image_create(numcomps, &cmptparm[0], CLRSPC_SRGB);
|
||||
+ image = opj_image_create(numcomps, &cmptparm[0], OPJ_CLRSPC_SRGB);
|
||||
if(!image)
|
||||
{
|
||||
fprintf(stderr, "Error: opj_image_create() failed\n");
|
||||
@@ -437,6 +422,7 @@ int write_image(dt_imageio_module_data_t *j2k_tmp, const char *filename, const v
|
||||
fprintf(stderr, "Error: this shouldn't happen, there is no bit depth of %d for jpeg 2000 images.\n",
|
||||
prec);
|
||||
free(rates);
|
||||
+ opj_image_destroy(image);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -457,58 +443,66 @@ int write_image(dt_imageio_module_data_t *j2k_tmp, const char *filename, const v
|
||||
int rc = 1;
|
||||
OPJ_CODEC_FORMAT codec;
|
||||
if(parameters.cod_format == J2K_CFMT) /* J2K format output */
|
||||
- codec = CODEC_J2K;
|
||||
+ codec = OPJ_CODEC_J2K;
|
||||
else
|
||||
- codec = CODEC_JP2;
|
||||
+ codec = OPJ_CODEC_JP2;
|
||||
|
||||
- int codestream_length;
|
||||
- size_t res;
|
||||
- opj_cio_t *cio = NULL;
|
||||
- FILE *f = NULL;
|
||||
+ opj_stream_t *cstream = NULL;
|
||||
|
||||
/* get a J2K/JP2 compressor handle */
|
||||
- opj_cinfo_t *cinfo = opj_create_compress(codec);
|
||||
+ opj_codec_t *ccodec = opj_create_compress(codec);
|
||||
+
|
||||
+ opj_set_error_handler(ccodec, error_callback, stderr);
|
||||
+ opj_set_warning_handler(ccodec, warning_callback, stderr);
|
||||
+ opj_set_info_handler(ccodec, info_callback, stderr);
|
||||
|
||||
- /* catch events using our callbacks and give a local context */
|
||||
- opj_set_event_mgr((opj_common_ptr)cinfo, &event_mgr, stderr);
|
||||
+ g_strlcpy(parameters.outfile, filename, sizeof(parameters.outfile));
|
||||
|
||||
/* setup the encoder parameters using the current image and user parameters */
|
||||
- opj_setup_encoder(cinfo, ¶meters, image);
|
||||
+ opj_setup_encoder(ccodec, ¶meters, image);
|
||||
|
||||
/* open a byte stream for writing */
|
||||
/* allocate memory for all tiles */
|
||||
- cio = opj_cio_open((opj_common_ptr)cinfo, NULL, 0);
|
||||
-
|
||||
- /* encode the image */
|
||||
- if(!opj_encode(cinfo, cio, image, NULL))
|
||||
+ cstream = opj_stream_create_default_file_stream(parameters.outfile, OPJ_FALSE);
|
||||
+ if(!cstream)
|
||||
{
|
||||
- opj_cio_close(cio);
|
||||
- fprintf(stderr, "failed to encode image\n");
|
||||
+ opj_destroy_codec(ccodec);
|
||||
+ opj_image_destroy(image);
|
||||
+ fprintf(stderr, "failed to create output stream\n");
|
||||
return 1;
|
||||
}
|
||||
- codestream_length = cio_tell(cio);
|
||||
|
||||
- /* write the buffer to disk */
|
||||
- f = fopen(filename, "wb");
|
||||
- if(!f)
|
||||
+ if(!opj_start_compress(ccodec, image, cstream))
|
||||
{
|
||||
- fprintf(stderr, "failed to open %s for writing\n", filename);
|
||||
+ opj_stream_destroy(cstream);
|
||||
+ opj_destroy_codec(ccodec);
|
||||
+ opj_image_destroy(image);
|
||||
+ fprintf(stderr, "failed to encode image: opj_start_compress\n");
|
||||
return 1;
|
||||
}
|
||||
- res = fwrite(cio->buffer, 1, codestream_length, f);
|
||||
- if(res < (size_t)codestream_length) /* FIXME */
|
||||
+
|
||||
+ /* encode the image */
|
||||
+ if(!opj_encode(ccodec, cstream))
|
||||
{
|
||||
- fprintf(stderr, "failed to write %d (%s)\n", codestream_length, filename);
|
||||
- fclose(f);
|
||||
+ opj_stream_destroy(cstream);
|
||||
+ opj_destroy_codec(ccodec);
|
||||
+ opj_image_destroy(image);
|
||||
+ fprintf(stderr, "failed to encode image: opj_encode\n");
|
||||
return 1;
|
||||
}
|
||||
- fclose(f);
|
||||
|
||||
- /* close and free the byte stream */
|
||||
- opj_cio_close(cio);
|
||||
+ /* encode the image */
|
||||
+ if(!opj_end_compress(ccodec, cstream))
|
||||
+ {
|
||||
+ opj_stream_destroy(cstream);
|
||||
+ opj_destroy_codec(ccodec);
|
||||
+ opj_image_destroy(image);
|
||||
+ fprintf(stderr, "failed to encode image: opj_end_compress\n");
|
||||
+ return 1;
|
||||
+ }
|
||||
|
||||
- /* free remaining compression structures */
|
||||
- opj_destroy_compress(cinfo);
|
||||
+ opj_stream_destroy(cstream);
|
||||
+ opj_destroy_codec(ccodec);
|
||||
|
||||
/* add exif data blob. seems to not work for j2k files :( */
|
||||
if(exif && j2k->format == JP2_CFMT) rc = dt_exif_write_blob(exif, exif_len, filename, 1);
|
||||
+348
@@ -0,0 +1,348 @@
|
||||
From c508a40d9b3fb0e113b0d2618c71b744c715899d Mon Sep 17 00:00:00 2001
|
||||
From: Roman Lebedev <lebedev.ri@gmail.com>
|
||||
Date: Thu, 9 Jun 2016 12:50:02 +0300
|
||||
Subject: [PATCH 2/3] CMake modules: update our copy of LibFindMacros.
|
||||
|
||||
(cherry picked from commit 7bd5417fd20308b0334dfd4bf96a71f6361ae3e4)
|
||||
---
|
||||
cmake/modules/LibFindMacros.cmake | 324 ++++++++++++++++++++++++++++++--------
|
||||
1 file changed, 257 insertions(+), 67 deletions(-)
|
||||
|
||||
diff --git a/cmake/modules/LibFindMacros.cmake b/cmake/modules/LibFindMacros.cmake
|
||||
index 5a83443..1e29796 100644
|
||||
--- a/cmake/modules/LibFindMacros.cmake
|
||||
+++ b/cmake/modules/LibFindMacros.cmake
|
||||
@@ -1,30 +1,97 @@
|
||||
-# Works the same as find_package, but forwards the "REQUIRED" argument used for
|
||||
-# the current package and always uses the "QUIET" flag. For this to work, the
|
||||
-# first parameter must be the prefix of the current package, then the prefix of
|
||||
-# the new package etc, which are passed to find_package.
|
||||
-macro (libfind_package PREFIX)
|
||||
- set (LIBFIND_PACKAGE_ARGS ${ARGN} QUIET)
|
||||
+# Version 2.2
|
||||
+# Public Domain, originally written by Lasse Kärkkäinen <tronic>
|
||||
+# Maintained at https://github.com/Tronic/cmake-modules
|
||||
+# Please send your improvements as pull requests on Github.
|
||||
+
|
||||
+# Find another package and make it a dependency of the current package.
|
||||
+# This also automatically forwards the "REQUIRED" argument.
|
||||
+# Usage: libfind_package(<prefix> <another package> [extra args to find_package])
|
||||
+macro (libfind_package PREFIX PKG)
|
||||
+ set(${PREFIX}_args ${PKG} ${ARGN})
|
||||
if (${PREFIX}_FIND_REQUIRED)
|
||||
- set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} REQUIRED)
|
||||
- endif (${PREFIX}_FIND_REQUIRED)
|
||||
- find_package(${LIBFIND_PACKAGE_ARGS})
|
||||
-endmacro (libfind_package)
|
||||
-
|
||||
-# Damn CMake developers made the UsePkgConfig system deprecated in the same release (2.6)
|
||||
-# where they added pkg_check_modules. Consequently I need to support both in my scripts
|
||||
-# to avoid those deprecated warnings. Here's a helper that does just that.
|
||||
-# Works identically to pkg_check_modules, except that no checks are needed prior to use.
|
||||
-macro (libfind_pkg_check_modules PREFIX PKGNAME)
|
||||
- if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
|
||||
- include(UsePkgConfig)
|
||||
- pkgconfig(${PKGNAME} ${PREFIX}_INCLUDE_DIRS ${PREFIX}_LIBRARY_DIRS ${PREFIX}_LDFLAGS ${PREFIX}_CFLAGS)
|
||||
- else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
|
||||
- find_package(PkgConfig)
|
||||
- if (PKG_CONFIG_FOUND)
|
||||
- pkg_check_modules(${PREFIX} ${PKGNAME})
|
||||
- endif (PKG_CONFIG_FOUND)
|
||||
- endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
|
||||
-endmacro (libfind_pkg_check_modules)
|
||||
+ set(${PREFIX}_args ${${PREFIX}_args} REQUIRED)
|
||||
+ endif()
|
||||
+ find_package(${${PREFIX}_args})
|
||||
+ set(${PREFIX}_DEPENDENCIES ${${PREFIX}_DEPENDENCIES};${PKG})
|
||||
+ unset(${PREFIX}_args)
|
||||
+endmacro()
|
||||
+
|
||||
+# A simple wrapper to make pkg-config searches a bit easier.
|
||||
+# Works the same as CMake's internal pkg_check_modules but is always quiet.
|
||||
+macro (libfind_pkg_check_modules)
|
||||
+ find_package(PkgConfig QUIET)
|
||||
+ if (PKG_CONFIG_FOUND)
|
||||
+ pkg_check_modules(${ARGN} QUIET)
|
||||
+ endif()
|
||||
+endmacro()
|
||||
+
|
||||
+# Avoid useless copy&pasta by doing what most simple libraries do anyway:
|
||||
+# pkg-config, find headers, find library.
|
||||
+# Usage: libfind_pkg_detect(<prefix> <pkg-config args> FIND_PATH <name> [other args] FIND_LIBRARY <name> [other args])
|
||||
+# E.g. libfind_pkg_detect(SDL2 sdl2 FIND_PATH SDL.h PATH_SUFFIXES SDL2 FIND_LIBRARY SDL2)
|
||||
+function (libfind_pkg_detect PREFIX)
|
||||
+ # Parse arguments
|
||||
+ set(argname pkgargs)
|
||||
+ foreach (i ${ARGN})
|
||||
+ if ("${i}" STREQUAL "FIND_PATH")
|
||||
+ set(argname pathargs)
|
||||
+ elseif ("${i}" STREQUAL "FIND_LIBRARY")
|
||||
+ set(argname libraryargs)
|
||||
+ else()
|
||||
+ set(${argname} ${${argname}} ${i})
|
||||
+ endif()
|
||||
+ endforeach()
|
||||
+ if (NOT pkgargs)
|
||||
+ message(FATAL_ERROR "libfind_pkg_detect requires at least a pkg_config package name to be passed.")
|
||||
+ endif()
|
||||
+ # Find library
|
||||
+ libfind_pkg_check_modules(${PREFIX}_PKGCONF ${pkgargs})
|
||||
+ if (pathargs)
|
||||
+ find_path(${PREFIX}_INCLUDE_DIR NAMES ${pathargs} HINTS ${${PREFIX}_PKGCONF_INCLUDE_DIRS})
|
||||
+ endif()
|
||||
+ if (libraryargs)
|
||||
+ find_library(${PREFIX}_LIBRARY NAMES ${libraryargs} HINTS ${${PREFIX}_PKGCONF_LIBRARY_DIRS})
|
||||
+ endif()
|
||||
+endfunction()
|
||||
+
|
||||
+# Extracts a version #define from a version.h file, output stored to <PREFIX>_VERSION.
|
||||
+# Usage: libfind_version_header(Foobar foobar/version.h FOOBAR_VERSION_STR)
|
||||
+# Fourth argument "QUIET" may be used for silently testing different define names.
|
||||
+# This function does nothing if the version variable is already defined.
|
||||
+function (libfind_version_header PREFIX VERSION_H DEFINE_NAME)
|
||||
+ # Skip processing if we already have a version or if the include dir was not found
|
||||
+ if (${PREFIX}_VERSION OR NOT ${PREFIX}_INCLUDE_DIR)
|
||||
+ return()
|
||||
+ endif()
|
||||
+ set(quiet ${${PREFIX}_FIND_QUIETLY})
|
||||
+ # Process optional arguments
|
||||
+ foreach(arg ${ARGN})
|
||||
+ if (arg STREQUAL "QUIET")
|
||||
+ set(quiet TRUE)
|
||||
+ else()
|
||||
+ message(AUTHOR_WARNING "Unknown argument ${arg} to libfind_version_header ignored.")
|
||||
+ endif()
|
||||
+ endforeach()
|
||||
+ # Read the header and parse for version number
|
||||
+ set(filename "${${PREFIX}_INCLUDE_DIR}/${VERSION_H}")
|
||||
+ if (NOT EXISTS ${filename})
|
||||
+ if (NOT quiet)
|
||||
+ message(AUTHOR_WARNING "Unable to find ${${PREFIX}_INCLUDE_DIR}/${VERSION_H}")
|
||||
+ endif()
|
||||
+ return()
|
||||
+ endif()
|
||||
+ file(READ "${filename}" header)
|
||||
+ string(REGEX REPLACE ".*#[ \t]*define[ \t]*${DEFINE_NAME}[ \t]*\"([^\n]*)\".*" "\\1" match "${header}")
|
||||
+ # No regex match?
|
||||
+ if (match STREQUAL header)
|
||||
+ if (NOT quiet)
|
||||
+ message(AUTHOR_WARNING "Unable to find \#define ${DEFINE_NAME} \"<version>\" from ${${PREFIX}_INCLUDE_DIR}/${VERSION_H}")
|
||||
+ endif()
|
||||
+ return()
|
||||
+ endif()
|
||||
+ # Export the version string
|
||||
+ set(${PREFIX}_VERSION "${match}" PARENT_SCOPE)
|
||||
+endfunction()
|
||||
|
||||
# Do the final processing once the paths have been detected.
|
||||
# If include dirs are needed, ${PREFIX}_PROCESS_INCLUDES should be set to contain
|
||||
@@ -32,45 +99,168 @@ endmacro (libfind_pkg_check_modules)
|
||||
# Ditto for ${PREFIX}_PROCESS_LIBS and library files.
|
||||
# Will set ${PREFIX}_FOUND, ${PREFIX}_INCLUDE_DIRS and ${PREFIX}_LIBRARIES.
|
||||
# Also handles errors in case library detection was required, etc.
|
||||
-macro (libfind_process PREFIX)
|
||||
- # Skip processing if already processed during this run
|
||||
- if (NOT ${PREFIX}_FOUND)
|
||||
- # Start with the assumption that the library was found
|
||||
- set (${PREFIX}_FOUND TRUE)
|
||||
-
|
||||
- # Process all includes and set _FOUND to false if any are missing
|
||||
- foreach (i ${${PREFIX}_PROCESS_INCLUDES})
|
||||
- if (i)
|
||||
- set (${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIRS} ${${i}})
|
||||
- mark_as_advanced(${i})
|
||||
- else (i)
|
||||
- set (${PREFIX}_FOUND FALSE)
|
||||
- endif (i)
|
||||
- endforeach (i)
|
||||
-
|
||||
- # Process all libraries and set _FOUND to false if any are missing
|
||||
- foreach (i ${${PREFIX}_PROCESS_LIBS})
|
||||
- if (i)
|
||||
- set (${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARIES} ${${i}})
|
||||
- mark_as_advanced(${i})
|
||||
- else (i)
|
||||
- set (${PREFIX}_FOUND FALSE)
|
||||
- endif (i)
|
||||
- endforeach (i)
|
||||
-
|
||||
- # Print message and/or exit on fatal error
|
||||
- if (${PREFIX}_FOUND)
|
||||
- if (NOT ${PREFIX}_FIND_QUIETLY)
|
||||
- message (STATUS "Found ${PREFIX} ${${PREFIX}_VERSION}")
|
||||
- endif (NOT ${PREFIX}_FIND_QUIETLY)
|
||||
- else (${PREFIX}_FOUND)
|
||||
- if (${PREFIX}_FIND_REQUIRED)
|
||||
- foreach (i ${${PREFIX}_PROCESS_INCLUDES} ${${PREFIX}_PROCESS_LIBS})
|
||||
- message("${i}=${${i}}")
|
||||
- endforeach (i)
|
||||
- message (FATAL_ERROR "Required library ${PREFIX} NOT FOUND.\nInstall the library (dev version) and try again. If the library is already installed, use ccmake to set the missing variables manually.")
|
||||
- endif (${PREFIX}_FIND_REQUIRED)
|
||||
- endif (${PREFIX}_FOUND)
|
||||
- endif (NOT ${PREFIX}_FOUND)
|
||||
-endmacro (libfind_process)
|
||||
+function (libfind_process PREFIX)
|
||||
+ # Skip processing if already processed during this configuration run
|
||||
+ if (${PREFIX}_FOUND)
|
||||
+ return()
|
||||
+ endif()
|
||||
+
|
||||
+ set(found TRUE) # Start with the assumption that the package was found
|
||||
+
|
||||
+ # Did we find any files? Did we miss includes? These are for formatting better error messages.
|
||||
+ set(some_files FALSE)
|
||||
+ set(missing_headers FALSE)
|
||||
+
|
||||
+ # Shorthands for some variables that we need often
|
||||
+ set(quiet ${${PREFIX}_FIND_QUIETLY})
|
||||
+ set(required ${${PREFIX}_FIND_REQUIRED})
|
||||
+ set(exactver ${${PREFIX}_FIND_VERSION_EXACT})
|
||||
+ set(findver "${${PREFIX}_FIND_VERSION}")
|
||||
+ set(version "${${PREFIX}_VERSION}")
|
||||
+
|
||||
+ # Lists of config option names (all, includes, libs)
|
||||
+ unset(configopts)
|
||||
+ set(includeopts ${${PREFIX}_PROCESS_INCLUDES})
|
||||
+ set(libraryopts ${${PREFIX}_PROCESS_LIBS})
|
||||
+
|
||||
+ # Process deps to add to
|
||||
+ foreach (i ${PREFIX} ${${PREFIX}_DEPENDENCIES})
|
||||
+ if (DEFINED ${i}_INCLUDE_OPTS OR DEFINED ${i}_LIBRARY_OPTS)
|
||||
+ # The package seems to export option lists that we can use, woohoo!
|
||||
+ list(APPEND includeopts ${${i}_INCLUDE_OPTS})
|
||||
+ list(APPEND libraryopts ${${i}_LIBRARY_OPTS})
|
||||
+ else()
|
||||
+ # If plural forms don't exist or they equal singular forms
|
||||
+ if ((NOT DEFINED ${i}_INCLUDE_DIRS AND NOT DEFINED ${i}_LIBRARIES) OR
|
||||
+ ({i}_INCLUDE_DIR STREQUAL ${i}_INCLUDE_DIRS AND ${i}_LIBRARY STREQUAL ${i}_LIBRARIES))
|
||||
+ # Singular forms can be used
|
||||
+ if (DEFINED ${i}_INCLUDE_DIR)
|
||||
+ list(APPEND includeopts ${i}_INCLUDE_DIR)
|
||||
+ endif()
|
||||
+ if (DEFINED ${i}_LIBRARY)
|
||||
+ list(APPEND libraryopts ${i}_LIBRARY)
|
||||
+ endif()
|
||||
+ else()
|
||||
+ # Oh no, we don't know the option names
|
||||
+ message(FATAL_ERROR "We couldn't determine config variable names for ${i} includes and libs. Aieeh!")
|
||||
+ endif()
|
||||
+ endif()
|
||||
+ endforeach()
|
||||
+
|
||||
+ if (includeopts)
|
||||
+ list(REMOVE_DUPLICATES includeopts)
|
||||
+ endif()
|
||||
+
|
||||
+ if (libraryopts)
|
||||
+ list(REMOVE_DUPLICATES libraryopts)
|
||||
+ endif()
|
||||
+
|
||||
+ string(REGEX REPLACE ".*[ ;]([^ ;]*(_INCLUDE_DIRS|_LIBRARIES))" "\\1" tmp "${includeopts} ${libraryopts}")
|
||||
+ if (NOT tmp STREQUAL "${includeopts} ${libraryopts}")
|
||||
+ message(AUTHOR_WARNING "Plural form ${tmp} found in config options of ${PREFIX}. This works as before but is now deprecated. Please only use singular forms INCLUDE_DIR and LIBRARY, and update your find scripts for LibFindMacros > 2.0 automatic dependency system (most often you can simply remove the PROCESS variables entirely).")
|
||||
+ endif()
|
||||
+
|
||||
+ # Include/library names separated by spaces (notice: not CMake lists)
|
||||
+ unset(includes)
|
||||
+ unset(libs)
|
||||
+
|
||||
+ # Process all includes and set found false if any are missing
|
||||
+ foreach (i ${includeopts})
|
||||
+ list(APPEND configopts ${i})
|
||||
+ if (NOT "${${i}}" STREQUAL "${i}-NOTFOUND")
|
||||
+ list(APPEND includes "${${i}}")
|
||||
+ else()
|
||||
+ set(found FALSE)
|
||||
+ set(missing_headers TRUE)
|
||||
+ endif()
|
||||
+ endforeach()
|
||||
+
|
||||
+ # Process all libraries and set found false if any are missing
|
||||
+ foreach (i ${libraryopts})
|
||||
+ list(APPEND configopts ${i})
|
||||
+ if (NOT "${${i}}" STREQUAL "${i}-NOTFOUND")
|
||||
+ list(APPEND libs "${${i}}")
|
||||
+ else()
|
||||
+ set (found FALSE)
|
||||
+ endif()
|
||||
+ endforeach()
|
||||
+
|
||||
+ # Version checks
|
||||
+ if (found AND findver)
|
||||
+ if (NOT version)
|
||||
+ message(WARNING "The find module for ${PREFIX} does not provide version information, so we'll just assume that it is OK. Please fix the module or remove package version requirements to get rid of this warning.")
|
||||
+ elseif (version VERSION_LESS findver OR (exactver AND NOT version VERSION_EQUAL findver))
|
||||
+ set(found FALSE)
|
||||
+ set(version_unsuitable TRUE)
|
||||
+ endif()
|
||||
+ endif()
|
||||
+
|
||||
+ # If all-OK, hide all config options, export variables, print status and exit
|
||||
+ if (found)
|
||||
+ foreach (i ${configopts})
|
||||
+ mark_as_advanced(${i})
|
||||
+ endforeach()
|
||||
+ if (NOT quiet)
|
||||
+ message(STATUS "Found ${PREFIX} ${${PREFIX}_VERSION}")
|
||||
+ if (LIBFIND_DEBUG)
|
||||
+ message(STATUS " ${PREFIX}_DEPENDENCIES=${${PREFIX}_DEPENDENCIES}")
|
||||
+ message(STATUS " ${PREFIX}_INCLUDE_OPTS=${includeopts}")
|
||||
+ message(STATUS " ${PREFIX}_INCLUDE_DIRS=${includes}")
|
||||
+ message(STATUS " ${PREFIX}_LIBRARY_OPTS=${libraryopts}")
|
||||
+ message(STATUS " ${PREFIX}_LIBRARIES=${libs}")
|
||||
+ endif()
|
||||
+ set (${PREFIX}_INCLUDE_OPTS ${includeopts} PARENT_SCOPE)
|
||||
+ set (${PREFIX}_LIBRARY_OPTS ${libraryopts} PARENT_SCOPE)
|
||||
+ set (${PREFIX}_INCLUDE_DIRS ${includes} PARENT_SCOPE)
|
||||
+ set (${PREFIX}_LIBRARIES ${libs} PARENT_SCOPE)
|
||||
+ set (${PREFIX}_FOUND TRUE PARENT_SCOPE)
|
||||
+ endif()
|
||||
+ return()
|
||||
+ endif()
|
||||
+
|
||||
+ # Format messages for debug info and the type of error
|
||||
+ set(vars "Relevant CMake configuration variables:\n")
|
||||
+ foreach (i ${configopts})
|
||||
+ mark_as_advanced(CLEAR ${i})
|
||||
+ set(val ${${i}})
|
||||
+ if ("${val}" STREQUAL "${i}-NOTFOUND")
|
||||
+ set (val "<not found>")
|
||||
+ elseif (val AND NOT EXISTS ${val})
|
||||
+ set (val "${val} (does not exist)")
|
||||
+ else()
|
||||
+ set(some_files TRUE)
|
||||
+ endif()
|
||||
+ set(vars "${vars} ${i}=${val}\n")
|
||||
+ endforeach()
|
||||
+ set(vars "${vars}You may use CMake GUI, cmake -D or ccmake to modify the values. Delete CMakeCache.txt to discard all values and force full re-detection if necessary.\n")
|
||||
+ if (version_unsuitable)
|
||||
+ set(msg "${PREFIX} ${${PREFIX}_VERSION} was found but")
|
||||
+ if (exactver)
|
||||
+ set(msg "${msg} only version ${findver} is acceptable.")
|
||||
+ else()
|
||||
+ set(msg "${msg} version ${findver} is the minimum requirement.")
|
||||
+ endif()
|
||||
+ else()
|
||||
+ if (missing_headers)
|
||||
+ set(msg "We could not find development headers for ${PREFIX}. Do you have the necessary dev package installed?")
|
||||
+ elseif (some_files)
|
||||
+ set(msg "We only found some files of ${PREFIX}, not all of them. Perhaps your installation is incomplete or maybe we just didn't look in the right place?")
|
||||
+ if(findver)
|
||||
+ set(msg "${msg} This could also be caused by incompatible version (if it helps, at least ${PREFIX} ${findver} should work).")
|
||||
+ endif()
|
||||
+ else()
|
||||
+ set(msg "We were unable to find package ${PREFIX}.")
|
||||
+ endif()
|
||||
+ endif()
|
||||
+
|
||||
+ # Fatal error out if REQUIRED
|
||||
+ if (required)
|
||||
+ set(msg "REQUIRED PACKAGE NOT FOUND\n${msg} This package is REQUIRED and you need to install it or adjust CMake configuration in order to continue building ${CMAKE_PROJECT_NAME}.")
|
||||
+ message(FATAL_ERROR "${msg}\n${vars}")
|
||||
+ endif()
|
||||
+ # Otherwise just print a nasty warning
|
||||
+ if (NOT quiet)
|
||||
+ message(WARNING "WARNING: MISSING PACKAGE\n${msg} This package is NOT REQUIRED and you may ignore this warning but by doing so you may miss some functionality of ${CMAKE_PROJECT_NAME}. \n${vars}")
|
||||
+ endif()
|
||||
+endfunction()
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
From 6f52fa346ef5dd5c22895a5fc404bf02bf29932c Mon Sep 17 00:00:00 2001
|
||||
From: Roman Lebedev <lebedev.ri@gmail.com>
|
||||
Date: Thu, 9 Jun 2016 12:52:09 +0300
|
||||
Subject: [PATCH 3/3] Fix warning in FindGIO.cmake
|
||||
|
||||
CMake Warning (dev) at cmake/modules/LibFindMacros.cmake:160 (message):
|
||||
Plural form Glib_LIBRARIES;Glib_LIBRARY found in config options of GIO.
|
||||
This works as before but is now deprecated. Please only use singular forms
|
||||
INCLUDE_DIR and LIBRARY, and update your find scripts for LibFindMacros >
|
||||
2.0 automatic dependency system (most often you can simply remove the
|
||||
PROCESS variables entirely).
|
||||
Call Stack (most recent call first):
|
||||
cmake/modules/FindGIO.cmake:26 (libfind_process)
|
||||
src/CMakeLists.txt:196 (find_package)
|
||||
|
||||
(cherry picked from commit 0717a2f5fc9dce880376c22856eae0c4dd7e4955)
|
||||
---
|
||||
cmake/modules/FindGIO.cmake | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/cmake/modules/FindGIO.cmake b/cmake/modules/FindGIO.cmake
|
||||
index c039042..a62f36e 100644
|
||||
--- a/cmake/modules/FindGIO.cmake
|
||||
+++ b/cmake/modules/FindGIO.cmake
|
||||
@@ -21,7 +21,5 @@ find_library(GIO_LIBRARY
|
||||
|
||||
# Set the include dir variables and the libraries and let libfind_process do the rest.
|
||||
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
|
||||
-set(GIO_PROCESS_INCLUDES Glib_INCLUDE_DIRS)
|
||||
-set(GIO_PROCESS_LIBS GIO_LIBRARY Glib_LIBRARIES)
|
||||
libfind_process(GIO)
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env xdg-open
|
||||
[Desktop Entry]
|
||||
Name=Darktable
|
||||
GenericName=Virtual Lighttable and Darkroom
|
||||
GenericName[ru]=Программа для отсмотра и проявки цифровых негативов
|
||||
GenericName[de]=Virtueller Leuchttisch und Dunkelkammer
|
||||
GenericName[sv]=Virtuellt ljusbord och mörkerrum
|
||||
GenericName[nl]=Virtuele Lichttafel en Doka
|
||||
GenericName[fi]=Virtuaalinen valopöytä ja pimiö
|
||||
GenericName[fr]=Table lumineuse et chambre noire virtuelles
|
||||
GenericName[cs]=Virtuální prosvětlovací pult a fotokomora
|
||||
|
||||
Comment=Organize and develop images from digital cameras
|
||||
Comment[ru]=Организация, сортировка и проявка цифровых негативов
|
||||
Comment[de]=Organisiere und entwickle Bilder von Digitalkameras
|
||||
Comment[sv]=Organisera och utveckla bilder ifrån digitalkameror
|
||||
Comment[nl]=Organiseer en ontwikkel beelden van digitale camera's
|
||||
Comment[fi]=Järjestele ja kehitä kuvia digitaalikameroista
|
||||
Comment[fr]=Organiser et développer les images d'un boîtier numérique
|
||||
Comment[cs]=Správa a vyvolávání snímků z digitálních fotoaparátů
|
||||
X-GNOME-FullName=Darktable Photo Workflow Software
|
||||
Version=1.0
|
||||
Type=Application
|
||||
Categories=Graphics;Photography;GTK;
|
||||
Exec=darktable
|
||||
TryExec=darktable
|
||||
Terminal=false
|
||||
StartupNotify=true
|
||||
MimeType=application/x-darktable;image/x-dcraw;
|
||||
Icon=darktable
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
<?xml version="1.0" ?>
|
||||
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
|
||||
<PISI>
|
||||
<Source>
|
||||
<Name>darktable</Name>
|
||||
<Packager>
|
||||
<Name>Stefan Gronewold</Name>
|
||||
<Email>groni@pisilinux.org</Email>
|
||||
</Packager>
|
||||
<License>GPL-3.0</License>
|
||||
<PartOf>multimedia.graphics</PartOf>
|
||||
<Summary>darktable is an open source photography workflow application and RAW developer.</Summary>
|
||||
<Description>darktable is an open source photography workflow application and RAW developer. A virtual lighttable and darkroom for photographers.
|
||||
</Description>
|
||||
<Archive type="tarxz" sha1sum="c9392af5df0045b36b89c6548b9ff552f34b7e15">https://github.com/darktable-org/darktable/releases/download/release-2.0.7/darktable-2.0.7.tar.xz</Archive>
|
||||
<Patches>
|
||||
<Patch level="1">0002-CMake-modules-update-our-copy-of-LibFindMacros.patch</Patch>
|
||||
<Patch level="1">0003-Fix-warning-in-FindGIO.cmake.patch</Patch>
|
||||
<Patch level="1">0001-debcherry-fixup-patch.patch</Patch>
|
||||
</Patches>
|
||||
<BuildDependencies>
|
||||
<Dependency>exiv2-devel</Dependency>
|
||||
<Dependency>gconf-devel</Dependency>
|
||||
<Dependency>gtk2-devel</Dependency>
|
||||
<Dependency>libjpeg-turbo-devel</Dependency>
|
||||
<Dependency>lcms2-devel</Dependency>
|
||||
<Dependency>lensfun-devel</Dependency>
|
||||
<Dependency>libgnome-keyring-devel</Dependency>
|
||||
<Dependency>libgphoto2-devel</Dependency>
|
||||
<Dependency>librsvg-devel</Dependency>
|
||||
<Dependency>libsdl-devel</Dependency>
|
||||
<Dependency>mesa-devel</Dependency>
|
||||
<Dependency>mesa-glu-devel</Dependency>
|
||||
<Dependency>openexr-devel</Dependency>
|
||||
<Dependency>tiff-devel</Dependency>
|
||||
<Dependency>libsoup-devel</Dependency>
|
||||
<Dependency>json-glib-devel</Dependency>
|
||||
<Dependency>libgomp</Dependency>
|
||||
<Dependency>cups-devel</Dependency>
|
||||
<Dependency>curl-devel</Dependency>
|
||||
<Dependency>gtk3-devel</Dependency>
|
||||
<Dependency>zlib-devel</Dependency>
|
||||
<Dependency>glib2-devel</Dependency>
|
||||
<Dependency>libX11-devel</Dependency>
|
||||
<Dependency>libpng-devel</Dependency>
|
||||
<Dependency>sqlite-devel</Dependency>
|
||||
<Dependency>libxml2-devel</Dependency>
|
||||
<Dependency>pugixml-devel</Dependency>
|
||||
<Dependency>libXrandr-devel</Dependency>
|
||||
<Dependency>libsecret-devel</Dependency>
|
||||
<Dependency>openjpeg-devel</Dependency>
|
||||
<Dependency>ghostscript-devel</Dependency>
|
||||
<Dependency>GraphicsMagick-devel</Dependency>
|
||||
<Dependency>webp-devel</Dependency>
|
||||
</BuildDependencies>
|
||||
</Source>
|
||||
|
||||
<Package>
|
||||
<Name>darktable</Name>
|
||||
<RuntimeDependencies>
|
||||
<Dependency>webp</Dependency>
|
||||
<Dependency>cups</Dependency>
|
||||
<Dependency>curl</Dependency>
|
||||
<Dependency>gtk3</Dependency>
|
||||
<Dependency>zlib</Dependency>
|
||||
<Dependency>glib2</Dependency>
|
||||
<Dependency>libX11</Dependency>
|
||||
<Dependency>libgcc</Dependency>
|
||||
<Dependency>libpng</Dependency>
|
||||
<Dependency>sqlite</Dependency>
|
||||
<Dependency>libxml2</Dependency>
|
||||
<Dependency>pugixml</Dependency>
|
||||
<Dependency>libXrandr</Dependency>
|
||||
<Dependency>libsecret</Dependency>
|
||||
<Dependency>mesa</Dependency>
|
||||
<Dependency>tiff</Dependency>
|
||||
<Dependency>gtk2</Dependency>
|
||||
<Dependency>lcms2</Dependency>
|
||||
<Dependency>cairo</Dependency>
|
||||
<Dependency>pango</Dependency>
|
||||
<Dependency>libsdl</Dependency>
|
||||
<Dependency>ilmbase</Dependency>
|
||||
<Dependency>lensfun</Dependency>
|
||||
<Dependency>librsvg</Dependency>
|
||||
<Dependency>libsoup</Dependency>
|
||||
<Dependency>libgomp</Dependency>
|
||||
<Dependency>mesa-glu</Dependency>
|
||||
<Dependency>openjpeg</Dependency>
|
||||
<Dependency>json-glib</Dependency>
|
||||
<Dependency>exiv2-libs</Dependency>
|
||||
<Dependency>gdk-pixbuf</Dependency>
|
||||
<Dependency>libgphoto2</Dependency>
|
||||
<Dependency>ghostscript</Dependency>
|
||||
<Dependency>openexr-libs</Dependency>
|
||||
<Dependency>libjpeg-turbo</Dependency>
|
||||
<Dependency>GraphicsMagick</Dependency>
|
||||
<Dependency>libgnome-keyring</Dependency>
|
||||
</RuntimeDependencies>
|
||||
<Files>
|
||||
<Path fileType="config">/etc</Path>
|
||||
<Path fileType="executable">/usr/bin</Path>
|
||||
<Path fileType="library">/usr/lib/darktable</Path>
|
||||
<Path fileType="data">/usr/share/applications</Path>
|
||||
<Path fileType="data">/usr/share/appdata</Path>
|
||||
<Path fileType="data">/usr/share/darktable</Path>
|
||||
<Path fileType="doc">/usr/share/doc/darktable</Path>
|
||||
<Path fileType="data">/usr/share/icons</Path>
|
||||
<Path fileType="localedata">/usr/share/locale</Path>
|
||||
<Path fileType="man">/usr/share/man</Path>
|
||||
</Files>
|
||||
</Package>
|
||||
|
||||
<History>
|
||||
<Update release="1">
|
||||
<Date>2016-11-12</Date>
|
||||
<Version>2.0.7</Version>
|
||||
<Comment>First Release</Comment>
|
||||
<Name>Stefan Gronewold</Name>
|
||||
<Email>groni@pisilinux.org</Email>
|
||||
</Update>
|
||||
</History>
|
||||
</PISI>
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Licensed under the GNU General Public License, version 3.
|
||||
# See the file http://www.gnu.org/licenses/gpl.txt
|
||||
|
||||
from pisi.actionsapi import cmaketools
|
||||
from pisi.actionsapi import get
|
||||
|
||||
def setup():
|
||||
cmaketools.configure("-DCMAKE_INSTALL_LIBDIR=lib")
|
||||
|
||||
def build():
|
||||
cmaketools.make()
|
||||
|
||||
def install():
|
||||
cmaketools.install()
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
From 9ec857bb403accc262a9b5a9c2921b5c064fc9c8 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Kraft <mail@sebastiankraft.net>
|
||||
Date: Sat, 9 Jan 2016 20:55:21 +0100
|
||||
Subject: [PATCH] Patch #47: respect DESTDIR when installing python stuff
|
||||
|
||||
---
|
||||
apps/CMakeLists.txt | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt
|
||||
index 70c77fd..2f6f8f1 100644
|
||||
--- a/apps/CMakeLists.txt
|
||||
+++ b/apps/CMakeLists.txt
|
||||
@@ -42,5 +42,5 @@ IF(PYTHON)
|
||||
IF(NOT DEFINED SETUP_PY_INSTALL_PREFIX)
|
||||
SET(SETUP_PY_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
||||
ENDIF()
|
||||
- INSTALL(CODE "execute_process(COMMAND ${PYTHON} ${SETUP_PY} install --prefix=${SETUP_PY_INSTALL_PREFIX})")
|
||||
+ INSTALL(CODE "execute_process(COMMAND ${PYTHON} ${SETUP_PY} install --prefix=\$ENV{DESTDIR}${SETUP_PY_INSTALL_PREFIX})")
|
||||
ENDIF(PYTHON)
|
||||
--
|
||||
2.6.4
|
||||
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
From 3f74b78e4ee9f1d400ebbf2b9093a0f9c48c6307 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Kraft <mail@sebastiankraft.net>
|
||||
Date: Sat, 9 Jan 2016 20:48:16 +0100
|
||||
Subject: [PATCH] Use database in source directory while running tests. Fixes
|
||||
bug #46.
|
||||
|
||||
---
|
||||
tests/CMakeLists.txt | 4 ++--
|
||||
tests/test_database.cpp | 2 +-
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
|
||||
index b79fda6..4056072 100644
|
||||
--- a/tests/CMakeLists.txt
|
||||
+++ b/tests/CMakeLists.txt
|
||||
@@ -1,6 +1,6 @@
|
||||
ADD_EXECUTABLE(test_database test_database.cpp)
|
||||
TARGET_LINK_LIBRARIES(test_database lensfun ${COMMON_LIBS})
|
||||
-ADD_TEST(Database test_database)
|
||||
+ADD_TEST(NAME Database WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND test_database)
|
||||
|
||||
ADD_EXECUTABLE(test_modifier test_modifier.cpp)
|
||||
TARGET_LINK_LIBRARIES(test_modifier lensfun ${COMMON_LIBS})
|
||||
@@ -30,4 +30,4 @@ TARGET_LINK_LIBRARIES(test_modifier_coord_geometry lensfun ${COMMON_LIBS})
|
||||
ADD_TEST(Modifier_coord_geometry test_modifier_coord_geometry)
|
||||
|
||||
FIND_PACKAGE(PythonInterp REQUIRED)
|
||||
-ADD_TEST(NAME Database_integrity COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/check_database/check_database.py ../../data/db)
|
||||
+ADD_TEST(NAME Database_integrity COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/check_database/check_database.py ${CMAKE_SOURCE_DIR}/data/db)
|
||||
diff --git a/tests/test_database.cpp b/tests/test_database.cpp
|
||||
index 45dc38f..49a2644 100644
|
||||
--- a/tests/test_database.cpp
|
||||
+++ b/tests/test_database.cpp
|
||||
@@ -10,7 +10,7 @@ typedef struct {
|
||||
void db_setup(lfFixture *lfFix, gconstpointer data)
|
||||
{
|
||||
lfFix->db = lf_db_new ();
|
||||
- lfFix->db->Load();
|
||||
+ lfFix->db->LoadDirectory("data/db");
|
||||
}
|
||||
|
||||
|
||||
--
|
||||
2.6.4
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" ?>
|
||||
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
|
||||
<PISI>
|
||||
<Source>
|
||||
<Name>lensfun</Name>
|
||||
<Homepage>http://lensfun.berlios.de/</Homepage>
|
||||
<Packager>
|
||||
<Name>PisiLinux Community</Name>
|
||||
<Email>admins@pisilinux.org</Email>
|
||||
</Packager>
|
||||
<License>LGPLv3</License>
|
||||
<License>GPLv3</License>
|
||||
<License>CCPL-Attribution-ShareAlike-3.0</License>
|
||||
<IsA>library</IsA>
|
||||
<Summary>A programming library for rectifying and simulating photographic lens distortions</Summary>
|
||||
<Description>lensfun provides an open source database of photographic lenses and their characteristics. The library provides also the necessary set of algorithms for correcting images based on detailed knowledge of lens properties and calibration data.</Description>
|
||||
<Archive sha1sum="1d978b15aa7304d66a4931fa37ca9f8f89396c16" type="targz">https://sourceforge.net/projects/lensfun/files/0.3.2/lensfun-0.3.2.tar.gz</Archive>
|
||||
<Patches>
|
||||
<Patch level="1">upstream_Patch-47-respect-DESTDIR-when-installing-python-stuf.patch</Patch>
|
||||
<Patch level="1">upstream_Use-database-in-source-directory-while-running-tests.patch</Patch>
|
||||
</Patches>
|
||||
<BuildDependencies>
|
||||
<Dependency>doxygen</Dependency>
|
||||
<Dependency>glib2-devel</Dependency>
|
||||
</BuildDependencies>
|
||||
</Source>
|
||||
|
||||
<Package>
|
||||
<Name>lensfun</Name>
|
||||
<RuntimeDependencies>
|
||||
<Dependency>libgcc</Dependency>
|
||||
<Dependency>glib2</Dependency>
|
||||
</RuntimeDependencies>
|
||||
<Files>
|
||||
<Path fileType="executable">/usr/bin</Path>
|
||||
<Path fileType="library">/usr/lib</Path>
|
||||
<Path fileType="doc">/usr/share/doc</Path>
|
||||
<Path fileType="data">/usr/share</Path>
|
||||
</Files>
|
||||
</Package>
|
||||
|
||||
<Package>
|
||||
<Name>lensfun-devel</Name>
|
||||
<Summary>Development files for lensfun</Summary>
|
||||
<RuntimeDependencies>
|
||||
<Dependency release="current">lensfun</Dependency>
|
||||
</RuntimeDependencies>
|
||||
<Files>
|
||||
<Path fileType="header">/usr/include</Path>
|
||||
<Path fileType="data">/usr/lib/pkgconfig</Path>
|
||||
</Files>
|
||||
</Package>
|
||||
|
||||
<History>
|
||||
<Update release="4">
|
||||
<Date>2016-11-12</Date>
|
||||
<Version>0.3.2</Version>
|
||||
<Comment>First Release.</Comment>
|
||||
<Name>Stefan Gronewold(groni)</Name>
|
||||
<Email>groni@pisilinux.org</Email>
|
||||
</Update>
|
||||
</History>
|
||||
</PISI>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" ?>
|
||||
<PISI>
|
||||
<Source>
|
||||
<Name>lensfun</Name>
|
||||
<Summary xml:lang="tr">Mercek kaynaklı bozulmaları simüle etmek ve düzeltmek için bir kütüphane</Summary>
|
||||
<Description xml:lang="tr">lensfun, kamera objektiflerinin karakteristiklerini içeren açık kaynaklı bir veritabanı ve bu karakteristikleri temel alarak mercek kaynaklı bozulmaları düzeltmek için yazılmış algoritmaları içeren bir kütüphanedir.</Description>
|
||||
</Source>
|
||||
|
||||
<Package>
|
||||
<Name>lensfun-devel</Name>
|
||||
<Summary xml:lang="tr">lensfun için geliştirme dosyaları</Summary>
|
||||
</Package>
|
||||
</PISI>
|
||||
+235
-1
@@ -30961,6 +30961,54 @@
|
||||
</Update>
|
||||
</History>
|
||||
</SpecFile>
|
||||
<SpecFile>
|
||||
<Source>
|
||||
<Name>pugixml</Name>
|
||||
<Homepage>http://pugixml.org</Homepage>
|
||||
<Packager>
|
||||
<Name>Stefan Gronewold</Name>
|
||||
<Email>groni@pisilinux.org</Email>
|
||||
</Packager>
|
||||
<License>MIT</License>
|
||||
<PartOf>util.misc</PartOf>
|
||||
<Summary xml:lang="en">Light-weight, simple and fast XML parser for C++ with XPath support</Summary>
|
||||
<Description xml:lang="en">Light-weight, simple and fast XML parser for C++ with XPath support</Description>
|
||||
<Archive type="targz" sha1sum="b32212efbae781a1830711798aabbc2974c8c552">https://github.com/zeux/pugixml/releases/download/v1.7/pugixml-1.7.tar.gz</Archive>
|
||||
<BuildDependencies>
|
||||
<Dependency>cmake</Dependency>
|
||||
</BuildDependencies>
|
||||
<SourceURI>util/misc/pugixml/pspec.xml</SourceURI>
|
||||
</Source>
|
||||
<Package>
|
||||
<Name>pugixml</Name>
|
||||
<RuntimeDependencies>
|
||||
<Dependency>libgcc</Dependency>
|
||||
</RuntimeDependencies>
|
||||
<Files>
|
||||
<Path fileType="library">/usr/lib</Path>
|
||||
</Files>
|
||||
</Package>
|
||||
<Package>
|
||||
<Name>pugixml-devel</Name>
|
||||
<Summary xml:lang="en">Development header for pugixml</Summary>
|
||||
<RuntimeDependencies>
|
||||
<Dependency release="1">pugixml</Dependency>
|
||||
</RuntimeDependencies>
|
||||
<Files>
|
||||
<Path fileType="header">/usr/include</Path>
|
||||
<Path fileType="data">/usr/lib/cmake</Path>
|
||||
</Files>
|
||||
</Package>
|
||||
<History>
|
||||
<Update release="1">
|
||||
<Date>2016-11-12</Date>
|
||||
<Version>1.7</Version>
|
||||
<Comment>First Release</Comment>
|
||||
<Name>Stefan Gronewold</Name>
|
||||
<Email>groni@pisilinux.org</Email>
|
||||
</Update>
|
||||
</History>
|
||||
</SpecFile>
|
||||
<SpecFile>
|
||||
<Source>
|
||||
<Name>lsof</Name>
|
||||
@@ -79188,6 +79236,7 @@ thunar-volman is installed and configured properly, and you plug in your digical
|
||||
<Dependency>qt5-x11extras-devel</Dependency>
|
||||
<Dependency>qt5-multimedia-devel</Dependency>
|
||||
<Dependency>qt5-webkit-devel</Dependency>
|
||||
<Dependency>qt5-imageformats-devel</Dependency>
|
||||
<Dependency>kconfig-devel</Dependency>
|
||||
<Dependency>kxmlgui-devel</Dependency>
|
||||
<Dependency>ki18n-devel</Dependency>
|
||||
@@ -79208,6 +79257,7 @@ thunar-volman is installed and configured properly, and you plug in your digical
|
||||
<Dependency>kcrash-devel</Dependency>
|
||||
<Dependency>kunitconversion-devel</Dependency>
|
||||
<Dependency>kcalcore-devel</Dependency>
|
||||
<Dependency>kitemsmodel-devel</Dependency>
|
||||
<Dependency>akonadi-devel</Dependency>
|
||||
<Dependency>akonadi-contacts-devel</Dependency>
|
||||
<Dependency>karchive-devel</Dependency>
|
||||
@@ -79231,9 +79281,10 @@ thunar-volman is installed and configured properly, and you plug in your digical
|
||||
<Dependency>marble-devel</Dependency>
|
||||
<Dependency>eigen3</Dependency>
|
||||
<Dependency>libgphoto2-devel</Dependency>
|
||||
<Dependency>libgomp-devel</Dependency>
|
||||
<Dependency>libgomp</Dependency>
|
||||
<Dependency>liblqr-devel</Dependency>
|
||||
<Dependency>libkface-devel</Dependency>
|
||||
<Dependency>kcalcore-devel</Dependency>
|
||||
<Dependency>glibc-devel</Dependency>
|
||||
<Dependency>zlib-devel</Dependency>
|
||||
<Dependency>libical-devel</Dependency>
|
||||
@@ -79244,6 +79295,8 @@ thunar-volman is installed and configured properly, and you plug in your digical
|
||||
<Dependency>libICE-devel</Dependency>
|
||||
<Dependency>kdoctools-devel</Dependency>
|
||||
<Dependency>qt5-phonon-devel</Dependency>
|
||||
<Dependency>boost-devel</Dependency>
|
||||
<Dependency>kemoticons-devel</Dependency>
|
||||
</BuildDependencies>
|
||||
<SourceURI>desktop/kde/graphics/digikam/pspec.xml</SourceURI>
|
||||
</Source>
|
||||
@@ -98595,6 +98648,69 @@ uses SIMD instructions (MMX, SSE2, etc.) to accelerate baseline JPEG compression
|
||||
</Update>
|
||||
</History>
|
||||
</SpecFile>
|
||||
<SpecFile>
|
||||
<Source>
|
||||
<Name>lensfun</Name>
|
||||
<Homepage>http://lensfun.berlios.de/</Homepage>
|
||||
<Packager>
|
||||
<Name>PisiLinux Community</Name>
|
||||
<Email>admins@pisilinux.org</Email>
|
||||
</Packager>
|
||||
<License>LGPLv3</License>
|
||||
<License>GPLv3</License>
|
||||
<License>CCPL-Attribution-ShareAlike-3.0</License>
|
||||
<IsA>library</IsA>
|
||||
<PartOf>multimedia.graphics</PartOf>
|
||||
<Summary xml:lang="en">A programming library for rectifying and simulating photographic lens distortions</Summary>
|
||||
<Summary xml:lang="tr">Mercek kaynaklı bozulmaları simüle etmek ve düzeltmek için bir kütüphane</Summary>
|
||||
<Description xml:lang="en">lensfun provides an open source database of photographic lenses and their characteristics. The library provides also the necessary set of algorithms for correcting images based on detailed knowledge of lens properties and calibration data.</Description>
|
||||
<Description xml:lang="tr">lensfun, kamera objektiflerinin karakteristiklerini içeren açık kaynaklı bir veritabanı ve bu karakteristikleri temel alarak mercek kaynaklı bozulmaları düzeltmek için yazılmış algoritmaları içeren bir kütüphanedir.</Description>
|
||||
<Archive type="targz" sha1sum="1d978b15aa7304d66a4931fa37ca9f8f89396c16">https://sourceforge.net/projects/lensfun/files/0.3.2/lensfun-0.3.2.tar.gz</Archive>
|
||||
<BuildDependencies>
|
||||
<Dependency>doxygen</Dependency>
|
||||
<Dependency>glib2-devel</Dependency>
|
||||
</BuildDependencies>
|
||||
<Patches>
|
||||
<Patch level="1">upstream_Patch-47-respect-DESTDIR-when-installing-python-stuf.patch</Patch>
|
||||
<Patch level="1">upstream_Use-database-in-source-directory-while-running-tests.patch</Patch>
|
||||
</Patches>
|
||||
<SourceURI>multimedia/graphics/lensfun/pspec.xml</SourceURI>
|
||||
</Source>
|
||||
<Package>
|
||||
<Name>lensfun</Name>
|
||||
<RuntimeDependencies>
|
||||
<Dependency>libgcc</Dependency>
|
||||
<Dependency>glib2</Dependency>
|
||||
</RuntimeDependencies>
|
||||
<Files>
|
||||
<Path fileType="executable">/usr/bin</Path>
|
||||
<Path fileType="library">/usr/lib</Path>
|
||||
<Path fileType="doc">/usr/share/doc</Path>
|
||||
<Path fileType="data">/usr/share</Path>
|
||||
</Files>
|
||||
</Package>
|
||||
<Package>
|
||||
<Name>lensfun-devel</Name>
|
||||
<Summary xml:lang="en">Development files for lensfun</Summary>
|
||||
<Summary xml:lang="tr">lensfun için geliştirme dosyaları</Summary>
|
||||
<RuntimeDependencies>
|
||||
<Dependency release="4">lensfun</Dependency>
|
||||
</RuntimeDependencies>
|
||||
<Files>
|
||||
<Path fileType="header">/usr/include</Path>
|
||||
<Path fileType="data">/usr/lib/pkgconfig</Path>
|
||||
</Files>
|
||||
</Package>
|
||||
<History>
|
||||
<Update release="4">
|
||||
<Date>2016-11-12</Date>
|
||||
<Version>0.3.2</Version>
|
||||
<Comment>First Release.</Comment>
|
||||
<Name>Stefan Gronewold(groni)</Name>
|
||||
<Email>groni@pisilinux.org</Email>
|
||||
</Update>
|
||||
</History>
|
||||
</SpecFile>
|
||||
<SpecFile>
|
||||
<Source>
|
||||
<Name>libraw</Name>
|
||||
@@ -98939,6 +99055,124 @@ uses SIMD instructions (MMX, SSE2, etc.) to accelerate baseline JPEG compression
|
||||
</Update>
|
||||
</History>
|
||||
</SpecFile>
|
||||
<SpecFile>
|
||||
<Source>
|
||||
<Name>darktable</Name>
|
||||
<Packager>
|
||||
<Name>Stefan Gronewold</Name>
|
||||
<Email>groni@pisilinux.org</Email>
|
||||
</Packager>
|
||||
<License>GPL-3.0</License>
|
||||
<PartOf>multimedia.graphics</PartOf>
|
||||
<Summary xml:lang="en">darktable is an open source photography workflow application and RAW developer.</Summary>
|
||||
<Description xml:lang="en">darktable is an open source photography workflow application and RAW developer. A virtual lighttable and darkroom for photographers.</Description>
|
||||
<Archive type="tarxz" sha1sum="c9392af5df0045b36b89c6548b9ff552f34b7e15">https://github.com/darktable-org/darktable/releases/download/release-2.0.7/darktable-2.0.7.tar.xz</Archive>
|
||||
<BuildDependencies>
|
||||
<Dependency>exiv2-devel</Dependency>
|
||||
<Dependency>gconf-devel</Dependency>
|
||||
<Dependency>gtk2-devel</Dependency>
|
||||
<Dependency>libjpeg-turbo-devel</Dependency>
|
||||
<Dependency>lcms2-devel</Dependency>
|
||||
<Dependency>lensfun-devel</Dependency>
|
||||
<Dependency>libgnome-keyring-devel</Dependency>
|
||||
<Dependency>libgphoto2-devel</Dependency>
|
||||
<Dependency>librsvg-devel</Dependency>
|
||||
<Dependency>libsdl-devel</Dependency>
|
||||
<Dependency>mesa-devel</Dependency>
|
||||
<Dependency>mesa-glu-devel</Dependency>
|
||||
<Dependency>openexr-devel</Dependency>
|
||||
<Dependency>tiff-devel</Dependency>
|
||||
<Dependency>libsoup-devel</Dependency>
|
||||
<Dependency>json-glib-devel</Dependency>
|
||||
<Dependency>libgomp</Dependency>
|
||||
<Dependency>cups-devel</Dependency>
|
||||
<Dependency>curl-devel</Dependency>
|
||||
<Dependency>gtk3-devel</Dependency>
|
||||
<Dependency>zlib-devel</Dependency>
|
||||
<Dependency>glib2-devel</Dependency>
|
||||
<Dependency>libX11-devel</Dependency>
|
||||
<Dependency>libpng-devel</Dependency>
|
||||
<Dependency>sqlite-devel</Dependency>
|
||||
<Dependency>libxml2-devel</Dependency>
|
||||
<Dependency>pugixml-devel</Dependency>
|
||||
<Dependency>libXrandr-devel</Dependency>
|
||||
<Dependency>libsecret-devel</Dependency>
|
||||
<Dependency>openjpeg-devel</Dependency>
|
||||
<Dependency>ghostscript-devel</Dependency>
|
||||
<Dependency>GraphicsMagick-devel</Dependency>
|
||||
<Dependency>webp-devel</Dependency>
|
||||
</BuildDependencies>
|
||||
<Patches>
|
||||
<Patch level="1">0002-CMake-modules-update-our-copy-of-LibFindMacros.patch</Patch>
|
||||
<Patch level="1">0003-Fix-warning-in-FindGIO.cmake.patch</Patch>
|
||||
<Patch level="1">0001-debcherry-fixup-patch.patch</Patch>
|
||||
</Patches>
|
||||
<SourceURI>multimedia/graphics/darktable/pspec.xml</SourceURI>
|
||||
</Source>
|
||||
<Package>
|
||||
<Name>darktable</Name>
|
||||
<RuntimeDependencies>
|
||||
<Dependency>webp</Dependency>
|
||||
<Dependency>cups</Dependency>
|
||||
<Dependency>curl</Dependency>
|
||||
<Dependency>gtk3</Dependency>
|
||||
<Dependency>zlib</Dependency>
|
||||
<Dependency>glib2</Dependency>
|
||||
<Dependency>libX11</Dependency>
|
||||
<Dependency>libgcc</Dependency>
|
||||
<Dependency>libpng</Dependency>
|
||||
<Dependency>sqlite</Dependency>
|
||||
<Dependency>libxml2</Dependency>
|
||||
<Dependency>pugixml</Dependency>
|
||||
<Dependency>libXrandr</Dependency>
|
||||
<Dependency>libsecret</Dependency>
|
||||
<Dependency>mesa</Dependency>
|
||||
<Dependency>tiff</Dependency>
|
||||
<Dependency>gtk2</Dependency>
|
||||
<Dependency>lcms2</Dependency>
|
||||
<Dependency>cairo</Dependency>
|
||||
<Dependency>pango</Dependency>
|
||||
<Dependency>libsdl</Dependency>
|
||||
<Dependency>ilmbase</Dependency>
|
||||
<Dependency>lensfun</Dependency>
|
||||
<Dependency>librsvg</Dependency>
|
||||
<Dependency>libsoup</Dependency>
|
||||
<Dependency>libgomp</Dependency>
|
||||
<Dependency>mesa-glu</Dependency>
|
||||
<Dependency>openjpeg</Dependency>
|
||||
<Dependency>json-glib</Dependency>
|
||||
<Dependency>exiv2-libs</Dependency>
|
||||
<Dependency>gdk-pixbuf</Dependency>
|
||||
<Dependency>libgphoto2</Dependency>
|
||||
<Dependency>ghostscript</Dependency>
|
||||
<Dependency>openexr-libs</Dependency>
|
||||
<Dependency>libjpeg-turbo</Dependency>
|
||||
<Dependency>GraphicsMagick</Dependency>
|
||||
<Dependency>libgnome-keyring</Dependency>
|
||||
</RuntimeDependencies>
|
||||
<Files>
|
||||
<Path fileType="config">/etc</Path>
|
||||
<Path fileType="executable">/usr/bin</Path>
|
||||
<Path fileType="library">/usr/lib/darktable</Path>
|
||||
<Path fileType="data">/usr/share/applications</Path>
|
||||
<Path fileType="data">/usr/share/appdata</Path>
|
||||
<Path fileType="data">/usr/share/darktable</Path>
|
||||
<Path fileType="doc">/usr/share/doc/darktable</Path>
|
||||
<Path fileType="data">/usr/share/icons</Path>
|
||||
<Path fileType="localedata">/usr/share/locale</Path>
|
||||
<Path fileType="man">/usr/share/man</Path>
|
||||
</Files>
|
||||
</Package>
|
||||
<History>
|
||||
<Update release="1">
|
||||
<Date>2016-11-12</Date>
|
||||
<Version>2.0.7</Version>
|
||||
<Comment>First Release</Comment>
|
||||
<Name>Stefan Gronewold</Name>
|
||||
<Email>groni@pisilinux.org</Email>
|
||||
</Update>
|
||||
</History>
|
||||
</SpecFile>
|
||||
<SpecFile>
|
||||
<Source>
|
||||
<Name>hugin</Name>
|
||||
|
||||
@@ -1 +1 @@
|
||||
910fdbc05d21f85b896ebd8535cced9f7eeb74b8
|
||||
b8851fdae701f9a16f12907253695bab6dd544c1
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
7af5dab6da3c4901b2e41a421233a5ebe5ca91f8
|
||||
5668f2de904b0865d273b26ff26166d99d34798d
|
||||
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
# Licensed under the GNU General Public License, version 3.
|
||||
# See the file http://www.gnu.org/copyleft/gpl.txt
|
||||
|
||||
from pisi.actionsapi import cmaketools
|
||||
from pisi.actionsapi import get
|
||||
from pisi.actionsapi import shelltools
|
||||
|
||||
WorkDir = "pugixml-1.7/scripts"
|
||||
|
||||
def setup():
|
||||
cmaketools.configure("-DCMAKE_INSTALL_LIBDIR=lib \
|
||||
-DBUILD_SHARED_LIBS=ON")
|
||||
|
||||
def build():
|
||||
cmaketools.make()
|
||||
|
||||
def install():
|
||||
cmaketools.rawInstall("DESTDIR=%s" % get.installDIR())
|
||||
|
||||
# pisitools.dodoc("AUTHORS", "BUGS", "ChangeLog", "COPYING", "README")
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" ?>
|
||||
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
|
||||
<PISI>
|
||||
<Source>
|
||||
<Name>pugixml</Name>
|
||||
<Homepage>http://pugixml.org</Homepage>
|
||||
<Packager>
|
||||
<Name>Stefan Gronewold</Name>
|
||||
<Email>groni@pisilinux.org</Email>
|
||||
</Packager>
|
||||
<License>MIT</License>
|
||||
<Summary>Light-weight, simple and fast XML parser for C++ with XPath support</Summary>
|
||||
<Description>Light-weight, simple and fast XML parser for C++ with XPath support</Description>
|
||||
<BuildDependencies>
|
||||
<Dependency>cmake</Dependency>
|
||||
</BuildDependencies>
|
||||
<Archive sha1sum="b32212efbae781a1830711798aabbc2974c8c552" type="targz">https://github.com/zeux/pugixml/releases/download/v1.7/pugixml-1.7.tar.gz</Archive>
|
||||
</Source>
|
||||
|
||||
<Package>
|
||||
<Name>pugixml</Name>
|
||||
<RuntimeDependencies>
|
||||
<Dependency>libgcc</Dependency>
|
||||
</RuntimeDependencies>
|
||||
<Files>
|
||||
<Path fileType="library">/usr/lib</Path>
|
||||
</Files>
|
||||
</Package>
|
||||
|
||||
<Package>
|
||||
<Name>pugixml-devel</Name>
|
||||
<Summary>Development header for pugixml</Summary>
|
||||
<RuntimeDependencies>
|
||||
<Dependency release="current">pugixml</Dependency>
|
||||
</RuntimeDependencies>
|
||||
<Files>
|
||||
<Path fileType="header">/usr/include</Path>
|
||||
<Path fileType="data">/usr/lib/cmake</Path>
|
||||
</Files>
|
||||
</Package>
|
||||
|
||||
<History>
|
||||
<Update release="1">
|
||||
<Date>2016-11-12</Date>
|
||||
<Version>1.7</Version>
|
||||
<Comment>First Release</Comment>
|
||||
<Name>Stefan Gronewold</Name>
|
||||
<Email>groni@pisilinux.org</Email>
|
||||
</Update>
|
||||
</History>
|
||||
</PISI>
|
||||
Reference in New Issue
Block a user