-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1309 from citrus-it/dcraw
ImageMagick: Use dcraw to convert raw images
- Loading branch information
Showing
8 changed files
with
160 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
#!/usr/bin/bash | ||
# | ||
# {{{ CDDL HEADER | ||
# | ||
# This file and its contents are supplied under the terms of the | ||
# Common Development and Distribution License ("CDDL"), version 1.0. | ||
# You may only use this file in accordance with the terms of version | ||
# 1.0 of the CDDL. | ||
# | ||
# A full copy of the text of the CDDL should have accompanied this | ||
# source. A copy of the CDDL is also available via the Internet at | ||
# http://www.illumos.org/license/CDDL. | ||
# }}} | ||
|
||
# Copyright 2023 OmniOS Community Edition (OmniOSce) Association. | ||
|
||
. ../../lib/build.sh | ||
|
||
PROG=dcraw | ||
PKG=ooce/multimedia/dcraw | ||
VER=9.28.0 | ||
SUMMARY="Raw digital photograph decoder" | ||
DESC="dcraw - Decoding raw digital photographs" | ||
|
||
LCMSVER=2.15 | ||
JASPERVER=4.0.0 | ||
|
||
XFORM_ARGS=" | ||
-DPREFIX=${PREFIX#/} | ||
-DJASPERVER=$JASPERVER | ||
-DLCMSVER=$LCMSVER | ||
" | ||
|
||
SKIP_LICENCES='JasPer' | ||
|
||
set_arch 64 | ||
set_builddir $PROG | ||
|
||
init | ||
prep_build | ||
|
||
######################################################################### | ||
|
||
save_buildenv | ||
|
||
unset CONFIGURE_OPTS | ||
CONFIGURE_OPTS="--prefix=/usr --disable-shared" | ||
build_dependency lcms2 lcms2-$LCMSVER $PROG/lcms2 lcms2 $LCMSVER | ||
|
||
unset CONFIGURE_OPTS | ||
CONFIGURE_OPTS+=" -DCMAKE_INSTALL_PREFIX=/usr" | ||
CONFIGURE_OPTS+=" -DJAS_ENABLE_SHARED=false" | ||
build_dependency -cmake jasper jasper-$JASPERVER $PROG/jasper jasper $JASPERVER | ||
|
||
restore_buildenv | ||
|
||
CPPFLAGS+=" -I$DEPROOT/usr/include" | ||
LDFLAGS+=" -L$DEPROOT/usr/lib" | ||
|
||
######################################################################### | ||
|
||
note -n "-- Building $PROG" | ||
|
||
configure_arch() { | ||
typeset arch=$1 | ||
|
||
CPPFLAGS+=" -I$OOCEOPT/include" | ||
LDFLAGS+=" -L$OOCEOPT/${LIBDIRS[$arch]} -R$OOCEOPT/${LIBDIRS[$arch]}" | ||
|
||
subsume_arch $arch CPPFLAGS | ||
subsume_arch $arch CFLAGS | ||
subsume_arch $arch LDFLAGS | ||
} | ||
|
||
make_arch() { | ||
typeset arch=$1 | ||
|
||
logcmd $GCC $CPPFLAGS $CFLAGS -o dcraw dcraw.c \ | ||
$LDFLAGS -lm -ljasper -llcms2 -ljpeg -lheif || logerr "build failed" | ||
} | ||
|
||
make_install() { | ||
logcmd $MKDIR -p $DESTDIR/$PREFIX/bin $DESTDIR/$PREFIX/share/man/man1 | ||
logcmd $CP $PROG $DESTDIR/$PREFIX/bin || logerr "cp $PROG" | ||
logcmd $CP $PROG.1 $DESTDIR/$PREFIX/share/man/man1/ || logerr "cp $PROG.1" | ||
} | ||
|
||
download_source $PROG $PROG $VER | ||
patch_source | ||
build | ||
make_package | ||
clean_up | ||
|
||
# Vim hints | ||
# vim:ts=4:sw=4:et:fdm=marker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This file and its contents are supplied under the terms of the | ||
# Common Development and Distribution License ("CDDL"), version 1.0. | ||
# You may only use this file in accordance with the terms of version | ||
# 1.0 of the CDDL. | ||
# | ||
# A full copy of the text of the CDDL should have accompanied this | ||
# source. A copy of the CDDL is also available via the Internet at | ||
# http://www.illumos.org/license/CDDL. | ||
|
||
# Copyright 2023 OmniOS Community Edition (OmniOSce) Association. | ||
|
||
license ../jasper-$(JASPERVER)/LICENSE.txt license=JasPer | ||
license ../lcms2-$(LCMSVER)/COPYING license=MIT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
diff -wpruN --no-dereference '--exclude=*.orig' a~/MagickCore/delegate.c a/MagickCore/delegate.c | ||
--- a~/MagickCore/delegate.c 1970-01-01 00:00:00 | ||
+++ a/MagickCore/delegate.c 1970-01-01 00:00:00 | ||
@@ -106,7 +106,7 @@ static const char | ||
" <delegate decode=\"https\" command=\""curl" -s -k -L -o "%o" "https:%M"\"/>" | ||
" <delegate decode=\"doc\" command=\""soffice" --convert-to pdf -outdir `dirname "%i"` "%i" 2> "%u"; mv "%i.pdf" "%o"\"/>" | ||
" <delegate decode=\"docx\" command=\""soffice" --convert-to pdf -outdir `dirname "%i"` "%i" 2> "%u"; mv "%i.pdf" "%o"\"/>" | ||
- " <delegate decode=\"dng:decode\" command=\""ufraw-batch" --silent --create-id=also --out-type=png --out-depth=16 "--output=%u.png" "%i"\"/>" | ||
+ " <delegate decode=\"dng:decode\" command=\"/opt/ooce/bin/dcraw -c -q 3 -H 5 -w "%i" > "%u.ppm"\"/>" | ||
" <delegate decode=\"dot\" command=\""dot" -Tsvg "%i" -o "%o"\"/>" | ||
" <delegate decode=\"dvi\" command=\""dvips" -sstdout=%%stderr -o "%o" "%i"\"/>" | ||
" <delegate decode=\"dxf\" command=\""uniconvertor" "%i" "%o.svg"; mv "%o.svg" "%o"\"/>" | ||
diff -wpruN --no-dereference '--exclude=*.orig' a~/config/delegates.xml.in a/config/delegates.xml.in | ||
--- a~/config/delegates.xml.in 1970-01-01 00:00:00 | ||
+++ a/config/delegates.xml.in 1970-01-01 00:00:00 | ||
@@ -66,7 +66,7 @@ | ||
<delegate decode="https:decode" command=""@WWWDecodeDelegate@" -s -k -L -o "%u.dat" "https:%M""/> | ||
<delegate decode="doc" command=""@DOCDecodeDelegate@" --headless --convert-to pdf -outdir `dirname "%i"` "%i" 2> "%u"; @MVDelegate@ "%i.pdf" "%o""/> | ||
<delegate decode="docx" command=""@DOCDecodeDelegate@" --headless --convert-to pdf -outdir `dirname "%i"` "%i" 2> "%u"; @MVDelegate@ "%i.pdf" "%o""/> | ||
- <delegate decode="dng:decode" command=""@DNGDecodeDelegate@" --silent --create-id=also --out-type=png --out-depth=16 "--output=%u.png" "%i""/> | ||
+ <delegate decode="dng:decode" stealth="True" command="/opt/ooce/bin/dcraw -c -q 3 -H 5 -w "%i" > "%u.ppm""/> | ||
<delegate decode="dot" command=""@GVCDecodeDelegate@" -Tsvg "%i" -o "%o"" /> | ||
<delegate decode="dvi" command=""@DVIDecodeDelegate@" -sstdout=%%stderr -o "%o" "%i""/> | ||
<delegate decode="edit" stealth="True" command=""@EditorDelegate@" -title "Edit Image Comment" -e vi "%o""/> | ||
diff -wpruN --no-dereference '--exclude=*.orig' a~/www/source/delegates.xml a/www/source/delegates.xml | ||
--- a~/www/source/delegates.xml 1970-01-01 00:00:00 | ||
+++ a/www/source/delegates.xml 1970-01-01 00:00:00 | ||
@@ -67,7 +67,7 @@ | ||
<delegate decode="https" command=""curl" -s -k -L -o "%o" "https:%M""/> | ||
<delegate decode="doc" command=""soffice" --convert-to pdf -outdir `dirname "%i"` "%i" 2> "%u"; /usr/bin/mv "%i.pdf" "%o""/> | ||
<delegate decode="docx" command=""soffice" --convert-to pdf -outdir `dirname "%i"` "%i" 2> "%u"; /usr/bin/mv "%i.pdf" "%o""/> | ||
- <delegate decode="dng:decode" command=""ufraw-batch" --silent --create-id=also --out-type=png --out-depth=16 "--output=%u.png" "%i""/> | ||
+ <delegate decode="dng:decode" stealth="True" command="/opt/ooce/bin/dcraw -c -q 3 -H 5 -w "%i" > "%u.ppm""/> | ||
<delegate decode="dot" command='"dot" -Tsvg "%i" -o "%o"' /> | ||
<delegate decode="dvi" command=""dvips" -sstdout=%%stderr -o "%o" "%i""/> | ||
<delegate decode="dxf" command=""uniconvertor" "%i" "%o.svg"; /usr/bin/mv "%o.svg" "%o""/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
la.patch | ||
dcraw.patch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters