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