mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-05 14:38:51 +02:00
Shotcut: add recipe (#4593)
disabled until mlt is updated for haiku, might also depends on Qt5 OpenGL support
This commit is contained in:
110
media-video/shotcut/patches/shotcut-19.12.31.patchset
Normal file
110
media-video/shotcut/patches/shotcut-19.12.31.patchset
Normal file
@@ -0,0 +1,110 @@
|
||||
From 91e3e861a7cc81c3c039611d664c7479e310a2d4 Mon Sep 17 00:00:00 2001
|
||||
From: TURX <turx2003@gmail.com>
|
||||
Date: Mon, 20 Jan 2020 01:32:19 +0800
|
||||
Subject: [PATCH] fix Haiku support
|
||||
|
||||
---
|
||||
src/jobs/meltjob.cpp | 2 ++
|
||||
src/main.cpp | 11 +++++++++++
|
||||
src/mainwindow.cpp | 14 +++++++++++++-
|
||||
src/src.pro | 6 ++++--
|
||||
4 files changed, 30 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/jobs/meltjob.cpp b/src/jobs/meltjob.cpp
|
||||
index 10156782..5b11a0b6 100644
|
||||
--- a/src/jobs/meltjob.cpp
|
||||
+++ b/src/jobs/meltjob.cpp
|
||||
@@ -87,6 +87,8 @@ void MeltJob::start()
|
||||
QString shotcutPath = qApp->applicationDirPath();
|
||||
#ifdef Q_OS_WIN
|
||||
QFileInfo meltPath(shotcutPath, "qmelt.exe");
|
||||
+#elif defined(Q_OS_HAIKU)
|
||||
+ QFileInfo meltPath(shotcutPath, "melt");
|
||||
#else
|
||||
QFileInfo meltPath(shotcutPath, "qmelt");
|
||||
#endif
|
||||
diff --git a/src/main.cpp b/src/main.cpp
|
||||
index 6d0d18fe..b2216f6d 100644
|
||||
--- a/src/main.cpp
|
||||
+++ b/src/main.cpp
|
||||
@@ -44,6 +44,10 @@ extern "C"
|
||||
}
|
||||
#endif
|
||||
|
||||
+#ifdef Q_OS_HAIKU
|
||||
+#include <FindDirectory.h>
|
||||
+#endif
|
||||
+
|
||||
static void mlt_log_handler(void *service, int mlt_level, const char *format, va_list args)
|
||||
{
|
||||
if (mlt_level > mlt_log_get_level())
|
||||
@@ -182,7 +186,14 @@ public:
|
||||
resourceArg = parser.positionalArguments();
|
||||
|
||||
// Startup logging.
|
||||
+#if !defined(Q_OS_HAIKU)
|
||||
dir = Settings.appDataLocation();
|
||||
+#else
|
||||
+ char buffer[B_PATH_NAME_LENGTH + B_FILE_NAME_LENGTH];
|
||||
+ find_directory(B_USER_LOG_DIRECTORY, -1, false, buffer, sizeof(buffer));
|
||||
+ QString path = QString::fromUtf8(buffer);
|
||||
+ dir = path;
|
||||
+#endif
|
||||
if (!dir.exists()) dir.mkpath(dir.path());
|
||||
const QString logFileName = dir.filePath("shotcut-log.txt");
|
||||
QFile::remove(logFileName);
|
||||
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
|
||||
index a170be4e..a3de57da 100644
|
||||
--- a/src/mainwindow.cpp
|
||||
+++ b/src/mainwindow.cpp
|
||||
@@ -90,6 +90,10 @@
|
||||
#include <QVersionNumber>
|
||||
#include <clocale>
|
||||
|
||||
+#ifdef Q_OS_HAIKU
|
||||
+#include <FindDirectory.h>
|
||||
+#endif
|
||||
+
|
||||
static bool eventDebugCallback(void **data)
|
||||
{
|
||||
QEvent *event = reinterpret_cast<QEvent*>(data[1]);
|
||||
@@ -3657,7 +3661,15 @@ void MainWindow::onDrawingMethodTriggered(QAction *action)
|
||||
void MainWindow::on_actionApplicationLog_triggered()
|
||||
{
|
||||
TextViewerDialog dialog(this);
|
||||
- QDir dir = Settings.appDataLocation();
|
||||
+ QDir dir;
|
||||
+#if !defined(Q_OS_HAIKU)
|
||||
+ dir = Settings.appDataLocation();
|
||||
+#else
|
||||
+ char buffer[B_PATH_NAME_LENGTH + B_FILE_NAME_LENGTH];
|
||||
+ find_directory(B_USER_LOG_DIRECTORY, -1, false, buffer, sizeof(buffer));
|
||||
+ QString path = QString::fromUtf8(buffer);
|
||||
+ dir = path;
|
||||
+#endif
|
||||
QFile logFile(dir.filePath("shotcut-log.txt"));
|
||||
logFile.open(QIODevice::ReadOnly | QIODevice::Text);
|
||||
dialog.setText(logFile.readAll());
|
||||
diff --git a/src/src.pro b/src/src.pro
|
||||
index 8d7294da..9030c5f3 100644
|
||||
--- a/src/src.pro
|
||||
+++ b/src/src.pro
|
||||
@@ -365,11 +365,13 @@ win32 {
|
||||
}
|
||||
RC_FILE = ../packaging/windows/shotcut.rc
|
||||
}
|
||||
-unix:!mac {
|
||||
+unix:!mac:!haiku {
|
||||
QT += x11extras
|
||||
+ LIBS += -lX11
|
||||
+}
|
||||
+unix:!mac {
|
||||
CONFIG += link_pkgconfig
|
||||
PKGCONFIG += mlt++
|
||||
- LIBS += -lX11
|
||||
}
|
||||
|
||||
unix:!mac:isEmpty(PREFIX) {
|
||||
--
|
||||
2.20.1
|
||||
|
||||
92
media-video/shotcut/shotcut-19.12.31.recipe
Normal file
92
media-video/shotcut/shotcut-19.12.31.recipe
Normal file
@@ -0,0 +1,92 @@
|
||||
SUMMARY="A free, open source, cross-platform video editor"
|
||||
DESCRIPTION="Major features include support for a wide range of formats."
|
||||
HOMEPAGE="https://shotcut.org/"
|
||||
COPYRIGHT="2011-2019 by Meltytech, LLC."
|
||||
LICENSE="GNU GPL v3"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://github.com/mltframework/shotcut/archive/v$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="d7017d605edb581cb47de4844827bd627c159c810614381f4586ef35e8c3d97a"
|
||||
SOURCE_DIR="shotcut-$portVersion"
|
||||
PATCHES="shotcut-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="?x86_64"
|
||||
SECONDARY_ARCHITECTURES="?x86"
|
||||
|
||||
PROVIDES="
|
||||
shotcut$secondaryArchSuffix = $portVersion
|
||||
app:shotcut
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
cmd:ffmpeg
|
||||
cmd:melt
|
||||
frei0r$secondaryArchSuffix
|
||||
ladspa_sdk$secondaryArchSuffix
|
||||
lib:libGL$secondaryArchSuffix
|
||||
lib:libmlt++$secondaryArchSuffix
|
||||
lib:libmlt$secondaryArchSuffix
|
||||
lib:libQt5$secondaryArchSuffix
|
||||
lib:libQt5Core$secondaryArchSuffix
|
||||
lib:libQt5Designer$secondaryArchSuffix
|
||||
lib:libQt5Gui$secondaryArchSuffix
|
||||
lib:libQt5Network$secondaryArchSuffix
|
||||
lib:libQt5Quick$secondaryArchSuffix
|
||||
lib:libQt5Sql$secondaryArchSuffix
|
||||
lib:libQt5Test$secondaryArchSuffix
|
||||
lib:libQt5WebKitWidgets$secondaryArchSuffix
|
||||
lib:libQt5Xml$secondaryArchSuffix
|
||||
lib:libsdl2_2.0$secondaryArchSuffix
|
||||
lib:libsqlite3$secondaryArchSuffix
|
||||
lib:libwebm$secondaryArchSuffix
|
||||
lib:libx264$secondaryArchSuffix
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
frei0r${secondaryArchSuffix}_devel
|
||||
ladspa_sdk${secondaryArchSuffix}_devel
|
||||
devel:libGL$secondaryArchSuffix
|
||||
devel:libmlt++$secondaryArchSuffix
|
||||
devel:libmlt$secondaryArchSuffix
|
||||
devel:libQt5$secondaryArchSuffix
|
||||
devel:libQt5Core$secondaryArchSuffix
|
||||
devel:libQt5Designer$secondaryArchSuffix
|
||||
devel:libQt5Gui$secondaryArchSuffix
|
||||
devel:libQt5Network$secondaryArchSuffix
|
||||
devel:libQt5Quick$secondaryArchSuffix
|
||||
devel:libQt5Sql$secondaryArchSuffix
|
||||
devel:libQt5Test$secondaryArchSuffix
|
||||
devel:libQt5WebKitWidgets$secondaryArchSuffix
|
||||
devel:libQt5Xml$secondaryArchSuffix
|
||||
devel:libwebm$secondaryArchSuffix
|
||||
devel:libx264$secondaryArchSuffix
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:getconf
|
||||
cmd:lrelease$secondaryArchSuffix >= 5
|
||||
cmd:make
|
||||
cmd:pkg_config$secondaryArchSuffix
|
||||
cmd:qmake$secondaryArchSuffix >= 5
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
qmake PREFIX=$prefix
|
||||
make $jobArgs
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
make install
|
||||
|
||||
mkdir -p $appsDir $dataDir
|
||||
mv $prefix/share/man/man1 $manDir
|
||||
mv $prefix/share/metainfo $dataDir
|
||||
mv $prefix/share/mime/packages $dataDir
|
||||
mv $prefix/share/shotcut $dataDir
|
||||
rm -rf $prefix/share
|
||||
|
||||
mv $prefix/bin/shotcut $appsDir/Shotcut
|
||||
addAppDeskbarSymlink $appsDir/Shotcut
|
||||
}
|
||||
Reference in New Issue
Block a user