commit:     4de7949186333cfd1c8ef2c29ac015591f3fba28
Author:     Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 30 08:06:08 2018 +0000
Commit:     Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Sun Dec 30 08:26:39 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4de79491

media-gfx/gmic: version bump to 2.4.3

Closes: https://bugs.gentoo.org/556116
Closes: https://bugs.gentoo.org/621270
Closes: https://bugs.gentoo.org/622466
Closes: https://bugs.gentoo.org/628318
Closes: https://bugs.gentoo.org/629194
Closes: https://bugs.gentoo.org/633950
Closes: https://bugs.gentoo.org/643090
Closes: https://bugs.gentoo.org/657764

Signed-off-by: Tim Harder <radhermit <AT> gentoo.org>

 media-gfx/gmic/Manifest                    |   1 +
 media-gfx/gmic/files/gmic-2.4.3-curl.patch | 100 +++++++++++++++++
 media-gfx/gmic/gmic-2.4.3.ebuild           | 170 +++++++++++++++++++++++++++++
 media-gfx/gmic/metadata.xml                |   1 +
 4 files changed, 272 insertions(+)

diff --git a/media-gfx/gmic/Manifest b/media-gfx/gmic/Manifest
index f0fb1ad0b3d..c72ee5e76e0 100644
--- a/media-gfx/gmic/Manifest
+++ b/media-gfx/gmic/Manifest
@@ -1,3 +1,4 @@
 DIST gmic_1.7.8.tar.gz 3013635 BLAKE2B 
1e964b42358010d1c643ff976f70774e2418a42b09601f29f9838e594ba4a0145e4c019cba39523efa85846bb75df7bbc451fd2c23ababc94ace93f35587c535
 SHA512 
2bfa7bb9ff3a99a76c71f7c4e0d619e9c205dafc02b5a2d1f097b6285c141e5413f7016b92d974327f787010a6832d272ab21a89842eee2484151072c2d4c559
 DIST gmic_1.7.9.tar.gz 3069082 BLAKE2B 
bc756258adbe468a4ceb347d546e1d283b6b21bb8bac4d3ec14b5c789fa375de37babded5862bdbbf86e83e4818c00c77758c13d10041ab90903d2d01e58ca6a
 SHA512 
749611748c9fe2a141efc9b0a445411c1ece842f4c576b68b3b17cbbffdc1cf43a2aee55dc399b899dc03882f240289beaef96d9ec85b10ffc0ad986412cd4bc
 DIST gmic_2.0.0.tar.gz 3181386 BLAKE2B 
4e6300388e62c915bf41ed04f70e487de8f5e460855f2e087c20766ef186d7dd1a4b99a053d9bd4ab02dc3f391982a9bebb20bcdd9b1e4737ba2bff77bd84a62
 SHA512 
08cb3bb02d072db5881dc3b2c23be766ae9909a29042777b474733afe30efeaeff35582ac69e8c5f38258c563919a17ce22294c594cbe04f792769b6609b3efb
+DIST gmic_2.4.3.tar.gz 3816129 BLAKE2B 
1c9dd6c7e45809d0cf8b8a45476a4b20ad321b5f34fbc5214cb149777c6e9a6aba845cd816cc1503010e281bda0b32e1059dd34d052afe2ebc086469163967be
 SHA512 
482e70b0c82992799c5769ded1547904d16dbc9206d67279b6f524c1214258b97fa539678844a450d6f64144dc7a2715c754d6a1d85398e648bc34086fc3218f

diff --git a/media-gfx/gmic/files/gmic-2.4.3-curl.patch 
b/media-gfx/gmic/files/gmic-2.4.3-curl.patch
new file mode 100644
index 00000000000..f91f86ff0d4
--- /dev/null
+++ b/media-gfx/gmic/files/gmic-2.4.3-curl.patch
@@ -0,0 +1,100 @@
+Add curl support for the cli app and base library and make it truly optional
+for gmic-qt instead of automagic.
+
+--- gmic-2.4.3/CMakeLists.txt
++++ gmic-2.4.3/CMakeLists.txt
+@@ -83,6 +83,7 @@
+ option(BUILD_MAN "Build the manpage" ON)
+ option(BUILD_BASH_COMPLETION "Build Bash completion" ON)
+ option(CUSTOM_CFLAGS "Override default compiler optimization flags" OFF)
++option(ENABLE_CURL "Add support for curl" ON)
+ option(ENABLE_X "Add support for X11" ON)
+ option(ENABLE_FFMPEG "Add support for FFMpeg" ON)
+ option(ENABLE_FFTW "Add support for FFTW" ON)
+@@ -136,6 +137,16 @@
+   link_directories(${ZLIB_LIBRARY_DIRS})
+ endif()
+ 
++# curl support
++if(ENABLE_CURL)
++  find_package(CURL)
++endif()
++if(CURL_FOUND)
++  set(COMPILE_FLAGS "${COMPILE_FLAGS} -Dcimg_use_curl")
++  include_directories(${CURL_INCLUDE_DIRS})
++  link_directories(${CURL_LIBRARY_DIRS})
++endif()
++
+ #X11 support
+ if(ENABLE_X)
+   find_package(X11)
+@@ -288,6 +299,7 @@
+     ${OPENEXR_LIBRARIES}
+     ${OPENCV_LIBRARIES}
+     ${ZLIB_LIBRARIES}
++    ${CURL_LIBRARIES}
+     ${FFTW3_LIBRARIES}
+     ${EXTRA_LIBRARIES}
+   )
+@@ -316,6 +328,7 @@
+     ${OPENEXR_LIBRARIES}
+     ${OPENCV_LIBRARIES}
+     ${ZLIB_LIBRARIES}
++    ${CURL_LIBRARIES}
+     ${FFTW3_LIBRARIES}
+     ${EXTRA_LIBRARIES}
+   )
+@@ -345,6 +358,7 @@
+       ${OPENEXR_LIBRARIES}
+       ${OPENCV_LIBRARIES}
+       ${ZLIB_LIBRARIES}
++      ${CURL_LIBRARIES}
+       ${FFTW3_LIBRARIES}
+       ${EXTRA_LIBRARIES}
+     )
+--- gmic-2.4.3/gmic-qt/CMakeLists.txt
++++ gmic-2.4.3/gmic-qt/CMakeLists.txt
+@@ -30,6 +30,7 @@
+ message("G'MIC path: " ${GMIC_PATH})
+ 
+ option(ENABLE_DYNAMIC_LINKING "Dynamically link the binaries to the GMIC 
shared library" OFF)
++option(ENABLE_CURL "Add support for curl" ON)
+ set (GMIC_LIB_PATH "${GMIC_PATH}" CACHE STRING "Define the path to the GMIC 
shared library")
+ 
+ #
+@@ -149,10 +150,12 @@
+ #
+ # CURL
+ #
+-find_package(CURL)
+-if (CURL_FOUND)
+-    add_definitions(-Dcimg_use_curl)
+-    include_directories(SYSTEM ${CURL_INCLUDE_DIRS} )
++if(ENABLE_CURL)
++    find_package(CURL)
++    if (CURL_FOUND)
++        add_definitions(-Dcimg_use_curl)
++        include_directories(SYSTEM ${CURL_INCLUDE_DIRS} )
++    endif()
+ endif()
+ 
+ #
+@@ -187,11 +190,13 @@
+         ${ZLIB_LIBRARIES}
+ )
+ 
+-if (CURL_FOUND)
+-    set(gmic_qt_LIBRARIES
+-        ${gmic_qt_LIBRARIES}
+-        ${CURL_LIBRARIES}
+-    )
++if(ENABLE_CURL)
++    if (CURL_FOUND)
++        set(gmic_qt_LIBRARIES
++            ${gmic_qt_LIBRARIES}
++            ${CURL_LIBRARIES}
++        )
++    endif()
+ endif()
+ 
+ add_definitions(-Dgmic_build)

diff --git a/media-gfx/gmic/gmic-2.4.3.ebuild b/media-gfx/gmic/gmic-2.4.3.ebuild
new file mode 100644
index 00000000000..0b6b7df9acb
--- /dev/null
+++ b/media-gfx/gmic/gmic-2.4.3.ebuild
@@ -0,0 +1,170 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+CMAKE_BUILD_TYPE=Release
+CMAKE_MIN_VERSION=3.9
+
+inherit cmake-utils bash-completion-r1
+
+if [[ ${PV} == "9999" ]]; then
+       EGIT_REPO_URI="https://github.com/dtschump/gmic.git";
+       inherit git-r3
+else
+       SRC_URI="https://gmic.eu/files/source/${PN}_${PV}.tar.gz";
+       KEYWORDS="~amd64 ~x86"
+fi
+
+DESCRIPTION="GREYC's Magic Image Converter"
+HOMEPAGE="https://gmic.eu/ https://github.com/dtschump/gmic";
+
+LICENSE="CeCILL-2 GPL-3"
+SLOT="0"
+IUSE="+cli curl ffmpeg fftw gimp graphicsmagick jpeg krita opencv openexr 
openmp png qt5 static-libs tiff X zlib"
+REQUIRED_USE="
+       || ( cli gimp krita qt5 )
+       gimp? ( png zlib fftw X )
+       krita? ( png zlib fftw X )
+       qt5? ( png zlib fftw X )
+"
+
+MIN_QT_VER="5.2.0"
+QT_DEPEND="
+       >=dev-qt/qtcore-${MIN_QT_VER}:5=
+       >=dev-qt/qtgui-${MIN_QT_VER}:5=
+       >=dev-qt/qtnetwork-${MIN_QT_VER}:5=
+       >=dev-qt/qtwidgets-${MIN_QT_VER}:5=
+"
+COMMON_DEPEND="
+       curl? ( net-misc/curl )
+       fftw? ( sci-libs/fftw:3.0=[threads] )
+       gimp? (
+               >=media-gfx/gimp-2.8.0
+               ${QT_DEPEND}
+       )
+       graphicsmagick? ( media-gfx/graphicsmagick:0= )
+       jpeg? ( virtual/jpeg:0 )
+       krita? ( ${QT_DEPEND} )
+       opencv? ( >=media-libs/opencv-2.3.1a-r1:0= )
+       openexr? (
+               media-libs/ilmbase:0=
+               media-libs/openexr:0=
+       )
+       png? ( media-libs/libpng:0= )
+       qt5? ( ${QT_DEPEND} )
+       tiff? ( media-libs/tiff:0 )
+       X? (
+               x11-libs/libX11
+               x11-libs/libXext
+       )
+       zlib? ( sys-libs/zlib:0= )"
+RDEPEND="${COMMON_DEPEND}
+       ffmpeg? ( media-video/ffmpeg:0= )
+"
+DEPEND="${COMMON_DEPEND}
+       virtual/pkgconfig
+       gimp? ( dev-qt/linguist-tools )
+       krita? ( dev-qt/linguist-tools )
+       qt5? ( dev-qt/linguist-tools )
+"
+
+pkg_pretend() {
+       if use openmp ; then
+               tc-has-openmp || die "Please switch to an openmp compatible 
compiler"
+       fi
+
+       if ! test-flag-CXX -std=c++11 ; then
+               die "You need at least GCC 4.7.x or Clang >= 3.3 for 
C++11-specific compiler flags"
+       fi
+}
+
+src_prepare() {
+       local PATCHES=( "${FILESDIR}"/${P}-curl.patch )
+       cmake-utils_src_prepare
+       sed -i '/CMAKE_CXX_FLAGS/s/-g //' CMakeLists.txt || die
+
+       if use gimp || use krita || use qt5; then
+               sed -i '/CMAKE_CXX_FLAGS_RELEASE/d' gmic-qt/CMakeLists.txt || 
die
+               local S="${S}/gmic-qt"
+               PATCHES=()
+               cmake-utils_src_prepare
+       fi
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DBUILD_LIB=ON
+               -DBUILD_LIB_STATIC=$(usex static-libs)
+               -DBUILD_CLI=$(usex cli)
+               -DBUILD_MAN=$(usex cli)
+               -DCUSTOM_CFLAGS=ON
+               -DENABLE_CURL=$(usex curl)
+               -DENABLE_X=$(usex X)
+               -DENABLE_FFMPEG=$(usex ffmpeg)
+               -DENABLE_FFTW=$(usex fftw)
+               -DENABLE_GRAPHICSMAGICK=$(usex graphicsmagick)
+               -DENABLE_JPEG=$(usex jpeg)
+               -DENABLE_OPENCV=$(usex opencv)
+               -DENABLE_OPENEXR=$(usex openexr)
+               -DENABLE_OPENMP=$(usex openmp)
+               -DENABLE_PNG=$(usex png)
+               -DENABLE_TIFF=$(usex tiff)
+               -DENABLE_ZLIB=$(usex zlib)
+               -DENABLE_DYNAMIC_LINKING=ON
+       )
+
+       cmake-utils_src_configure
+
+       # configure gmic-qt frontends
+       local CMAKE_USE_DIR="${S}/gmic-qt"
+       mycmakeargs=(
+               -DENABLE_DYNAMIC_LINKING=ON
+               -DENABLE_CURL=$(usex curl)
+               -DGMIC_LIB_PATH="${BUILD_DIR}"
+               -DGMIC_PATH="${S}/src"
+       )
+
+       if use gimp; then
+               mycmakeargs+=( -DGMIC_QT_HOST=gimp )
+               BUILD_DIR="${BUILD_DIR}"/gimp cmake-utils_src_configure
+       fi
+
+       if use krita; then
+               mycmakeargs+=( -DGMIC_QT_HOST=krita )
+               BUILD_DIR="${BUILD_DIR}"/krita cmake-utils_src_configure
+       fi
+
+       if use qt5; then
+               mycmakeargs+=( -DGMIC_QT_HOST=none )
+               BUILD_DIR="${BUILD_DIR}"/qt5 cmake-utils_src_configure
+       fi
+}
+
+src_compile() {
+       cmake-utils_src_compile
+
+       # build gmic-qt frontends
+       local S="${S}/gmic-qt"
+       use gimp && { BUILD_DIR="${BUILD_DIR}"/gimp cmake-utils_src_compile || 
die "failed building gimp plugin" ; }
+       use krita && { BUILD_DIR="${BUILD_DIR}"/krita cmake-utils_src_compile 
|| die "failed building krita plugin" ; }
+       use qt5 && { BUILD_DIR="${BUILD_DIR}"/qt5 cmake-utils_src_compile || 
die "failed building qt5 GUI" ; }
+}
+
+src_install() {
+       cmake-utils_src_install
+       dodoc README
+       use cli && newbashcomp "${BUILD_DIR}"/resources/gmic_bashcompletion.sh 
${PN}
+
+       local PLUGINDIR="/usr/$(get_libdir)/gimp/2.0/plug-ins"
+       insinto "${PLUGINDIR}"
+       doins resources/gmic_film_cluts.gmz
+
+       # install gmic-qt frontends
+       if use gimp; then
+               exeinto "${PLUGINDIR}"
+               doexe "${BUILD_DIR}"/gimp/gmic_gimp_qt
+       fi
+       use krita && dobin "${BUILD_DIR}"/krita/gmic_krita_qt
+       use qt5 && dobin "${BUILD_DIR}"/qt5/gmic_qt
+}

diff --git a/media-gfx/gmic/metadata.xml b/media-gfx/gmic/metadata.xml
index 97ea96d2123..1cd8c96cdca 100644
--- a/media-gfx/gmic/metadata.xml
+++ b/media-gfx/gmic/metadata.xml
@@ -7,6 +7,7 @@
        </maintainer>
        <use>
                <flag name="cli">Build CLI interface</flag>
+               <flag name="krita">Build <pkg>media-gfx/krita</pkg> 
plugin</flag>
                <flag name="opencv">Enable support for webcams using the OpenCV 
library</flag>
        </use>
        <upstream>

Reply via email to