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-9.8.ebuild @ 60:c87f8ad0fc1e

adding ebuild for Blackmagic Desktop Video 9.8
author Daniel Neugebauer <dneuge@energiequant.de>
date Tue, 20 May 2014 23:26:32 +0200
parents
children 33ab6d742b71
comparison
equal deleted inserted replaced
59:c8a52cf20ef3 60:c87f8ad0fc1e
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 inherit linux-mod
7
8 DESCRIPTION="Desktop Video - drivers and tools for products by Blackmagic Design including DeckLink and Intensity"
9 HOMEPAGE="http://www.blackmagicdesign.com/"
10
11 SRC_URI="Blackmagic_Desktop_Video_Linux_${PV}.tar.gz"
12 UNPACKED_DIR="desktopvideo-9.8a2-x86_64"
13
14 #LICENSE="BlackmagicDesktopVideo"
15 SLOT="0"
16 KEYWORDS="~amd64"
17 IUSE="autostart"
18 RESTRICT="fetch"
19
20 DEPEND=""
21 RDEPEND="${DEPEND}"
22
23 # supress QA warnings about stripping etc., i.e. stuff we cannot change since we install prebuilt binaries
24 QA_PREBUILT="opt/blackmagic-desktop-video/usr/bin/* opt/blackmagic-desktop-video/usr/lib/*"
25
26 # for kernel module compilation
27 MODULE_NAMES="blackmagic(misc:${S}/usr/src/desktopvideo-9.8a2:${S}/usr/src/desktopvideo-9.8a2)"
28 BUILD_TARGETS="clean all"
29
30 pkg_nofetch() {
31 einfo "Please visit ${HOMEPAGE} and download \"Desktop Video ${PV} for Linux\""
32 einfo "for your product from the support section and move it to ${DISTDIR}"
33 einfo ""
34 einfo " expected filename: ${SRC_URI}"
35 einfo ""
36 einfo "The license should be shown and has to be accepted before the download"
37 einfo "starts."
38 }
39
40 src_unpack() {
41 unpack ${A}
42
43 cd ${WORKDIR}
44 tar xfz desktopvideo-${PV}-x86_64.tar.gz
45
46 # symlink to what is supposed to have been prepared
47 ln -s ${UNPACKED_DIR} ${P}
48 }
49
50 src_prepare() {
51 return
52 }
53
54 src_compile() {
55 # library/tools are binary but kernel module requires compilation
56 linux-mod_src_compile
57 }
58
59 src_install() {
60 # all pre-built binaries should go into /opt and be symlinked to usr/bin etc.
61 installdir="${D}/opt/blackmagic-desktop-video"
62
63 mkdir -p ${installdir}
64 cp -a ${WORKDIR}/${UNPACKED_DIR}/* ${installdir}/
65
66 symlinks=(
67 'usr/bin/BlackmagicControlPanel'
68 'usr/bin/BlackmagicFirmwareUpdater'
69 'usr/lib/libDeckLinkAPI.so'
70 'usr/lib/libDeckLinkPreviewAPI.so'
71 'usr/lib/blackmagic'
72 'usr/share/applications/BlackmagicControlPanel.desktop'
73 'usr/share/doc/desktopvideo'
74 'usr/share/icons/hicolor/16x16/apps/BlackmagicControlPanel.png'
75 'usr/share/icons/hicolor/32x32/apps/BlackmagicControlPanel.png'
76 'usr/share/icons/hicolor/48x48/apps/BlackmagicControlPanel.png'
77 'usr/share/icons/hicolor/128x128/apps/BlackmagicControlPanel.png'
78 'usr/share/icons/hicolor/256x256/apps/BlackmagicControlPanel.png'
79 )
80
81 for path in "${symlinks[@]}"; do
82 dosym /opt/blackmagic-desktop-video/${path} ${path}
83 done
84
85 # udev rule should be placed in /lib/udev/rules.d instead
86 dosym /opt/blackmagic-desktop-video/etc/udev/rules.d/20-blackmagic.rules /lib/udev/rules.d/20-blackmagic.rules
87
88 # add firmware check to autostart?
89 if use autostart; then
90 dosym /opt/blackmagic-desktop-video/etc/xdg/autostart/blackmagic-firmware-notify.desktop /etc/xdg/autostart/blackmagic-firmware-notify.desktop
91 fi
92
93 # kernel module
94 linux-mod_src_install
95 }
96
97 pkg_postinst() {
98 # kernel module
99 linux-mod_pkg_postinst
100
101 # 12345678901234567890123456789012345678901234567890123456789012345678901234567890
102 einfo ""
103 einfo "Please do *NOT* report any QA errors to Gentoo or Blackmagic!"
104 einfo ""
105 einfo "The kernel module is simply called blackmagic. You may want to modprobe it now"
106 einfo "to see if it works (it should print your devices to kernel log)."
107 einfo ""
108 einfo "Installed tools are BlackmagicFirmwareUpdater and BlackmagicControlPanel."
109 einfo ""
110 if use autostart; then
111 einfo "Automated update check has been installed."
112 else
113 einfo "Automated update check has *not* been installed this time. (set USE flag"
114 einfo "autostart if you want that)"
115 fi
116 einfo ""
117 einfo "If your product is not being recognized, you may need to increase the vmalloc"
118 einfo "limit in your kernel. You can do that by adding e.g. vmalloc=256M to your kernel"
119 einfo "boot line. You can see current usage by running"
120 einfo ""
121 einfo " # grep VmallocUsed /proc/meminfo"
122 einfo ""
123 einfo "We are reloading udev rules now..."
124 /sbin/udevadm control --reload-rules || einfo " ... failed, you may want to check this before rebooting!"
125 }
126
127 pkg_postrm() {
128 # kernel module
129 linux-mod_pkg_postrm
130 }