Files
haikuports/media-libs/libopenshot/libopenshot-0.2.0.recipe
Leorize 42905e5ba0 media-libs/libopenshot: various changes
- splitted python modules to a separate package
- added debuginfo package
- added doc package
- patched to use system jsoncpp
2018-09-05 20:10:07 +07:00

175 lines
4.8 KiB
Bash

SUMMARY="Video editing library used by OpenShot"
DESCRIPTION="libopenshot is an open-source, cross-platform C++ library \
dedicated to delivering high quality video editing, animation, and playback \
solutions to the world. This is the same library which powers \
OpenShot Video Editor (version 2.0+). C++, Python are fully supported."
HOMEPAGE="http://www.openshot.org"
COPYRIGHT="2008-2018 OpenShot Studios, LLC"
LICENSE="GNU LGPL v3"
REVISION="1"
SOURCE_URI="https://github.com/OpenShot/libopenshot/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="f6f79c18023253720698c3049a0cd4b5783354cfbc6345e736e15268be6e297d"
SOURCE_FILENAME="libopenshot-$portVersion.tar.gz"
PATCHES="libopenshot-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86"
libVersion="15"
PROVIDES="
libopenshot$secondaryArchSuffix = $portVersion
lib:libopenshot$secondaryArchSuffix = $libVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libavcodec$secondaryArchSuffix
lib:libavformat$secondaryArchSuffix
lib:libavutil$secondaryArchSuffix
lib:libgomp$secondaryArchSuffix
lib:libjsoncpp$secondaryArchSuffix
lib:libMagick++_6.Q16$secondaryArchSuffix
lib:libMagickCore_6.Q16$secondaryArchSuffix
lib:libopenshot_audio$secondaryArchSuffix
lib:libQt5Core$secondaryArchSuffix
lib:libQt5Gui$secondaryArchSuffix
lib:libQt5Widgets$secondaryArchSuffix
lib:libswresample$secondaryArchSuffix
lib:libswscale$secondaryArchSuffix
lib:libzmq$secondaryArchSuffix
"
PROVIDES_devel="
libopenshot${secondaryArchSuffix}_devel = $portVersion compat >= 0
devel:libopenshot${secondaryArchSuffix} = $libVersion
"
REQUIRES_devel="
libopenshot$secondaryArchSuffix == $portVersion base
"
SUMMARY_python3="$SUMMARY (python3 bindings)"
PROVIDES_python3="
libopenshot${secondaryArchSuffix}_python3 = $portVersion
"
REQUIRES_python3="
libopenshot$secondaryArchSuffix == $portVersion base
lib:libavutil$secondaryArchSuffix
lib:libopenshot_audio$secondaryArchSuffix
lib:libpython3.6m$secondaryArchSuffix
"
if [ "$targetArchitecture" = "x86_gcc2" ]; then
PROVIDES_python3+="
libopenshot_python3 = $portVersion
"
fi
SUMMARY_python3_debuginfo="$SUMMARY (python3 bindings debug info)"
PROVIDES_python3_debuginfo="
libopenshot${secondaryArchSuffix}_python3_debuginfo = $portVersion
debuginfo:_openshot.so(libopenshot_python3) = $portVersion
"
REQUIRES_python3_debuginfo="
libopenshot${secondaryArchSuffix}_python3 == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
unittest++${secondaryArchSuffix}_devel
devel:libavcodec$secondaryArchSuffix
devel:libavdevice$secondaryArchSuffix
devel:libavformat$secondaryArchSuffix
devel:libavresample$secondaryArchSuffix
devel:libavutil$secondaryArchSuffix
devel:libexecinfo$secondaryArchSuffix
devel:libjsoncpp$secondaryArchSuffix
devel:libMagick++_6.Q16$secondaryArchSuffix
devel:libopenshot_audio$secondaryArchSuffix >= 6
devel:libQt5Core$secondaryArchSuffix
devel:libQt5Gui$secondaryArchSuffix
devel:libQt5Multimedia$secondaryArchSuffix
devel:libQt5MultimediaWidgets$secondaryArchSuffix
devel:libswresample$secondaryArchSuffix
devel:libswscale$secondaryArchSuffix
devel:libzmq$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:make
cmd:python3
cmd:swig$secondaryArchSuffix
"
if [ -z "$secondaryArchSuffix" ]; then
ARCHITECTURES_doc="any"
PROVIDES_doc="
libopenshot_audio_doc = $portVersion
"
BUILD_PREREQUIRES+="
cmd:dot
cmd:doxygen
"
fi
defineDebugInfoPackage libopenshot$secondaryArchSuffix \
$libDir/libopenshot.so.$portVersion
BUILD()
{
python=$portPackageLinksDir/cmd~python3/bin/python3
pythonVersion=$($python --version 2>&1 | sed 's/Python //' | head -c3)
installLocation=$prefix/lib/python$pythonVersion/vendor-packages/
export LDFLAGS="-Wl,--as-needed" # Trim unneeded links
cmake . $cmakeDirArgs \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DPYTHON_MODULE_PATH=$installLocation \
-DENABLE_RUBY=OFF \
-DUSE_SYSTEM_JSONCPP=ON
make $jobArgs
if [ -z "$secondaryArchSuffix" ]; then
make $jobArgs doc
fi
}
INSTALL()
{
make install
prepareInstalledDevelLibs libopenshot
# devel package
packageEntries devel \
$developDir
if [ -z "$secondaryArchSuffix" ]; then
install -d -m 755 $developDocDir
mv -T $docDir/libopenshot $developDocDir
rm -rf $documentationDir
packageEntries doc \
$developDir
fi
python=$portPackageLinksDir/cmd~python3/bin/python3
pythonVersion=$($python --version 2>&1 | sed 's/Python //' | head -c3)
pythonLocation=$prefix/lib/python$pythonVersion
installLocation=$pythonLocation/vendor-packages
pythonDebugInfoDir=$(getPackagePrefix python3_debuginfo)/$relativeDebugInfoDir
extractDebugInfo $installLocation/_openshot.so \
"$pythonDebugInfoDir/_openshot.so(libopenshot_python3-$portFullVersion).debuginfo"
# python package
packageEntries python3 \
$pythonLocation
}
TEST()
{
make $jobArgs test
}