aboutsummaryrefslogtreecommitdiff
blob: eb826bb45b90f8aff16f715bfbeff61d662fcb9e (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=5

DESCRIPTION="Binary version of VMware horizon client"
HOMEPAGE="https://my.vmware.com/web/vmware/info/slug/desktop_end_user_computing/vmware_horizon_clients/4_0"
SRC_URI="https://download3.vmware.com/software/view/viewclients/CART16Q3/VMware-Horizon-Client-4.2.0-4329640.x64.bundle"

LICENSE="vmware"
SLOT="0"
KEYWORDS="~amd64 ~x86"

DEPEND=""
RDEPEND=""

src_unpack() {
	mkdir ${S}               # Create source dir
	cp ${DISTDIR}/${A} ${S}  # Copy the distfile to the source dir - symlink won't execute
	chmod +x ${S}/${A}       # Make the distdir executable
	cd ${S}
	./${A} -x extract/
}

src_prepare() {
	# Arch PKGBUILD build() function:

	# This is a dirty hack, but it works.
	# Change dynamic section in ELF files to fix dynamic linking.
	# Make sure the length is not changed!
	#	libudev.so.0 -> libudev.so.1
	#
	# for system openssl:
	#	libssl.so.1.0.[12] -> libssl.so.1.0.0
	#	libcrypto.so.1.0.[12] -> libcrypto.so.1.0.0
	#
	# for bundled openssl - we use uncommon name to make sure no other application will care:
	#	libssl.so.1.0.[12] -> libssl-vmw.so.0
	#	libcrypto.so.1.0.[12] -> libcrypto-vmw.so.0

	cd extract
	for bundle in vmware-horizon-*; do
		echo "Patching ${bundle}..."
		for FILE in $(find "${bundle}" -type f); do
			# executables and libraries only
			file --mime "${FILE}" | egrep -q "(application/x-(executable|sharedlib)|text/x-shellscript)" || continue

			# make executable
			chmod +x "${FILE}"

			# ELF executables and libraries only
			file --mime "${FILE}" | egrep -q "application/x-(executable|sharedlib)" || continue

			# link against libudev.so.1
			sed -i -e 's/libudev.so.0/libudev.so.1/' "${FILE}"

			# even openssl 1.0.[12].x has library file names ending in .so.1.0.0
			if [ ${_USE_BUNDLED_OPENSSL:=0} -eq 0 -o "${bundle}" = 'vmware-horizon-client' ]; then
				sed -i -e 's/libssl.so.1.0.[12]/libssl.so.1.0.0/' \
					-e 's/libcrypto.so.1.0.[12]/libcrypto.so.1.0.0/' \
					"${FILE}"
			else
				# Some files link against openssl...
				# Use the bundled version there.
				sed -i -e 's/libssl.so.1.0.[012]/libssl-vmw.so.0/' \
					-e 's/libcrypto.so.1.0.[012]/libcrypto-vmw.so.0/' \
					"${FILE}"
			fi
		done
	done

	# now that we fixed dynamic linking, remove the libraries provided by the package...
	rm -f vmware-horizon-pcoip/pcoip/lib/vmware/lib{crypto,ssl}.so.1.0.2
}

src_install() {
	# Following the Arch Linux package build for v4.1.0

	# Client:
	cd ${S}/extract/vmware-horizon-client/
	dobin bin/*
	exeinto usr/lib/vmware/view/bin/
	doexe lib/vmware/view/bin/vmware-view
	insinto usr/share
	doins -r share/*
	dodoc doc/*
	dodoc debug/*

	# PCOIP:
	cd ${S}/extract/vmware-horizon-pcoip/pcoip/
	dobin bin/*
	insinto usr/lib/
	doins -r lib/*

	# Real-time audio/video:
	cd ${S}/extract/vmware-horizon-rtav/
	insinto usr/lib/
	doins -r lib/*

	# Smartcard:
	cd ${S}/extract/vmware-horizon-smartcard/
	insinto usr/lib/
	doins -r lib/*

	# USB redirection:
	cd ${S}/extract/vmware-horizon-usb/
	exeinto usr/lib/vmware/view/usb/
	doexe bin/*
	# Note: no init scripts

	# Virtual printing:
	cd ${S}/extract/vmware-horizon-virtual-printing/
	exeinto usr/lib/vmware/view/usb/
	doexe bin/*
	dobin bin/x86_64-linux-NOSSL/thnu*  # Specific for amd64
	exeinto etc/thnuclnt/
	doexe bin/x86_64-linux-NOSSL/.thnumod  # Specific for amd64
	exeinto usr/lib/vmware/rdpvcbridge/
	doexe lib/tprdp.so
	insinto usr/share/cups/mime/
	doins bin/conf/thnuclnt.convs bin/conf/thnuclnt.types
	# Note: no Arch service file
}

pkg_postinst() {
	ewarn "This is an experimental ebuild.  Use at your own risk!"
}