diff --git a/media-libs/mlt/mlt-6.18.0.recipe b/media-libs/mlt/mlt-6.18.0.recipe new file mode 100644 index 000000000..5dc8fd87c --- /dev/null +++ b/media-libs/mlt/mlt-6.18.0.recipe @@ -0,0 +1,63 @@ +SUMMARY="An open source multimedia framework" +DESCRIPTION="A LGPL multimedia framework designed for TV broadcasting" +HOMEPAGE="https://www.mltframework.org/" +COPYRIGHT="2011-2019 by Meltytech, LLC." +LICENSE="GNU LGPL v2.1" +REVISION="1" +SOURCE_URI="https://github.com/mltframework/mlt/releases/download/v$portVersion/mlt-$portVersion.tar.gz" +CHECKSUM_SHA256="fd2a346e0cc093e5d813e04cd126c077a2d224ae4d17b5226ff7478feaa445ea" +PATCHES="mlt-$portVersion.patchset" + +ARCHITECTURES="x86_64" +SECONDARY_ARCHITECTURES="x86" + +libMltVersionCompat="$portVersion compat >= ${portVersion%%.*}" + +PROVIDES=" + mlt$secondaryArchSuffix = $portVersion + cmd:melt + lib:libmlt$secondaryArchSuffix = $libMltVersionCompat + lib:libmlt++$secondaryArchSuffix = $libMltVersionCompat + " +REQUIRES=" + haiku$secondaryArchSuffix + " + +PROVIDES_devel=" + mlt${secondaryArchSuffix}_devel = $portVersion + devel:libmlt$secondaryArchSuffix = $libMltVersionCompat + devel:libmlt++$secondaryArchSuffix = $libMltVersionCompat + " +REQUIRES_devel=" + mlt$secondaryArchSuffix == $portVersion base + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + " +BUILD_PREREQUIRES=" + cmd:awk + cmd:find + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:make + cmd:pkg_config$secondaryArchSuffix + " + +BUILD() +{ + runConfigure ./configure + make $jobsArgs +} + +INSTALL() +{ + make install + + prepareInstalledDevelLibs libmlt libmlt++ + fixPkgconfig + + # devel package + packageEntries devel \ + $developDir +} diff --git a/media-libs/mlt/patches/mlt-6.18.0.patchset b/media-libs/mlt/patches/mlt-6.18.0.patchset new file mode 100644 index 000000000..75bde2fdc --- /dev/null +++ b/media-libs/mlt/patches/mlt-6.18.0.patchset @@ -0,0 +1,276 @@ +From 0d0dfdbd3bff57d61e5522cc8ff4e240e38c4ef3 Mon Sep 17 00:00:00 2001 +From: TURX +Date: Sun, 19 Jan 2020 22:57:40 +0800 +Subject: [PATCH] fix Haiku support + +--- + Makefile | 4 ++-- + configure | 19 +++++++++++++++++-- + src/framework/Makefile | 6 +++--- + src/framework/configure | 3 ++- + src/framework/mlt_consumer.c | 8 ++++++++ + src/framework/mlt_slices.c | 2 ++ + src/mlt++/Makefile | 6 +++--- + src/mlt++/configure | 4 ++-- + src/modules/decklink/consumer_decklink.cpp | 2 ++ + src/modules/decklink/producer_decklink.cpp | 2 ++ + 10 files changed, 43 insertions(+), 13 deletions(-) + +diff --git a/Makefile b/Makefile +index 938c6a6c..64de6f36 100644 +--- a/Makefile ++++ b/Makefile +@@ -26,7 +26,7 @@ include config.mak + + install: + install -d "$(DESTDIR)$(prefix)/bin" +- install -d "$(DESTDIR)$(prefix)/include" ++ install -d "$(DESTDIR)$(includedir)" + install -d "$(DESTDIR)$(libdir)" + install -d "$(DESTDIR)$(moduledir)" + ifeq ($(extra_versioning), true) +@@ -52,7 +52,7 @@ uninstall: + for subdir in $$list; do \ + $(MAKE) DESTDIR=$(DESTDIR) -C $$subdir $@ || exit 1; \ + done +- rm -rf "$(DESTDIR)$(prefix)/include/mlt" ++ rm -rf "$(DESTDIR)$(includedir)/mlt" + rm -rf "$(DESTDIR)$(mltdatadir)" + ifeq ($(compat_dirs), true) + rm -rf "$(DESTDIR)$(prefix)/share/mlt" +diff --git a/configure b/configure +index a32a75ce..7dff1e19 100755 +--- a/configure ++++ b/configure +@@ -18,6 +18,7 @@ General build options: + --libdir=directory - lib directory (default: $prefix/lib) + --datadir=directory - data directory (default: $prefix/share) + --mandir=directory - man documentation directory (default: $prefix/share/man) ++ --includedir=directory - headers directory (default: $prefix/include) + --rename-melt - Give melt executable a different name (it will not be versioned) + --enable-extra-versioning - Version melt and the data and modules directories + --enable-gpl - Enable GPLv2 components +@@ -58,6 +59,7 @@ build_config() + echo "bindir=$prefix/bin" + echo "datadir=$datadir" + echo "mandir=$mandir" ++ echo "includedir=$includedir" + echo "extra_versioning=$extra_versioning" + echo "melt_noversion=$melt_noversion" + echo "targetos=$targetos" +@@ -131,6 +133,16 @@ build_config() + echo "RDYNAMIC=-rdynamic" + echo "LDFLAGS+=-Wl,--as-needed" + ;; ++ Haiku) ++ [ "$optimisations" = "true" ] && ++ echo "OPTIMISATIONS+=-ffast-math" ++ echo "CFLAGS+=-fPIC" ++ echo "CXXFLAGS+=-fPIC" ++ echo "SHFLAGS=-shared" ++ echo "LIBDL=" ++ echo "RDYNAMIC=" ++ echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed" ++ ;; + MinGW) + [ "$windeploy" = false ] && + echo "CFLAGS+=-DNODEPLOY" +@@ -178,7 +190,7 @@ build_pkgconfig() + ( + echo exec_prefix=$prefix + echo libdir=$libdir +- echo includedir=$prefix/include ++ echo includedir=$includedir + echo datadir=$datadir + echo mandir=$mandir + echo version=$version +@@ -194,7 +206,7 @@ build_pkgconfig() + ( + echo exec_prefix=$prefix + echo libdir=$libdir +- echo includedir=$prefix/include ++ echo includedir=$includedir + echo datadir=$datadir + echo mandir=$mandir + echo version=$version +@@ -229,6 +241,7 @@ export amd64=false + export extra_versioning=false + export melt_noversion=false + export windeploy=true ++export includedir=$includedir + + # Define the compiler used in tests (gcc is not installed everywhere) + : ${CC:=gcc} +@@ -264,6 +277,7 @@ do + --libdir=* ) libdir="${i#--libdir=}" ;; + --datadir=* ) datadir="${i#--datadir=}" ;; + --mandir=* ) mandir="${i#--mandir=}" ;; ++ --includedir=* ) includedir="${i#--includedir=}" ;; + --rename-melt=* ) meltname="${i#--rename-melt=}"; melt_noversion=true ;; + --enable-extra-versioning ) extra_versioning=true ;; + --enable-debug ) optimisations=false ;; +@@ -322,6 +336,7 @@ export LIBSUF + [ "$libdir" = "" ] && libdir=$prefix/lib + [ "$datadir" = "" ] && datadir=$prefix/share + [ "$mandir" = "" ] && mandir=$prefix/share/man ++[ "$includedir" = "" ] && includedir=$prefix/include + + export unversionedmoduledir=${libdir}/mlt + export unversionedmltdatadir=${datadir}/mlt +diff --git a/src/framework/Makefile b/src/framework/Makefile +index 654883f1..395e7955 100644 +--- a/src/framework/Makefile ++++ b/src/framework/Makefile +@@ -128,8 +128,8 @@ install: + ln -sf $(TARGET) $(DESTDIR)$(libdir)/$(SONAME) ; \ + ln -sf $(TARGET) $(DESTDIR)$(libdir)/$(NAME) ; \ + fi +- install -d "$(DESTDIR)$(prefix)/include/mlt/framework" +- install -m 644 $(INCS) "$(DESTDIR)$(prefix)/include/mlt/framework" ++ install -d "$(DESTDIR)$(includedir)/mlt/framework" ++ install -m 644 $(INCS) "$(DESTDIR)$(includedir)/mlt/framework" + install -d "$(DESTDIR)$(mltdatadir)" + install -m 644 metaschema.yaml "$(DESTDIR)$(mltdatadir)" + +@@ -148,7 +148,7 @@ uninstall: + fi ; \ + rm -f "$(DESTDIR)$(libdir)/libmlt.def" ; \ + fi +- rm -rf "$(DESTDIR)$(prefix)/include/mlt/framework" ++ rm -rf "$(DESTDIR)$(includedir)/mlt/framework" + rm -f "$(DESTDIR)$(mltdatadir)/metaschema.yaml" + + ifneq ($(wildcard .depend),) +diff --git a/src/framework/configure b/src/framework/configure +index 601b20c9..a16a5668 100755 +--- a/src/framework/configure ++++ b/src/framework/configure +@@ -1,4 +1,5 @@ + #!/bin/sh +-echo "framework -I$prefix/include -I$prefix/include/mlt -D_REENTRANT -L$libdir -lmlt" >> ../../packages.dat ++ ++echo "framework -I$includedir -I$includedir/mlt -D_REENTRANT -L$libdir -lmlt" >> ../../packages.dat + + echo > config.mak +diff --git a/src/framework/mlt_consumer.c b/src/framework/mlt_consumer.c +index 21f02403..f8241ca2 100644 +--- a/src/framework/mlt_consumer.c ++++ b/src/framework/mlt_consumer.c +@@ -1191,9 +1191,13 @@ static void consumer_work_start( mlt_consumer self ) + + priority.sched_priority = mlt_properties_get_int( MLT_CONSUMER_PROPERTIES( self ), "priority" ); + pthread_attr_init( &thread_attributes ); ++#ifndef __HAIKU__ + pthread_attr_setschedpolicy( &thread_attributes, SCHED_OTHER ); ++#endif + pthread_attr_setschedparam( &thread_attributes, &priority ); ++#ifndef __HAIKU__ + pthread_attr_setinheritsched( &thread_attributes, PTHREAD_EXPLICIT_SCHED ); ++#endif + pthread_attr_setscope( &thread_attributes, PTHREAD_SCOPE_SYSTEM ); + + while ( n-- ) +@@ -1779,9 +1783,13 @@ static void mlt_thread_create( mlt_consumer self, thread_function_t function ) + { + pthread_attr_t thread_attributes; + pthread_attr_init( &thread_attributes ); ++#ifndef __HAIKU__ + pthread_attr_setschedpolicy( &thread_attributes, SCHED_OTHER ); ++#endif + pthread_attr_setschedparam( &thread_attributes, &priority ); ++#ifndef __HAIKU__ + pthread_attr_setinheritsched( &thread_attributes, PTHREAD_EXPLICIT_SCHED ); ++#endif + pthread_attr_setscope( &thread_attributes, PTHREAD_SCOPE_SYSTEM ); + priv->ahead_thread = malloc( sizeof( pthread_t ) ); + pthread_t *handle = priv->ahead_thread; +diff --git a/src/framework/mlt_slices.c b/src/framework/mlt_slices.c +index 60b17cd4..63e5daec 100644 +--- a/src/framework/mlt_slices.c ++++ b/src/framework/mlt_slices.c +@@ -200,7 +200,9 @@ mlt_slices mlt_slices_init( int threads, int policy, int priority ) + policy = SCHED_OTHER; + if ( priority < 0 ) + priority = sched_get_priority_max( policy ); ++#ifndef __HAIKU__ + pthread_attr_setschedpolicy( &tattr, policy ); ++#endif + param.sched_priority = priority; + pthread_attr_setschedparam( &tattr, ¶m ); + +diff --git a/src/mlt++/Makefile b/src/mlt++/Makefile +index 5fe19b66..6bc97f56 100644 +--- a/src/mlt++/Makefile ++++ b/src/mlt++/Makefile +@@ -86,8 +86,8 @@ install: + ln -sf $(TARGET) $(DESTDIR)$(libdir)/$(SONAME) ; \ + ln -sf $(TARGET) $(DESTDIR)$(libdir)/$(NAME) ; \ + fi +- $(INSTALL) -d "$(DESTDIR)$(prefix)/include/mlt++" +- $(INSTALL) -m 644 $(HEADERS) "$(DESTDIR)$(prefix)/include/mlt++" ++ $(INSTALL) -d "$(DESTDIR)$(includedir)/mlt++" ++ $(INSTALL) -m 644 $(HEADERS) "$(DESTDIR)$(includedir)/mlt++" + + uninstall: + rm -f "$(DESTDIR)$(libdir)/$(TARGET)" +@@ -104,7 +104,7 @@ uninstall: + fi ; \ + rm -f "$(DESTDIR)$(libdir)/libmlt++.def" ; \ + fi +- rm -rf "$(DESTDIR)$(prefix)/include/mlt++" ++ rm -rf "$(DESTDIR)$(includedir)/mlt++" + + ifneq ($(wildcard .depend),) + include .depend +diff --git a/src/mlt++/configure b/src/mlt++/configure +index 48e1fd9e..432ca716 100755 +--- a/src/mlt++/configure ++++ b/src/mlt++/configure +@@ -1,6 +1,6 @@ + #!/bin/sh + echo "soversion=3" > config.mak +-echo "mlt++ -I$prefix/include -I$prefix/include/mlt++ -D_REENTRANT -L$libdir -lmlt++" >> ../../packages.dat ++echo "mlt++ -I$includedir -I$includedir/mlt++ -D_REENTRANT -L$libdir -lmlt++" >> ../../packages.dat + + WARNINGS="-W -Wwrite-strings -Wcast-qual -Wpointer-arith -Wcast-align -Wredundant-decls" + +@@ -10,7 +10,7 @@ case $targetos in + echo "CXXFLAGS+=-Wall -fPIC" + echo "LIBFLAGS=-dynamiclib -single_module" + ;; +- Linux|FreeBSD|NetBSD|GNU/kFreeBSD|GNU) ++ Linux|FreeBSD|NetBSD|GNU/kFreeBSD|GNU|Haiku) + echo LIBSUF=.so + echo "CXXFLAGS+=-Wall $WARNINGS -fPIC -DPIC" + echo "LIBFLAGS=-shared" +diff --git a/src/modules/decklink/consumer_decklink.cpp b/src/modules/decklink/consumer_decklink.cpp +index 2ffdef04..c659c641 100644 +--- a/src/modules/decklink/consumer_decklink.cpp ++++ b/src/modules/decklink/consumer_decklink.cpp +@@ -657,7 +657,9 @@ protected: + return; + + pthread_attr_init(&tattr); ++#ifndef __HAIKU__ + pthread_attr_setschedpolicy(&tattr, SCHED_FIFO); ++#endif + + if ( !strcmp( "max", mlt_properties_get( properties, "priority" ) ) ) + param.sched_priority = sched_get_priority_max(SCHED_FIFO) - 1; +diff --git a/src/modules/decklink/producer_decklink.cpp b/src/modules/decklink/producer_decklink.cpp +index 43e7fa46..75a7c5d3 100644 +--- a/src/modules/decklink/producer_decklink.cpp ++++ b/src/modules/decklink/producer_decklink.cpp +@@ -457,7 +457,9 @@ public: + struct sched_param param; + + pthread_attr_init(&tattr); ++#ifndef __HAIKU__ + pthread_attr_setschedpolicy(&tattr, SCHED_FIFO); ++#endif + + if ( !strcmp( "max", mlt_properties_get( properties, "priority" ) ) ) + param.sched_priority = sched_get_priority_max(SCHED_FIFO) - 1; +-- +2.20.1 +