Accepting request 180239 from graphics

-  Remove patented code from the source via
   generate--tarball.sh bnc#824484
   * added backported patch from git master
     0001-thumbnail-compression-make-libsquish-optional 
   * Remove pkgconfig(colord) from Build Requires
   Because compression code is disabled previous cache will not
   work. Removing  ~/.cache/darktable/mipmaps is necessary (forwarded request 180238 from toganm)

OBS-URL: https://build.opensuse.org/request/show/180239
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/darktable?expand=0&rev=32
This commit is contained in:
Stephan Kulow 2013-06-21 08:33:25 +00:00 committed by Git OBS Bridge
parent 9e24dd790b
commit cebcdd7434
6 changed files with 123 additions and 5 deletions

View File

@ -0,0 +1,85 @@
From 1b9952c990c3611691306bfd46e0929c7fc14386 Mon Sep 17 00:00:00 2001
From: johannes hanika <hanika@kit.edu>
Date: Mon, 10 Jun 2013 11:25:09 +0200
Subject: [PATCH] thumbnail compression: make libsquish optional.
some poor sobs in undeveloped countries are concerned by software patents.
Signed-off-by: Togan Muftuoglu <toganm@users.sourceforge.net>
---
CMakeLists.txt | 1 +
src/CMakeLists.txt | 3 +++
src/common/mipmap_cache.c | 6 ++++++
3 files changed, 10 insertions(+)
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,6 +10,7 @@ option(USE_FLICKR "Enable Flickr support
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)
--- 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
--- 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>
@@ -1340,12 +1342,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;
}
@@ -1359,6 +1363,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)
{
@@ -1367,6 +1372,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
}

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:aa259f467006c4dcb655cdc90b041f7b06b211f306d4e26e70534994facb341c
size 2259736

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b1756295dfda78fc828603033a58f233ced1908b8a50ec97d2e600d6eacf8e2a
size 2273260

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Thu Jun 20 12:52:15 UTC 2013 - toganm@opensuse.org
- Remove patented code from the source via
generate--tarball.sh bnc#824484
* added backported patch from git master
0001-thumbnail-compression-make-libsquish-optional
* Remove pkgconfig(colord) from Build Requires
Because compression code is disabled previous cache will not
work. Removing ~/.cache/darktable/mipmaps is necessary
-------------------------------------------------------------------
Mon Jun 10 13:07:02 UTC 2013 - toganm@opensuse.org

View File

@ -20,10 +20,18 @@ Name: darktable
Version: 1.2.1
Release: 0
Url: http://darktable.sourceforge.net
Source0: https://downloads.sourceforge.net/project/darktable/darktable/1.2/%name-%version.tar.xz
# darktable contains patented code that we cannot ship. Therefore we use
# this script to remove the patented code before shipping it.
# Download the upstream tarball and invoke this script while in the
# tarball's directory:
# Originial Source: https://downloads.sourceforge.net/project/darktable/darktable/1.2/%%name-%%version.tar.xz
# ./generate-tarball.sh
Source0: %name-%version-nopatents.tar.xz
Source1: http://sourceforge.net/projects/darktable/files/darktable/1.2/darktable-usermanual.pdf
#PATCH-FIX-UPSTREAM backported from git master bnc#823114
Patch0: 0001-fixed-error-handling-for-broken-full-color-images.patch
#PATCH-FIX-OPENSUSE makes the use of squish library backported from git
Patch1: 0001-thumbnail-compression-make-libsquish-optional.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: cmake
BuildRequires: dbus-1-glib-devel
@ -39,7 +47,6 @@ BuildRequires: pkg-config
BuildRequires: update-desktop-files
BuildRequires: pkgconfig(GraphicsMagick)
BuildRequires: pkgconfig(OpenEXR)
BuildRequires: pkgconfig(colord)
BuildRequires: pkgconfig(dri)
BuildRequires: pkgconfig(exiv2)
BuildRequires: pkgconfig(flickcurl)
@ -90,6 +97,7 @@ This package provides the user manual in pdf format
%prep
%setup -q
%patch0 -p1
%patch1 -p1
chmod -x tools/create_control_svg.sh tools/purge_non_existing_images.sh
cp %{S:1} darktable-usermanual.pdf
@ -106,6 +114,7 @@ cmake \
-DCMAKE_BUILD_TYPE=Release \
-DBINARY_PACKAGE_BUILD=1 \
-DUSE_XMLLINT=OFF \
-DUSE_SQUISH=OFF -DUSE_COLORD=OFF \
-DINSTALL_IOP_EXPERIMENTAL=On ..
%__make %{_smp_mflags} VERBOSE=1

12
generate-tarball.sh Normal file
View File

@ -0,0 +1,12 @@
#!/bin/sh
VERSION=$1
tar -xJvf darktable-$VERSION.tar.xz
rm -rf darktable-$VERSION/src/external/squish
tar -cJvf darktable-$VERSION-nopatents.tar.xz darktable-$VERSION
rm -rf darktable-$VERSION/
rm darktable-$VERSION.tar.xz