We have moved to Git. This repository is only provided for compatibility with old installations. Learn how to migrate your installation here.

comparison media-libs/blackmagic-desktop-video/blackmagic-desktop-video-11.4.ebuild @ 224:c80972b7e7e2

Blackmagic Desktop Video and Media Express updated to latest version
author Daniel Neugebauer <dneuge@energiequant.de>
date Mon, 10 Feb 2020 14:22:31 +0100
parents media-libs/blackmagic-desktop-video/blackmagic-desktop-video-10.9.ebuild@ea74cb722388
children 3c0316b4ca58
comparison
equal deleted inserted replaced
223:ea74cb722388 224:c80972b7e7e2
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 # TODOs:
5 # - fix QA notice about installing symlinks in /usr/lib
6
7 EAPI=5
8
9 inherit linux-mod
10
11 DESCRIPTION="Desktop Video - drivers and tools for products by Blackmagic Design including DeckLink and Intensity"
12 HOMEPAGE="http://www.blackmagicdesign.com/"
13 HOMEPAGE_DOWNLOAD_NAME="Desktop Video ${PV}"
14
15 SRC_URI="Blackmagic_Desktop_Video_Linux_${PV}.tar.gz"
16 DESKTOP_VIDEO_SHORT_VERSION="11.4"
17 DESKTOP_VIDEO_VERSION="11.4a14"
18 CONTAINER_DIR="Blackmagic_Desktop_Video_Linux_${DESKTOP_VIDEO_SHORT_VERSION}"
19 UNPACKED_DIR="desktopvideo-${DESKTOP_VIDEO_VERSION}-x86_64"
20
21 LICENSE="BlackmagicDesktopVideo"
22 SLOT="0"
23 KEYWORDS="~amd64"
24 #IUSE="autostart patch_compat"
25 IUSE="autostart"
26 RESTRICT="fetch"
27
28 # dependencies found via command: (ldd would include transitive dependencies)
29 # equery belongs $(for file in /usr/lib/libDeckLink* /usr/lib/blackmagic/*; do objdump -p $file | grep NEEDED; done 2>/dev/null | cut -b24- | sort | uniq | grep -vE 'lib(Qt5(Core|Network|Gui|Widgets)|qxcb|qgtk2|DeckLink)')
30 DEPEND=""
31 RDEPEND="${DEPEND}
32 media-libs/mesa
33 sys-devel/gcc
34 sys-libs/glibc
35 "
36
37 # supress QA warnings about stripping etc., i.e. stuff we cannot change since we install prebuilt binaries
38 QA_PREBUILT="opt/blackmagic-desktop-video/usr/bin/* opt/blackmagic-desktop-video/usr/lib/*"
39
40 # for kernel module compilation
41 MODULE_NAMES="blackmagic(misc:${S}/usr/src/blackmagic-${DESKTOP_VIDEO_VERSION}:${S}/usr/src/blackmagic-${DESKTOP_VIDEO_VERSION}) blackmagic-io(misc:${S}/usr/src/blackmagic-io-${DESKTOP_VIDEO_VERSION}:${S}/usr/src/blackmagic-io-${DESKTOP_VIDEO_VERSION})"
42 BUILD_TARGETS="clean all"
43
44 #PATCH_COMPAT_MAX_MAJOR=4
45 #PATCH_COMPAT_MAX_MINOR=10
46
47 #OFFICIAL_COMPAT_MAX_MAJOR=4
48 #OFFICIAL_COMPAT_MAX_MINOR=9
49
50 pkg_nofetch() {
51 # 1 2 3 4 5 6 7 8
52 # 1234567890123456789012345678901234567890123456789012345678901234567890123456789012
53 einfo "Please visit ${HOMEPAGE} and download \"${HOMEPAGE_DOWNLOAD_NAME}\""
54 einfo "for your product from the support section and move it to ${DISTDIR}"
55 einfo ""
56 einfo " expected filename: ${SRC_URI}"
57 einfo ""
58 einfo "If your browser downloads a .tar file you will need to rename it to .tar.gz"
59 }
60
61 #pkg_pretend() {
62 # if kernel_is -gt $PATCH_COMPAT_MAX_MAJOR $PATCH_COMPAT_MAX_MINOR; then
63 # # 12345678901234567890123456789012345678901234567890123456789012345678901234567890
64 # ewarn "Your kernel version seems to be unsupported; you have two options if modules do"
65 # ewarn "not work/compile:"
66 # ewarn ""
67 # ewarn " 1) Recommended: downgrade to an officially supported kernel version (e.g. ${OFFICIAL_COMPAT_MAX_MAJOR}.${OFFICIAL_COMPAT_MAX_MINOR})"
68 # ewarn ""
69 # ewarn " 2) Downgrade to an inofficially supported kernel version (max. ${PATCH_COMPAT_MAX_MAJOR}.${PATCH_COMPAT_MAX_MINOR}) and apply"
70 # ewarn " the *inofficial* patch which allows more recent kernel versions but may void"
71 # ewarn " warranty permanently. This can be done by setting the USE-flag patch_compat"
72 # ewarn " for this ebuild. The patch is not guaranteed to work at all and may even"
73 # ewarn " damage your hardware. Use at your own risk; you've been warned!"
74 # ewarn ""
75 # ewarn "It's highly recommended to choose option 1 and wait for an officially supported"
76 # ewarn "update unless you want to risk loosing your hardware and support."
77 # elif kernel_is -gt $OFFICIAL_COMPAT_MAX_MAJOR $OFFICIAL_COMPAT_MAX_MINOR && ! use patch_compat; then
78 # # 12345678901234567890123456789012345678901234567890123456789012345678901234567890
79 # ewarn "Your kernel version seems to be unsupported; you have two options if modules do"
80 # ewarn "not work/compile:"
81 # ewarn ""
82 # ewarn " 1) Recommended: downgrade to an officially supported kernel version (e.g. ${OFFICIAL_COMPAT_MAX_MAJOR}.${OFFICIAL_COMPAT_MAX_MINOR})"
83 # ewarn ""
84 # ewarn " 2) Apply an *inofficial* patch which allows more recent kernel versions but may"
85 # ewarn " void warranty permanently. This can be done by setting the USE-flag"
86 # ewarn " patch_compat for this ebuild. The patch is not guaranteed to work at all"
87 # ewarn " and may even damage your hardware. Use at your own risk; you've been warned!"
88 # ewarn ""
89 # ewarn "It's highly recommended to choose option 1 and wait for an officially supported"
90 # ewarn "update unless you want to risk loosing your hardware and support."
91 # elif kernel_is -le $OFFICIAL_COMPAT_MAX_MAJOR $OFFICIAL_COMPAT_MAX_MINOR && use patch_compat; then
92 # # 12345678901234567890123456789012345678901234567890123456789012345678901234567890
93 # einfo "Your kernel version is officially supported by this release. It is recommended"
94 # einfo "to unset patch_compat USE flag until you need it again."
95 # einfo "Inofficial patches will not be applied this time."
96 # fi
97 #}
98
99 src_unpack() {
100 unpack ${A}
101
102 cd ${WORKDIR}
103 tar xfz ${CONTAINER_DIR}/other/x86_64/desktopvideo-${DESKTOP_VIDEO_VERSION}-x86_64.tar.gz
104
105 # symlink to what is supposed to have been prepared
106 ln -s ${UNPACKED_DIR} ${P}
107 }
108
109 #src_prepare() {
110 # if kernel_is -gt $OFFICIAL_COMPAT_MAX_MAJOR $OFFICIAL_COMPAT_MAX_MINOR && use patch_compat; then
111 # if kernel_is -gt 4 9; then
112 # epatch "${FILESDIR}/10_9_0__4_10_get_user_pages_remote.patch"
113 # fi
114 # fi
115 #}
116
117 src_compile() {
118 # library/tools are binary but kernel module requires compilation
119 linux-mod_src_compile
120 }
121
122 src_install() {
123 # all pre-built binaries should go into /opt and be symlinked to usr/bin etc.
124 finalinstalldir="/opt/blackmagic-desktop-video"
125 installdir="${D}${finalinstalldir}"
126
127 mkdir -p ${installdir}
128 cp -a ${WORKDIR}/${UNPACKED_DIR}/* ${installdir}/
129
130 # copy text files (readme and license) from parent directory
131 cp -a ${WORKDIR}/${CONTAINER_DIR}/*.txt ${installdir}/
132
133 # there should a blank directory in /etc according to the archive...
134 mkdir -p ${installdir}/etc/blackmagic
135 chmod 755 ${installdir}/etc/blackmagic
136
137 # NOTE: Not linking usr/lib/systemd as I don't use that and thus can't test it...
138 # Also omitting DesktopVideoUpdater as it is useless when installed from ebuilds.
139 symlinks=(
140 'etc/init.d/DesktopVideoHelper'
141 'usr/bin/BlackmagicDesktopVideoSetup'
142 'usr/bin/BlackmagicFirmwareUpdater'
143 'usr/bin/BlackmagicFirmwareUpdaterGui'
144 'usr/lib/blackmagic'
145 'usr/lib/libDeckLinkAPI.so'
146 'usr/lib/libDeckLinkPreviewAPI.so'
147 'usr/lib/libScannerAPI.so'
148 'usr/share/applications/BlackmagicDesktopVideoSetup.desktop'
149 'usr/share/applications/BlackmagicFirmwareUpdaterGui.desktop'
150 'usr/share/doc/desktopvideo'
151 'usr/share/doc/desktopvideo-gui'
152 'usr/share/doc/desktopvideo-scanner'
153 'usr/share/icons/hicolor/16x16/apps/BlackmagicDesktopVideoSetup.png'
154 'usr/share/icons/hicolor/16x16/apps/BlackmagicFirmwareUpdaterGui.png'
155 'usr/share/icons/hicolor/32x32/apps/BlackmagicDesktopVideoSetup.png'
156 'usr/share/icons/hicolor/32x32/apps/BlackmagicFirmwareUpdaterGui.png'
157 'usr/share/icons/hicolor/48x48/apps/BlackmagicDesktopVideoSetup.png'
158 'usr/share/icons/hicolor/48x48/apps/BlackmagicFirmwareUpdaterGui.png'
159 'usr/share/icons/hicolor/128x128/apps/BlackmagicDesktopVideoSetup.png'
160 'usr/share/icons/hicolor/128x128/apps/BlackmagicFirmwareUpdaterGui.png'
161 'usr/share/icons/hicolor/256x256/apps/BlackmagicDesktopVideoSetup.png'
162 'usr/share/icons/hicolor/256x256/apps/BlackmagicFirmwareUpdaterGui.png'
163 )
164
165 for path in "${symlinks[@]}"; do
166 dosym /opt/blackmagic-desktop-video/${path} ${path}
167 done
168
169 # dneuge: no clue on how to use this...
170 ## QA notice says we should generate a linker script if we don't place libraries in /usr/lib
171 ## see: https://devmanual.gentoo.org/eclass-reference/toolchain-funcs.eclass/index.html
172 #gen_usr_ldscript usr/lib/libDeckLinkAPI.so usr/lib/libDeckLinkPreviewAPI.so
173
174 # don't symlink man-pages, install a copy instead
175 # NOTE: DesktopVideoHelper appears to have disappeared, so we won't install the man page either
176 doman usr/share/man/man1/BlackmagicDesktopVideoSetup.1
177 doman usr/share/man/man1/BlackmagicFirmwareUpdater.1
178 doman usr/share/man/man1/BlackmagicFirmwareUpdaterGui.1
179
180 # udev rules should be placed in /lib/udev/rules.d instead
181 dosym /opt/blackmagic-desktop-video/etc/udev/rules.d/51-cintel.rules /lib/udev/rules.d/51-cintel.rules
182 dosym /opt/blackmagic-desktop-video/etc/udev/rules.d/55-blackmagic.rules /lib/udev/rules.d/55-blackmagic.rules
183
184 # add firmware check to autostart?
185 if use autostart; then
186 dosym /opt/blackmagic-desktop-video/etc/xdg/autostart/BlackmagicFirmwareUpdaterGuiAutoStart.desktop /etc/xdg/autostart/BlackmagicFirmwareUpdaterGuiAutoStart.desktop
187 fi
188
189 # kernel module
190 linux-mod_src_install
191 }
192
193 pkg_postinst() {
194 # kernel module
195 linux-mod_pkg_postinst
196
197 # 12345678901234567890123456789012345678901234567890123456789012345678901234567890
198 einfo ""
199 einfo "Please do *NOT* report any QA errors to Gentoo or Blackmagic!"
200 einfo ""
201 einfo "Kernel modules are blackmagic and blackmagic-io. Try blackmagic if in doubt."
202 einfo "When upgrading, please rmmod both first. Then modprobe blackmagic to see if it"
203 einfo "works (it should print your devices to kernel log)."
204 einfo ""
205 einfo "Installed tools are BlackmagicFirmwareUpdater, BlackmagicFirmwareUpdaterGui and"
206 einfo "BlackmagicDesktopVideoSetup."
207 einfo ""
208 einfo "For Media Express emerge media-video/blackmagic-media-express."
209 einfo ""
210 if use autostart; then
211 einfo "Automated firmware update check has been installed."
212 else
213 einfo "Automated firmware update check has *not* been installed this time."
214 einfo "(set USE flag autostart if you want that)"
215 fi
216 einfo ""
217 einfo "If your product is not being recognized, there are two common reasons:"
218 einfo ""
219 einfo " 1) You may need to increase the vmalloc limit in your kernel."
220 einfo " This can be done by adding e.g. vmalloc=256M to your kernel boot line. You"
221 einfo " can see current usage by running"
222 einfo ""
223 einfo " # grep VmallocUsed /proc/meminfo"
224 einfo ""
225 einfo " 2) Your firmware may be outdated. Make sure you reload the modules (or simply"
226 einfo " reboot) and then run BlackmagicFirmwareUpdater or, if you prefer,"
227 einfo " BlackmagicFirmwareUpdaterGui"
228 einfo ""
229 einfo "Licenses can be found in: ${finalinstalldir}/usr/share/doc/"
230 einfo ""
231 einfo "We are reloading udev rules now..."
232 /bin/udevadm control --reload-rules || einfo " ... failed, you may want to check this before rebooting!"
233
234 #if kernel_is -gt $OFFICIAL_COMPAT_MAX_MAJOR $OFFICIAL_COMPAT_MAX_MINOR && use patch_compat; then
235 # # 12345678901234567890123456789012345678901234567890123456789012345678901234567890
236 # ewarn ""
237 # ewarn " *** YOU HAVE APPLIED INOFFICIAL PATCHES TO INSTALLED KERNEL MODULES ***"
238 # ewarn " *** DO NOT REPORT ANY ERRORS TO BLACKMAGIC, YOU BREAK WARRANTY ***"
239 # ewarn ""
240 # ewarn "Applying those patches is generally discouraged as it can potentially damage"
241 # ewarn "your hardware and therefore may void your warranty. You are recommended to"
242 # ewarn "go back to an older kernel and wait for an official update instead of applying"
243 # ewarn "these patches. At the very least, note that there is no support of any kind when"
244 # ewarn "using patched drivers. Avoid contacting the vendor for support while using"
245 # ewarn "inofficial drivers. Revert to official drivers and retry with untainted hardware"
246 # ewarn "if something doesn't work as expected. Additionally, your system may behave"
247 # ewarn "unstable."
248 # ewarn ""
249 # ewarn "Remove USE-flag patch_compat and re-emerge this ebuild immediately before use"
250 # ewarn "if you enabled it accidentally."
251 # ewarn ""
252 # ewarn " *** USE AT YOUR OWN RISK ***"
253 #fi
254 }
255
256 pkg_postrm() {
257 # kernel module
258 linux-mod_pkg_postrm
259 }