megacoffee.net Gentoo overlay - legacy mirror
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-12.5.ebuild @ 258:1767728323bb
[sync] imported 4c2cea0..04d1b06 from upstream
commit 04d1b06f1ef195542b349745a54363216d62a85a
Author: Daniel Neugebauer <dneuge@energiequant.de>
Date: Mon Aug 7 19:03:55 2023 +0200
media-libs/blackmagic-desktop-video: integrate udev_reload as asked
commit e978764acb35ba478b0a9c01782adc148a2c9dd5
Author: Daniel Neugebauer <dneuge@energiequant.de>
Date: Mon Aug 7 18:53:27 2023 +0200
BlackMagic Desktop Video: bump to 12.5 (SDK 12.5.1)
author | Migration Sync <gentoo-overlay@megacoffee.net> |
---|---|
date | Mon, 07 Aug 2023 17:15:02 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
257:e7bfeec05909 | 258:1767728323bb |
---|---|
1 # Copyright 1999-2023 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=8 | |
8 | |
9 inherit linux-info linux-mod udev | |
10 | |
11 DESCRIPTION="Desktop Video - drivers and tools for products by Blackmagic Design including DeckLink, UltraStudio 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="12.5" | |
17 DESKTOP_VIDEO_VERSION="12.5a15" | |
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 +desktop patch_compat" | |
25 IUSE="autostart +desktop" | |
26 RESTRICT="fetch splitdebug strip" | |
27 | |
28 # dependencies found via command: (ldd would include transitive dependencies) | |
29 # for file in /usr/lib/libDeckLink* /usr/lib/blackmagic/DesktopVideo/* /usr/lib/blackmagic/DesktopVideo/plugins/*/*; 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 # equery belongs $(for file in /usr/lib/libDeckLink* /usr/lib/blackmagic/DesktopVideo/* /usr/lib/blackmagic/DesktopVideo/plugins/*/*; 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)') | |
31 DEPEND="" | |
32 RDEPEND="${DEPEND} | |
33 | |
34 desktop? ( | |
35 media-libs/freetype | |
36 media-libs/fontconfig | |
37 media-libs/libglvnd | |
38 sys-apps/dbus | |
39 x11-libs/libICE | |
40 x11-libs/libSM | |
41 x11-libs/libX11 | |
42 x11-libs/libXext | |
43 x11-libs/libXrender | |
44 x11-libs/libxcb | |
45 ) | |
46 | |
47 dev-libs/glib | |
48 dev-libs/libusb | |
49 sys-apps/util-linux | |
50 sys-devel/gcc | |
51 sys-libs/glibc | |
52 sys-libs/libcxx | |
53 sys-libs/libcxxabi | |
54 " | |
55 | |
56 # supress QA warnings about stripping etc., i.e. stuff we cannot change since we install prebuilt binaries | |
57 QA_PREBUILT="opt/blackmagic-desktop-video/usr/bin/* opt/blackmagic-desktop-video/usr/lib/*" | |
58 | |
59 # for kernel module compilation | |
60 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})" | |
61 BUILD_TARGETS="clean all" | |
62 BUILD_PARAMS="-j1" # work around race-condition causing .bmd-support.o.cmd to be missing | |
63 CONFIG_CHECK="~!WERROR" | |
64 ERROR_WERROR="If compilation fails disable CONFIG_WERROR and recompile kernel before retrying." | |
65 | |
66 #PATCH_COMPAT_MAX_MAJOR=6 | |
67 #PATCH_COMPAT_MAX_MINOR=1 | |
68 | |
69 #OFFICIAL_COMPAT_MAX_MAJOR=6 | |
70 #OFFICIAL_COMPAT_MAX_MINOR=1 | |
71 | |
72 pkg_nofetch() { | |
73 # 1 2 3 4 5 6 7 8 | |
74 # 1234567890123456789012345678901234567890123456789012345678901234567890123456789012 | |
75 einfo "Please visit ${HOMEPAGE} and download \"${HOMEPAGE_DOWNLOAD_NAME}\"" | |
76 einfo "for your product from the support section and move it to your DISTDIR" | |
77 einfo "(/var/cache/distfiles or /usr/portage/distfiles unless you changed it)." | |
78 einfo "" | |
79 einfo " expected filename: ${SRC_URI}" | |
80 einfo "" | |
81 einfo "If your browser downloads a .tar file you will need to rename it to .tar.gz" | |
82 } | |
83 | |
84 #pkg_pretend() { | |
85 # if kernel_is -gt $PATCH_COMPAT_MAX_MAJOR $PATCH_COMPAT_MAX_MINOR; then | |
86 # # 12345678901234567890123456789012345678901234567890123456789012345678901234567890 | |
87 # ewarn "Your kernel version seems to be unsupported; you have two options if modules do" | |
88 # ewarn "not work/compile:" | |
89 # ewarn "" | |
90 # ewarn " 1) Recommended: downgrade to an officially supported kernel version (e.g. ${OFFICIAL_COMPAT_MAX_MAJOR}.${OFFICIAL_COMPAT_MAX_MINOR})" | |
91 # ewarn "" | |
92 # ewarn " 2) Downgrade to an inofficially supported kernel version (max. ${PATCH_COMPAT_MAX_MAJOR}.${PATCH_COMPAT_MAX_MINOR}) and apply" | |
93 # ewarn " the *inofficial* patch which allows more recent kernel versions but may void" | |
94 # ewarn " warranty permanently. This can be done by setting the USE-flag patch_compat" | |
95 # ewarn " for this ebuild. The patch is not guaranteed to work at all and may even" | |
96 # ewarn " damage your hardware. Use at your own risk; you've been warned!" | |
97 # ewarn "" | |
98 # ewarn "It's highly recommended to choose option 1 and wait for an officially supported" | |
99 # ewarn "update unless you want to risk loosing your hardware and support." | |
100 # elif kernel_is -gt $OFFICIAL_COMPAT_MAX_MAJOR $OFFICIAL_COMPAT_MAX_MINOR && ! use patch_compat; then | |
101 # # 12345678901234567890123456789012345678901234567890123456789012345678901234567890 | |
102 # ewarn "Your kernel version seems to be unsupported; you have two options if modules do" | |
103 # ewarn "not work/compile:" | |
104 # ewarn "" | |
105 # ewarn " 1) Recommended: downgrade to an officially supported kernel version (e.g. ${OFFICIAL_COMPAT_MAX_MAJOR}.${OFFICIAL_COMPAT_MAX_MINOR})" | |
106 # ewarn "" | |
107 # ewarn " 2) Apply an *inofficial* patch which allows more recent kernel versions but may" | |
108 # ewarn " void warranty permanently. This can be done by setting the USE-flag" | |
109 # ewarn " patch_compat for this ebuild. The patch is not guaranteed to work at all" | |
110 # ewarn " and may even damage your hardware. Use at your own risk; you've been warned!" | |
111 # ewarn "" | |
112 # ewarn "It's highly recommended to choose option 1 and wait for an officially supported" | |
113 # ewarn "update unless you want to risk loosing your hardware and support." | |
114 # elif kernel_is -le $OFFICIAL_COMPAT_MAX_MAJOR $OFFICIAL_COMPAT_MAX_MINOR && use patch_compat; then | |
115 # # 12345678901234567890123456789012345678901234567890123456789012345678901234567890 | |
116 # einfo "Your kernel version is officially supported by this release. It is recommended" | |
117 # einfo "to unset patch_compat USE flag until you need it again." | |
118 # einfo "Inofficial patches will not be applied this time." | |
119 # fi | |
120 #} | |
121 | |
122 src_unpack() { | |
123 unpack ${A} | |
124 | |
125 cd ${WORKDIR} | |
126 tar xfz ${CONTAINER_DIR}/other/x86_64/desktopvideo-${DESKTOP_VIDEO_VERSION}-x86_64.tar.gz | |
127 | |
128 # symlink to what is supposed to have been prepared | |
129 ln -s ${UNPACKED_DIR} ${P} | |
130 } | |
131 | |
132 #src_prepare() { | |
133 # if kernel_is -gt $OFFICIAL_COMPAT_MAX_MAJOR $OFFICIAL_COMPAT_MAX_MINOR && use patch_compat; then | |
134 # eapply "${FILESDIR}/12.4.1__6_1__01_prandom_u32.patch" | |
135 # eapply "${FILESDIR}/12.4.1__6_1__02_snd_dma_continuous_data.patch" | |
136 # fi | |
137 # eapply_user | |
138 #} | |
139 | |
140 src_compile() { | |
141 # library/tools are binary but kernel module requires compilation | |
142 linux-mod_src_compile | |
143 } | |
144 | |
145 src_install() { | |
146 # all pre-built binaries should go into /opt and be symlinked to usr/bin etc. | |
147 finalinstalldir="/opt/blackmagic-desktop-video" | |
148 installdir="${D}${finalinstalldir}" | |
149 | |
150 mkdir -p ${installdir} | |
151 cp -a ${WORKDIR}/${UNPACKED_DIR}/* ${installdir}/ | |
152 | |
153 # copy text files (readme and license) from parent directory | |
154 cp -a ${WORKDIR}/${CONTAINER_DIR}/*.txt ${installdir}/ | |
155 | |
156 # there should a blank directory in /etc according to the archive... | |
157 mkdir -p ${installdir}/etc/blackmagic | |
158 chmod 755 ${installdir}/etc/blackmagic | |
159 | |
160 # NOTE: Not linking usr/lib/systemd as I do not use that and thus canot test it... | |
161 symlinks=( | |
162 'etc/init.d/DesktopVideoHelper' | |
163 'etc/dracut.conf.d/dracut-blackmagic.conf' | |
164 'usr/bin/BlackmagicDesktopVideoSetup' | |
165 'usr/bin/DesktopVideoUpdateTool' | |
166 'usr/bin/DesktopVideoUpdater' | |
167 'usr/lib/blackmagic' | |
168 'usr/lib/libDeckLinkAPI.so' | |
169 'usr/lib/libDeckLinkPreviewAPI.so' | |
170 'usr/share/applications/BlackmagicDesktopVideoSetup.desktop' | |
171 'usr/share/applications/DesktopVideoUpdater.desktop' | |
172 'usr/share/icons/hicolor/16x16/apps/BlackmagicDesktopVideoSetup.png' | |
173 'usr/share/icons/hicolor/16x16/apps/DesktopVideoUpdater.png' | |
174 'usr/share/icons/hicolor/32x32/apps/BlackmagicDesktopVideoSetup.png' | |
175 'usr/share/icons/hicolor/32x32/apps/DesktopVideoUpdater.png' | |
176 'usr/share/icons/hicolor/48x48/apps/BlackmagicDesktopVideoSetup.png' | |
177 'usr/share/icons/hicolor/48x48/apps/DesktopVideoUpdater.png' | |
178 'usr/share/icons/hicolor/128x128/apps/BlackmagicDesktopVideoSetup.png' | |
179 'usr/share/icons/hicolor/128x128/apps/DesktopVideoUpdater.png' | |
180 'usr/share/icons/hicolor/256x256/apps/BlackmagicDesktopVideoSetup.png' | |
181 'usr/share/icons/hicolor/256x256/apps/DesktopVideoUpdater.png' | |
182 ) | |
183 | |
184 for path in "${symlinks[@]}"; do | |
185 dosym /opt/blackmagic-desktop-video/${path} ${path} | |
186 done | |
187 | |
188 # copy but do not compress documentation | |
189 # reason for having it twice (in /opt and /usr): | |
190 # - symlinking with original directory names causes a QA notice as we should use our package name | |
191 # - symlinking with our package name causes some weird sandbox violation | |
192 docompress -x /usr/share/doc | |
193 docinto desktopvideo | |
194 dodoc -r ${finalinstalldir}/usr/share/doc/desktopvideo/* | |
195 docinto desktopvideo-gui | |
196 dodoc -r ${finalinstalldir}/usr/share/doc/desktopvideo-gui/* | |
197 | |
198 # dneuge: no clue on how to use this... | |
199 ## QA notice says we should generate a linker script if we don't place libraries in /usr/lib | |
200 ## see: https://devmanual.gentoo.org/eclass-reference/toolchain-funcs.eclass/index.html | |
201 #gen_usr_ldscript usr/lib/libDeckLinkAPI.so usr/lib/libDeckLinkPreviewAPI.so | |
202 | |
203 # don't symlink man-pages, install a copy instead | |
204 # NOTE: DesktopVideoHelper appears to have disappeared, so we won't install the man page either | |
205 doman usr/share/man/man1/BlackmagicDesktopVideoSetup.1 | |
206 doman usr/share/man/man1/BlackmagicFirmwareUpdater.1 | |
207 doman usr/share/man/man1/DesktopVideoHelper.1 | |
208 doman usr/share/man/man1/DesktopVideoUpdateTool.1 | |
209 doman usr/share/man/man1/DesktopVideoUpdater.1 | |
210 | |
211 # udev rules should be placed in /lib/udev/rules.d instead | |
212 dosym /opt/blackmagic-desktop-video/etc/udev/rules.d/55-blackmagic.rules /lib/udev/rules.d/55-blackmagic.rules | |
213 | |
214 # add firmware check to autostart? | |
215 if use autostart; then | |
216 dosym /opt/blackmagic-desktop-video/etc/xdg/autostart/DesktopVideoUpdaterAutoStart.desktop /etc/xdg/autostart/DesktopVideoUpdaterAutoStart.desktop | |
217 fi | |
218 | |
219 # kernel module | |
220 linux-mod_src_install | |
221 } | |
222 | |
223 pkg_postinst() { | |
224 # kernel module | |
225 linux-mod_pkg_postinst | |
226 | |
227 # 12345678901234567890123456789012345678901234567890123456789012345678901234567890 | |
228 einfo "" | |
229 einfo "Please do *NOT* report any QA errors to Gentoo or Blackmagic!" | |
230 einfo "" | |
231 einfo "Kernel modules are blackmagic and blackmagic-io. Try blackmagic if in doubt." | |
232 einfo "When upgrading, please rmmod both first. Then modprobe blackmagic to see if it" | |
233 einfo "works (it should print your devices to kernel log)." | |
234 einfo "" | |
235 einfo "Installed tools are DesktopVideoUpdateTool (CLI), DesktopVideoUpdater (GUI) and" | |
236 einfo "BlackmagicDesktopVideoSetup." | |
237 einfo "" | |
238 einfo "For Media Express emerge media-video/blackmagic-media-express." | |
239 einfo "" | |
240 if use autostart; then | |
241 einfo "Automated firmware update check has been installed." | |
242 else | |
243 einfo "Automated firmware update check has *not* been installed this time." | |
244 einfo "(set USE flag autostart if you want that)" | |
245 fi | |
246 einfo "" | |
247 einfo "If your product is not being recognized, there are two common reasons:" | |
248 einfo "" | |
249 einfo " 1) You may need to increase the vmalloc limit in your kernel." | |
250 einfo " This can be done by adding e.g. vmalloc=256M to your kernel boot line. You" | |
251 einfo " can see current usage by running" | |
252 einfo "" | |
253 einfo " # grep VmallocUsed /proc/meminfo" | |
254 einfo "" | |
255 einfo " 2) Your firmware may be outdated. Make sure you reload the modules (or simply" | |
256 einfo " reboot) and then run DesktopVideoUpdateTool (CLI) or, if you prefer," | |
257 einfo " DesktopVideoUpdater (GUI)" | |
258 einfo "" | |
259 einfo "Licenses can be found in: ${finalinstalldir}/usr/share/doc/" | |
260 einfo "" | |
261 udev_reload || ewarn "Reloading udev rules failed, you may want to check this before rebooting!" | |
262 | |
263 #if kernel_is -gt $OFFICIAL_COMPAT_MAX_MAJOR $OFFICIAL_COMPAT_MAX_MINOR && use patch_compat; then | |
264 # # 12345678901234567890123456789012345678901234567890123456789012345678901234567890 | |
265 # ewarn "" | |
266 # ewarn " *** YOU HAVE APPLIED INOFFICIAL PATCHES TO INSTALLED KERNEL MODULES ***" | |
267 # ewarn " *** DO NOT REPORT ANY ERRORS TO BLACKMAGIC, YOU BREAK WARRANTY ***" | |
268 # ewarn "" | |
269 # ewarn "Applying those patches is generally discouraged as it can potentially damage" | |
270 # ewarn "your hardware and therefore may void your warranty. You are recommended to" | |
271 # ewarn "go back to an older kernel and wait for an official update instead of applying" | |
272 # ewarn "these patches. At the very least, note that there is no support of any kind when" | |
273 # ewarn "using patched drivers. Avoid contacting the vendor for support while using" | |
274 # ewarn "inofficial drivers. Revert to official drivers and retry with untainted hardware" | |
275 # ewarn "if something doesn't work as expected. Additionally, your system may behave" | |
276 # ewarn "unstable." | |
277 # ewarn "" | |
278 # ewarn "Remove USE-flag patch_compat and re-emerge this ebuild immediately before use" | |
279 # ewarn "if you enabled it accidentally." | |
280 # ewarn "" | |
281 # ewarn " *** USE AT YOUR OWN RISK ***" | |
282 #fi | |
283 } | |
284 | |
285 pkg_postrm() { | |
286 udev_reload || ewarn "Reloading udev rules failed, you may want to check this before rebooting!" | |
287 | |
288 # kernel module | |
289 linux-mod_pkg_postrm | |
290 } |