summaryrefslogtreecommitdiff
path: root/x11-drivers/displaylink-driver/displaylink-driver-5.1.26.ebuild
blob: 160cad1bc491bc82ff064166783ce2dd7cb077f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# from https://git.hossie.de/projects/GEN/repos/gentoo-overlay/browse/x11-drivers/displaylink-driver
# Distributed under the terms of the GNU General Public License v2
 
EAPI=6
 
inherit eutils systemd udev unpacker
 
DESCRIPTION="DisplayLink USB Graphics Software"
HOMEPAGE="http://www.displaylink.com/downloads/ubuntu"
SRC_URI="${P}.zip"
 
LICENSE="DisplayLink"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE="systemd"
 
QA_PREBUILT="/opt/displaylink/DisplayLinkManager"
RESTRICT="fetch"
 
DEPEND="app-admin/chrpath"
RDEPEND=">=sys-devel/gcc-4.8.3
=x11-drivers/evdi-1.6*
virtual/libusb:1
|| ( x11-drivers/xf86-video-modesetting >=x11-base/xorg-server-1.17.0 )
!systemd? ( sys-power/pm-utils )"
 
pkg_nofetch() {
einfo "Please download DisplayLink USB Graphics Software for Ubuntu 5.1.zip from"
einfo "http://www.displaylink.com/downloads/ubuntu"
einfo "and rename it to ${P}.zip"
}
 
src_unpack() {
default
sh ./"${PN}"-"${PV}".run --noexec --nox11 --target "${P}"
}
 
src_install() {
if [[ ( $(gcc-major-version) -eq 5 && $(gcc-minor-version) -ge 1 ) || $(gcc-major-version) -gt 5 ]]; then
MY_UBUNTU_VERSION=1604
else
MY_UBUNTU_VERSION=1404
fi
 
einfo "Using package for Ubuntu ${MY_UBUNTU_VERSION} based on your gcc version: $(gcc-version)"
 
case "${ARCH}" in
amd64) MY_ARCH="x64" ;;
*) MY_ARCH="${ARCH}" ;;
esac
 
DLM="${S}/${MY_ARCH}-ubuntu-${MY_UBUNTU_VERSION}/DisplayLinkManager"
 
dodir /opt/displaylink
keepdir /var/log/displaylink
 
exeinto /opt/displaylink
chrpath -d "${DLM}"
doexe "${DLM}"
 
insinto /opt/displaylink
doins *.spkg
 
udev_dorules "${FILESDIR}/99-displaylink.rules"
 
insinto /opt/displaylink
insopts -m0755
newins "${FILESDIR}/udev.sh" udev.sh
if use systemd; then
newins "${FILESDIR}/pm-systemd-displaylink" suspend.sh
dosym /opt/displaylink/suspend.sh /lib/systemd/system-sleep/displaylink.sh
systemd_dounit "${FILESDIR}/dlm.service"
else
newins "${FILESDIR}/pm-displaylink" suspend.sh
dosym /opt/displaylink/suspend.sh /etc/pm/sleep.d/displaylink.sh
newinitd "${FILESDIR}/rc-displaylink-1.3" dlm
fi
}
 
pkg_postinst() {
einfo "The DisplayLinkManager Init is now called dlm"
einfo ""
einfo "You should be able to use xrandr as follows:"
einfo "xrandr --setprovideroutputsource 1 0"
einfo "Repeat for more screens, like:"
einfo "xrandr --setprovideroutputsource 2 0"
einfo "Then, you can use xrandr or GUI tools like arandr to configure the screens, e.g."
einfo "xrandr --output DVI-1-0 --auto"
}