diff options
author | Jimi Huotari <chiitoo@gentoo.org> | 2017-08-31 14:46:07 +0300 |
---|---|---|
committer | Patrice Clement <monsieurp@gentoo.org> | 2017-10-11 23:04:12 +0200 |
commit | 8434e38d77c3d9b82292c822164a385d9244f8fc (patch) | |
tree | e03b65fb2761d03d3a15a7e749a3f66a3908a302 /media-video | |
parent | app-backup/burp: remove old unstable-branch versions (diff) | |
download | gentoo-8434e38d77c3d9b82292c822164a385d9244f8fc.tar.gz gentoo-8434e38d77c3d9b82292c822164a385d9244f8fc.tar.bz2 gentoo-8434e38d77c3d9b82292c822164a385d9244f8fc.zip |
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
Diffstat (limited to 'media-video')
4 files changed, 76 insertions, 0 deletions
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 000000000000..ca1de74973bb --- /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 <chiitoo@gentoo.org> +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 07c1a8007eb9..40f9313612c5 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 07c1a8007eb9..40f9313612c5 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 07c1a8007eb9..40f9313612c5 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() { |