Gentoo Archives: gentoo-commits

From: Pacho Ramos <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/crossover-bin/
Date: Wed, 22 Dec 2021 11:11:57
Message-Id: 1640171509.e815b545e5d99fadf66d837e1e73b1ea2d4c875d.pacho@gentoo
1 commit: e815b545e5d99fadf66d837e1e73b1ea2d4c875d
2 Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
3 AuthorDate: Wed Dec 22 11:11:41 2021 +0000
4 Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 22 11:11:49 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e815b545
7
8 app-emulation/crossover-bin: Don't install opencl libs when USE is off
9
10 Package-Manager: Portage-3.0.30, Repoman-3.0.3
11 Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>
12
13 .../crossover-bin/crossover-bin-21.1.0-r1.ebuild | 228 +++++++++++++++++++++
14 1 file changed, 228 insertions(+)
15
16 diff --git a/app-emulation/crossover-bin/crossover-bin-21.1.0-r1.ebuild b/app-emulation/crossover-bin/crossover-bin-21.1.0-r1.ebuild
17 new file mode 100644
18 index 000000000000..0e66d60c63cb
19 --- /dev/null
20 +++ b/app-emulation/crossover-bin/crossover-bin-21.1.0-r1.ebuild
21 @@ -0,0 +1,228 @@
22 +# Copyright 1999-2021 Gentoo Authors
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=8
26 +PYTHON_COMPAT=( python3_{7..10} )
27 +
28 +inherit python-single-r1 unpacker
29 +
30 +DESCRIPTION="Commercial version of app-emulation/wine with paid support"
31 +HOMEPAGE="https://www.codeweavers.com/products/"
32 +SRC_URI="https://media.codeweavers.com/pub/crossover/cxlinux/demo/install-crossover-${PV}.bin"
33 +
34 +LICENSE="CROSSOVER-3"
35 +SLOT="0"
36 +KEYWORDS="-* ~amd64 ~x86"
37 +IUSE="+capi +cups doc +gphoto2 +gsm +gstreamer +jpeg +lcms ldap +mp3 +nls osmesa +openal +opencl +opengl +pcap +png +scanner +ssl +v4l +vulkan"
38 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
39 +
40 +RESTRICT="bindist test"
41 +
42 +QA_FLAGS_IGNORED="opt/cxoffice/.*"
43 +QA_PRESTRIPPED="
44 + opt/cxoffice/lib/.*
45 + opt/cxoffice/lib64/.*
46 + opt/cxoffice/bin/cabextract
47 + opt/cxoffice/bin/cxburner
48 + opt/cxoffice/bin/cxntlm_auth
49 + opt/cxoffice/bin/wineserver
50 + opt/cxoffice/bin/wineserver32
51 + opt/cxoffice/bin/wineserver64
52 + opt/cxoffice/bin/wine64-preloader
53 + opt/cxoffice/bin/unrar
54 + opt/cxoffice/bin/wine-preloader
55 + opt/cxoffice/bin/cxdiag
56 + opt/cxoffice/bin/cxdiag64
57 + opt/cxoffice/bin/cxgettext
58 + opt/cxoffice/bin/vkd3d-compiler
59 + opt/cxoffice/bin/wineloader
60 + opt/cxoffice/bin/wineloader64
61 +"
62 +QA_TEXTRELS="
63 + opt/cxoffice/bin/wineserver32
64 + opt/cxoffice/lib/wine/*
65 + opt/cxoffice/lib/libwine.so*
66 +"
67 +
68 +S="${WORKDIR}"
69 +
70 +DEPEND=""
71 +BDEPEND="${PYTHON_DEPS}
72 + app-arch/cpio
73 + app-arch/unzip
74 + dev-lang/perl
75 + dev-util/bbe
76 +"
77 +
78 +RDEPEND="${DEPEND}
79 + ${PYTHON_DEPS}
80 + $(python_gen_cond_dep '
81 + dev-python/dbus-python[${PYTHON_USEDEP}]
82 + dev-python/pygobject:3[${PYTHON_USEDEP}]
83 + ')
84 + !prefix? ( sys-libs/glibc )
85 + !app-emulation/crossover-office-pro-bin
86 + !app-emulation/crossover-office-bin
87 + capi? ( net-libs/libcapi[abi_x86_32(-)] )
88 + cups? ( net-print/cups[abi_x86_32(-)] )
89 + gsm? ( media-sound/gsm[abi_x86_32(-)] )
90 + jpeg? ( virtual/jpeg:0[abi_x86_32(-)] )
91 + lcms? ( media-libs/lcms:2 )
92 + ldap? ( net-nds/openldap[abi_x86_32(-)] )
93 + gphoto2? ( media-libs/libgphoto2[abi_x86_32(-)] )
94 + gstreamer? (
95 + media-libs/gstreamer:1.0[abi_x86_32(-)]
96 + jpeg? ( media-plugins/gst-plugins-jpeg:1.0[abi_x86_32(-)] )
97 + media-plugins/gst-plugins-meta:1.0[abi_x86_32(-)]
98 + )
99 + mp3? ( >=media-sound/mpg123-1.5.0[abi_x86_32(-)] )
100 + nls? ( sys-devel/gettext[abi_x86_32(-)] )
101 + openal? ( media-libs/openal[abi_x86_32(-)] )
102 + opencl? ( virtual/opencl[abi_x86_32(-)] )
103 + opengl? (
104 + virtual/glu[abi_x86_32(-)]
105 + virtual/opengl[abi_x86_32(-)]
106 + )
107 + pcap? ( net-libs/libpcap[abi_x86_32(-)] )
108 + png? ( media-libs/libpng:0[abi_x86_32(-)] )
109 + scanner? ( media-gfx/sane-backends[abi_x86_32(-)] )
110 + ssl? ( net-libs/gnutls:0/30[abi_x86_32(-)] )
111 + v4l? ( media-libs/libv4l[abi_x86_32(-)] )
112 + vulkan? ( media-libs/vulkan-loader[abi_x86_32(-)] )
113 + dev-libs/glib:2
114 + dev-libs/gobject-introspection
115 + dev-libs/openssl:0
116 + dev-util/desktop-file-utils
117 + media-libs/alsa-lib[abi_x86_32(-)]
118 + media-libs/freetype:2[abi_x86_32(-)]
119 + media-libs/mesa[abi_x86_32(-),osmesa?]
120 + media-libs/tiff:0[abi_x86_32(-)]
121 + sys-auth/nss-mdns[abi_x86_32(-)]
122 + sys-apps/util-linux[abi_x86_32(-)]
123 + sys-libs/libunwind[abi_x86_32(-)]
124 + sys-libs/ncurses-compat:5[abi_x86_32(-)]
125 + sys-libs/zlib[abi_x86_32(-)]
126 + x11-libs/libICE[abi_x86_32(-)]
127 + x11-libs/libSM[abi_x86_32(-)]
128 + x11-libs/libX11[abi_x86_32(-)]
129 + x11-libs/libXau[abi_x86_32(-)]
130 + x11-libs/libXcursor[abi_x86_32(-)]
131 + x11-libs/libXdmcp[abi_x86_32(-)]
132 + x11-libs/libXext[abi_x86_32(-)]
133 + x11-libs/libXi[abi_x86_32(-)]
134 + x11-libs/libXrandr[abi_x86_32(-)]
135 + x11-libs/libXxf86vm[abi_x86_32(-)]
136 + x11-libs/libxcb[abi_x86_32(-)]
137 + x11-libs/gdk-pixbuf:2[introspection]
138 + x11-libs/gtk+:3[introspection]
139 + x11-libs/pango[introspection]
140 + x11-libs/vte:2.91[introspection]
141 + || (
142 + sys-libs/libxcrypt[compat]
143 + sys-libs/glibc[crypt(+)]
144 + )
145 +"
146 +
147 +src_unpack() {
148 + # self unpacking zip archive; unzip warns about the exe stuff
149 + unpack_zip ${A}
150 +}
151 +
152 +src_prepare() {
153 + default
154 +
155 + sed -i \
156 + -e "s:xdg_install_icons(:&\"${ED}\".:" \
157 + -e "s:\"\(.*\)/applications:\"${ED}\1/applications:" \
158 + -e "s:\"\(.*\)/desktop-directories:\"${ED}\1/desktop-directories:" \
159 + "${S}/lib/perl/CXMenuXDG.pm"
160 +
161 + # Remove unnecessary files, license.txt file kept as it's used by
162 + # multiple files (apart of the menu to show the license)
163 + rm -r guis/ || die "Could not remove files"
164 + use doc || rm -r doc/ || die "Could not remove files"
165 +}
166 +
167 +src_install() {
168 + # Install crossover symlink, bug #476314
169 + dosym ../cxoffice/bin/crossover /opt/bin/crossover
170 +
171 + # Install documentation
172 + dodoc README changelog.txt
173 + rm README changelog.txt || die "Could not remove README and changelog.txt"
174 +
175 + # Install files
176 + dodir /opt/cxoffice
177 + #cp -r ./* "${ED}/opt/cxoffice" \
178 + find . | cpio -dumpl "${ED}/opt/cxoffice" 2>/dev/null \
179 + || die "Could not install into ${ED}/opt/cxoffice"
180 +
181 + # Disable auto-update
182 + sed -i -e 's/;;\"AutoUpdate\" = \"1\"/\"AutoUpdate\" = \"0\"/g' share/crossover/data/cxoffice.conf || die
183 +
184 + # Install configuration file
185 + insinto /opt/cxoffice/etc
186 + doins share/crossover/data/cxoffice.conf
187 + dodir /etc/env.d
188 + echo "CONFIG_PROTECT=/opt/cxoffice/etc/cxoffice.conf" >> "${ED}"/etc/env.d/30crossover-bin || die
189 +
190 + # Konqueror in its infinite wisdom decides to try opening things for
191 + # writing, which are sandbox violations. This breaks the install process if
192 + # it is installed, so we ninja edit it to false so it so doesn't run.
193 + sed -i -e 's/cxwhich konqueror/false &/' "${ED}/opt/cxoffice/bin/locate_gui.sh" \
194 + || die "Could not apply workaround for konqueror"
195 +
196 + # Install menus
197 + # XXX: locate_gui.sh automatically detects *-application-merged directories
198 + # This means what we install will vary depending on the contents of
199 + # /etc/xdg, which is a QA violation. It is not clear how to resolve this.
200 + XDG_DATA_HOME="/usr/share" XDG_CONFIG_HOME="/etc/xdg" \
201 + "${ED}/opt/cxoffice/bin/cxmenu" --destdir="${ED}" --crossover --install \
202 + || die "Could not install menus"
203 +
204 + # Revert ninja edit
205 + sed -i -e 's/false \(cxwhich konqueror\)/\1/' "${ED}/opt/cxoffice/bin/locate_gui.sh" \
206 + || die "Could not apply workaround for konqueror"
207 +
208 + # Drop Uninstall menus
209 + rm "${ED}/usr/share/applications/"*"Uninstall"* \
210 + || die "Could not remove uninstall menus"
211 +
212 + # Fix PATHs
213 + sed -i \
214 + -e "s:\"${ED}\".::" \
215 + -e "s:${ED}::" \
216 + "${ED}/opt/cxoffice/lib/perl/CXMenuXDG.pm" \
217 + || die "Could not fix paths in ${ED}/opt/cxoffice/lib/perl/CXMenuXDG.pm"
218 + sed -i -e "s:${ED}:/:" \
219 + "${ED}/usr/share/applications/"*"CrossOver.desktop" \
220 + || die "Could not fix paths of *.desktop files"
221 +
222 + # Workaround missing libs
223 + # https://www.codeweavers.com/support/forums/general/?t=26;mhl=198658;msg=198658
224 + if use gphoto2; then
225 + bbe -e 's/libgphoto2_port.so.10/libgphoto2_port.so.12/' "${ED}/opt/cxoffice/lib/wine/gphoto2.ds.so" >tmp || die
226 + mv tmp "${ED}/opt/cxoffice/lib/wine/gphoto2.ds.so" || die
227 + bbe -e 's/libgphoto2_port.so.10/libgphoto2_port.so.12/' "${ED}/opt/cxoffice/bin/cxdiag" >tmp || die
228 + mv tmp "${ED}/opt/cxoffice/bin/cxdiag" || die
229 + fperms a+x "/opt/cxoffice/bin/cxdiag"
230 + fi
231 + # It tries to load libpcap as packaged in Debian, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=657900
232 + # https://bugs.gentoo.org/721108
233 + if use pcap; then
234 + bbe -e 's/libpcap.so.0.8/libpcap.so.1.9.1/' "${ED}/opt/cxoffice/lib/wine/wpcap.dll.so" >tmp || die
235 + bbe -e 's/libpcap.so.0.8/libpcap.so.1.9.1/' "${ED}/opt/cxoffice/lib64/wine/wpcap.dll.so" >tmp64 || die
236 + mv tmp "${ED}/opt/cxoffice/lib/wine/wpcap.dll.so" || die
237 + mv tmp64 "${ED}/opt/cxoffice/lib64/wine/wpcap.dll.so" || die
238 + fi
239 +
240 + # Remove libs that link to openldap
241 + if ! use ldap; then
242 + rm "${ED}"/opt/cxoffice/lib*/wine/wldap32.dll.so || die
243 + fi
244 +
245 + # Remove libs that link to opencl
246 + if ! use opencl; then
247 + rm "${ED}"/opt/cxoffice/lib*/wine/opencl.dll.so || die
248 + fi
249 +}