[darktable] Disable squish

madko madko at fedoraproject.org
Mon Jun 10 14:09:38 UTC 2013


commit 61876fbaafa44f93d7c0fe34cea920f5a0aba863
Author: Edouard Bourguignon <madko at linuxed.net>
Date:   Mon Jun 10 16:09:18 2013 +0200

    Disable squish

 darktable-squish_optional.patch |   85 +++++++++++++++++++++++++++++++++++++++
 darktable.spec                  |    9 +++-
 2 files changed, 91 insertions(+), 3 deletions(-)
---
diff --git a/darktable-squish_optional.patch b/darktable-squish_optional.patch
new file mode 100644
index 0000000..693bc40
--- /dev/null
+++ b/darktable-squish_optional.patch
@@ -0,0 +1,85 @@
+commit 52e3da288fb3ef17b38f1d0e346cd57407ea5c03
+Author: johannes hanika <hanika at kit.edu>
+Date:   Mon Jun 10 11:25:09 2013 +0200
+
+    thumbnail compression: make libsquish optional.
+    
+    some poor sobs in undeveloped countries are concerned by software patents.
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 8b3478d..7271e88 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -10,6 +10,7 @@ option(USE_FLICKR "Enable Flickr support" ON)
+ option(USE_GLIBJSON "Enable GlibJson support" ON)
+ option(USE_GNOME_KEYRING "Build gnome-keyring password storage backend" ON)
+ option(USE_UNITY "Use libunity to report progress in the launcher" OFF)
++option(USE_SQUISH "Use thumbnail compression via libsquish" OFF)
+ option(BUILD_SLIDESHOW "Build the opengl slideshow viewer" ON)
+ option(USE_OPENMP "Use openmp threading support." ON)
+ option(USE_OPENCL "Use OpenCL support." ON)
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index a0c230f..9118c66 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -491,12 +491,15 @@ if(USE_COLORD)
+   endif(COLORD_FOUND)
+ endif(USE_COLORD)
+ 
++if(USE_SQUISH)
+ # libsquish for compressed thumbnails:
+ add_dependencies(lib_darktable squish)
+ add_library(squish_static STATIC IMPORTED)
+ set_target_properties(squish_static PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/external/squish/libsquish.a)
+ target_link_libraries(lib_darktable ${LIBS} squish_static)
+ add_subdirectory(external/squish)
++add_definitions("-DHAVE_SQUISH")
++endif(USE_SQUISH)
+ 
+ install(TARGETS lib_darktable DESTINATION ${LIB_INSTALL}/darktable)
+ # make sure static libs is first
+diff --git a/src/common/mipmap_cache.c b/src/common/mipmap_cache.c
+index dc2751f..4f81902 100644
+--- a/src/common/mipmap_cache.c
++++ b/src/common/mipmap_cache.c
+@@ -26,7 +26,9 @@
+ #include "control/conf.h"
+ #include "control/jobs.h"
+ #include "libraw/libraw.h"
++#ifdef HAVE_SQUISH
+ #include "squish/csquish.h"
++#endif
+ 
+ #include <assert.h>
+ #include <string.h>
+@@ -1377,12 +1379,14 @@ dt_mipmap_cache_decompress(
+   const dt_mipmap_buffer_t *buf,
+   uint8_t *scratchmem)
+ {
++#ifdef HAVE_SQUISH
+   if(darktable.mipmap_cache->compression_type && buf->width > 8 && buf->height > 8)
+   {
+     squish_decompress_image(scratchmem, buf->width, buf->height, buf->buf, squish_dxt1);
+     return scratchmem;
+   }
+   else
++#endif
+   {
+     return buf->buf;
+   }
+@@ -1396,6 +1400,7 @@ dt_mipmap_cache_compress(
+   dt_mipmap_buffer_t *buf,
+   uint8_t *const scratchmem)
+ {
++#ifdef HAVE_SQUISH
+   // only do something if compression is on, don't compress skulls:
+   if(darktable.mipmap_cache->compression_type && buf->width > 8 && buf->height > 8)
+   {
+@@ -1404,6 +1409,7 @@ dt_mipmap_cache_compress(
+     if(darktable.mipmap_cache->compression_type == 1) flags |= squish_colour_range_fit;
+     squish_compress_image(scratchmem, buf->width, buf->height, buf->buf, squish_dxt1);
+   }
++#endif
+ }
+ 
+ 
diff --git a/darktable.spec b/darktable.spec
index 6315285..f9bbd15 100644
--- a/darktable.spec
+++ b/darktable.spec
@@ -3,7 +3,7 @@
 
 Name:		darktable
 Version:	1.2.1
-Release:	2%{?dist}
+Release:	3%{?dist}
 Summary:	Utility to organize and develop raw images
 
 Group:		Applications/Multimedia
@@ -11,6 +11,7 @@ License:	GPLv3+
 URL:		http://darktable.sourceforge.net/
 Source0:	http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz
 Patch0:		darktable-broken_full_color_images.patch
+Patch1:		darktable-squish_optional.patch
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  cmake
@@ -38,8 +39,6 @@ BuildRequires:	json-glib-devel
 %if 0%{?with_gegl}
 BuildRequires:	gegl-devel
 %endif
-BuildRequires:	LibRaw-devel
-BuildRequires:	colord-devel
 
 Requires:	gtk2-engines
 
@@ -57,6 +56,7 @@ It also enables you to develop raw images and enhance them.
 %prep
 %setup -q -n %{name}-%{version}
 %patch0 -p1 -b broken_full_color_images.rej
+%patch1 -p1 -b squish_optional.rej
 
 %build
 mkdir buildFedora
@@ -125,6 +125,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
 
 
 %changelog
+* Mon Jun 10 2013 Edouard Bourguignon <madko at linuxed.net> - 1.2.1-3
+- Patch to make squish optional
+
 * Mon Jun 10 2013 Edouard Bourguignon <madko at linuxed.net> - 1.2.1-2
 - fix for CVE-2013-2126 (Thanks to Alex Tutubalin's patch)
 - Do not use squish (bug #972604)


More information about the scm-commits mailing list