diff options
author | Philipp Rösner <rndxelement@protonmail.com> | 2023-12-30 00:27:47 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2024-01-20 12:31:06 +0000 |
commit | 74f9c50bdbb151a94c35a3a6036fb7b0292ca857 (patch) | |
tree | 7ab7596341ab98348349e2245ce8de59470898c8 /media-gfx/converseen | |
parent | media-libs/opensubdiv: use get_libdir (diff) | |
download | gentoo-74f9c50bdbb151a94c35a3a6036fb7b0292ca857.tar.gz gentoo-74f9c50bdbb151a94c35a3a6036fb7b0292ca857.tar.bz2 gentoo-74f9c50bdbb151a94c35a3a6036fb7b0292ca857.zip |
media-gfx/converseen: add 0.12.0.1
Adjust GraphicsMagick linking to be compatible with upstream
CMakeLists.txt.
Add minor file patches to graphicsmagick-support patch.
Signed-off-by: Philipp Rösner <rndxelement@protonmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'media-gfx/converseen')
-rw-r--r-- | media-gfx/converseen/Manifest | 1 | ||||
-rw-r--r-- | media-gfx/converseen/converseen-0.12.0.1.ebuild | 68 | ||||
-rw-r--r-- | media-gfx/converseen/files/converseen-0.12.0.1-graphicsmagick-support.patch | 82 |
3 files changed, 151 insertions, 0 deletions
diff --git a/media-gfx/converseen/Manifest b/media-gfx/converseen/Manifest index 29df21a853c6..387bb3b5722b 100644 --- a/media-gfx/converseen/Manifest +++ b/media-gfx/converseen/Manifest @@ -1,3 +1,4 @@ +DIST converseen-0.12.0.1.tar.gz 2296100 BLAKE2B 83a0271e1451fa196852d717332fa7446cd22bac7b675f3f306692aa1e11d4c5500d033fd9bbb7dd4ec9190ff3b15149bad1e9646006f533d930fc1d686b0a9b SHA512 4e6efa44953b097f8c6af19e3d849caf570a0fa2db673133e1d8ca2abee98b43d2fbd2d12e6c8c2a8ec6a9dd61a1ca3f25ee7a7787791cc783d8c967eacb9d9d DIST converseen-0.9.10.0.tar.gz 769693 BLAKE2B 651edf41b6cdf010fdae47d457f2459c4e99a1657302bc4facfbd70bd7d7b7b85842290b74ea76a396fa75ca5f5398234d309aae179704ce40f1dbb61195835c SHA512 c2ee7c59685879dffcb6f3f4ef9267cb611d358bec21ecd57b90bbc7fa86a07b4aa8dd855956970b35ec671c57b8bbc4d0620c2cb5629a36ca4305e47f4d3b59 DIST converseen-0.9.11.1.tar.gz 770024 BLAKE2B 671599099abf5b143bde7c57efc547626c14e15bebbd3a70ce4ec43d4febbaf69eebedebaaac935572b785afaa086c383b68bae0f02bc16ca68625dfb55b8c85 SHA512 1d61fa88d9e3d6ed23fb98d0495b00315adca880fd1d0d95e8322c48d9fdcd161ee00b5e2f5f52212c4db66d97e26ac0da561926e55de4bc047d3ad98b6f69dd DIST converseen-0.9.9.8.tar.gz 769184 BLAKE2B 136d4454825fd64bd8129544df25213346550d4a1bf550fd8c32eef7c2c02cda5965aa235ec8f637de53462968a08c1e1b7c5db454c68ed1cac64d08c322fd54 SHA512 64ef5c5614c6536d84c6fc5ad6f9180c45a4c9d1294e492f0b09a596203d91871191f62ef80c6f888f010377c834ae76d825a29b137885756cc33a7d38d70208 diff --git a/media-gfx/converseen/converseen-0.12.0.1.ebuild b/media-gfx/converseen/converseen-0.12.0.1.ebuild new file mode 100644 index 000000000000..1ab74418a96e --- /dev/null +++ b/media-gfx/converseen/converseen-0.12.0.1.ebuild @@ -0,0 +1,68 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake xdg-utils + +DESCRIPTION="Batch image converter and resizer based on ImageMagick" +HOMEPAGE="https://converseen.fasterland.net/ + https://github.com/Faster3ck/Converseen/" +SRC_URI="https://github.com/Faster3ck/Converseen/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="amd64 x86" +IUSE="graphicsmagick debug" + +RDEPEND=" + dev-qt/qtcore:5 + dev-qt/qtgui:5 + dev-qt/qtnetwork:5 + dev-qt/qtwidgets:5 + graphicsmagick? ( media-gfx/graphicsmagick:=[cxx,imagemagick] ) + !graphicsmagick? ( media-gfx/imagemagick:=[cxx] ) +" +DEPEND="${RDEPEND}" +BDEPEND=" + dev-qt/linguist-tools:5 +" + +S="${WORKDIR}/${P^}" + +PATCHES=( + "${FILESDIR}/${PN}-0.9.9.0-appdata-path.patch" + "${FILESDIR}/${PN}-0.9.9.0-no-update.patch" + "${FILESDIR}/${P}-graphicsmagick-support.patch" +) + +src_prepare() { + cmake_src_prepare + + if use graphicsmagick; then + # Replace variables in CMakeLists.txt + sed -i -e "s/GENTOO_LIB/\/usr\/$(get_libdir)/g" \ + -e "s/GENTOO_INCLUDE/\/usr\/include/g" \ + "${S}/CMakeLists.txt" || + die "Failed to sed graphicsmagick patch" + + # Replace MagickCore in globals.cpp + sed -i -e "s/MagickCore/MagickLib/" "${S}/src/globals.cpp" || + die "Failed to sed globals.cpp" + fi +} + +pkg_postinst() { + elog "Please note that due to security policy restrictions" + elog "on media-gfx/imagemagick the support for PS, PDF and" + elog "XPS files must be explicitly enabled by commenting out" + elog "the respective policies in /etc/ImageMagick-7/policy.xml." + elog "See https://wiki.gentoo.org/wiki/ImageMagick#Troubleshooting" + elog "for more information." + + xdg_icon_cache_update +} + +pkg_postrm() { + xdg_icon_cache_update +} diff --git a/media-gfx/converseen/files/converseen-0.12.0.1-graphicsmagick-support.patch b/media-gfx/converseen/files/converseen-0.12.0.1-graphicsmagick-support.patch new file mode 100644 index 000000000000..79ae21989745 --- /dev/null +++ b/media-gfx/converseen/files/converseen-0.12.0.1-graphicsmagick-support.patch @@ -0,0 +1,82 @@ +# See https://bugs.gentoo.org/628688 for further info and +# development discussion about this patch. +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -17,7 +17,18 @@ else () + find_package(Qt5 COMPONENTS Core Gui Network Widgets LinguistTools REQUIRED)
+ endif()
+
+-find_package(ImageMagick REQUIRED COMPONENTS Magick++ MagickWand MagickCore)
++find_package(ImageMagick COMPONENTS Magick++ MagickWand MagickCore)
++if (NOT ImageMagick_FOUND)
++ set(ImageMagick_INCLUDE_DIRS "GENTOO_INCLUDE/GraphicsMagick")
++ set(ImageMagick_Magick++_INCLUDE_DIRS "GENTOO_INCLUDE/GraphicsMagick/Magick++")
++ set(ImageMagick_MagickCore_INCLUDE_DIRS "GENTOO_INCLUDE/GraphicsMagick/magic")
++ set(ImageMagick_LIBRARY "GENTOO_LIB/libGraphicsMagick.so")
++ set(ImageMagick_Magick++_LIBRARY "GENTOO_LIB/libGraphicsMagick++.so")
++ set(ImageMagick_MagickCore_LIBRARY "GENTOO_LIB/libGraphicsMagick.so")
++ set(ImageMagick_MagickWand_LIBRARY "GENTOO_LIB/libGraphicsMagickWand.so")
++ set(ImageMagick_MagickWand_INCLUDE_DIRS "GENTOO_INCLUDE/GraphicsMagick/wand")
++ set(ImageMagick_LIBRARIES ${ImageMagick_LIBRARY} ${ImageMagick_Magick++_LIBRARY} ${ImageMagick_MagickCore_LIBRARY} ${ImageMagick_MagickWand_LIBRARY}) ++endif ()
+
+ set(converseen_SOURCES
+ src/main.cpp
+--- a/src/converter.cpp ++++ b/src/converter.cpp +@@ -290,8 +290,14 @@ bool Converter::writeImage(Image &my_image, const QString &format, const int &qu + + error_status = ""; + ++/* Workaround to compile with GraphicsMagick: ++ GraphicsMagick "MagickLibVersion" is greater that 0x100000 ++ e.g. GraphicsMagick-1.3.25 has "MagickLibVersion=0x181501" ++ or GraphicsMagick-1.3.26 has "MagickLibVersion=0x191600" */ + #if MagickLibVersion < 0x700 + hasTransparency = my_image.matte(); ++#elif MagickLibVersion > 0x100000 ++ hasTransparency = my_image.matte(); + #else + hasTransparency = my_image.alpha(); + #endif +@@ -349,6 +355,8 @@ Image Converter::convertPDFtoImage(Image &my_image) + + #if MagickLibVersion < 0x700 + ximage.antiAlias(true); ++#elif MagickLibVersion > 0x100000 ++ ximage.antiAlias(true); + #else + ximage.textAntiAlias(true); + #endif +--- a/src/globals.h ++++ b/src/globals.h +@@ -32,8 +32,14 @@ + using namespace Magick; + using namespace std; + ++/* Workaround to compile with GraphicsMagick: ++ GraphicsMagick "MagickLibVersion" is greater that 0x100000 ++ e.g. GraphicsMagick-1.3.25 has "MagickLibVersion=0x181501" ++ or GraphicsMagick-1.3.26 has "MagickLibVersion=0x191600" */ + #if MagickLibVersion < 0x700 + typedef FilterTypes IMFilterType; ++#elif MagickLibVersion > 0x100000 ++ typedef FilterTypes IMFilterType; + #else + typedef FilterType IMFilterType; + #endif +--- a/src/formats.cpp ++++ b/src/formats.cpp +@@ -174,6 +174,12 @@ bool Formats::isVideo(list<CoderInfo>::iterator entry) + QStringList videoFormats(QStringList() << "3G2" << "3GP" << "APNG" << "AVI" << "FLV" << "M2V" << "M4V" << "MKV" << "MOV" << "MP4" << "MPEG" << "MPG" << "WEBM" << "WMV"); + + return videoFormats.contains(currFormat); ++#elif MagickLibVersion > 0x100000 ++ // Support for ImageMagick-6. This will be removed sooner as Linux distros drop the support! ++ QString currFormat = QString::fromStdString(entry->name()); ++ QStringList videoFormats(QStringList() << "3G2" << "3GP" << "APNG" << "AVI" << "FLV" << "M2V" << "M4V" << "MKV" << "MOV" << "MP4" << "MPEG" << "MPG" << "WEBM" << "WMV"); ++ ++ return videoFormats.contains(currFormat); + #else + return (QString::fromStdString(entry->module()) == "VIDEO") ? true : false; + #endif |