From 2348a620f25bdb2d4b3d86db07c5ab33b933250e Mon Sep 17 00:00:00 2001 From: crater2150 Date: Sun, 5 Apr 2020 21:38:34 +0200 Subject: [PATCH] libopenshot: update to 0.2.5 --- common/shlibs | 1 - .../libopenshot/patches/imagemagick7.patch | 417 ------------------ srcpkgs/libopenshot/template | 11 +- 3 files changed, 3 insertions(+), 426 deletions(-) delete mode 100644 srcpkgs/libopenshot/patches/imagemagick7.patch diff --git a/common/shlibs b/common/shlibs index c8cf8ecf9df..f18df7266ff 100644 --- a/common/shlibs +++ b/common/shlibs @@ -2495,7 +2495,6 @@ libax25io.so.0 libax25-0.0.12rc4_1 libmill.so.18 libmill-1.14_1 libges-1.0.so.0 gst1-editing-services-1.6.2_1 libykneomgr.so.0 libykneomgr-0.1.8_1 -libopenshot.so.17 libopenshot-0.2.3_1 libopenshot-audio.so.7 libopenshot-audio-0.2.0_1 libopenshot.so.19 libopenshot-0.2.5_3 libpqxx-6.3.so libpqxx-6.3.3_1 diff --git a/srcpkgs/libopenshot/patches/imagemagick7.patch b/srcpkgs/libopenshot/patches/imagemagick7.patch deleted file mode 100644 index 62c9965ea2d..00000000000 --- a/srcpkgs/libopenshot/patches/imagemagick7.patch +++ /dev/null @@ -1,417 +0,0 @@ -From b0b6e43d8ff977e4853fe494a8ed4f10dc25e571 Mon Sep 17 00:00:00 2001 -From: "FeRD (Frank Dana)" -Date: Thu, 13 Jun 2019 03:10:16 -0400 -Subject: [PATCH 1/2] Add ImageMagick 7 compatibility -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -A new header, `imclude/MagickUtilities.h`, is created to hold the -compatibility `#define`s. - -The image-conversion code in `src/Frame.cpp` received the only -major changes — instead of doing the export by hand (and having -to account for changes in the underlying API), it uses the -`MagickCore::ExportImagePixels()` function which does basically -the same work, but accounts for all of the API changes for us. -The API of that function is _unchanged_ from IM6 to IM7. - -TODO: `MagickCore::ExportImagePixels()` will return an `exception` -struct if it encounters any problems. Currently the code ignores -that, which it should not. ---- - include/Frame.h | 4 +-- - include/ImageReader.h | 8 +++-- - include/ImageWriter.h | 9 +++--- - include/MagickUtilities.h | 61 +++++++++++++++++++++++++++++++++++++++ - include/TextReader.h | 10 +++++-- - include/effects/Mask.h | 7 +++-- - src/Frame.cpp | 22 +++++--------- - src/ImageReader.cpp | 9 ++++-- - src/ImageWriter.cpp | 6 +++- - src/TextReader.cpp | 5 ++++ - src/effects/Mask.cpp | 9 +++--- - 11 files changed, 112 insertions(+), 38 deletions(-) - create mode 100644 include/MagickUtilities.h - -diff --git a/include/Frame.h b/include/Frame.h -index 6b682edb..eef750ff 100644 ---- a/include/Frame.h -+++ b/include/Frame.h -@@ -53,14 +53,12 @@ - #include - #include - #include "ZmqLogger.h" --#ifdef USE_IMAGEMAGICK -- #include "Magick++.h" --#endif - #include "JuceLibraryCode/JuceHeader.h" - #include "ChannelLayouts.h" - #include "AudioBufferSource.h" - #include "AudioResampler.h" - #include "Fraction.h" -+#include "MagickUtilities.h" - - #pragma SWIG nowarn=362 - using namespace std; -diff --git a/include/ImageReader.h b/include/ImageReader.h -index e698e0c1..7ad23173 100644 ---- a/include/ImageReader.h -+++ b/include/ImageReader.h -@@ -28,6 +28,9 @@ - #ifndef OPENSHOT_IMAGE_READER_H - #define OPENSHOT_IMAGE_READER_H - -+// Require ImageMagick support -+#ifdef USE_IMAGEMAGICK -+ - #include "ReaderBase.h" - - #include -@@ -36,9 +39,9 @@ - #include - #include - #include --#include "Magick++.h" - #include "CacheMemory.h" - #include "Exceptions.h" -+#include "MagickUtilities.h" - - using namespace std; - -@@ -113,4 +116,5 @@ namespace openshot - - } - --#endif -+#endif //USE_IMAGEMAGICK -+#endif //OPENSHOT_IMAGE_READER_H -diff --git a/include/ImageWriter.h b/include/ImageWriter.h -index 25177134..b7dd7dc2 100644 ---- a/include/ImageWriter.h -+++ b/include/ImageWriter.h -@@ -32,10 +32,11 @@ - * along with OpenShot Library. If not, see . - */ - -- - #ifndef OPENSHOT_IMAGE_WRITER_H - #define OPENSHOT_IMAGE_WRITER_H - -+#ifdef USE_IMAGEMAGICK -+ - #include "ReaderBase.h" - #include "WriterBase.h" - -@@ -44,11 +45,10 @@ - #include - #include - #include --#include "Magick++.h" - #include "CacheMemory.h" - #include "Exceptions.h" - #include "OpenMPUtilities.h" -- -+#include "MagickUtilities.h" - - using namespace std; - -@@ -145,4 +145,5 @@ namespace openshot - - } - --#endif -+#endif //USE_IMAGEMAGICK -+#endif //OPENSHOT_IMAGE_WRITER_H -diff --git a/include/MagickUtilities.h b/include/MagickUtilities.h -new file mode 100644 -index 00000000..f3b7ea12 ---- /dev/null -+++ b/include/MagickUtilities.h -@@ -0,0 +1,61 @@ -+/** -+ * @file -+ * @brief Header file for MagickUtilities (IM6/IM7 compatibility overlay) -+ * @author Jonathan Thomas -+ * @author FeRD (Frank Dana) -+ */ -+ -+/* LICENSE -+ * -+ * Copyright (c) 2008-2019 OpenShot Studios, LLC -+ * . This file is part of -+ * OpenShot Library (libopenshot), an open-source project dedicated to -+ * delivering high quality video editing and animation solutions to the -+ * world. For more information visit . -+ * -+ * OpenShot Library (libopenshot) is free software: you can redistribute it -+ * and/or modify it under the terms of the GNU Lesser General Public License -+ * as published by the Free Software Foundation, either version 3 of the -+ * License, or (at your option) any later version. -+ * -+ * OpenShot Library (libopenshot) is distributed in the hope that it will be -+ * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with OpenShot Library. If not, see . -+ */ -+ -+#ifndef OPENSHOT_MAGICK_UTILITIES_H -+#define OPENSHOT_MAGICK_UTILITIES_H -+ -+#ifdef USE_IMAGEMAGICK -+ -+ #include "Magick++.h" -+ -+ // Determine ImageMagick version, as IM7 isn't fully -+ // backwards compatible -+ #ifndef NEW_MAGICK -+ #define NEW_MAGICK (MagickLibVersion >= 0x700) -+ #endif -+ -+ // IM7: ->alpha(bool) -+ // IM6: ->matte(bool) -+ #if NEW_MAGICK -+ #define MAGICK_IMAGE_ALPHA(im, a) im->alpha((a)) -+ #else -+ #define MAGICK_IMAGE_ALPHA(im, a) im->matte((a)) -+ #endif -+ -+ // IM7: vector -+ // IM6: list -+ // (both have the push_back() method which is all we use) -+ #if NEW_MAGICK -+ #define MAGICK_DRAWABLE vector -+ #else -+ #define MAGICK_DRAWABLE list -+ #endif -+ -+#endif -+#endif -diff --git a/include/TextReader.h b/include/TextReader.h -index d7d653d2..bb4bdc22 100644 ---- a/include/TextReader.h -+++ b/include/TextReader.h -@@ -28,6 +28,9 @@ - #ifndef OPENSHOT_TEXT_READER_H - #define OPENSHOT_TEXT_READER_H - -+// Require ImageMagick support -+#ifdef USE_IMAGEMAGICK -+ - #include "ReaderBase.h" - - #include -@@ -36,10 +39,10 @@ - #include - #include - #include --#include "Magick++.h" - #include "CacheMemory.h" - #include "Enums.h" - #include "Exceptions.h" -+#include "MagickUtilities.h" - - using namespace std; - -@@ -91,7 +94,7 @@ namespace openshot - string text_color; - string background_color; - std::shared_ptr image; -- list lines; -+ MAGICK_DRAWABLE lines; - bool is_open; - GravityType gravity; - -@@ -144,4 +147,5 @@ namespace openshot - - } - --#endif -+#endif //USE_IMAGEMAGICK -+#endif //OPENSHOT_TEXT_READER_H -diff --git a/include/effects/Mask.h b/include/effects/Mask.h -index ef707f5f..e5b8f649 100644 ---- a/include/effects/Mask.h -+++ b/include/effects/Mask.h -@@ -25,8 +25,8 @@ - * along with OpenShot Library. If not, see . - */ - --#ifndef OPENSHOT_WIPE_EFFECT_H --#define OPENSHOT_WIPE_EFFECT_H -+#ifndef OPENSHOT_MASK_EFFECT_H -+#define OPENSHOT_MASK_EFFECT_H - - #include "../EffectBase.h" - -@@ -45,6 +45,7 @@ - #include "../QtImageReader.h" - #include "../ChunkReader.h" - #ifdef USE_IMAGEMAGICK -+ #include "../MagickUtilities.h" - #include "../ImageReader.h" - #endif - -@@ -54,7 +55,7 @@ namespace openshot - { - - /** -- * @brief This class uses the ImageMagick++ libraries, to apply alpha (or transparency) masks -+ * @brief This class uses the image libraries to apply alpha (or transparency) masks - * to any frame. It can also be animated, and used as a powerful Wipe transition. - * - * These masks / wipes can also be combined, such as a transparency mask on top of a clip, which -diff --git a/src/Frame.cpp b/src/Frame.cpp -index aa7c0d87..5e06e61e 100644 ---- a/src/Frame.cpp -+++ b/src/Frame.cpp -@@ -926,7 +926,7 @@ std::shared_ptr Frame::GetMagickImage() - // Give image a transparent background color - magick_image->backgroundColor(Magick::Color("none")); - magick_image->virtualPixelMethod(Magick::TransparentVirtualPixelMethod); -- magick_image->matte(true); -+ MAGICK_IMAGE_ALPHA(magick_image, true); - - return magick_image; - } -@@ -945,20 +945,12 @@ void Frame::AddMagickImage(std::shared_ptr new_image) - qbuffer = new unsigned char[bufferSize](); - unsigned char *buffer = (unsigned char*)qbuffer; - -- // Iterate through the pixel packets, and load our own buffer -- // Each color needs to be scaled to 8 bit (using the ImageMagick built-in ScaleQuantumToChar function) -- int numcopied = 0; -- Magick::PixelPacket *pixels = new_image->getPixels(0,0, new_image->columns(), new_image->rows()); -- for (int n = 0, i = 0; n < new_image->columns() * new_image->rows(); n += 1, i += 4) { -- buffer[i+0] = MagickCore::ScaleQuantumToChar((Magick::Quantum) pixels[n].red); -- buffer[i+1] = MagickCore::ScaleQuantumToChar((Magick::Quantum) pixels[n].green); -- buffer[i+2] = MagickCore::ScaleQuantumToChar((Magick::Quantum) pixels[n].blue); -- buffer[i+3] = 255 - MagickCore::ScaleQuantumToChar((Magick::Quantum) pixels[n].opacity); -- numcopied+=4; -- } -- -- // Create QImage of frame data -- image = std::shared_ptr(new QImage(qbuffer, width, height, width * BPP, QImage::Format_RGBA8888, (QImageCleanupFunction) &cleanUpBuffer, (void*) qbuffer)); -+ MagickCore::ExceptionInfo exception; -+ // TODO: Actually do something, if we get an exception here -+ MagickCore::ExportImagePixels(new_image->constImage(), 0, 0, new_image->columns(), new_image->rows(), "RGBA", Magick::CharPixel, buffer, &exception); -+ -+ // Create QImage of frame data -+ image = std::shared_ptr(new QImage(qbuffer, width, height, width * BPP, QImage::Format_RGBA8888, (QImageCleanupFunction) &cleanUpBuffer, (void*) qbuffer)); - - // Update height and width - width = image->width(); -diff --git a/src/ImageReader.cpp b/src/ImageReader.cpp -index f535666a..cc2005a4 100644 ---- a/src/ImageReader.cpp -+++ b/src/ImageReader.cpp -@@ -25,6 +25,9 @@ - * along with OpenShot Library. If not, see . - */ - -+// Require ImageMagick support -+#ifdef USE_IMAGEMAGICK -+ - #include "../include/ImageReader.h" - - using namespace openshot; -@@ -59,7 +62,7 @@ void ImageReader::Open() - - // Give image a transparent background color - image->backgroundColor(Magick::Color("none")); -- image->matte(true); -+ MAGICK_IMAGE_ALPHA(image, true); - } - catch (Magick::Exception e) { - // raise exception -@@ -106,7 +109,7 @@ void ImageReader::Close() - { - // Mark as "closed" - is_open = false; -- -+ - // Delete the image - image.reset(); - } -@@ -188,3 +191,5 @@ void ImageReader::SetJsonValue(Json::Value root) { - Open(); - } - } -+ -+#endif //USE_IMAGEMAGICK -diff --git a/src/ImageWriter.cpp b/src/ImageWriter.cpp -index 41626b09..5bc0367a 100644 ---- a/src/ImageWriter.cpp -+++ b/src/ImageWriter.cpp -@@ -28,6 +28,9 @@ - * along with OpenShot Library. If not, see . - */ - -+//Require ImageMagick support -+#ifdef USE_IMAGEMAGICK -+ - #include "../include/ImageWriter.h" - - using namespace openshot; -@@ -97,7 +100,7 @@ void ImageWriter::WriteFrame(std::shared_ptr frame) - std::shared_ptr frame_image = frame->GetMagickImage(); - frame_image->magick( info.vcodec ); - frame_image->backgroundColor(Magick::Color("none")); -- frame_image->matte(true); -+ MAGICK_IMAGE_ALPHA(frame_image, true); - frame_image->quality(image_quality); - frame_image->animationDelay(info.video_timebase.ToFloat() * 100); - frame_image->animationIterations(number_of_loops); -@@ -153,3 +156,4 @@ void ImageWriter::Close() - ZmqLogger::Instance()->AppendDebugMethod("ImageWriter::Close", "", -1, "", -1, "", -1, "", -1, "", -1, "", -1); - } - -+#endif //USE_IMAGEMAGICK -diff --git a/src/TextReader.cpp b/src/TextReader.cpp -index 8234aa5d..b3faecf3 100644 ---- a/src/TextReader.cpp -+++ b/src/TextReader.cpp -@@ -25,6 +25,9 @@ - * along with OpenShot Library. If not, see . - */ - -+// Require ImageMagick support -+#ifdef USE_IMAGEMAGICK -+ - #include "../include/TextReader.h" - - using namespace openshot; -@@ -254,3 +257,5 @@ void TextReader::SetJsonValue(Json::Value root) { - Open(); - } - } -+ -+#endif //USE_IMAGEMAGICK -diff --git a/src/effects/Mask.cpp b/src/effects/Mask.cpp -index f8f34ac6..ab634654 100644 ---- a/src/effects/Mask.cpp -+++ b/src/effects/Mask.cpp -@@ -234,11 +234,11 @@ void Mask::SetJsonValue(Json::Value root) { - reader->SetJsonValue(root["reader"]); - - #ifdef USE_IMAGEMAGICK -- } else if (type == "ImageReader") { -+ } else if (type == "ImageReader") { - -- // Create new reader -- reader = new ImageReader(root["reader"]["path"].asString()); -- reader->SetJsonValue(root["reader"]); -+ // Create new reader -+ reader = new ImageReader(root["reader"]["path"].asString()); -+ reader->SetJsonValue(root["reader"]); - #endif - - } else if (type == "QtImageReader") { -@@ -290,4 +290,3 @@ string Mask::PropertiesJSON(int64_t requested_frame) { - // Return formatted string - return root.toStyledString(); - } -- diff --git a/srcpkgs/libopenshot/template b/srcpkgs/libopenshot/template index 0701bed0dbf..57b3edcf7e3 100644 --- a/srcpkgs/libopenshot/template +++ b/srcpkgs/libopenshot/template @@ -1,7 +1,7 @@ # Template file for 'libopenshot' pkgname=libopenshot -version=0.2.3 -revision=3 +version=0.2.5 +revision=1 archs="i686 x86_64 ppc64le" build_style=cmake configure_args="-DENABLE_RUBY=OFF -DUSE_SYSTEM_JSONCPP=ON" # Builds fail with Ruby-2.4.1 @@ -15,14 +15,9 @@ maintainer="Spencer Hill " license="LGPL-3.0-or-later" homepage="https://github.com/OpenShot/libopenshot" distfiles="https://github.com/OpenShot/libopenshot/archive/v${version}.tar.gz" -checksum=8536b0a790b0d98ed4c3b10e11d1b34ae68ccbc710887e3703a5143d95598746 +checksum=8ae7d226fbd2efbc84da4f7d9d8c7f3cc9616e4de46e1233e3b0a84ac0a429bc patch_args="-Np1" -pre_configure() { - # vendored python cmake module does not find python 3.8 - rm cmake/Modules/FindPythonLibs.cmake -} - libopenshot-devel_package() { short_desc+=" - development files" pkg_install() {