summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Harder <radhermit@gentoo.org>2011-11-09 17:48:17 +0000
committerTim Harder <radhermit@gentoo.org>2011-11-09 17:48:17 +0000
commit49f5b09630ff717684bf6715e0d22a0500d162ea (patch)
tree1153e0b14212668c2f63294201c8e62327c6be89 /media-gfx/darktable
parentadd a note about the upstream documentation (diff)
downloadgentoo-2-49f5b09630ff717684bf6715e0d22a0500d162ea.tar.gz
gentoo-2-49f5b09630ff717684bf6715e0d22a0500d162ea.tar.bz2
gentoo-2-49f5b09630ff717684bf6715e0d22a0500d162ea.zip
Version bump. Add opencl use flag.
(Portage version: 2.2.0_alpha72/cvs/Linux x86_64)
Diffstat (limited to 'media-gfx/darktable')
-rw-r--r--media-gfx/darktable/ChangeLog11
-rw-r--r--media-gfx/darktable/darktable-0.9.3.ebuild110
-rw-r--r--media-gfx/darktable/files/darktable-0.9.3-cflags.patch43
-rw-r--r--media-gfx/darktable/files/darktable-0.9.3-no-rawspeed.patch48
-rw-r--r--media-gfx/darktable/files/darktable-0.9.3-opencl-kernels.patch12
-rw-r--r--media-gfx/darktable/files/darktable-0.9.3-system-libraw.patch85
-rw-r--r--media-gfx/darktable/metadata.xml1
7 files changed, 309 insertions, 1 deletions
diff --git a/media-gfx/darktable/ChangeLog b/media-gfx/darktable/ChangeLog
index da4359a8a2a7..4fcb57aed93f 100644
--- a/media-gfx/darktable/ChangeLog
+++ b/media-gfx/darktable/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for media-gfx/darktable
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-gfx/darktable/ChangeLog,v 1.10 2011/09/21 18:39:29 radhermit Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-gfx/darktable/ChangeLog,v 1.11 2011/11/09 17:48:17 radhermit Exp $
+
+*darktable-0.9.3 (09 Nov 2011)
+
+ 09 Nov 2011; Tim Harder <radhermit@gentoo.org> +darktable-0.9.3.ebuild,
+ +files/darktable-0.9.3-cflags.patch,
+ +files/darktable-0.9.3-no-rawspeed.patch,
+ +files/darktable-0.9.3-opencl-kernels.patch,
+ +files/darktable-0.9.3-system-libraw.patch, metadata.xml:
+ Version bump. Add opencl use flag.
21 Sep 2011; Tim Harder <radhermit@gentoo.org> darktable-0.9.2-r2.ebuild,
+files/darktable-0.9.2-zlib-header.patch:
diff --git a/media-gfx/darktable/darktable-0.9.3.ebuild b/media-gfx/darktable/darktable-0.9.3.ebuild
new file mode 100644
index 000000000000..d888eed1c778
--- /dev/null
+++ b/media-gfx/darktable/darktable-0.9.3.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-gfx/darktable/darktable-0.9.3.ebuild,v 1.1 2011/11/09 17:48:17 radhermit Exp $
+
+EAPI="4"
+GCONF_DEBUG="no"
+
+inherit gnome2 cmake-utils toolchain-funcs
+
+DESCRIPTION="A virtual lighttable and darkroom for photographers"
+HOMEPAGE="http://darktable.sf.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE="debug flickr gnome gphoto2 kde nls opencl openmp +rawspeed +slideshow video_cards_nvidia"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="
+ dev-db/sqlite:3
+ dev-libs/libxml2:2
+ flickr? ( media-libs/flickcurl )
+ gnome? (
+ gnome-base/gconf
+ gnome-base/gnome-keyring
+ )
+ gnome-base/librsvg:2
+ gphoto2? ( media-libs/libgphoto2 )
+ kde? ( dev-libs/dbus-glib )
+ media-gfx/exiv2
+ media-libs/lcms:2
+ >=media-libs/lensfun-0.2.3
+ media-libs/libpng
+ >=media-libs/libraw-0.13.4[demosaic]
+ media-libs/openexr
+ media-libs/tiff
+ net-misc/curl
+ opencl? ( video_cards_nvidia? (
+ x11-drivers/nvidia-drivers
+ >=dev-util/nvidia-cuda-toolkit-3.1
+ ) )
+ slideshow? (
+ media-libs/libsdl
+ virtual/opengl
+ )
+ virtual/jpeg
+ x11-libs/cairo
+ x11-libs/gdk-pixbuf:2
+ x11-libs/gtk+:2"
+DEPEND="${RDEPEND}
+ dev-util/pkgconfig
+ nls? ( sys-devel/gettext )"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-system-libraw.patch
+ "${FILESDIR}"/${P}-no-rawspeed.patch
+ "${FILESDIR}"/${P}-cflags.patch
+ "${FILESDIR}"/${P}-opencl-kernels.patch
+)
+
+pkg_setup() {
+ if use openmp ; then
+ tc-has-openmp || die "Please switch to an openmp compatible compiler"
+ fi
+}
+
+src_prepare() {
+ base_src_prepare
+ sed -i -e "s:\(/share/doc/\)darktable:\1${PF}:" \
+ -e "s:LICENSE::" doc/CMakeLists.txt || die
+}
+
+src_configure() {
+ local myconf
+ if use gnome ; then
+ myconf="-DDONT_INSTALL_GCONF_SCHEMAS=OFF"
+ else
+ myconf="-DDONT_INSTALL_GCONF_SCHEMAS=ON"
+ fi
+
+ if use opencl && use video_cards_nvidia ; then
+ myconf+=" -DUSE_OPENCL=ON"
+ else
+ myconf+=" -DUSE_OPENCL=OFF"
+ fi
+
+ use debug && CMAKE_BUILD_TYPE=Debug
+
+ mycmakeargs=(
+ $(cmake-utils_use_use flickr FLICKR)
+ $(cmake-utils_use_use gnome GCONF_BACKEND)
+ $(cmake-utils_use_use gnome GNOME_KEYRING)
+ $(cmake-utils_use_use gphoto2 CAMERA_SUPPORT)
+ $(cmake-utils_use_use kde KWALLET)
+ $(cmake-utils_use_use nls NLS)
+ $(cmake-utils_use_use openmp OPENMP)
+ $(cmake-utils_use !rawspeed DONT_USE_RAWSPEED)
+ $(cmake-utils_use_build slideshow SLIDESHOW)
+ ${myconf}
+ -DINSTALL_IOP_EXPERIMENTAL=ON
+ -DINSTALL_IOP_LEGACY=ON
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL="1"
+ cmake-utils_src_install
+ unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
+}
diff --git a/media-gfx/darktable/files/darktable-0.9.3-cflags.patch b/media-gfx/darktable/files/darktable-0.9.3-cflags.patch
new file mode 100644
index 000000000000..a949cc66b919
--- /dev/null
+++ b/media-gfx/darktable/files/darktable-0.9.3-cflags.patch
@@ -0,0 +1,43 @@
+--- darktable-0.9.3.orig/src/CMakeLists.txt
++++ darktable-0.9.3/src/CMakeLists.txt
+@@ -231,39 +231,11 @@
+ # c++ code doesn't like -Werror (libraw)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fno-strict-aliasing")
+
+-if(NOT APPLE)
+- # apple build fails on deprecated warnings..
+- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
+-endif(NOT APPLE)
+-
+ if(NOT WIN32)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")
+ endif(NOT WIN32)
+
+-if(NOT BINARY_PACKAGE_BUILD)
+- MESSAGE("-- Checking for -march=native support")
+- CHECK_C_COMPILER_FLAG("-march=native" MARCHNATIVE)
+- if (MARCHNATIVE)
+- set(MARCH "-march=native")
+- else()
+- MESSAGE("-- Checking for -mtune=native support")
+- CHECK_C_COMPILER_FLAG("-mtune=native" MTUNENATIVE)
+- if (MTUNENATIVE)
+- set(MARCH "-mtune=native")
+- else()
+- set(MARCH "-mtune=generic")
+- endif()
+- endif()
+-else()
+- set(MARCH "-mtune=generic")
+-endif()
+-
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2 -mfpmath=sse ${MARCH} -g")
+-set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -ffast-math -fexpensive-optimizations")
+-set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g -D_DEBUG")
+-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2 -mfpmath=sse ${MARCH} -g")
+-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -ffast-math -fexpensive-optimizations")
+-set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g -D_DEBUG")
++set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")
+
+
+ #
diff --git a/media-gfx/darktable/files/darktable-0.9.3-no-rawspeed.patch b/media-gfx/darktable/files/darktable-0.9.3-no-rawspeed.patch
new file mode 100644
index 000000000000..774762ea654e
--- /dev/null
+++ b/media-gfx/darktable/files/darktable-0.9.3-no-rawspeed.patch
@@ -0,0 +1,48 @@
+--- darktable-0.9.3.orig/src/CMakeLists.txt
++++ darktable-0.9.3/src/CMakeLists.txt
+@@ -290,21 +290,19 @@
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/metadata_gen.h ${CMAKE_CURRENT_BINARY_DIR}/metadata_gen.c
+ COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../tools/create_metadata.sh ${CMAKE_CURRENT_SOURCE_DIR}/../tools/metadata.txt ${CMAKE_CURRENT_BINARY_DIR}
+ )
+-
+-# this is a dummy library whose sole purpose is to serve as a dependency for subdirs, such as imageio/storage/gallery.
+-# cmake can't depend on custom targets in other directories than the current one.
+-add_library(metadata_dummy ${CMAKE_CURRENT_BINARY_DIR}/metadata_gen.c ${CMAKE_CURRENT_BINARY_DIR}/metadata_gen.h)
++add_custom_target(metadata_gen DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/metadata_gen.c ${CMAKE_CURRENT_BINARY_DIR}/metadata_gen.h)
+
+ #
+ # build libdarktable
+ #
+-add_library(lib_darktable STATIC SHARED ${CMAKE_CURRENT_BINARY_DIR}/preferences_gen.h ${CMAKE_CURRENT_BINARY_DIR}/metadata_gen.h ${CMAKE_CURRENT_BINARY_DIR}/metadata_gen.c ${SOURCES})
++add_library(lib_darktable SHARED ${CMAKE_CURRENT_BINARY_DIR}/preferences_gen.h ${CMAKE_CURRENT_BINARY_DIR}/metadata_gen.h ${CMAKE_CURRENT_BINARY_DIR}/metadata_gen.c ${SOURCES})
++add_dependencies(lib_darktable metadata_gen)
+ if(APPLE)
+ set_target_properties(lib_darktable PROPERTIES INSTALL_NAME_DIR "@executable_path/../lib/darktable")
+ endif(APPLE)
+ set_target_properties(lib_darktable PROPERTIES OUTPUT_NAME darktable)
+ set_target_properties(lib_darktable PROPERTIES LINKER_LANGUAGE C)
+-
++target_link_libraries(lib_darktable ${LIBS})
+
+ #
+ # the libraw part is a bit of a hack:
+@@ -329,7 +327,7 @@
+ add_dependencies(lib_darktable rawspeed)
+ add_library(rawspeed_static STATIC IMPORTED)
+ set_target_properties(rawspeed_static PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/external/rawspeed/librawspeed.a)
+- target_link_libraries(lib_darktable ${LIBS} rawspeed_static)
++ target_link_libraries(lib_darktable rawspeed_static)
+ # compile rawspeed
+ add_subdirectory(external/rawspeed)
+ endif(NOT DONT_USE_RAWSPEED)
+--- darktable-0.9.3.orig/src/imageio/storage/CMakeLists.txt
++++ darktable-0.9.3/src/imageio/storage/CMakeLists.txt
+@@ -10,7 +10,7 @@
+ foreach(module ${MODULES} ${MODULES_EXPERIMENTAL})
+ add_library(${module} MODULE "${module}.c")
+ endforeach(module)
+-add_dependencies(gallery metadata_dummy)
++add_dependencies(gallery metadata_gen)
+
+ foreach(module ${MODULES})
+ target_link_libraries(${module} ${LIBS})
diff --git a/media-gfx/darktable/files/darktable-0.9.3-opencl-kernels.patch b/media-gfx/darktable/files/darktable-0.9.3-opencl-kernels.patch
new file mode 100644
index 000000000000..ff05acbe2db0
--- /dev/null
+++ b/media-gfx/darktable/files/darktable-0.9.3-opencl-kernels.patch
@@ -0,0 +1,12 @@
+--- darktable-0.9.3/data/kernels/CMakeLists.txt.orig
++++ darktable-0.9.3/data/kernels/CMakeLists.txt
+@@ -3,5 +3,7 @@
+ #
+ # install opencl kernel source files
+ #
+-FILE(GLOB DT_OPENCL_KERNELS "*.cl" "programs.conf")
+-install(FILES ${DT_OPENCL_KERNELS} DESTINATION ${SHARE_INSTALL}/kernels)
++if(USE_OPENCL)
++ FILE(GLOB DT_OPENCL_KERNELS "*.cl" "programs.conf")
++ install(FILES ${DT_OPENCL_KERNELS} DESTINATION ${SHARE_INSTALL}/kernels)
++endif(USE_OPENCL)
diff --git a/media-gfx/darktable/files/darktable-0.9.3-system-libraw.patch b/media-gfx/darktable/files/darktable-0.9.3-system-libraw.patch
new file mode 100644
index 000000000000..189f264f8899
--- /dev/null
+++ b/media-gfx/darktable/files/darktable-0.9.3-system-libraw.patch
@@ -0,0 +1,85 @@
+--- darktable-0.9.3.orig/cmake/modules/FindLibraw.cmake
++++ darktable-0.9.3/cmake/modules/FindLibraw.cmake
+@@ -0,0 +1,29 @@
++# - Try to find libraw
++# Once done, this will define
++#
++# Libraw_FOUND - system has Libraw
++# Libraw_INCLUDE_DIRS - the Libraw include directories
++# Libraw_LIBRARIES - link these to use Libraw
++
++include(LibFindMacros)
++
++# Use pkg-config to get hints about paths
++libfind_pkg_check_modules(Libraw_PKGCONF libraw)
++
++# Include dir
++find_path(Libraw_INCLUDE_DIR
++ NAMES libraw.h
++ PATHS ${Libraw_PKGCONF_INCLUDE_DIRS}
++)
++
++# Finally the library itself
++find_library(Libraw_LIBRARY
++ NAMES raw_r
++ PATHS ${Libraw_PKGCONF_LIBRARY_DIRS}
++)
++
++# 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(Libraw_PROCESS_INCLUDES Libraw_INCLUDE_DIR Libraw_INCLUDE_DIRS)
++set(Libraw_PROCESS_LIBS Libraw_LIBRARY Libraw_LIBRARIES)
++libfind_process(Libraw)
+--- darktable-0.9.3.orig/src/CMakeLists.txt
++++ darktable-0.9.3/src/CMakeLists.txt
+@@ -70,7 +70,6 @@
+
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external)
+-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/LibRaw)
+
+ # initial compiler flags
+ add_definitions("-DHAVE_CONFIG_H")
+@@ -122,7 +121,7 @@
+ endif(USE_CAMERA_SUPPORT)
+
+ # Find all the libs that don't require extra parameters
+-foreach(lib ${OUR_LIBS} LensFun GIO GThread GModule Cairo PangoCairo PThread Rsvg2 GDK-PixBuf LibXml2 INotify Sqlite3 Exiv2 CURL PNG JPEG TIFF OpenEXR LCMS2)
++foreach(lib ${OUR_LIBS} LensFun Libraw GIO GThread GModule Cairo PangoCairo PThread Rsvg2 GDK-PixBuf LibXml2 INotify Sqlite3 Exiv2 CURL PNG JPEG TIFF OpenEXR LCMS2)
+ find_package(${lib} REQUIRED)
+ include_directories(${${lib}_INCLUDE_DIRS})
+ list(APPEND LIBS ${${lib}_LIBRARIES})
+@@ -306,23 +305,6 @@
+ set_target_properties(lib_darktable PROPERTIES LINKER_LANGUAGE C)
+
+
+-#
+-# the libraw part is a bit of a hack:
+-# the static linking didn't work since it was pulling -lstdc++ and -lm into linker flags.
+-# so we do a custom dependency and pretend an imported liblibraw_r.a so no other -l are
+-# appended.
+-#
+-add_dependencies(lib_darktable libraw_r)
+-add_library(libraw_static STATIC IMPORTED)
+-set_target_properties(libraw_static PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/external/LibRaw/liblibraw_r.a)
+-if(APPLE)
+- set(LIBRAW_STATIC_LIBS libraw_static stdc++)
+-else(APPLE)
+- set(LIBRAW_STATIC_LIBS libraw_static)
+-endif(APPLE)
+-
+-target_link_libraries(lib_darktable ${LIBS} ${LIBRAW_STATIC_LIBS})
+-
+ # same for librawspeed (can switch it off with -DDONT_USE_RAWSPEED, for macs):
+ if(NOT DONT_USE_RAWSPEED)
+ add_definitions("-DHAVE_RAWSPEED")
+@@ -337,9 +319,6 @@
+ install(TARGETS lib_darktable DESTINATION ${LIB_INSTALL}/darktable)
+ list(APPEND LIBS lib_darktable)
+
+-# Compile libraw modules
+-add_subdirectory(external/LibRaw)
+-
+ # Compile views modules
+ add_subdirectory(views)
+
diff --git a/media-gfx/darktable/metadata.xml b/media-gfx/darktable/metadata.xml
index 2275ca3ad8f7..46956183e85a 100644
--- a/media-gfx/darktable/metadata.xml
+++ b/media-gfx/darktable/metadata.xml
@@ -8,6 +8,7 @@
</maintainer>
<use>
<flag name="flickr">Add support for uploading photos to flickr</flag>
+ <flag name="opencl">Enable opencl support</flag>
<flag name="rawspeed">Enable the rawspeed backend</flag>
<flag name="slideshow">Build the opengl slideshow viewer</flag>
</use>