You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

188 lines
5.7 KiB

#!/bin/sh
# Generated by Alien's SlackBuild Toolkit: http://slackware.com/~alien/AST
# Copyright 2009, 2010, 2011, 2012, 2013, 2014, 2015 Eric Hameleers, Eindhoven, Netherlands
# Copyright 2015-2017 Thorn Inurcide
# Copyright 2015-2017 tde-slackbuilds project on GitHub
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software for
# any purpose with or without fee is hereby granted, provided that
# the above copyright notice and this permission notice appear in all
# copies.
#
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
PRGNAM=libkdcraw
PKGNAM=$TDEPFX$PRGNAM
VERSION=$TDEVERSION
BUILD=${BUILD:-1}
TAG=${TAG:-_tde}
source ../../get-source.sh
getsource_fn
untar_fn
# for slack-desc
langs="en";for Lang in $I18N;do [[ -s translations/messages/$Lang".po" ]] && langs="$langs $Lang";done
listdocs_fn
## use latest version of dcraw.c
cp $SB_SRCDIR/dcraw.c libkdcraw/dcraw/
## .. modified as per the dcraw/README
sed -i 's| printf (_("Camera: %s %s\\n"), make, model);| printf (_("Camera: %s\\n"), make);\
printf (_("Model: %s\\n"), model);|' libkdcraw/dcraw/dcraw.c
## .. and the corresponding supported cameras list
cp $SB_SRCDIR/CAMERALIST libkdcraw/dcraw/
## .. and the updated man page
cp $SB_SRCDIR/dcraw.1 libkdcraw/dcraw/
## .. and which requires jasper
sed -i '72i find_package( Jasper )\
if( JASPER_FOUND )\
set( HAVE_JASPER 1 )\
else()\
tde_message_fatal( "jasper library is required, but was not found on your system" )\
endif()\
' ConfigureChecks.cmake
#
sed -i 's|MATH_LIBC.*$|&\n ${JASPER_LIBRARIES}|' libkdcraw/dcraw/CMakeLists.txt
## .. and install the list of supported cameras
echo "INSTALL(
FILES CAMERALIST
DESTINATION \${CMAKE_INSTALL_PREFIX}/doc/$PRGNAM-$VERSION
RENAME CameraList
COMPONENT doc
)" >> libkdcraw/dcraw/CMakeLists.txt
#
## and revert the name of the cli binary and man page to dcraw as it's not a TDE/TQt application
## and is confusing where kdcraw is used for the libraw library built
sed -i 's| kdcraw| dcraw|' libkdcraw/dcraw/CMakeLists.txt
sed -i 's|BUILD_KDCRAW|BUILD_DCRAW|;s|Build kdcraw program|Build dcraw program|' {{,libkdcraw/}CMakeLists.txt,ConfigureChecks.cmake}
patch -p0 -N << EOF
--- libkdcraw/dcraw/CMakeLists.txt
+++ libkdcraw/dcraw/CMakeLists.txt
@@ -4,4 +4,2 @@
\${CMAKE_CURRENT_SOURCE_DIR}
- \${TDE_INCLUDE_DIR}
- \${TQT_INCLUDE_DIRS}
\${LCMS_INCLUDE_DIRS}
@@ -10,8 +8,2 @@
-link_directories(
- \${TQT_LIBRARY_DIRS}
- \${TDE_LIB_DIR}
-)
-
-
##### dcraw (executable)
EOF
## tqt libs required for raw2png
sed -i 's|\##### test programs|link_directories(\
${TQT_LIBRARY_DIRS}\
)\
\
&|' libkdcraw/test/CMakeLists.txt
## .. and install libraw sample [test] programs
patch -p0 -N << EOF
--- libkdcraw/test/CMakeLists.txt
+++ libkdcraw/test/CMakeLists.txt
@@ -22,0 +23 @@
+ DESTINATION \${BIN_INSTALL_DIR}
@@ -30,0 +32 @@
+ DESTINATION \${BIN_INSTALL_DIR}
@@ -38,0 +41 @@
+ DESTINATION \${BIN_INSTALL_DIR}
@@ -46,0 +50 @@
+ DESTINATION \${BIN_INSTALL_DIR}
@@ -54,0 +59 @@
+ DESTINATION \${BIN_INSTALL_DIR}
@@ -62,0 +68 @@
+ DESTINATION \${BIN_INSTALL_DIR}
@@ -70,0 +77 @@
+ DESTINATION \${BIN_INSTALL_DIR}
EOF
## .. add two more libraw sample programs
echo 'tde_add_executable( half_mt AUTOMOC
DESTINATION ${BIN_INSTALL_DIR}
SOURCES ../libraw/samples/half_mt.c
LINK raw-static
)
tde_add_executable( dcraw_half AUTOMOC
DESTINATION ${BIN_INSTALL_DIR}
SOURCES ../libraw/samples/dcraw_half.c
LINK raw-static
)' >> libkdcraw/test/CMakeLists.txt
chown_fn
cd_builddir_fn
cmake ${G_NINJA:-} \
-DCMAKE_C_FLAGS="$SLKRCFLAGS" \
-DCMAKE_CXX_FLAGS="$SLKRCFLAGS" \
-DCMAKE_C_COMPILER=$COMPILER \
-DCMAKE_CXX_COMPILER=$COMPILER_CXX \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$INSTALL_TDE \
-DMAN_INSTALL_DIR=$INSTALL_TDE/man \
-DLIB_SUFFIX=$LIBDIRSUFFIX \
-DWITH_GCC_VISIBILITY=${GCC_VIS:-} \
-DWITH_LCMS="ON" \
-DWITH_OPENMP="ON" \
-DBUILD_DCRAW="ON" \
-DBUILD_TESTS="ON" \
-DBUILD_TRANSLATIONS="ON" \
-Wno-dev \
..
make_fn
installdocs_fn
mangzip_fn
strip_fn
mkdir_install_fn
doinst_sh_fn
PRGNAM=$PKGNAM
echo "
# HOW TO EDIT THIS FILE:
# The 'handy ruler' below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|' on
# the right side marks the last column you can put a character in. You must make
# exactly 11 lines for the formatting to be correct. It's also customary to
# leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
$PRGNAM: libkdcraw (LibRaw Library Wrapper)
$PRGNAM:
$PRGNAM: Libkdcraw is a C++ interface around the LibRaw library used to decode
$PRGNAM: RAW picture files and used by kipi-plugins, digiKam, gwenview and
$PRGNAM: ksquirrel.
$PRGNAM:
$PRGNAM: The cameras supported by the cli program dcraw are listed in
$PRGNAM: $INSTALL_TDE/doc/$PRGNAM-$VERSION/CameraList
$PRGNAM:
$PRGNAM: With language support for:
$PRGNAM: $langs
" > $PKG/install/slack-desc
makepkg_fn