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.ebuild @ 180:6a6b4b2dc204

Blackmagic: updating Desktop Video + SDK to 10.8, adding check for kernel version to 10.7, bumping download archive in Media Express 3.5.2
author Daniel Neugebauer <dneuge@energiequant.de>
date Thu, 15 Sep 2016 11:00:57 +0200
parents media-libs/blackmagic-desktop-video/blackmagic-desktop-video-10.7.ebuild@a7e9f1aabd14
children
comparison
equal deleted inserted replaced
179:0e11f0586bd5 180:6a6b4b2dc204
1 # Copyright 1999-2016 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.8a2"
17 UNPACKED_DIR="desktopvideo-${DESKTOP_VIDEO_VERSION}-x86_64"
18
19 LICENSE="BlackmagicDesktopVideo"
20 SLOT="0"
21 KEYWORDS="~amd64"
22 IUSE="autostart"
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 3 18; then
59 # # 12345678901234567890123456789012345678901234567890123456789012345678901234567890
60 # ewarn "Your kernel version seems to be unsupported; please consider downgrading to 3.18"
61 # ewarn "if modules don't work."
62 # fi
63 #}
64
65 src_unpack() {
66 unpack ${A}
67
68 cd ${WORKDIR}
69 tar xfz Blackmagic_Desktop_Video_Linux_${PV}/other/x86_64/desktopvideo-${DESKTOP_VIDEO_VERSION}-x86_64.tar.gz
70
71 # symlink to what is supposed to have been prepared
72 ln -s ${UNPACKED_DIR} ${P}
73 }
74
75 #src_prepare() {
76 # epatch "${FILESDIR}/9-8-strict-prototypes.patch"
77 #}
78
79 src_compile() {
80 # library/tools are binary but kernel module requires compilation
81 linux-mod_src_compile
82 }
83
84 src_install() {
85 # all pre-built binaries should go into /opt and be symlinked to usr/bin etc.
86 finalinstalldir="/opt/blackmagic-desktop-video"
87 installdir="${D}${finalinstalldir}"
88
89 mkdir -p ${installdir}
90 cp -a ${WORKDIR}/${UNPACKED_DIR}/* ${installdir}/
91
92 # copy text files (readme and license) from parent directory
93 cp -a ${WORKDIR}/Blackmagic_Desktop_Video_Linux_${PV}/*.txt ${installdir}/
94
95 # there should a blank directory in /etc according to the archive...
96 mkdir -p ${installdir}/etc/blackmagic
97 chmod 755 ${installdir}/etc/blackmagic
98
99 # NOTE: Not linking usr/lib/systemd as I don't use that and thus can't test it...
100 symlinks=(
101 'etc/init.d/DesktopVideoHelper'
102 'usr/bin/BlackmagicDesktopVideoSetup'
103 'usr/bin/BlackmagicFirmwareUpdater'
104 'usr/bin/BlackmagicFirmwareUpdaterGui'
105 'usr/lib/blackmagic'
106 'usr/lib/libDeckLinkAPI.so'
107 'usr/lib/libDeckLinkPreviewAPI.so'
108 'usr/sbin/DesktopVideoHelper'
109 'usr/share/applications/BlackmagicDesktopVideoSetup.desktop'
110 'usr/share/applications/BlackmagicFirmwareUpdaterGui.desktop'
111 'usr/share/doc/desktopvideo'
112 'usr/share/doc/desktopvideo-gui'
113 'usr/share/icons/hicolor/16x16/apps/BlackmagicDesktopVideoSetup.png'
114 'usr/share/icons/hicolor/16x16/apps/BlackmagicFirmwareUpdaterGui.png'
115 'usr/share/icons/hicolor/32x32/apps/BlackmagicDesktopVideoSetup.png'
116 'usr/share/icons/hicolor/32x32/apps/BlackmagicFirmwareUpdaterGui.png'
117 'usr/share/icons/hicolor/48x48/apps/BlackmagicDesktopVideoSetup.png'
118 'usr/share/icons/hicolor/48x48/apps/BlackmagicFirmwareUpdaterGui.png'
119 'usr/share/icons/hicolor/128x128/apps/BlackmagicDesktopVideoSetup.png'
120 'usr/share/icons/hicolor/128x128/apps/BlackmagicFirmwareUpdaterGui.png'
121 'usr/share/icons/hicolor/256x256/apps/BlackmagicDesktopVideoSetup.png'
122 'usr/share/icons/hicolor/256x256/apps/BlackmagicFirmwareUpdaterGui.png'
123 )
124
125 for path in "${symlinks[@]}"; do
126 dosym /opt/blackmagic-desktop-video/${path} ${path}
127 done
128
129 # dneuge: no clue on how to use this...
130 ## QA notice says we should generate a linker script if we don't place libraries in /usr/lib
131 ## see: https://devmanual.gentoo.org/eclass-reference/toolchain-funcs.eclass/index.html
132 #gen_usr_ldscript usr/lib/libDeckLinkAPI.so usr/lib/libDeckLinkPreviewAPI.so
133
134 # don't symlink man-pages, install a copy instead
135 doman usr/share/man/man1/*.1
136
137 # udev rule should be placed in /lib/udev/rules.d instead
138 dosym /opt/blackmagic-desktop-video/etc/udev/rules.d/55-blackmagic.rules /lib/udev/rules.d/55-blackmagic.rules
139
140 # add firmware check to autostart?
141 if use autostart; then
142 dosym /opt/blackmagic-desktop-video/etc/xdg/autostart/BlackmagicFirmwareUpdaterGuiAutoStart.desktop /etc/xdg/autostart/BlackmagicFirmwareUpdaterGuiAutoStart.desktop
143 fi
144
145 # kernel module
146 linux-mod_src_install
147 }
148
149 pkg_postinst() {
150 # kernel module
151 linux-mod_pkg_postinst
152
153 # 12345678901234567890123456789012345678901234567890123456789012345678901234567890
154 einfo ""
155 einfo "Please do *NOT* report any QA errors to Gentoo or Blackmagic!"
156 einfo ""
157 einfo "Kernel modules are blackmagic and blackmagic-io. Try blackmagic if in doubt."
158 einfo "When upgrading, please rmmod both first. Then modprobe blackmagic to see if it"
159 einfo "works (it should print your devices to kernel log)."
160 einfo ""
161 einfo "Installed tools are BlackmagicFirmwareUpdater, BlackmagicFirmwareUpdaterGui and"
162 einfo "BlackmagicDesktopVideoSetup (former BlackmagicDesktopVideoUtility and called"
163 einfo "BlackmagicControlPanel before that)."
164 einfo ""
165 einfo "For Media Express emerge media-video/blackmagic-media-express."
166 einfo ""
167 if use autostart; then
168 einfo "Automated update check has been installed."
169 else
170 einfo "Automated update check has *not* been installed this time. (set USE flag"
171 einfo "autostart if you want that)"
172 fi
173 einfo ""
174 einfo "If your product is not being recognized, there are two common reasons:"
175 einfo ""
176 einfo " 1) You may need to increase the vmalloc limit in your kernel."
177 einfo " This can be done by adding e.g. vmalloc=256M to your kernel boot line. You"
178 einfo " can see current usage by running"
179 einfo ""
180 einfo " # grep VmallocUsed /proc/meminfo"
181 einfo ""
182 einfo " 2) Your firmware may be outdated. Make sure you reload the modules (or simply"
183 einfo " reboot) and then run BlackmagicFirmwareUpdater or, if you prefer,"
184 einfo " BlackmagicFirmwareUpdaterGui"
185 einfo ""
186 einfo "Licenses can be found in: ${finalinstalldir}/usr/share/doc/"
187 einfo ""
188 einfo "We are reloading udev rules now..."
189 /bin/udevadm control --reload-rules || einfo " ... failed, you may want to check this before rebooting!"
190 }
191
192 pkg_postrm() {
193 # kernel module
194 linux-mod_pkg_postrm
195 }