dev-python/pytest: arm64 stable (bug #723996)
[gentoo.git] / app-emulation / crossover-bin / crossover-bin-18.5.0-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 PYTHON_COMPAT=( python2_7 )
6 PYTHON_REQ_USE="threads"
7
8 inherit python-single-r1 unpacker
9
10 DESCRIPTION="Commercial version of app-emulation/wine with paid support."
11 HOMEPAGE="https://www.codeweavers.com/products/"
12 SRC_URI="https://media.codeweavers.com/pub/crossover/cxlinux/demo/install-crossover-${PV}.bin"
13
14 LICENSE="CROSSOVER-3"
15 SLOT="0"
16 KEYWORDS="-* ~amd64 ~x86"
17 IUSE="+capi +cups doc +gphoto2 +gsm +jpeg +lcms ldap +mp3 +nls +openal +opencl +opengl +pcap +png scanner +ssl +v4l +vulkan"
18 REQUIRED_USE=${PYTHON_REQUIRED_USE}
19 RESTRICT="bindist test"
20
21 QA_FLAGS_IGNORED="opt/cxoffice/.*"
22 QA_PRESTRIPPED="
23         opt/cxoffice/lib/.*
24         opt/cxoffice/lib64/.*
25         opt/cxoffice/bin/cxburner
26         opt/cxoffice/bin/cxntlm_auth
27         opt/cxoffice/bin/wineserver
28         opt/cxoffice/bin/wineserver32
29         opt/cxoffice/bin/wineserver64
30         opt/cxoffice/bin/wine64-preloader
31         opt/cxoffice/bin/unrar
32         opt/cxoffice/bin/wine-preloader
33         opt/cxoffice/bin/cxdiag
34         opt/cxoffice/bin/cxdiag64
35         opt/cxoffice/bin/cxgettext
36         opt/cxoffice/bin/wineloader
37         opt/cxoffice/bin/wineloader64
38 "
39
40 S="${WORKDIR}"
41
42 DEPEND=""
43 BDEPEND="${PYTHON_DEPS}
44         dev-lang/perl
45         app-arch/unzip
46 "
47
48 RDEPEND="${DEPEND}
49         ${PYTHON_DEPS}
50         !prefix? ( sys-libs/glibc )
51         $(python_gen_cond_dep '
52                 >=dev-python/pygtk-2.10:2[${PYTHON_MULTI_USEDEP}]
53                 dev-python/dbus-python[${PYTHON_MULTI_USEDEP}]
54         ')
55         !app-emulation/crossover-office-pro-bin
56         !app-emulation/crossover-office-bin
57         capi? ( net-libs/libcapi[abi_x86_32(-)] )
58         cups? ( net-print/cups[abi_x86_32(-)] )
59         gsm? ( media-sound/gsm[abi_x86_32(-)] )
60         jpeg? ( virtual/jpeg:0[abi_x86_32(-)] )
61         lcms? ( media-libs/lcms:2 )
62         ldap? ( net-nds/openldap[abi_x86_32(-)] )
63         gphoto2? ( media-libs/libgphoto2[abi_x86_32(-)] )
64         mp3? ( >=media-sound/mpg123-1.5.0[abi_x86_32(-)] )
65         nls? ( sys-devel/gettext[abi_x86_32(-)] )
66         openal? ( media-libs/openal[abi_x86_32(-)] )
67         opencl? ( virtual/opencl[abi_x86_32(-)] )
68         opengl? (
69                 virtual/glu[abi_x86_32(-)]
70                 virtual/opengl[abi_x86_32(-)]
71         )
72         pcap? ( net-libs/libpcap[abi_x86_32(-)] )
73         png? ( media-libs/libpng:0[abi_x86_32(-)] )
74         scanner? ( media-gfx/sane-backends[abi_x86_32(-)] )
75         ssl? ( net-libs/gnutls:0/30[abi_x86_32(-)] )
76         v4l? ( media-libs/libv4l[abi_x86_32(-)] )
77         vulkan? ( media-libs/vulkan-loader[abi_x86_32(-)] )
78         dev-util/desktop-file-utils
79         media-libs/alsa-lib[abi_x86_32(-)]
80         media-libs/freetype:2[abi_x86_32(-)]
81         media-libs/mesa[abi_x86_32(-)]
82         media-libs/tiff:0[abi_x86_32(-)]
83         sys-auth/nss-mdns[abi_x86_32(-)]
84         sys-apps/util-linux[abi_x86_32(-)]
85         sys-libs/ncurses-compat:5[abi_x86_32(-)]
86         sys-libs/zlib[abi_x86_32(-)]
87         x11-libs/libICE[abi_x86_32(-)]
88         x11-libs/libSM[abi_x86_32(-)]
89         x11-libs/libX11[abi_x86_32(-)]
90         x11-libs/libXau[abi_x86_32(-)]
91         x11-libs/libXdmcp[abi_x86_32(-)]
92         x11-libs/libXext[abi_x86_32(-)]
93         x11-libs/libXi[abi_x86_32(-)]
94         x11-libs/libXrandr[abi_x86_32(-)]
95         x11-libs/libXxf86vm[abi_x86_32(-)]
96         x11-libs/libxcb[abi_x86_32(-)]
97 "
98
99 pkg_nofetch() {
100         einfo "Please visit ${HOMEPAGE}"
101         einfo "and place ${A} into your DISTDIR directory"
102 }
103
104 src_unpack() {
105         # self unpacking zip archive; unzip warns about the exe stuff
106         unpack_zip ${A}
107 }
108
109 src_prepare() {
110         default
111         python_fix_shebang .
112
113         sed -i \
114                 -e "s:xdg_install_icons(:&\"${ED}\".:" \
115                 -e "s:\"\(.*\)/applications:\"${ED}\1/applications:" \
116                 -e "s:\"\(.*\)/desktop-directories:\"${ED}\1/desktop-directories:" \
117                 "${S}/lib/perl/CXMenuXDG.pm"
118
119         # Remove unnecessary files
120         rm -r license.txt guis/ || die "Could not remove files"
121         use doc || rm -r doc/ || die "Could not remove files"
122 }
123
124 src_install() {
125         # Install crossover symlink, bug #476314
126         dosym ../cxoffice/bin/crossover /opt/bin/crossover
127
128         # Install documentation
129         dodoc README changelog.txt
130         rm README changelog.txt || die "Could not remove README and changelog.txt"
131
132         # Install files
133         dodir /opt/cxoffice
134         #cp -r ./* "${ED}/opt/cxoffice" \
135         find . | cpio -dumpl "${ED}/opt/cxoffice" 2>/dev/null \
136                 || die "Could not install into ${ED}/opt/cxoffice"
137
138         # Install configuration file
139         insinto /opt/cxoffice/etc
140         doins share/crossover/data/cxoffice.conf
141         dodir /etc/env.d
142         echo "CONFIG_PROTECT=/opt/cxoffice/etc/cxoffice.conf" >> "${ED}"/etc/env.d/30crossover-bin || die
143
144         # Konqueror in its infinite wisdom decides to try opening things for
145         # writing, which are sandbox violations. This breaks the install process if
146         # it is installed, so we ninja edit it to false so it so doesn't run.
147         sed -i -e 's/cxwhich konqueror/false &/' "${ED}/opt/cxoffice/bin/locate_gui.sh" \
148                 || die "Could not apply workaround for konqueror"
149
150         # Install menus
151         # XXX: locate_gui.sh automatically detects *-application-merged directories
152         # This means what we install will vary depending on the contents of
153         # /etc/xdg, which is a QA violation. It is not clear how to resolve this.
154         XDG_DATA_HOME="/usr/share" XDG_CONFIG_HOME="/etc/xdg" \
155                 "${ED}/opt/cxoffice/bin/cxmenu" --destdir="${ED}" --crossover --install \
156                 || die "Could not install menus"
157
158         # Revert ninja edit
159         sed -i -e 's/false \(cxwhich konqueror\)/\1/' "${ED}/opt/cxoffice/bin/locate_gui.sh" \
160                 || die "Could not apply workaround for konqueror"
161
162         rm "${ED}/usr/share/applications/"*"Uninstall CrossOver Linux.desktop" \
163                 || die "Could not remove uninstall menus"
164         sed -i \
165                 -e "s:\"${ED}\".::" \
166                 -e "s:${ED}::" \
167                 "${ED}/opt/cxoffice/lib/perl/CXMenuXDG.pm" \
168                 || die "Could not fix paths in ${ED}/opt/cxoffice/lib/perl/CXMenuXDG.pm"
169         sed -i -e "s:${ED}:/:" \
170                 "${ED}/usr/share/applications/"*"CrossOver.desktop" \
171                 || die "Could not fix paths of *.desktop files"
172 }
173
174 pkg_postinst() {
175         einfo "${P} is open source software with the exception of the GUI."
176         einfo "Source code can be obtained from:"
177         einfo
178         einfo "https://media.codeweavers.com/pub/crossover/source/crossover-sources-${PV}.tar.gz"
179 }