vmware-player-12.1.0.3272444-r2.ebuild 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils versionator readme.gentoo-r1 fdo-mime gnome2-utils pax-utils systemd vmware-bundle
  5. MY_PN="VMware-Player"
  6. MY_PV=$(get_version_component_range 1-3)
  7. PV_MODULES="308.$(get_version_component_range 2-3)"
  8. PV_BUILD=$(get_version_component_range 4)
  9. MY_P="${MY_PN}-${MY_PV}-${PV_BUILD}"
  10. SYSTEMD_UNITS_TAG="gentoo-02"
  11. DESCRIPTION="Emulate a complete PC without the performance overhead of most emulators"
  12. HOMEPAGE="http://www.vmware.com/products/player/"
  13. BASE_URI="https://softwareupdate.vmware.com/cds/vmw-desktop/player/${MY_PV}/${PV_BUILD}/linux/core/"
  14. SRC_URI="
  15. ${BASE_URI}${MY_P}.x86_64.bundle.tar
  16. https://github.com/akhuettel/systemd-vmware/archive/${SYSTEMD_UNITS_TAG}.tar.gz -> vmware-systemd-${SYSTEMD_UNITS_TAG}.tgz
  17. "
  18. LICENSE="vmware GPL-2 GPL-3"
  19. SLOT="0"
  20. KEYWORDS="-* ~amd64"
  21. IUSE="bundled-libs cups doc ovftool +vmware-tools"
  22. RESTRICT="mirror strip preserve-libs"
  23. BUNDLED_LIBS_DIR=/opt/vmware/lib/vmware/lib
  24. BUNDLED_LIBS="
  25. libXau.so.6
  26. libXcomposite.so.1
  27. libXcursor.so.1
  28. libXdamage.so.1
  29. libXdmcp.so.6
  30. libXfixes.so.3
  31. libXft.so.2
  32. libXinerama.so.1
  33. libXrandr.so.2
  34. libXrender.so.1
  35. libaio.so.1
  36. libatk-1.0.so.0
  37. libatkmm-1.6.so.1
  38. libatspi.so.0
  39. libcairo.so.2
  40. libcairomm-1.0.so.1
  41. libcrypto.so.1.0.1
  42. libcurl.so.4
  43. libdbus-1.so.3
  44. libfontconfig.so.1
  45. libfreetype.so.6
  46. libfuse.so.2
  47. libgailutil.so.18
  48. libgcc_s.so.1
  49. libgcrypt.so.11
  50. libgdk-x11-2.0.so.0
  51. libgdk_pixbuf-2.0.so.0
  52. libgdkmm-2.4.so.1
  53. libgio-2.0.so.0
  54. libgiomm-2.4.so.1
  55. libglib-2.0.so.0
  56. libglibmm-2.4.so.1
  57. libglibmm_generate_extra_defs-2.4.so.1
  58. libgmodule-2.0.so.0
  59. libgobject-2.0.so.0
  60. libgpg-error.so.0
  61. libgthread-2.0.so.0
  62. libgtk-x11-2.0.so.0
  63. libgtkmm-2.4.so.1
  64. libpango-1.0.so.0
  65. libpangocairo-1.0.so.0
  66. libpangoft2-1.0.so.0
  67. libpangomm-1.4.so.1
  68. libpangox-1.0.so.0
  69. libpangoxft-1.0.so.0
  70. libpcsclite.so.1
  71. libpixman-1.so.0
  72. libpng12.so.0
  73. librsvg-2.so.2
  74. libsigc-2.0.so.0
  75. libssl.so.1.0.1
  76. libstdc++.so.6
  77. libxml2.so.2
  78. libz.so.1
  79. "
  80. BUNDLED_LIB_DEPENDS="
  81. app-accessibility/at-spi2-core
  82. dev-cpp/atkmm
  83. dev-cpp/cairomm
  84. dev-cpp/glibmm:2
  85. dev-cpp/gtkmm:2.4
  86. dev-cpp/pangomm
  87. dev-libs/atk
  88. dev-libs/glib:2
  89. dev-libs/libaio
  90. dev-libs/libgcrypt:11/11
  91. dev-libs/libgpg-error
  92. dev-libs/libsigc++:2
  93. dev-libs/libxml2
  94. dev-libs/openssl:0
  95. gnome-base/librsvg:2
  96. media-libs/fontconfig
  97. media-libs/freetype
  98. media-libs/libpng:1.2
  99. net-misc/curl
  100. sys-apps/dbus
  101. sys-apps/pcsc-lite
  102. sys-fs/fuse
  103. sys-libs/zlib
  104. x11-libs/cairo
  105. x11-libs/gdk-pixbuf:2
  106. x11-libs/gtk+:2
  107. x11-libs/libXau
  108. x11-libs/libXcomposite
  109. x11-libs/libXcursor
  110. x11-libs/libXdamage
  111. x11-libs/libXdmcp
  112. x11-libs/libXfixes
  113. x11-libs/libXft
  114. x11-libs/libXinerama
  115. x11-libs/libXrandr
  116. x11-libs/libXrender
  117. x11-libs/pango
  118. x11-libs/pangox-compat
  119. x11-libs/pixman
  120. "
  121. # vmware should not use virtual/libc as this is a
  122. # precompiled binary package thats linked to glibc.
  123. RDEPEND="
  124. app-arch/bzip2
  125. dev-libs/dbus-glib
  126. dev-libs/expat
  127. dev-libs/gmp:0
  128. dev-libs/icu
  129. dev-libs/json-c
  130. dev-libs/libcroco
  131. dev-libs/libffi
  132. dev-libs/libgcrypt:0/20
  133. dev-libs/libtasn1:0/6
  134. dev-libs/nettle:0/6
  135. gnome-base/gconf
  136. gnome-base/libgnome-keyring
  137. media-gfx/graphite2
  138. media-libs/alsa-lib
  139. media-libs/harfbuzz:0/0.9.18
  140. media-libs/libart_lgpl
  141. media-libs/libpng:0
  142. media-libs/libvorbis
  143. media-libs/mesa
  144. net-dns/libidn
  145. net-libs/gnutls
  146. net-print/cups
  147. sys-apps/tcp-wrappers
  148. sys-apps/util-linux
  149. x11-libs/libICE
  150. x11-libs/libSM
  151. x11-libs/libX11
  152. x11-libs/libXext
  153. x11-libs/libXi
  154. x11-libs/libXtst
  155. x11-libs/libXxf86vm
  156. x11-libs/libdrm
  157. x11-libs/libxcb
  158. x11-libs/libxshmfence
  159. x11-libs/startup-notification
  160. x11-libs/xcb-util
  161. x11-themes/hicolor-icon-theme
  162. bundled-libs? (
  163. media-libs/jbigkit:0/2.1
  164. media-libs/tiff:3
  165. virtual/jpeg:62
  166. )
  167. !bundled-libs? ( ${BUNDLED_LIB_DEPENDS} )
  168. !app-emulation/vmware-workstation
  169. "
  170. PDEPEND="~app-emulation/vmware-modules-${PV_MODULES}
  171. vmware-tools? ( app-emulation/vmware-tools )"
  172. DEPEND=">=dev-util/patchelf-0.9"
  173. S=${WORKDIR}
  174. VM_INSTALL_DIR="/opt/vmware"
  175. QA_PREBUILT="/opt/*"
  176. QA_WX_LOAD="opt/vmware/lib/vmware/tools-upgraders/vmware-tools-upgrader-32 opt/vmware/lib/vmware/bin/vmware-vmx-stats opt/vmware/lib/vmware/bin/vmware-vmx-debug opt/vmware/lib/vmware/bin/vmware-vmx"
  177. src_unpack() {
  178. default
  179. local bundle=${MY_P}.x86_64.bundle
  180. local component; for component in \
  181. vmware-player \
  182. vmware-player-app \
  183. vmware-player-setup \
  184. vmware-vmx \
  185. vmware-network-editor \
  186. vmware-usbarbitrator
  187. do
  188. vmware-bundle_extract-bundle-component "${bundle}" "${component}" "${S}"
  189. done
  190. if use ovftool; then
  191. vmware-bundle_extract-bundle-component "${bundle}" vmware-ovftool
  192. fi
  193. }
  194. clean_bundled_libs() {
  195. einfo "Removing bundled libraries"
  196. for libname in ${BUNDLED_LIBS} ; do
  197. rm -rv "${S}"/lib/lib/${libname} || die "Failed removing bundled ${libname}"
  198. done
  199. rm -rv "${S}"/lib/libconf || die "Failed removing bundled gtk conf libs"
  200. # Among the bundled libs there are libcrypto.so.1.0.1 and libssl.so.1.0.1
  201. # (needed by libcds.so) which seem to be compiled from openssl-1.0.1h.
  202. # Upstream real sonames are *so.1.0.0 so it's necessary to fix DT_NEEDED link
  203. # in libcds.so to be able to use system libs.
  204. pushd >/dev/null .
  205. cd "${S}"/lib/lib/libcds.so
  206. einfo "Patching libcds.so"
  207. patchelf --replace-needed libssl.so.1.0.{1,0} \
  208. --replace-needed libcrypto.so.1.0.{1,0} \
  209. libcds.so
  210. popd >/dev/null
  211. # vmware-player seems to use a custom version of libgksu2.so, for this reason
  212. # we leave the bundled version. The libvmware-gksu.so library declares simply DT_NEEDED
  213. # libgksu2.so.0 but it uses at runtime the bundled version, patch the lib to avoid portage
  214. # preserve-libs mechanism to be triggered when a system lib is available (but not required)
  215. pushd >/dev/null .
  216. cd "${S}"/lib/lib/libvmware-gksu.so
  217. einfo "Patching libvmware-gksu.so"
  218. patchelf --set-rpath "\$ORIGIN/../libgksu2.so.0" \
  219. libvmware-gksu.so
  220. popd >/dev/null
  221. }
  222. src_prepare() {
  223. rm -f bin/vmware-modconfig
  224. rm -rf lib/modules/binary
  225. # Bug 459566
  226. mv lib/libvmware-netcfg.so lib/lib/
  227. if ! use bundled-libs ; then
  228. clean_bundled_libs
  229. fi
  230. DOC_CONTENTS="
  231. /etc/env.d is updated during ${PN} installation. Please run:\n
  232. env-update && source /etc/profile\n
  233. Before you can use ${PN}, you must configure a default network setup.
  234. You can do this by running 'emerge --config ${PN}'.\n
  235. To be able to run ${PN} your user must be in the vmware group.\n
  236. You MUST set USE=bundled-libs if you are running gcc-5, otherwise vmware will not start.
  237. "
  238. }
  239. src_install() {
  240. local major_minor=$(get_version_component_range 1-2 "${PV}")
  241. # revdep-rebuild entry
  242. insinto /etc/revdep-rebuild
  243. echo "SEARCH_DIRS_MASK=\"${VM_INSTALL_DIR}\"" >> ${T}/10${PN}
  244. doins "${T}"/10${PN}
  245. # install the binaries
  246. into "${VM_INSTALL_DIR}"
  247. dobin bin/*
  248. # install the libraries
  249. insinto "${VM_INSTALL_DIR}"/lib/vmware
  250. doins -r lib/*
  251. # workaround for hardcoded search paths needed during shared objects loading
  252. if ! use bundled-libs ; then
  253. dosym /usr/$(get_libdir)/libglib-2.0.so.0 \
  254. "${VM_INSTALL_DIR}"/lib/vmware/lib/libglib-2.0.so.0/libglib-2.0.so.0
  255. # Bug 432918
  256. dosym /usr/$(get_libdir)/libcrypto.so.1.0.0 \
  257. "${VM_INSTALL_DIR}"/lib/vmware/lib/libcrypto.so.1.0.1/libcrypto.so.1.0.1
  258. dosym /usr/$(get_libdir)/libssl.so.1.0.0 \
  259. "${VM_INSTALL_DIR}"/lib/vmware/lib/libssl.so.1.0.1/libssl.so.1.0.1
  260. fi
  261. # install the ancillaries
  262. insinto /usr
  263. doins -r share
  264. if use cups; then
  265. exeinto $(cups-config --serverbin)/filter
  266. doexe extras/thnucups
  267. insinto /etc/cups
  268. doins -r etc/cups/*
  269. fi
  270. if use doc; then
  271. dodoc doc/*
  272. fi
  273. exeinto "${VM_INSTALL_DIR}"/lib/vmware/setup
  274. doexe vmware-config
  275. # install ovftool
  276. if use ovftool; then
  277. cd "${S}"
  278. insinto "${VM_INSTALL_DIR}"/lib/vmware-ovftool
  279. doins -r vmware-ovftool/*
  280. chmod 0755 "${D}${VM_INSTALL_DIR}"/lib/vmware-ovftool/{ovftool,ovftool.bin}
  281. dosym "${D}${VM_INSTALL_DIR}"/lib/vmware-ovftool/ovftool "${VM_INSTALL_DIR}"/bin/ovftool
  282. fi
  283. # create symlinks for the various tools
  284. local tool ; for tool in thnuclnt vmplayer{,-daemon} \
  285. vmware-{acetool,modconfig{,-console},gksu,fuseUI} ; do
  286. dosym appLoader "${VM_INSTALL_DIR}"/lib/vmware/bin/"${tool}"
  287. done
  288. dosym "${VM_INSTALL_DIR}"/lib/vmware/bin/vmplayer "${VM_INSTALL_DIR}"/bin/vmplayer
  289. dosym "${VM_INSTALL_DIR}"/lib/vmware/icu /etc/vmware/icu
  290. # fix permissions
  291. fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/bin/{appLoader,fusermount,launcher.sh,mkisofs,vmware-remotemks}
  292. fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/lib/wrapper-gtk24.sh
  293. fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/lib/libgksu2.so.0/gksu-run-helper
  294. fperms 4711 "${VM_INSTALL_DIR}"/lib/vmware/bin/vmware-vmx{,-debug,-stats}
  295. pax-mark -m "${D}${VM_INSTALL_DIR}"/lib/vmware/bin/vmware-vmx
  296. # create the environment
  297. local envd="${T}/90vmware"
  298. cat > "${envd}" <<-EOF
  299. PATH='${VM_INSTALL_DIR}/bin'
  300. ROOTPATH='${VM_INSTALL_DIR}/bin'
  301. EOF
  302. use bundled-libs && echo 'VMWARE_USE_SHIPPED_LIBS=1' >> "${envd}"
  303. doenvd "${envd}"
  304. # create the configuration
  305. dodir /etc/vmware
  306. cat > "${D}"/etc/vmware/bootstrap <<-EOF
  307. BINDIR='${VM_INSTALL_DIR}/bin'
  308. LIBDIR='${VM_INSTALL_DIR}/lib'
  309. EOF
  310. cat > "${D}"/etc/vmware/config <<-EOF
  311. bindir = "${VM_INSTALL_DIR}/bin"
  312. libdir = "${VM_INSTALL_DIR}/lib/vmware"
  313. initscriptdir = "/etc/init.d"
  314. authd.fullpath = "${VM_INSTALL_DIR}/sbin/vmware-authd"
  315. gksu.rootMethod = "su"
  316. VMCI_CONFED = "yes"
  317. VMBLOCK_CONFED = "yes"
  318. VSOCK_CONFED = "yes"
  319. NETWORKING = "yes"
  320. player.product.version = "${MY_PV}"
  321. product.buildNumber = "${PV_BUILD}"
  322. EOF
  323. # install the init.d script
  324. local initscript="${T}/vmware.rc"
  325. sed -e "s:@@BINDIR@@:${VM_INSTALL_DIR}/bin:g" \
  326. "${FILESDIR}/vmware-${major_minor}.rc" > "${initscript}" || die
  327. newinitd "${initscript}" vmware
  328. # fill in variable placeholders
  329. if use bundled-libs ; then
  330. sed -e "s:@@LIBCONF_DIR@@:${VM_INSTALL_DIR}/lib/vmware/libconf:g" \
  331. -i "${D}${VM_INSTALL_DIR}"/lib/vmware/libconf/etc/{gtk-2.0/{gdk-pixbuf.loaders,gtk.immodules},pango/pango{.modules,rc}} || die
  332. fi
  333. sed -e "s:@@BINARY@@:${VM_INSTALL_DIR}/bin/vmplayer:g" \
  334. -e "/^Encoding/d" \
  335. -i "${D}/usr/share/applications/vmware-player.desktop" || die
  336. # install systemd unit files
  337. systemd_dounit "${WORKDIR}/systemd-vmware-${SYSTEMD_UNITS_TAG}/"*.{service,target}
  338. readme.gentoo_create_doc
  339. }
  340. pkg_config() {
  341. "${VM_INSTALL_DIR}"/bin/vmware-networks --postinstall ${PN},old,new
  342. }
  343. pkg_preinst() {
  344. gnome2_icon_savelist
  345. }
  346. pkg_postinst() {
  347. fdo-mime_desktop_database_update
  348. gnome2_icon_cache_update
  349. readme.gentoo_print_elog
  350. ewarn "${P} is using an old version of libgcrypt library which"
  351. ewarn "is going to be soon removed from portage due to security reasons"
  352. ewarn "(see https://bugs.gentoo.org/show_bug.cgi?id=541564)."
  353. ewarn "Until vmware is fixed upstream you're exposed to security issues!"
  354. }
  355. pkg_prerm() {
  356. einfo "Stopping ${PN} for safe unmerge"
  357. /etc/init.d/vmware stop
  358. }
  359. pkg_postrm() {
  360. fdo-mime_desktop_database_update
  361. gnome2_icon_cache_update
  362. }