2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-10-04 13:48:56 +00:00
|
|
|
|
2013-08-12 04:03:04 +00:00
|
|
|
# NOTE: When updating Wine, please check Wine-Gecko and Wine-Mono for updates too:
|
|
|
|
# http://wiki.winehq.org/Gecko
|
|
|
|
# http://wiki.winehq.org/Mono
|
2011-03-10 05:11:03 +00:00
|
|
|
class Wine < Formula
|
2011-08-16 15:56:29 +00:00
|
|
|
homepage 'http://winehq.org/'
|
2012-10-21 20:27:57 +00:00
|
|
|
|
2013-09-22 01:47:54 +00:00
|
|
|
stable do
|
2014-02-27 14:19:55 +00:00
|
|
|
url 'https://downloads.sourceforge.net/project/wine/Source/wine-1.6.2.tar.bz2'
|
2014-01-17 22:23:11 +00:00
|
|
|
sha256 'f0ab9eede5a0ccacbf6e50682649f9377b9199e49cf55641f1787cf72405acbe'
|
2013-11-20 00:44:53 +00:00
|
|
|
|
|
|
|
resource 'gecko' do
|
2014-02-27 14:19:55 +00:00
|
|
|
url 'https://downloads.sourceforge.net/wine/wine_gecko-2.21-x86.msi', :using => :nounzip
|
2013-11-20 00:44:53 +00:00
|
|
|
version '2.21'
|
|
|
|
sha1 'a514fc4d53783a586c7880a676c415695fe934a3'
|
|
|
|
end
|
2014-01-09 17:02:35 +00:00
|
|
|
|
|
|
|
resource 'mono' do
|
2014-02-27 14:19:55 +00:00
|
|
|
url 'https://downloads.sourceforge.net/wine/wine-mono-0.0.8.msi', :using => :nounzip
|
2014-01-09 17:02:35 +00:00
|
|
|
sha256 '3dfc23bbc29015e4e538dab8b83cb825d3248a0e5cf3b3318503ee7331115402'
|
|
|
|
end
|
2013-09-22 01:47:54 +00:00
|
|
|
end
|
2011-03-18 20:55:57 +00:00
|
|
|
|
2013-08-04 03:20:30 +00:00
|
|
|
devel do
|
2014-03-08 09:49:03 +00:00
|
|
|
url 'https://downloads.sourceforge.net/project/wine/Source/wine-1.7.14.tar.bz2'
|
|
|
|
sha256 '2df1937e28936ba33e70a42fddcee01097ca0fbdd4dbf2c2f05d8a2ff5263e09'
|
2013-08-04 03:20:30 +00:00
|
|
|
|
2014-03-17 04:33:19 +00:00
|
|
|
# http://bugs.winehq.org/show_bug.cgi?id=34166
|
|
|
|
patch do
|
|
|
|
url "http://bugs.winehq.org/attachment.cgi?id=47639"
|
|
|
|
sha1 "c195f4b9c0af450c7dc3f396e8661ea5248f2b01"
|
|
|
|
end
|
2013-09-22 01:47:54 +00:00
|
|
|
end
|
2012-09-14 16:07:47 +00:00
|
|
|
|
2014-03-17 04:33:19 +00:00
|
|
|
head "git://source.winehq.org/git/wine.git"
|
|
|
|
|
2013-11-20 15:58:40 +00:00
|
|
|
env :std
|
|
|
|
|
2013-07-15 20:16:52 +00:00
|
|
|
# note that all wine dependencies should declare a --universal option in their formula,
|
|
|
|
# otherwise homebrew will not notice that they are not built universal
|
2013-09-22 01:47:54 +00:00
|
|
|
require_universal_deps
|
2013-07-15 20:16:52 +00:00
|
|
|
|
|
|
|
# Wine will build both the Mac and the X11 driver by default, and you can switch
|
|
|
|
# between them. But if you really want to build without X11, you can.
|
|
|
|
depends_on :x11 => :recommended
|
2014-03-12 19:38:54 +00:00
|
|
|
depends_on 'freetype'
|
2009-10-04 13:48:56 +00:00
|
|
|
depends_on 'jpeg'
|
2013-08-17 20:41:38 +00:00
|
|
|
depends_on 'libgphoto2'
|
2014-01-17 22:23:11 +00:00
|
|
|
depends_on 'little-cms2'
|
2010-12-13 23:06:05 +00:00
|
|
|
depends_on 'libicns'
|
2013-01-19 20:16:29 +00:00
|
|
|
depends_on 'libtiff'
|
2013-07-15 20:16:52 +00:00
|
|
|
depends_on 'sane-backends'
|
2013-08-16 17:01:59 +00:00
|
|
|
depends_on 'libgsm' => :optional
|
2011-06-07 10:44:27 +00:00
|
|
|
|
2013-08-12 04:07:39 +00:00
|
|
|
resource 'gecko' do
|
2014-02-27 14:19:55 +00:00
|
|
|
url 'https://downloads.sourceforge.net/wine/wine_gecko-2.24-x86.msi', :using => :nounzip
|
2013-10-02 03:29:56 +00:00
|
|
|
version '2.24'
|
|
|
|
sha1 'b4923c0565e6cbd20075a0d4119ce3b48424f962'
|
2013-08-12 04:07:39 +00:00
|
|
|
end
|
|
|
|
|
2013-09-12 06:17:49 +00:00
|
|
|
resource 'mono' do
|
2014-02-27 14:19:55 +00:00
|
|
|
url 'https://downloads.sourceforge.net/wine/wine-mono-4.5.2.msi', :using => :nounzip
|
2014-01-09 17:02:35 +00:00
|
|
|
sha256 'd9124edb41ba4418af10eba519dafb25ab4338c567d25ce0eb4ce1e1b4d7eaad'
|
2013-08-12 04:07:39 +00:00
|
|
|
end
|
|
|
|
|
2012-03-18 20:33:24 +00:00
|
|
|
fails_with :llvm do
|
|
|
|
build 2336
|
|
|
|
cause 'llvm-gcc does not respect force_align_arg_pointer'
|
|
|
|
end
|
2011-03-21 21:24:22 +00:00
|
|
|
|
2013-08-02 18:36:10 +00:00
|
|
|
fails_with :clang do
|
|
|
|
build 421
|
|
|
|
cause 'error: invalid operand for instruction lretw'
|
|
|
|
end
|
|
|
|
|
2013-11-23 21:50:23 +00:00
|
|
|
# These libraries are not specified as dependencies, or not built as 32-bit:
|
2013-07-15 20:16:52 +00:00
|
|
|
# configure: libv4l, gstreamer-0.10, libcapi20, libgsm
|
2010-03-25 17:45:32 +00:00
|
|
|
|
2010-12-29 04:57:07 +00:00
|
|
|
# Wine loads many libraries lazily using dlopen calls, so it needs these paths
|
|
|
|
# to be searched by dyld.
|
2011-03-09 12:22:43 +00:00
|
|
|
# Including /usr/lib because wine, as of 1.3.15, tries to dlopen
|
|
|
|
# libncurses.5.4.dylib, and fails to find it without the fallback path.
|
2011-03-18 20:55:57 +00:00
|
|
|
|
2013-11-20 16:54:04 +00:00
|
|
|
def library_path
|
2013-12-02 23:28:05 +00:00
|
|
|
paths = %W[#{HOMEBREW_PREFIX}/lib /usr/lib]
|
2014-03-06 20:40:26 +00:00
|
|
|
paths.unshift(MacOS::X11.lib) if build.with? 'x11'
|
2013-11-20 16:54:04 +00:00
|
|
|
paths.join(':')
|
|
|
|
end
|
|
|
|
|
2012-03-27 18:44:09 +00:00
|
|
|
def wine_wrapper; <<-EOS.undent
|
|
|
|
#!/bin/sh
|
2013-10-26 20:20:44 +00:00
|
|
|
DYLD_FALLBACK_LIBRARY_PATH="#{library_path}" "#{bin}/wine.bin" "$@"
|
2012-03-27 18:44:09 +00:00
|
|
|
EOS
|
2010-08-06 19:50:42 +00:00
|
|
|
end
|
|
|
|
|
2009-10-04 13:48:56 +00:00
|
|
|
def install
|
2013-11-20 15:58:40 +00:00
|
|
|
# Build 32-bit; Wine doesn't support 64-bit host builds on OS X.
|
|
|
|
build32 = "-arch i386 -m32"
|
|
|
|
|
|
|
|
ENV.append "CFLAGS", build32
|
|
|
|
ENV.append "LDFLAGS", build32
|
2013-03-04 21:14:02 +00:00
|
|
|
|
2013-10-02 03:29:56 +00:00
|
|
|
# The clang that comes with Xcode 5 no longer miscompiles wine. Tested with 1.7.3.
|
2013-11-03 17:45:26 +00:00
|
|
|
if ENV.compiler == :clang and MacOS.clang_build_version < 500
|
2013-08-04 03:20:30 +00:00
|
|
|
opoo <<-EOS.undent
|
2013-11-03 17:45:26 +00:00
|
|
|
Clang currently miscompiles some parts of Wine.
|
|
|
|
If you have GCC, you can get a more stable build with:
|
|
|
|
brew install wine --cc=gcc-4.2 # or 4.7, 4.8, etc.
|
2013-08-04 03:20:30 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
2013-01-19 20:16:29 +00:00
|
|
|
# Workarounds for XCode not including pkg-config files
|
2013-11-19 23:20:07 +00:00
|
|
|
# FIXME we include pkg-config files for libxml2 and libxslt. Is this really necessary?
|
2013-01-19 20:16:29 +00:00
|
|
|
ENV.libxml2
|
|
|
|
ENV.append "LDFLAGS", "-lxslt"
|
|
|
|
|
2013-07-15 20:16:52 +00:00
|
|
|
args = ["--prefix=#{prefix}"]
|
2013-07-10 02:30:15 +00:00
|
|
|
args << "--disable-win16" if MacOS.version <= :leopard or ENV.compiler == :clang
|
2010-06-21 16:56:22 +00:00
|
|
|
|
2010-12-13 23:06:05 +00:00
|
|
|
# 64-bit builds of mpg123 are incompatible with 32-bit builds of Wine
|
2011-02-12 16:49:20 +00:00
|
|
|
args << "--without-mpg123" if Hardware.is_64_bit?
|
2010-08-10 14:42:05 +00:00
|
|
|
|
2013-08-18 21:45:50 +00:00
|
|
|
args << "--without-x" if build.without? 'x11'
|
|
|
|
|
2010-06-21 16:56:22 +00:00
|
|
|
system "./configure", *args
|
2013-07-15 20:16:52 +00:00
|
|
|
|
|
|
|
unless ENV.compiler == :clang or ENV.compiler == :llvm
|
|
|
|
# The Mac driver uses blocks and must be compiled with clang even if the rest of
|
|
|
|
# Wine is built with gcc. This must be done after configure.
|
|
|
|
system 'make', 'dlls/winemac.drv/Makefile'
|
|
|
|
inreplace 'dlls/winemac.drv/Makefile', /^CC\s*=\s*[^\s]+/, "CC = clang"
|
|
|
|
end
|
|
|
|
|
2009-10-04 13:48:56 +00:00
|
|
|
system "make install"
|
2013-08-12 04:07:39 +00:00
|
|
|
(share/'wine/gecko').install resource('gecko')
|
|
|
|
(share/'wine/mono').install resource('mono')
|
2011-08-02 00:46:33 +00:00
|
|
|
|
2010-08-06 19:50:42 +00:00
|
|
|
# Use a wrapper script, so rename wine to wine.bin
|
|
|
|
# and name our startup script wine
|
2012-10-21 20:27:57 +00:00
|
|
|
mv bin/'wine', bin/'wine.bin'
|
|
|
|
(bin/'wine').write(wine_wrapper)
|
2013-08-12 04:07:39 +00:00
|
|
|
|
|
|
|
# Don't need Gnome desktop support
|
|
|
|
(share/'applications').rmtree
|
2009-10-04 13:48:56 +00:00
|
|
|
end
|
|
|
|
|
2013-07-21 18:14:05 +00:00
|
|
|
def caveats
|
|
|
|
s = <<-EOS.undent
|
|
|
|
You may want to get winetricks:
|
|
|
|
brew install winetricks
|
|
|
|
|
|
|
|
The current version of Wine contains a partial implementation of dwrite.dll
|
|
|
|
which may cause text rendering issues in applications such as Steam.
|
|
|
|
We recommend that you run winecfg, add an override for dwrite in the
|
|
|
|
Libraries tab, and edit the override mode to "disable". See:
|
|
|
|
http://bugs.winehq.org/show_bug.cgi?id=31374
|
2009-10-04 13:48:56 +00:00
|
|
|
EOS
|
2013-07-21 18:14:05 +00:00
|
|
|
|
2014-03-06 20:40:26 +00:00
|
|
|
if build.with? 'x11'
|
2013-07-21 18:14:05 +00:00
|
|
|
s += <<-EOS.undent
|
|
|
|
|
|
|
|
By default Wine uses a native Mac driver. To switch to the X11 driver, use
|
|
|
|
regedit to set the "graphics" key under "HKCU\Software\Wine\Drivers" to
|
|
|
|
"x11" (or use winetricks).
|
|
|
|
|
|
|
|
For best results with X11, install the latest version of XQuartz:
|
|
|
|
http://xquartz.macosforge.org/
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
return s
|
2009-10-04 13:48:56 +00:00
|
|
|
end
|
|
|
|
end
|