commit: 8434e38d77c3d9b82292c822164a385d9244f8fc Author: Jimi Huotari <chiitoo <AT> gentoo <DOT> org> AuthorDate: Thu Aug 31 11:46:07 2017 +0000 Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org> CommitDate: Wed Oct 11 21:04:12 2017 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8434e38d
media-video/obs-studio: fix build against ImageMagick 7. Since ImageMagick 7, the headers have been under a different directory, and the build with ImageMagick support will fail when the old path is used. This commit patches in detection for the version being used, while also choosing the path accordingly. Special thanks to Hu. Upstream Pull Request: https://github.com/jp9000/obs-studio/pull/1018 Closes: https://bugs.gentoo.org/627520 Closes: https://github.com/gentoo/gentoo/pull/5642 Package-Manager: Portage-2.3.8, Repoman-2.3.3 .../files/obs-studio-ImageMagick-header-path.patch | 70 ++++++++++++++++++++++ media-video/obs-studio/obs-studio-18.0.2.ebuild | 2 + media-video/obs-studio/obs-studio-19.0.2.ebuild | 2 + media-video/obs-studio/obs-studio-20.0.1.ebuild | 2 + 4 files changed, 76 insertions(+) diff --git a/media-video/obs-studio/files/obs-studio-ImageMagick-header-path.patch b/media-video/obs-studio/files/obs-studio-ImageMagick-header-path.patch new file mode 100644 index 00000000000..ca1de74973b --- /dev/null +++ b/media-video/obs-studio/files/obs-studio-ImageMagick-header-path.patch @@ -0,0 +1,70 @@ +From affb84f98477bb490554f56bf82ebffcefa0ec42 Mon Sep 17 00:00:00 2001 +From: Jimi Huotari <[email protected]> +Date: Tue, 5 Sep 2017 23:30:24 +0300 +Subject: [PATCH 1/3] libobs: Fix ImageMagick header path + +Since ImageMagick 7, the header path has been changed. This commit +implements a check for the version being used, and includes the +header as is appropriate. + +Special thanks to Hu. + +Mantis-Bug: https://obsproject.com/mantis/view.php?id=966 + +Gentoo-Bug: https://bugs.gentoo.org/627520 +--- + libobs/CMakeLists.txt | 6 ++++++ + libobs/graphics/graphics-magick.c | 6 ++++++ + libobs/obsconfig.h.in | 3 +++ + 3 files changed, 15 insertions(+) + +diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt +index cd2b80e1..e91f366a 100644 +--- a/libobs/CMakeLists.txt ++++ b/libobs/CMakeLists.txt +@@ -31,6 +31,12 @@ option(LIBOBS_PREFER_IMAGEMAGICK "Prefer ImageMagick over ffmpeg for image loadi + if(NOT FFMPEG_AVCODEC_FOUND OR (ImageMagick_MagickCore_FOUND AND LIBOBS_PREFER_IMAGEMAGICK)) + message(STATUS "Using ImageMagick for image loading in libobs") + ++ if(${ImageMagick_VERSION_STRING} LESS 7) ++ set(LIBOBS_IMAGEMAGICK_DIR_STYLE LIBOBS_IMAGEMAGICK_DIR_STYLE_6L) ++ elseif(${ImageMagick_VERSION_STRING} GREATER_EQUAL 7) ++ set(LIBOBS_IMAGEMAGICK_DIR_STYLE LIBOBS_IMAGEMAGICK_DIR_STYLE_7GE) ++ endif() ++ + set(libobs_image_loading_SOURCES + graphics/graphics-magick.c) + set(libobs_image_loading_LIBRARIES +diff --git a/libobs/graphics/graphics-magick.c b/libobs/graphics/graphics-magick.c +index c106bfa6..6e4e1e96 100644 +--- a/libobs/graphics/graphics-magick.c ++++ b/libobs/graphics/graphics-magick.c +@@ -1,8 +1,14 @@ + #include "graphics.h" ++#include "obsconfig.h" + + #define MAGICKCORE_QUANTUM_DEPTH 16 + #define MAGICKCORE_HDRI_ENABLE 0 ++ ++#if LIBOBS_IMAGEMAGICK_DIR_STYLE == LIBOBS_IMAGEMAGICK_DIR_STYLE_6L + #include <magick/MagickCore.h> ++#elif LIBOBS_IMAGEMAGICK_DIR_STYLE == LIBOBS_IMAGEMAGICK_DIR_STYLE_7GE ++#include <MagickCore/MagickCore.h> ++#endif + + void gs_init_image_deps() + { +diff --git a/libobs/obsconfig.h.in b/libobs/obsconfig.h.in +index f86962d5..cc1f4005 100644 +--- a/libobs/obsconfig.h.in ++++ b/libobs/obsconfig.h.in +@@ -17,3 +17,6 @@ + #define OBS_UNIX_STRUCTURE @OBS_UNIX_STRUCTURE@ + #define BUILD_CAPTIONS @BUILD_CAPTIONS@ + #define HAVE_DBUS @HAVE_DBUS@ ++#define LIBOBS_IMAGEMAGICK_DIR_STYLE_6L 6 ++#define LIBOBS_IMAGEMAGICK_DIR_STYLE_7GE 7 ++#define LIBOBS_IMAGEMAGICK_DIR_STYLE @LIBOBS_IMAGEMAGICK_DIR_STYLE@ +-- +2.14.1 + diff --git a/media-video/obs-studio/obs-studio-18.0.2.ebuild b/media-video/obs-studio/obs-studio-18.0.2.ebuild index 07c1a8007eb..40f9313612c 100644 --- a/media-video/obs-studio/obs-studio-18.0.2.ebuild +++ b/media-video/obs-studio/obs-studio-18.0.2.ebuild @@ -51,6 +51,8 @@ DEPEND=" " RDEPEND="${DEPEND}" +PATCHES="${FILESDIR}/${PN}-ImageMagick-header-path.patch" + CMAKE_REMOVE_MODULES_LIST=( FindFreetype ) src_configure() { diff --git a/media-video/obs-studio/obs-studio-19.0.2.ebuild b/media-video/obs-studio/obs-studio-19.0.2.ebuild index 07c1a8007eb..40f9313612c 100644 --- a/media-video/obs-studio/obs-studio-19.0.2.ebuild +++ b/media-video/obs-studio/obs-studio-19.0.2.ebuild @@ -51,6 +51,8 @@ DEPEND=" " RDEPEND="${DEPEND}" +PATCHES="${FILESDIR}/${PN}-ImageMagick-header-path.patch" + CMAKE_REMOVE_MODULES_LIST=( FindFreetype ) src_configure() { diff --git a/media-video/obs-studio/obs-studio-20.0.1.ebuild b/media-video/obs-studio/obs-studio-20.0.1.ebuild index 07c1a8007eb..40f9313612c 100644 --- a/media-video/obs-studio/obs-studio-20.0.1.ebuild +++ b/media-video/obs-studio/obs-studio-20.0.1.ebuild @@ -51,6 +51,8 @@ DEPEND=" " RDEPEND="${DEPEND}" +PATCHES="${FILESDIR}/${PN}-ImageMagick-header-path.patch" + CMAKE_REMOVE_MODULES_LIST=( FindFreetype ) src_configure() {
