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.8.4.ebuild @ 195:99358bd23968

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