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.2.2.ebuild @ 243:4e2200ed1559
[sync] imported e80c7f6..6937046 from upstream
commit 6937046afd9a4ffd479050a295c1d38796917df7
Author: Daniel Neugebauer <dneuge@energiequant.de>
Date: Fri Mar 4 19:34:16 2022 +0100
updates BlackMagic ebuilds to Desktop Video 12.2.2 release
ebuild changes include:
- switch to EAPI 8 (no changes needed)
- updated/completed dependencies
- added "desktop" USE flag to control dependencies only relevant
for desktop applications
- doc install location is now correct package name
- ... installed as a copy to leave original contents in /opt,
symlinking with correct name was not possible
- xdg MIME database now gets updated for MediaExpress
author | Migration Sync <gentoo-overlay@megacoffee.net> |
---|---|
date | Fri, 04 Mar 2022 18:45:02 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
242:1f4acc9d6241 | 243:4e2200ed1559 |
---|---|
1 # Copyright 1999-2022 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 | |
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.2.2" | |
17 DESKTOP_VIDEO_VERSION="12.2.2a6" | |
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 +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=4 | |
67 #PATCH_COMPAT_MAX_MINOR=10 | |
68 | |
69 #OFFICIAL_COMPAT_MAX_MAJOR=4 | |
70 #OFFICIAL_COMPAT_MAX_MINOR=9 | |
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 # if kernel_is -gt 4 9; then | |
135 # epatch "${FILESDIR}/10_9_0__4_10_get_user_pages_remote.patch" | |
136 # fi | |
137 # fi | |
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 don't use that and thus can't test it... | |
161 symlinks=( | |
162 'etc/init.d/DesktopVideoHelper' | |
163 'usr/bin/BlackmagicDesktopVideoSetup' | |
164 'usr/bin/DesktopVideoUpdateTool' | |
165 'usr/bin/DesktopVideoUpdater' | |
166 'usr/lib/blackmagic' | |
167 'usr/lib/libDeckLinkAPI.so' | |
168 'usr/lib/libDeckLinkPreviewAPI.so' | |
169 'usr/share/applications/BlackmagicDesktopVideoSetup.desktop' | |
170 'usr/share/applications/DesktopVideoUpdater.desktop' | |
171 'usr/share/icons/hicolor/16x16/apps/BlackmagicDesktopVideoSetup.png' | |
172 'usr/share/icons/hicolor/16x16/apps/DesktopVideoUpdater.png' | |
173 'usr/share/icons/hicolor/32x32/apps/BlackmagicDesktopVideoSetup.png' | |
174 'usr/share/icons/hicolor/32x32/apps/DesktopVideoUpdater.png' | |
175 'usr/share/icons/hicolor/48x48/apps/BlackmagicDesktopVideoSetup.png' | |
176 'usr/share/icons/hicolor/48x48/apps/DesktopVideoUpdater.png' | |
177 'usr/share/icons/hicolor/128x128/apps/BlackmagicDesktopVideoSetup.png' | |
178 'usr/share/icons/hicolor/128x128/apps/DesktopVideoUpdater.png' | |
179 'usr/share/icons/hicolor/256x256/apps/BlackmagicDesktopVideoSetup.png' | |
180 'usr/share/icons/hicolor/256x256/apps/DesktopVideoUpdater.png' | |
181 ) | |
182 | |
183 for path in "${symlinks[@]}"; do | |
184 dosym /opt/blackmagic-desktop-video/${path} ${path} | |
185 done | |
186 | |
187 # copy but do not compress documentation | |
188 # reason for having it twice (in /opt and /usr): | |
189 # - symlinking with original directory names causes a QA notice as we should use our package name | |
190 # - symlinking with our package name causes some weird sandbox violation | |
191 docompress -x /usr/share/doc | |
192 docinto desktopvideo | |
193 dodoc -r ${finalinstalldir}/usr/share/doc/desktopvideo/* | |
194 docinto desktopvideo-gui | |
195 dodoc -r ${finalinstalldir}/usr/share/doc/desktopvideo-gui/* | |
196 | |
197 # dneuge: no clue on how to use this... | |
198 ## QA notice says we should generate a linker script if we don't place libraries in /usr/lib | |
199 ## see: https://devmanual.gentoo.org/eclass-reference/toolchain-funcs.eclass/index.html | |
200 #gen_usr_ldscript usr/lib/libDeckLinkAPI.so usr/lib/libDeckLinkPreviewAPI.so | |
201 | |
202 # don't symlink man-pages, install a copy instead | |
203 # NOTE: DesktopVideoHelper appears to have disappeared, so we won't install the man page either | |
204 doman usr/share/man/man1/BlackmagicDesktopVideoSetup.1 | |
205 doman usr/share/man/man1/BlackmagicFirmwareUpdater.1 | |
206 doman usr/share/man/man1/DesktopVideoHelper.1 | |
207 doman usr/share/man/man1/DesktopVideoUpdateTool.1 | |
208 doman usr/share/man/man1/DesktopVideoUpdater.1 | |
209 | |
210 # udev rules should be placed in /lib/udev/rules.d instead | |
211 dosym /opt/blackmagic-desktop-video/etc/udev/rules.d/55-blackmagic.rules /lib/udev/rules.d/55-blackmagic.rules | |
212 | |
213 # add firmware check to autostart? | |
214 if use autostart; then | |
215 dosym /opt/blackmagic-desktop-video/etc/xdg/autostart/DesktopVideoUpdaterAutoStart.desktop /etc/xdg/autostart/DesktopVideoUpdaterAutoStart.desktop | |
216 fi | |
217 | |
218 # kernel module | |
219 linux-mod_src_install | |
220 } | |
221 | |
222 pkg_postinst() { | |
223 # kernel module | |
224 linux-mod_pkg_postinst | |
225 | |
226 # 12345678901234567890123456789012345678901234567890123456789012345678901234567890 | |
227 einfo "" | |
228 einfo "Please do *NOT* report any QA errors to Gentoo or Blackmagic!" | |
229 einfo "" | |
230 einfo "Kernel modules are blackmagic and blackmagic-io. Try blackmagic if in doubt." | |
231 einfo "When upgrading, please rmmod both first. Then modprobe blackmagic to see if it" | |
232 einfo "works (it should print your devices to kernel log)." | |
233 einfo "" | |
234 einfo "Installed tools are DesktopVideoUpdateTool (CLI), DesktopVideoUpdater (GUI) and" | |
235 einfo "BlackmagicDesktopVideoSetup." | |
236 einfo "" | |
237 einfo "For Media Express emerge media-video/blackmagic-media-express." | |
238 einfo "" | |
239 if use autostart; then | |
240 einfo "Automated firmware update check has been installed." | |
241 else | |
242 einfo "Automated firmware update check has *not* been installed this time." | |
243 einfo "(set USE flag autostart if you want that)" | |
244 fi | |
245 einfo "" | |
246 einfo "If your product is not being recognized, there are two common reasons:" | |
247 einfo "" | |
248 einfo " 1) You may need to increase the vmalloc limit in your kernel." | |
249 einfo " This can be done by adding e.g. vmalloc=256M to your kernel boot line. You" | |
250 einfo " can see current usage by running" | |
251 einfo "" | |
252 einfo " # grep VmallocUsed /proc/meminfo" | |
253 einfo "" | |
254 einfo " 2) Your firmware may be outdated. Make sure you reload the modules (or simply" | |
255 einfo " reboot) and then run DesktopVideoUpdateTool (CLI) or, if you prefer," | |
256 einfo " DesktopVideoUpdater (GUI)" | |
257 einfo "" | |
258 einfo "Licenses can be found in: ${finalinstalldir}/usr/share/doc/" | |
259 einfo "" | |
260 einfo "We are reloading udev rules now..." | |
261 /bin/udevadm control --reload-rules || einfo " ... 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 # kernel module | |
287 linux-mod_pkg_postrm | |
288 } |