class Qemu < Formula desc "x86 and PowerPC Emulator" homepage "http://wiki.qemu.org" url "http://wiki.qemu-project.org/download/qemu-2.6.0.tar.bz2" mirror "http://ftp.osuosl.org/pub/blfs/conglomeration/qemu/qemu-2.6.0.tar.bz2" sha256 "c9ac4a651b273233d21b8bec32e30507cb9cce7900841febc330956a1a8434ec" head "git://git.qemu-project.org/qemu.git" bottle do sha256 "3315fd7c6093169133497b4eae48f82f22919f41286adf28b666a3da894764b5" => :el_capitan sha256 "41c8a897ab1296ac0724e49e617b8fe319bcc35c66718c5375e22bca4aa71d81" => :yosemite sha256 "060e7a83fb5e2d270b9b306188ea536524b42ee4dc6b8203c8c98f9b9ddddcae" => :mavericks end depends_on "pkg-config" => :build depends_on "libtool" => :build depends_on "jpeg" depends_on "libpng" => :recommended depends_on "gnutls" depends_on "glib" depends_on "pixman" depends_on "vde" => :optional depends_on "sdl" => :optional depends_on "gtk+" => :optional depends_on "libssh2" => :optional fails_with :gcc_4_0 do cause "qemu requires a compiler with support for the __thread specifier" end fails_with :gcc do cause "qemu requires a compiler with support for the __thread specifier" end # 3.2MB working disc-image file hosted on upstream's servers for people to use to test qemu functionality. resource "armtest" do url "http://wiki.qemu.org/download/arm-test-0.2.tar.gz" sha256 "4b4c2dce4c055f0a2adb93d571987a3d40c96c6cbfd9244d19b9708ce5aea454" end def install ENV["LIBTOOL"] = "glibtool" args = %W[ --prefix=#{prefix} --cc=#{ENV.cc} --host-cc=#{ENV.cc} --disable-bsd-user --disable-guest-agent ] # Cocoa and SDL UIs cannot both be enabled at once. if build.with? "sdl" args << "--enable-sdl" << "--disable-cocoa" else args << "--enable-cocoa" << "--disable-sdl" end args << (build.with?("vde") ? "--enable-vde" : "--disable-vde") args << (build.with?("gtk+") ? "--enable-gtk" : "--disable-gtk") args << (build.with?("libssh2") ? "--enable-libssh2" : "--disable-libssh2") system "./configure", *args system "make", "V=1", "install" end test do system "#{bin}/qemu-system-i386", "--version" resource("armtest").stage testpath assert_match "file format: raw", shell_output("#{bin}/qemu-img info arm_root.img") end end