homebrew-core/Formula/wine.rb

56 lines
1.4 KiB
Ruby
Raw Normal View History

require 'formula'
2009-10-04 13:48:56 +00:00
class Wine <Formula
2010-01-31 11:20:35 +00:00
url 'http://ibiblio.org/pub/linux/system/emulators/wine/wine-1.1.37.tar.bz2'
md5 'a9144360723c8276dffdbcea9c1028d5'
2009-10-04 13:48:56 +00:00
homepage 'http://www.winehq.org/'
2009-10-04 13:48:56 +00:00
depends_on 'jpeg'
depends_on 'mpg123' => :optional
2009-10-04 13:48:56 +00:00
def install
# Wine does not compile with LLVM yet
ENV.gcc_4_2
2009-10-04 13:48:56 +00:00
ENV.x11
# Make sure we build 32bit version, because Wine64 is not fully functional yet
2009-10-04 13:48:56 +00:00
build32 = "-arch i386 -m32"
ENV["LIBS"] = "-lGL -lGLU"
2009-11-16 18:41:26 +00:00
ENV.append "CFLAGS", build32
ENV.append "CXXFLAGS", "-D_DARWIN_NO_64_BIT_INODE"
ENV.append "LDFLAGS", [build32, "-framework CoreServices", "-lz", "-lGL -lGLU"].join(' ')
ENV.append "DYLD_FALLBACK_LIBRARY_PATH", "/usr/X11/lib"
2009-10-04 13:48:56 +00:00
system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking", "--disable-win16"
system "make install"
rename_binary
install_wrapper
end
def caveats; <<-EOS
Get winetricks with:
wget http://www.kegel.com/wine/winetricks > #{prefix}/bin/winetricks
chmod +x #{prefix}/bin/winetricks
brew link wine
EOS
end
def wine_wrapper
DATA
end
2009-10-04 13:48:56 +00:00
def rename_binary
(bin+'wine').rename(bin+'wine.bin')
end
def install_wrapper
(bin+'wine').write(wine_wrapper.read.gsub('@PREFIX@', prefix))
end
end
__END__
#!/bin/sh
DYLD_FALLBACK_LIBRARY_PATH="/usr/X11/lib" \
"@PREFIX@/bin/wine.bin" "$@"