summaryrefslogtreecommitdiff
path: root/media-gfx/gmic
diff options
context:
space:
mode:
Diffstat (limited to 'media-gfx/gmic')
-rw-r--r--media-gfx/gmic/Manifest2
-rw-r--r--media-gfx/gmic/gmic-2.9.9.ebuild174
2 files changed, 176 insertions, 0 deletions
diff --git a/media-gfx/gmic/Manifest b/media-gfx/gmic/Manifest
index dd88ebb4ab05..410888be7456 100644
--- a/media-gfx/gmic/Manifest
+++ b/media-gfx/gmic/Manifest
@@ -1,4 +1,6 @@
AUX gmic-2.9.2_ipa-sra.patch 665 BLAKE2B b61fa87ac2da5fd5956c89cb4a6c128f266a175dca70cd34ff4bed0483c934241a375131eaddd6ebd5f3afb52e694d4fc6839d20718bc06463c0e263f15b6d5a SHA512 6f04cac4de5914cedd269655fe58ca406199c042bdbab6e706cfea49516d0a7e1234e61c51b6a142341a7984dd96e97c4b8f13c2efbe427627be26539af8653e
DIST gmic_2.9.8.tar.gz 7311372 BLAKE2B 6438198cbaefe1de712ccd85179887b858ec1f7e039a080f0070e5ed454fd52b9414ecbd7c93dce740261df501f086634ab0bd291b70bb18778979faf2331486 SHA512 588362de60d51b1814cbe08f7402b143b656712bf2b4dc33830196068d7464394fe314d1c0dcee608a7408c7b7507596e88dee588a54f0eff1cad9e826b19bb3
+DIST gmic_2.9.9.tar.gz 7325061 BLAKE2B 256b4f1180edfc8ebb3a3e7f7666c7b44d95cd36a52c1b5539a355f022471eeef776c77b820864ca05b2ccc4a58a2e85970994cfdbce9e55aff31112af4e6000 SHA512 fcc129f5acfb32a3154d4c987f574c18ad68dd35e9e357fdc391166211747f5d7eed63a2fcde29c110a79e8665f2a6d1e70b68c81e19bb02be43a84ec7f1cc64
EBUILD gmic-2.9.8.ebuild 4259 BLAKE2B 7596e851d7ad3b53e29c21a8e65c7f893d30bea57889237b844befe1124c8cdf9d5bf5d8fe8c71f90adbcb44d3809473214e0117877f53b2b2b85218b9756b0a SHA512 a124e2cbc12aa50bdb444114afc9b22ed85cb269c315370f75a5aeeeabb29cb11bbf17bbb8e2104fbca4c67f7b7a9e68324b455fe627c42d9cd6ede70c79b142
+EBUILD gmic-2.9.9.ebuild 4262 BLAKE2B d078b537729da8b811057929f6bd42059a856149a411bbccce306dc43ddf627bac38a9c32be5d5f5ce86c4b15ebbe94e9529afb7c6e20a518ec1c926d6378ecf SHA512 d3a88e07b665108c4618b2b7841d639c070ed2340869f9da9fd7558a9bb0b9d965a5960948fd5b3b3d46611cd6ede7bc6730759fd829a89cd0351af054c7f888
MISC metadata.xml 533 BLAKE2B 29dc054d7e7f718782ad0bb914bd8ce7b2dc6519826c4fe21be1cc20c4ddd21b99355c565106123de39bec8dadb08c1ca1fcb10989cc6fe984e6a6ea7e611c5f SHA512 2eb6d59dfa0d092625b755e952dbddf6c6dda811ae19768811ea7dc8a07771cfd3e4d074e8e996ec2de5e74243721c8b82d7cb8fc86300246096e18b782b5a2c
diff --git a/media-gfx/gmic/gmic-2.9.9.ebuild b/media-gfx/gmic/gmic-2.9.9.ebuild
new file mode 100644
index 000000000000..b58559de3751
--- /dev/null
+++ b/media-gfx/gmic/gmic-2.9.9.ebuild
@@ -0,0 +1,174 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+CMAKE_BUILD_TYPE=Release
+
+inherit cmake bash-completion-r1 toolchain-funcs
+
+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 ~arm64 ~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="
+ 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:0/2
+ ${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}
+ gimp? ( dev-qt/linguist-tools )
+ krita? ( dev-qt/linguist-tools )
+ qt5? ( dev-qt/linguist-tools )
+"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.9.2_ipa-sra.patch
+)
+
+pkg_pretend() {
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if use openmp; then
+ tc-has-openmp || die "Please switch to an openmp compatible compiler"
+ fi
+ fi
+}
+
+src_prepare() {
+ cmake_src_prepare
+ sed -i '/CMAKE_CXX_FLAGS/s/-g //' CMakeLists.txt || die
+
+ if use gimp || use krita || use qt5; then
+ # respect user flags
+ sed -e '/CMAKE_CXX_FLAGS_RELEASE/d' \
+ -e '/${CMAKE_EXE_LINKER_FLAGS} -s/d' \
+ -i gmic-qt/CMakeLists.txt || die
+ local S="${S}/gmic-qt"
+ # Bug #753377
+ local PATCHES=()
+ cmake_src_prepare
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_LIB=ON
+ -DBUILD_LIB_STATIC=$(usex static-libs)
+ -DBUILD_CLI=$(usex cli)
+ -DBUILD_MAN=$(usex cli)
+ -DBUILD_BASH_COMPLETION=$(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_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_src_configure
+ fi
+
+ if use krita; then
+ mycmakeargs+=( -DGMIC_QT_HOST=krita )
+ BUILD_DIR="${BUILD_DIR}"/krita cmake_src_configure
+ fi
+
+ if use qt5; then
+ mycmakeargs+=( -DGMIC_QT_HOST=none )
+ BUILD_DIR="${BUILD_DIR}"/qt5 cmake_src_configure
+ fi
+}
+
+src_compile() {
+ cmake_src_compile
+
+ # build gmic-qt frontends
+ local S="${S}/gmic-qt"
+ use gimp && { BUILD_DIR="${BUILD_DIR}"/gimp cmake_src_compile || die "failed building gimp plugin" ; }
+ use krita && { BUILD_DIR="${BUILD_DIR}"/krita cmake_src_compile || die "failed building krita plugin" ; }
+ use qt5 && { BUILD_DIR="${BUILD_DIR}"/qt5 cmake_src_compile || die "failed building qt5 GUI" ; }
+}
+
+src_install() {
+ cmake_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_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
+}