diff --git a/media-video/decklink-drivers/Manifest b/media-video/decklink-drivers/Manifest new file mode 100644 index 0000000..10582bd --- /dev/null +++ b/media-video/decklink-drivers/Manifest @@ -0,0 +1,2 @@ +DIST Blackmagic_DeckLink_SDK_12.2.zip 107165577 BLAKE2B 589f435bc644a9f3e5954e262905228e22ae9c6f04fbe823cbaea42ea26a37eb275d15221ccf100bd1112222ee695c9a7c1aec24de7e8fb8a949123835a38a86 SHA512 096926894748f8cf6f6156c3da0a3b0317e914089af23b41a2f13ab95fcb673a6f91def79bdeeb55eef9ac3b3221bf9cc2b057958cfaa795ef54249a5d5899b9 +DIST Blackmagic_Desktop_Video_Linux_12.2.tar.gz 1028551320 BLAKE2B a373e26eb63552c204978a74a66b172d6aa6fcbd520f2f50a3bfaa3c31e4a2dc824dd8f62e47f882343a545f5c8387ead25c79e1e71accfe19d9da37ba3bf8f9 SHA512 fc33fa7655fb2984832b4485fad55c54c958e2cc6b9dabdf39d71f3d9b87aeb0823956ba771cea25db03321d95b7e6e0f601d4aabfbe4438a925da5a8bd26652 diff --git a/media-video/decklink-drivers/decklink-drivers-12.2.ebuild b/media-video/decklink-drivers/decklink-drivers-12.2.ebuild new file mode 100644 index 0000000..915bdac --- /dev/null +++ b/media-video/decklink-drivers/decklink-drivers-12.2.ebuild @@ -0,0 +1,172 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit linux-mod + +DESCRIPTION="Desktop Video drivers & tools for products by Blackmagic Design (e.g. DeckLink)" +HOMEPAGE="http://www.blackmagicdesign.com/" + +# Desktop Video Revision +REV="a12" + +# SDK Package Version +SDK_VERSION="${PV}" + +SRC_URI="Blackmagic_Desktop_Video_Linux_${PV}.tar.gz +headers? ( Blackmagic_DeckLink_SDK_${SDK_VERSION}.zip )" +UNPACKED_DIR="desktopvideo-${PV}${REV}-x86_64" + +LICENSE="BlackmagicDesktopVideo" +SLOT="0" +KEYWORDS="~amd64" +IUSE="autostart +headers X" +RESTRICT="fetch" + +DEPEND="" +RDEPEND="${DEPEND} +X? ( + dev-qt/qtgui:5 + virtual/libusb + )" + +# supress QA warnings about stripping etc., i.e. stuff we cannot change since we install prebuilt binaries +QA_PREBUILT="opt/blackmagic-desktop-video/usr/bin/* opt/blackmagic-desktop-video/usr/lib/*" + +# for kernel module compilation +MODULE_NAMES="blackmagic(misc:${S}/usr/src/blackmagic-${PV}${REV}) +blackmagic-io(misc:${S}/usr/src/blackmagic-io-${PV}${REV})" +BUILD_PARAMS="-j1" +BUILD_TARGETS="clean all" + +pkg_nofetch() { + einfo "Please visit ${HOMEPAGE} and download \"Desktop Video ${PV} for Linux\"" + if use headers; then + einfo "and \"Desktop Video ${SDK_VERSION} SDK for Linux\"" + fi + einfo "for your product from the support section and move it to ${DISTDIR}" + einfo "" + einfo " expected filenames: ${SRC_URI}" + einfo "" + einfo "The license should be shown and has to be accepted before the download" + einfo "starts." +} + +src_unpack() { + unpack ${A} + + cd "${WORKDIR}" + tar xfz Blackmagic_Desktop_Video_Linux_${PV}/other/x86_64/${UNPACKED_DIR}.tar.gz + + # symlink to what is supposed to have been prepared + ln -s ${UNPACKED_DIR} ${P} +} + +src_compile() { + # library/tools are binary but kernel module requires compilation + linux-mod_src_compile +} + +src_install() { + # all pre-built binaries should go into /opt and be symlinked to usr/bin etc. + optdir="opt/blackmagic-desktop-video" + installdir="${D}${optdir}" + + mkdir -p ${installdir} + cp -a "${WORKDIR}"/${UNPACKED_DIR}/* ${installdir}/ + rm -rf ${installdir}/usr/src + + symlinks=( + 'usr/bin/DesktopVideoUpdateTool' + 'usr/lib/libDeckLinkAPI.so' + 'usr/lib/libDeckLinkPreviewAPI.so' + 'usr/lib/blackmagic' + #'usr/sbin/DesktopVideoHelper' + 'usr/share/doc/desktopvideo' + ) + for path in "${symlinks[@]}"; do + relpath=$(realpath -m -s --relative-to="/${path}" "/${optdir}") + dosym ${relpath:3}/${path} ${path} + done + + if use X; then + symlinks=( + 'usr/bin/BlackmagicDesktopVideoSetup' + 'usr/bin/BlackmagicFirmwareUpdaterGui' + 'usr/share/applications/BlackmagicDesktopVideoSetup.desktop' + 'usr/share/applications/BlackmagicFirmwareUpdaterGui.desktop' + 'usr/share/doc/desktopvideo' + 'usr/share/icons/hicolor/16x16/apps/BlackmagicDesktopVideoSetup.png' + 'usr/share/icons/hicolor/16x16/apps/BlackmagicFirmwareUpdaterGui.png' + 'usr/share/icons/hicolor/32x32/apps/BlackmagicDesktopVideoSetup.png' + 'usr/share/icons/hicolor/32x32/apps/BlackmagicFirmwareUpdaterGui.png' + 'usr/share/icons/hicolor/48x48/apps/BlackmagicDesktopVideoSetup.png' + 'usr/share/icons/hicolor/48x48/apps/BlackmagicFirmwareUpdaterGui.png' + 'usr/share/icons/hicolor/128x128/apps/BlackmagicDesktopVideoSetup.png' + 'usr/share/icons/hicolor/128x128/apps/BlackmagicFirmwareUpdaterGui.png' + 'usr/share/icons/hicolor/256x256/apps/BlackmagicDesktopVideoSetup.png' + 'usr/share/icons/hicolor/256x256/apps/BlackmagicFirmwareUpdaterGui.png' + ) + for path in "${symlinks[@]}"; do + relpath=$(realpath -m -s --relative-to="/${path}" "/${optdir}") + dosym ${relpath:3}/${path} ${path} + done + + # add firmware check to autostart? + if use autostart; then + dosym ../../../${optdir}/etc/xdg/autostart/BlackmagicFirmwareUpdaterGuiAutostart.desktop /etc/xdg/autostart/BlackmagicFirmwareUpdaterGuiAutostart.desktop + fi + fi + + # udev rule should be placed in /lib/udev/rules.d instead + dosym ../../../${optdir}/etc/udev/rules.d/55-blackmagic.rules /lib/udev/rules.d/55-blackmagic.rules + + if use headers; then + # copy headers from SDK + mkdir -p ${installdir}/usr/include + cp -a "${WORKDIR}/Blackmagic DeckLink SDK ${SDK_VERSION}/Linux/include" ${installdir}/usr/include/blackmagic + + dosym ../../${optdir}/usr/include/blackmagic usr/include/blackmagic + fi + + newinitd "${FILESDIR}/DesktopVideoHelper.initd" blackmagic-DesktopVideoHelper + + # kernel module + linux-mod_src_install +} + +pkg_postinst() { + # kernel module + linux-mod_pkg_postinst + + # 12345678901234567890123456789012345678901234567890123456789012345678901234567890 + einfo "" + einfo "Please do *NOT* report any QA errors to Gentoo or Blackmagic!" + einfo "" + einfo "The kernel module is simply called blackmagic or blckmagic-io depends on your BMD device. You may want to modprobe it now" + einfo "to see if it works (it should print your devices to kernel log)." + einfo "" + einfo "Installed tools are DesktopVideoUpdateTool. !!!! Notice rename. !!!!" + einfo "" + if use autostart; then + einfo "Automated update check has been installed." + else + einfo "Automated update check has *not* been installed this time. (set USE flag" + einfo "autostart if you want that)" + fi + einfo "" + einfo "If your product is not being recognized, you may need to increase the vmalloc" + einfo "limit in your kernel. You can do that by adding e.g. vmalloc=256M to your kernel" + einfo "boot line. You can see current usage by running" + einfo "" + einfo " # grep VmallocUsed /proc/meminfo" + einfo "" + einfo "We are reloading udev rules now..." + /bin/udevadm control --reload-rules || einfo " ... failed, you may want to check this before rebooting!" +} + +pkg_postrm() { + # kernel module + linux-mod_pkg_postrm +} diff --git a/media-video/decklink-drivers/files/DesktopVideoHelper.initd b/media-video/decklink-drivers/files/DesktopVideoHelper.initd new file mode 100644 index 0000000..66f16dd --- /dev/null +++ b/media-video/decklink-drivers/files/DesktopVideoHelper.initd @@ -0,0 +1,11 @@ +#!/sbin/openrc-run +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +name=blackmagic-DesktopVideoHelper +pidfile=/run/blackmagic-DesktopVideoHelper.pid +command=/usr/sbin/DesktopVideoHelper +retry="TERM/10/KILL/5" +command_args="" + +# vim:ft=gentoo-init-d:noet:ts=4:sts=4:sw=4: