/[gentoo-x86]/app-emulation/wine/wine-1.7.36.ebuild
Gentoo

Contents of /app-emulation/wine/wine-1.7.36.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sat Jul 11 07:54:37 2015 UTC (3 years, 9 months ago) by np-hardass
Branch: MAIN
CVS Tags: HEAD
Fixes bugs #548100, #539830, #543446, update to new multilib dependency code, and unify ebuild code/build system

(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 18F89C67)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI="5"
6
7 AUTOTOOLS_AUTORECONF=1
8 PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
9 PLOCALE_BACKUP="en"
10
11 inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
12
13 if [[ ${PV} == "9999" ]] ; then
14 EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
15 EGIT_BRANCH="master"
16 inherit git-r3
17 SRC_URI=""
18 #KEYWORDS=""
19 else
20 MY_P="${PN}-${PV/_/-}"
21 SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
22 KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
23 S=${WORKDIR}/${MY_P}
24 fi
25
26 GV="2.34"
27 MV="4.5.4"
28 STAGING_P="wine-staging-${PV}"
29 STAGING_DIR="${WORKDIR}/${STAGING_P}"
30 WINE_GENTOO="wine-gentoo-2015.03.07"
31 GST_P="wine-1.7.34-gstreamer-v5"
32 DESCRIPTION="Free implementation of Windows(tm) on Unix"
33 HOMEPAGE="http://www.winehq.org/"
34 SRC_URI="${SRC_URI}
35 gecko? (
36 abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
37 abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
38 )
39 mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
40 gstreamer? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${GST_P}.patch.bz2 )
41 http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
42
43 if [[ ${PV} == "9999" ]] ; then
44 STAGING_EGIT_REPO_URI="git://github.com/wine-compholio/wine-staging.git"
45 else
46 SRC_URI="${SRC_URI}
47 staging? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )
48 pulseaudio? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )"
49 fi
50
51 LICENSE="LGPL-2.1"
52 SLOT="0"
53 IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png +prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
54 REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
55 test? ( abi_x86_32 )
56 elibc_glibc? ( threads )
57 mono? ( abi_x86_32 )
58 pipelight? ( staging )
59 s3tc? ( staging )
60 osmesa? ( opengl )" #286560
61
62 # FIXME: the test suite is unsuitable for us; many tests require net access
63 # or fail due to Xvfb's opengl limitations.
64 RESTRICT="test"
65
66 COMMON_DEPEND="
67 truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
68 capi? ( net-dialup/capi4k-utils )
69 ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
70 udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
71 fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
72 gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
73 openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
74 gstreamer? (
75 media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
76 media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
77 )
78 X? (
79 x11-libs/libXcursor[${MULTILIB_USEDEP}]
80 x11-libs/libXext[${MULTILIB_USEDEP}]
81 x11-libs/libXrandr[${MULTILIB_USEDEP}]
82 x11-libs/libXi[${MULTILIB_USEDEP}]
83 x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
84 )
85 xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
86 alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
87 cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
88 opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
89 opengl? (
90 virtual/glu[${MULTILIB_USEDEP}]
91 virtual/opengl[${MULTILIB_USEDEP}]
92 )
93 gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
94 jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
95 ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
96 lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
97 mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
98 netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
99 nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
100 odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
101 osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
102 pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
103 staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
104 s3tc? ( media-libs/libtxc_dxtn[${MULTILIB_USEDEP}] )
105 pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
106 xml? (
107 dev-libs/libxml2[${MULTILIB_USEDEP}]
108 dev-libs/libxslt[${MULTILIB_USEDEP}]
109 )
110 scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
111 ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
112 png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
113 v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
114 xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
115 abi_x86_32? (
116 !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
117 !<app-emulation/emul-linux-x86-baselibs-20140508-r14
118 !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
119 !<app-emulation/emul-linux-x86-db-20140508-r3
120 !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
121 !<app-emulation/emul-linux-x86-medialibs-20140508-r6
122 !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
123 !<app-emulation/emul-linux-x86-opengl-20140508-r1
124 !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
125 !<app-emulation/emul-linux-x86-sdl-20140508-r1
126 !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
127 !<app-emulation/emul-linux-x86-soundlibs-20140508
128 !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
129 !<app-emulation/emul-linux-x86-xlibs-20140508
130 )"
131 RDEPEND="${COMMON_DEPEND}
132 dos? ( games-emulation/dosbox )
133 perl? ( dev-lang/perl dev-perl/XML-Simple )
134 samba? ( >=net-fs/samba-3.0.25 )
135 selinux? ( sec-policy/selinux-wine )
136 udisks? ( sys-fs/udisks:2 )
137 pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
138
139 # tools/make_requests requires perl
140 DEPEND="${COMMON_DEPEND}
141 staging? ( dev-lang/perl dev-perl/XML-Simple )
142 X? (
143 x11-proto/inputproto
144 x11-proto/xextproto
145 x11-proto/xf86vidmodeproto
146 )
147 xinerama? ( x11-proto/xineramaproto )
148 prelink? ( sys-devel/prelink )
149 >=sys-kernel/linux-headers-2.6
150 virtual/pkgconfig
151 virtual/yacc
152 sys-devel/flex"
153
154 # These use a non-standard "Wine" category, which is provided by
155 # /etc/xdg/applications-merged/wine.menu
156 QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
157 usr/share/applications/wine-notepad.desktop
158 usr/share/applications/wine-uninstaller.desktop
159 usr/share/applications/wine-winecfg.desktop"
160
161 wine_build_environment_check() {
162 [[ ${MERGE_TYPE} = "binary" ]] && return 0
163
164 # bug #549768
165 if [[ $(gcc-major-version) = 5 ]]; then
166 eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
167 eerror
168 return 1
169 fi
170
171 if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
172 eerror "You need gcc-4.4+ to build 64-bit wine"
173 eerror
174 return 1
175 fi
176
177 if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
178 eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
179 eerror "See https://bugs.gentoo.org/487864 for more details."
180 eerror
181 return 1
182 fi
183 }
184
185 pkg_pretend() {
186 wine_build_environment_check || die
187 }
188
189 pkg_setup() {
190 wine_build_environment_check || die
191 }
192
193 src_unpack() {
194 if [[ ${PV} == "9999" ]] ; then
195 git-r3_src_unpack
196 if use staging || use pulseaudio; then
197 EGIT_REPO_URI=${STAGING_EGIT_REPO_URI}
198 unset ${PN}_LIVE_REPO;
199 EGIT_CHECKOUT_DIR=${STAGING_DIR} git-r3_src_unpack
200 fi
201 else
202 unpack ${MY_P}.tar.bz2
203 use staging || use pulseaudio && unpack "${STAGING_P}.tar.gz"
204 fi
205
206 unpack "${WINE_GENTOO}.tar.bz2"
207 use gstreamer && unpack "${GST_P}.patch.bz2"
208
209 l10n_find_plocales_changes "${S}/po" "" ".po"
210 }
211
212 src_prepare() {
213 local md5="$(md5sum server/protocol.def)"
214 local PATCHES=(
215 "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
216 "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
217 "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
218 "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
219 )
220
221 if use gstreamer; then
222 # See http://bugs.winehq.org/show_bug.cgi?id=30557
223 ewarn "Applying experimental patch to fix GStreamer support. Note that"
224 ewarn "this patch has been reported to cause crashes in certain games."
225
226 PATCHES+=( "${WORKDIR}/${GST_P}.patch" )
227 fi
228 if use staging; then
229 ewarn "Applying the unofficial Wine-Staging patchset which is unsupported"
230 ewarn "by Wine developers. Please don't report bugs to Wine bugzilla"
231 ewarn "unless you can reproduce them with USE=-staging"
232
233 local STAGING_EXCLUDE=""
234 use pipelight || STAGING_EXCLUDE="${STAGING_EXCLUDE} -W Pipelight"
235
236 # Launch wine-staging patcher in a subshell, using epatch as a backend, and gitapply.sh as a backend for binary patches
237 ebegin "Running Wine-Staging patch installer"
238 (
239 set -- DESTDIR="${S}" --backend=epatch --no-autoconf --all ${STAGING_EXCLUDE}
240 cd "${STAGING_DIR}/patches"
241 source "${STAGING_DIR}/patches/patchinstall.sh"
242 )
243 eend $?
244 elif use pulseaudio; then
245 PATCHES+=( "${STAGING_DIR}/patches/winepulse-PulseAudio_Support"/*.patch )
246 fi
247 autotools-utils_src_prepare
248
249 # Modification of the server protocol requires regenerating the server requests
250 if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
251 einfo "server/protocol.def was patched; running tools/make_requests"
252 tools/make_requests || die #432348
253 fi
254 sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
255 if ! use run-exes; then
256 sed -i '/^MimeType/d' tools/wine.desktop || die #117785
257 fi
258
259 # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
260 cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
261
262 l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
263 }
264
265 src_configure() {
266 export LDCONFIG=/bin/true
267 use custom-cflags || strip-flags
268
269 multilib-minimal_src_configure
270 }
271
272 multilib_src_configure() {
273 local myconf=(
274 --sysconfdir=/etc/wine
275 $(use_with alsa)
276 $(use_with capi)
277 $(use_with lcms cms)
278 $(use_with cups)
279 $(use_with ncurses curses)
280 $(use_with udisks dbus)
281 $(use_with fontconfig)
282 $(use_with ssl gnutls)
283 $(use_enable gecko mshtml)
284 $(use_with gphoto2 gphoto)
285 $(use_with gsm)
286 $(use_with gstreamer)
287 --without-hal
288 $(use_with jpeg)
289 $(use_with ldap)
290 $(use_enable mono mscoree)
291 $(use_with mp3 mpg123)
292 $(use_with netapi)
293 $(use_with nls gettext)
294 $(use_with openal)
295 $(use_with opencl)
296 $(use_with opengl)
297 $(use_with osmesa)
298 $(use_with oss)
299 $(use_with pcap)
300 $(use_with png)
301 $(use_with threads pthread)
302 $(use_with scanner sane)
303 $(use_enable test tests)
304 $(use_with truetype freetype)
305 $(use_with v4l)
306 $(use_with X x)
307 $(use_with xcomposite)
308 $(use_with xinerama)
309 $(use_with xml)
310 $(use_with xml xslt)
311 )
312
313 if use pulseaudio || use staging; then
314 myconf+=( $(use_with pulseaudio pulse) )
315 fi
316 use staging && myconf+=(
317 --with-xattr
318 $(use_with s3tc txc_dxtn)
319 )
320
321 local PKG_CONFIG AR RANLIB
322 # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
323 # set AR and RANLIB to make QA scripts happy; #483342
324 tc-export PKG_CONFIG AR RANLIB
325
326 if use amd64; then
327 if [[ ${ABI} == amd64 ]]; then
328 myconf+=( --enable-win64 )
329 else
330 myconf+=( --disable-win64 )
331 fi
332
333 # Note: using --with-wine64 results in problems with multilib.eclass
334 # CC/LD hackery. We're using separate tools instead.
335 fi
336
337 ECONF_SOURCE=${S} \
338 econf "${myconf[@]}"
339 emake depend
340 }
341
342 multilib_src_test() {
343 # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
344 if [[ ${ABI} == x86 ]]; then
345 if [[ $(id -u) == 0 ]]; then
346 ewarn "Skipping tests since they cannot be run under the root user."
347 ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
348 return
349 fi
350
351 WINEPREFIX="${T}/.wine-${ABI}" \
352 Xemake test
353 fi
354 }
355
356 multilib_src_install_all() {
357 local DOCS=( ANNOUNCE AUTHORS README )
358 local l
359 add_locale_docs() {
360 local locale_doc="documentation/README.$1"
361 [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
362 }
363 l10n_for_each_locale_do add_locale_docs
364
365 einstalldocs
366 prune_libtool_files --all
367
368 emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
369 if use gecko ; then
370 insinto /usr/share/wine/gecko
371 use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
372 use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
373 fi
374 if use mono ; then
375 insinto /usr/share/wine/mono
376 doins "${DISTDIR}"/wine-mono-${MV}.msi
377 fi
378 if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
379 rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
380 fi
381
382 use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
383 use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
384
385 if use abi_x86_64 && ! use abi_x86_32; then
386 dosym /usr/bin/wine{64,} # 404331
387 dosym /usr/bin/wine{64,}-preloader
388 fi
389
390 # respect LINGUAS when installing man pages, #469418
391 for l in de fr pl; do
392 use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
393 done
394 }
395
396 pkg_preinst() {
397 gnome2_icon_savelist
398 }
399
400 pkg_postinst() {
401 gnome2_icon_cache_update
402 fdo-mime_desktop_database_update
403
404 if ! use gecko; then
405 ewarn "Without Wine Gecko, wine prefixes will not have a default"
406 ewarn "implementation of iexplore. Many older windows applications"
407 ewarn "rely upon the existence of an iexplore implementation, so"
408 ewarn "you will likely need to install an external one, like via winetricks"
409 fi
410 if ! use mono; then
411 ewarn "Without Wine Mono, wine prefixes will not have a default"
412 ewarn "implementation of .NET. Many windows applications rely upon"
413 ewarn "the existence of a .NET implementation, so you will likely need"
414 ewarn "to install an external one, like via winetricks"
415 fi
416 }
417
418 pkg_postrm() {
419 gnome2_icon_cache_update
420 fdo-mime_desktop_database_update
421 }

  ViewVC Help
Powered by ViewVC 1.1.20