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

Contents of /app-emulation/wine/wine-1.7.4-r1.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.24"
27 MV="0.0.8"
28 PULSE_PATCHES="winepulse-patches-1.7.4"
29 WINE_GENTOO="wine-gentoo-2015.03.07"
30 DESCRIPTION="Free implementation of Windows(tm) on Unix"
31 HOMEPAGE="http://www.winehq.org/"
32 SRC_URI="${SRC_URI}
33 gecko? (
34 abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
35 abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
36 )
37 mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
38 pulseaudio? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${PULSE_PATCHES}.tar.bz2 )
39 http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
40
41 LICENSE="LGPL-2.1"
42 SLOT="0"
43 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 nls odbc openal opencl +opengl osmesa oss +perl +png +prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
44 REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
45 test? ( abi_x86_32 )
46 elibc_glibc? ( threads )
47 mono? ( abi_x86_32 )
48 osmesa? ( opengl )" #286560
49
50 # FIXME: the test suite is unsuitable for us; many tests require net access
51 # or fail due to Xvfb's opengl limitations.
52 RESTRICT="test"
53
54 COMMON_DEPEND="
55 truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
56 capi? ( net-dialup/capi4k-utils )
57 ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
58 udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
59 fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
60 gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
61 openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
62 gstreamer? (
63 media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
64 media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
65 )
66 X? (
67 x11-libs/libXcursor[${MULTILIB_USEDEP}]
68 x11-libs/libXext[${MULTILIB_USEDEP}]
69 x11-libs/libXrandr[${MULTILIB_USEDEP}]
70 x11-libs/libXi[${MULTILIB_USEDEP}]
71 x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
72 )
73 xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
74 alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
75 cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
76 opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
77 opengl? (
78 virtual/glu[${MULTILIB_USEDEP}]
79 virtual/opengl[${MULTILIB_USEDEP}]
80 )
81 gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
82 jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
83 ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
84 lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
85 mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
86 nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
87 odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
88 osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
89 pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
90 xml? (
91 dev-libs/libxml2[${MULTILIB_USEDEP}]
92 dev-libs/libxslt[${MULTILIB_USEDEP}]
93 )
94 scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
95 ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
96 png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
97 v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
98 xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
99 abi_x86_32? (
100 !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
101 !<app-emulation/emul-linux-x86-baselibs-20140508-r14
102 !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
103 !<app-emulation/emul-linux-x86-db-20140508-r3
104 !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
105 !<app-emulation/emul-linux-x86-medialibs-20140508-r6
106 !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
107 !<app-emulation/emul-linux-x86-opengl-20140508-r1
108 !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
109 !<app-emulation/emul-linux-x86-sdl-20140508-r1
110 !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
111 !<app-emulation/emul-linux-x86-soundlibs-20140508
112 !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
113 !<app-emulation/emul-linux-x86-xlibs-20140508
114 )"
115
116 RDEPEND="${COMMON_DEPEND}
117 dos? ( games-emulation/dosbox )
118 perl? ( dev-lang/perl dev-perl/XML-Simple )
119 samba? ( >=net-fs/samba-3.0.25 )
120 selinux? ( sec-policy/selinux-wine )
121 udisks? ( sys-fs/udisks:2 )
122 pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
123
124 DEPEND="${COMMON_DEPEND}
125 X? (
126 x11-proto/inputproto
127 x11-proto/xextproto
128 x11-proto/xf86vidmodeproto
129 )
130 xinerama? ( x11-proto/xineramaproto )
131 prelink? ( sys-devel/prelink )
132 >=sys-kernel/linux-headers-2.6
133 virtual/pkgconfig
134 virtual/yacc
135 sys-devel/flex"
136
137 # These use a non-standard "Wine" category, which is provided by
138 # /etc/xdg/applications-merged/wine.menu
139 QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
140 usr/share/applications/wine-notepad.desktop
141 usr/share/applications/wine-uninstaller.desktop
142 usr/share/applications/wine-winecfg.desktop"
143
144 wine_build_environment_check() {
145 [[ ${MERGE_TYPE} = "binary" ]] && return 0
146
147 # bug #549768
148 if [[ $(gcc-major-version) = 5 ]]; then
149 eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
150 eerror
151 return 1
152 fi
153
154 if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
155 eerror "You need gcc-4.4+ to build 64-bit wine"
156 eerror
157 return 1
158 fi
159
160 if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
161 eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
162 eerror "See https://bugs.gentoo.org/487864 for more details."
163 eerror
164 return 1
165 fi
166 }
167
168 pkg_pretend() {
169 wine_build_environment_check || die
170 }
171
172 pkg_setup() {
173 wine_build_environment_check || die
174 }
175
176 src_unpack() {
177 if [[ ${PV} == "9999" ]] ; then
178 git-r3_src_unpack
179 else
180 unpack ${MY_P}.tar.bz2
181 fi
182
183 use pulseaudio && unpack "${PULSE_PATCHES}.tar.bz2"
184 unpack "${WINE_GENTOO}.tar.bz2"
185
186 l10n_find_plocales_changes "${S}/po" "" ".po"
187 }
188
189 src_prepare() {
190 local md5="$(md5sum server/protocol.def)"
191 local PATCHES=(
192 "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
193 "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
194 "${FILESDIR}"/${PN}-1.7.2-osmesa-check.patch #429386
195 "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
196 "${FILESDIR}"/${PN}-1.7.0-freetype-header-location.patch #539830
197 "${FILESDIR}"/${PN}-gcc-4.9-null-pointer.patch #543446
198 )
199 use pulseaudio && PATCHES+=(
200 "../${PULSE_PATCHES}"/*.patch #421365
201 )
202
203 autotools-utils_src_prepare
204
205 # Modification of the server protocol requires regenerating the server requests
206 if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
207 einfo "server/protocol.def was patched; running tools/make_requests"
208 tools/make_requests || die #432348
209 fi
210 sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
211 if ! use run-exes; then
212 sed -i '/^MimeType/d' tools/wine.desktop || die #117785
213 fi
214
215 # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
216 cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
217
218 l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
219 }
220
221 src_configure() {
222 export LDCONFIG=/bin/true
223 use custom-cflags || strip-flags
224
225 multilib-minimal_src_configure
226 }
227
228 multilib_src_configure() {
229 local myconf=(
230 --sysconfdir=/etc/wine
231 $(use_with alsa)
232 $(use_with capi)
233 $(use_with lcms cms)
234 $(use_with cups)
235 $(use_with ncurses curses)
236 $(use_with udisks dbus)
237 $(use_with fontconfig)
238 $(use_with ssl gnutls)
239 $(use_enable gecko mshtml)
240 $(use_with gphoto2 gphoto)
241 $(use_with gsm)
242 $(use_with gstreamer)
243 --without-hal
244 $(use_with jpeg)
245 $(use_with ldap)
246 $(use_enable mono mscoree)
247 $(use_with mp3 mpg123)
248 $(use_with nls gettext)
249 $(use_with openal)
250 $(use_with opencl)
251 $(use_with opengl)
252 $(use_with osmesa)
253 $(use_with oss)
254 $(use_with png)
255 $(use_with threads pthread)
256 $(use_with scanner sane)
257 $(use_enable test tests)
258 $(use_with truetype freetype)
259 $(use_with v4l)
260 $(use_with X x)
261 $(use_with xcomposite)
262 $(use_with xinerama)
263 $(use_with xml)
264 $(use_with xml xslt)
265 )
266
267 use pulseaudio && myconf+=( --with-pulse )
268
269 local PKG_CONFIG AR RANLIB
270 # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
271 # set AR and RANLIB to make QA scripts happy; #483342
272 tc-export PKG_CONFIG AR RANLIB
273
274 if use amd64; then
275 if [[ ${ABI} == amd64 ]]; then
276 myconf+=( --enable-win64 )
277 else
278 myconf+=( --disable-win64 )
279 fi
280
281 # Note: using --with-wine64 results in problems with multilib.eclass
282 # CC/LD hackery. We're using separate tools instead.
283 fi
284
285 ECONF_SOURCE=${S} \
286 econf "${myconf[@]}"
287 emake depend
288 }
289
290 multilib_src_test() {
291 # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
292 if [[ ${ABI} == x86 ]]; then
293 if [[ $(id -u) == 0 ]]; then
294 ewarn "Skipping tests since they cannot be run under the root user."
295 ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
296 return
297 fi
298
299 WINEPREFIX="${T}/.wine-${ABI}" \
300 Xemake test
301 fi
302 }
303
304 multilib_src_install_all() {
305 local DOCS=( ANNOUNCE AUTHORS README )
306 local l
307 add_locale_docs() {
308 local locale_doc="documentation/README.$1"
309 [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
310 }
311 l10n_for_each_locale_do add_locale_docs
312
313 einstalldocs
314 prune_libtool_files --all
315
316 emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
317 if use gecko ; then
318 insinto /usr/share/wine/gecko
319 use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
320 use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
321 fi
322 if use mono ; then
323 insinto /usr/share/wine/mono
324 doins "${DISTDIR}"/wine-mono-${MV}.msi
325 fi
326 if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
327 rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
328 fi
329
330 use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
331 use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
332
333 if use abi_x86_64 && ! use abi_x86_32; then
334 dosym /usr/bin/wine{64,} # 404331
335 dosym /usr/bin/wine{64,}-preloader
336 fi
337
338 # respect LINGUAS when installing man pages, #469418
339 for l in de fr pl; do
340 use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
341 done
342 }
343
344 pkg_preinst() {
345 gnome2_icon_savelist
346 }
347
348 pkg_postinst() {
349 gnome2_icon_cache_update
350 fdo-mime_desktop_database_update
351
352 if ! use gecko; then
353 ewarn "Without Wine Gecko, wine prefixes will not have a default"
354 ewarn "implementation of iexplore. Many older windows applications"
355 ewarn "rely upon the existence of an iexplore implementation, so"
356 ewarn "you will likely need to install an external one, like via winetricks"
357 fi
358 if ! use mono; then
359 ewarn "Without Wine Mono, wine prefixes will not have a default"
360 ewarn "implementation of .NET. Many windows applications rely upon"
361 ewarn "the existence of a .NET implementation, so you will likely need"
362 ewarn "to install an external one, like via winetricks"
363 fi
364 }
365
366 pkg_postrm() {
367 gnome2_icon_cache_update
368 fdo-mime_desktop_database_update
369 }

  ViewVC Help
Powered by ViewVC 1.1.20