Files
haikuports/media-libs/libopenshot/libopenshot-0.2.5.recipe
2021-01-26 18:15:38 +01:00

154 lines
4.7 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="https://www.openshot.org/"
COPYRIGHT="2008-2020 OpenShot Studios, LLC"
LICENSE="GNU LGPL v3"
REVISION="4"
SOURCE_URI="https://github.com/OpenShot/libopenshot/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="8ae7d226fbd2efbc84da4f7d9d8c7f3cc9616e4de46e1233e3b0a84ac0a429bc"
SOURCE_FILENAME="libopenshot-$portVersion.tar.gz"
PATCHES="libopenshot-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86"
PYTHON_VERSION="3.8"
libVersion="17"
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_python38="$SUMMARY (python3 bindings)"
PROVIDES_python38="
libopenshot${secondaryArchSuffix}_python38 = $portVersion
"
REQUIRES_python38="
libopenshot$secondaryArchSuffix == $portVersion base
lib:libavutil$secondaryArchSuffix
lib:libopenshot_audio$secondaryArchSuffix
lib:libpython${PYTHON_VERSION}$secondaryArchSuffix
"
if [ "$targetArchitecture" = "x86_gcc2" ]; then
PROVIDES_python38+="
libopenshot_python38 = $portVersion
"
fi
SUMMARY_python38_debuginfo="$SUMMARY (python3 bindings debug info)"
PROVIDES_python38_debuginfo="
libopenshot${secondaryArchSuffix}_python38_debuginfo = $portVersion
debuginfo:_openshot.so(libopenshot_python38) = $portVersion
"
REQUIRES_python38_debuginfo="
libopenshot${secondaryArchSuffix}_python38 == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
unittest++${secondaryArchSuffix}_devel
devel:libavcodec$secondaryArchSuffix
devel:libavdevice$secondaryArchSuffix
devel:libavformat$secondaryArchSuffix
devel:libavutil$secondaryArchSuffix
devel:libexecinfo$secondaryArchSuffix
devel:libjsoncpp$secondaryArchSuffix
devel:libMagick++_6.Q16$secondaryArchSuffix
devel:libopenshot_audio$secondaryArchSuffix
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:pkg_config$secondaryArchSuffix
cmd:python${PYTHON_VERSION}
cmd:swig$secondaryArchSuffix
"
defineDebugInfoPackage libopenshot$secondaryArchSuffix \
$libDir/libopenshot.so.$portVersion
BUILD()
{
python=$portPackageLinksDir/cmd~python${PYTHON_VERSION}/bin/python${PYTHON_VERSION}m
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 \
-DLIBOPENSHOT_AUDIO_INCLUDE_DIR=/system/$relativeIncludeDir/libopenshot-audio/JuceLibraryCode \
-DPYTHON_MODULE_PATH=$installLocation \
-DENABLE_RUBY=OFF \
-DENABLE_TESTS=OFF \
-DENABLE_DOCS=OFF \
-DUSE_SYSTEM_JSONCPP=ON
make $jobArgs
}
INSTALL()
{
make install
prepareInstalledDevelLibs libopenshot
# devel package
packageEntries devel \
$developDir
python=$portPackageLinksDir/cmd~python${PYTHON_VERSION}/bin/python${PYTHON_VERSION}
pythonVersion=$($python --version 2>&1 | sed 's/Python //' | head -c3)
pythonLocation=$prefix/lib/python$pythonVersion
installLocation=$pythonLocation/vendor-packages
pythonDebugInfoDir=$(getPackagePrefix python38_debuginfo)/$relativeDebugInfoDir
mv $pythonLocation/dist-packages $pythonLocation/vendor-packages
extractDebugInfo $installLocation/_openshot.so \
"$pythonDebugInfoDir/_openshot.so(libopenshot_python38-$portFullVersion).debuginfo"
# python package
packageEntries python38 \
$pythonLocation
}
TEST()
{
make $jobArgs test
}