dev-python/pytest: arm64 stable (bug #723996)
[gentoo.git] / app-emulation / crossover-bin / crossover-bin-15.3.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
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 +opengl +png +scanner +ssl +v4l"
18 REQUIRED_USE=${PYTHON_REQUIRED_USE}
19 RESTRICT="bindist test"
20 QA_FLAGS_IGNORED="opt/cxoffice/.*"
21 QA_PRESTRIPPED="opt/cxoffice/lib/.*
22         opt/cxoffice/bin/cxburner
23         opt/cxoffice/bin/cxntlm_auth
24         opt/cxoffice/bin/wineserver
25         opt/cxoffice/bin/unrar
26         opt/cxoffice/bin/wine-preloader
27         opt/cxoffice/bin/cxdiag
28         opt/cxoffice/bin/cxgettext
29         opt/cxoffice/bin/wineloader
30         "
31 S="${WORKDIR}"
32
33 DEPEND="dev-lang/perl
34         app-arch/unzip
35         ${PYTHON_DEPS}"
36
37 RDEPEND="${DEPEND}
38         !prefix? ( sys-libs/glibc )
39         $(python_gen_cond_dep '
40                 >=dev-python/pygtk-2.10[${PYTHON_MULTI_USEDEP}]
41                 dev-python/dbus-python[${PYTHON_MULTI_USEDEP}]
42         ')
43         dev-util/desktop-file-utils
44         !app-emulation/crossover-office-pro-bin
45         !app-emulation/crossover-office-bin
46         capi? ( net-libs/libcapi[abi_x86_32(-)] )
47         cups? ( net-print/cups[abi_x86_32(-)] )
48         gsm? ( media-sound/gsm[abi_x86_32(-)] )
49         jpeg? ( virtual/jpeg[abi_x86_32(-)] )
50         lcms? ( media-libs/lcms:2 )
51         ldap? ( net-nds/openldap[abi_x86_32(-)] )
52         gphoto2? ( media-libs/libgphoto2[abi_x86_32(-)] )
53         mp3? ( >=media-sound/mpg123-1.5.0[abi_x86_32(-)] )
54         nls? ( sys-devel/gettext[abi_x86_32(-)] )
55         openal? ( media-libs/openal[abi_x86_32(-)] )
56         opengl? (
57                 virtual/glu[abi_x86_32(-)]
58                 virtual/opengl[abi_x86_32(-)]
59         )
60         png? ( media-libs/libpng:0[abi_x86_32(-)] )
61         scanner? ( media-gfx/sane-backends[abi_x86_32(-)] )
62         ssl? ( dev-libs/openssl:0[abi_x86_32(-)] )
63         v4l? ( media-libs/libv4l[abi_x86_32(-)] )
64         media-libs/alsa-lib[abi_x86_32(-)]
65         >=media-libs/freetype-2.0.0[abi_x86_32(-)]
66         media-libs/mesa[abi_x86_32(-)]
67         sys-apps/util-linux[abi_x86_32(-)]
68         sys-libs/ncurses-compat:5[abi_x86_32(-)]
69         sys-libs/zlib[abi_x86_32(-)]
70         x11-libs/libICE[abi_x86_32(-)]
71         x11-libs/libSM[abi_x86_32(-)]
72         x11-libs/libX11[abi_x86_32(-)]
73         x11-libs/libXau[abi_x86_32(-)]
74         x11-libs/libXdmcp[abi_x86_32(-)]
75         x11-libs/libXext[abi_x86_32(-)]
76         x11-libs/libXi[abi_x86_32(-)]
77         x11-libs/libXrandr[abi_x86_32(-)]
78         x11-libs/libXxf86vm[abi_x86_32(-)]
79         x11-libs/libxcb[abi_x86_32(-)]"
80
81 pkg_nofetch() {
82         einfo "Please visit ${HOMEPAGE}"
83         einfo "and place ${A} into your DISTDIR directory"
84 }
85
86 src_unpack() {
87         # self unpacking zip archive; unzip warns about the exe stuff
88         unpack_zip ${A}
89 }
90
91 src_prepare() {
92         python_fix_shebang .
93
94         sed -i \
95                 -e "s:xdg_install_icons(:&\"${ED}\".:" \
96                 -e "s:\"\(.*\)/applications:\"${ED}\1/applications:" \
97                 -e "s:\"\(.*\)/desktop-directories:\"${ED}\1/desktop-directories:" \
98                 "${S}/lib/perl/CXMenuXDG.pm"
99
100         # Remove unnecessary files
101         rm -r license.txt guis/ || die "Could not remove files"
102         use doc || rm -r doc/ || die "Could not remove files"
103 }
104
105 src_install() {
106         # Install crossover symlink, bug #476314
107         dosym ../cxoffice/bin/crossover /opt/bin/crossover
108
109         # Install documentation
110         dodoc README changelog.txt
111         rm README changelog.txt || die "Could not remove README and changelog.txt"
112
113         # Install files
114         dodir /opt/cxoffice
115         #cp -r ./* "${ED}opt/cxoffice" \
116         find . | cpio -dumpl "${ED}/opt/cxoffice" 2>/dev/null \
117                 || die "Could not install into ${ED}opt/cxoffice"
118
119         # Install configuration file
120         insinto /opt/cxoffice/etc
121         doins share/crossover/data/cxoffice.conf
122
123         # Install menus
124         # XXX: locate_gui.sh automatically detects *-application-merged directories
125         # This means what we install will vary depending on the contents of
126         # /etc/xdg, which is a QA violation. It is not clear how to resolve this.
127         XDG_DATA_DIRS="/usr/share" XDG_CONFIG_HOME="/etc/xdg" \
128                 "${ED}opt/cxoffice/bin/cxmenu" --destdir="${ED}" --crossover --install \
129                 || die "Could not install menus"
130
131         rm "${ED}usr/share/applications/"*"Uninstall CrossOver Linux.desktop" \
132                 "${ED}opt/cxoffice/support/desktopdata/cxoffice-0/cxmenu/Launchers/StartMenu/Uninstall CrossOver Linux.desktop" \
133                 || die "Could not remove uninstall menus"
134         sed -i \
135                 -e "s:\"${ED}\".::" \
136                 -e "s:${ED}::" \
137                 "${ED}/opt/cxoffice/lib/perl/CXMenuXDG.pm" \
138                 || die "Could not fix paths in ${ED}/opt/cxoffice/lib/perl/CXMenuXDG.pm"
139         sed -i -e "s:${ED}:/:" \
140                 "${ED}/opt/cxoffice/support/desktopdata/cxoffice-0/cxmenu/Launchers/StartMenu/"*.desktop \
141                 "${ED}usr/share/applications/"*"CrossOver.desktop" \
142                 || die "Could not fix paths of *.desktop files"
143 }
144
145 pkg_postinst() {
146         einfo "${P} is open source software with the exception of the GUI."
147         einfo "Source code can be obtained from:"
148         einfo
149         einfo "https://media.codeweavers.com/pub/crossover/source/crossover-sources-${PV}.tar.gz"
150 }