Permalink
Cannot retrieve contributors at this time
129 lines (116 sloc)
5.33 KB
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
homebrew-core/Formula/qemu.rb
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Qemu < Formula | |
desc "Emulator for x86 and PowerPC" | |
homepage "https://www.qemu.org/" | |
url "https://download.qemu.org/qemu-8.0.2.tar.xz" | |
sha256 "f060abd435fbe6794125e2c398568ffc3cfa540042596907a8b18edca34cf6a5" | |
license "GPL-2.0-only" | |
head "https://git.qemu.org/git/qemu.git", branch: "master" | |
bottle do | |
sha256 arm64_ventura: "359cdf4548d7145592f70af5c431142f33e812e11d5a4183ec27691021a394ee" | |
sha256 arm64_monterey: "38f2b8cf135b72d985cf54749fa2c8616da36a086a69e8233098b7904f305c41" | |
sha256 arm64_big_sur: "71b24aee340ca2661ae7a3fae476478a1a019e0928d2509ab9fb9fabf44702c2" | |
sha256 ventura: "3ad8760e829f5cf0cfca3113aa488cc0683a1ee6bf9ca76fc2769d9adb38452b" | |
sha256 monterey: "9caf13bc0bc2a52e61ebacaffcd67ffb4d1a7318bdf2ddab235dfe0c1b2d5c06" | |
sha256 big_sur: "d92fda3fa6da4a95e73a8f1bd1ddcd5d24ef2b26f5041c021a37e5583c50c137" | |
sha256 x86_64_linux: "d7945e0cf256b82a4293c90a55bb0b56e872a33dd2bfa9dade6d70bd36158850" | |
end | |
depends_on "libtool" => :build | |
depends_on "meson" => :build | |
depends_on "ninja" => :build | |
depends_on "pkg-config" => :build | |
depends_on "spice-protocol" => :build | |
depends_on "capstone" | |
depends_on "glib" | |
depends_on "gnutls" | |
depends_on "jpeg-turbo" | |
depends_on "libpng" | |
depends_on "libslirp" | |
depends_on "libssh" | |
depends_on "libusb" | |
depends_on "lzo" | |
depends_on "ncurses" | |
depends_on "nettle" | |
depends_on "pixman" | |
depends_on "snappy" | |
depends_on "vde" | |
depends_on "zstd" | |
uses_from_macos "bison" => :build | |
uses_from_macos "flex" => :build | |
on_linux do | |
depends_on "attr" | |
depends_on "gtk+3" | |
depends_on "libcap-ng" | |
end | |
fails_with gcc: "5" | |
# 820KB floppy disk image file of FreeDOS 1.2, used to test QEMU | |
resource "homebrew-test-image" do | |
url "https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/official/FD12FLOPPY.zip" | |
sha256 "81237c7b42dc0ffc8b32a2f5734e3480a3f9a470c50c14a9c4576a2561a35807" | |
end | |
def install | |
ENV["LIBTOOL"] = "glibtool" | |
args = %W[ | |
--prefix=#{prefix} | |
--cc=#{ENV.cc} | |
--host-cc=#{ENV.cc} | |
--disable-bsd-user | |
--disable-guest-agent | |
--enable-slirp | |
--enable-capstone | |
--enable-curses | |
--enable-libssh | |
--enable-vde | |
--enable-virtfs | |
--enable-zstd | |
--extra-cflags=-DNCURSES_WIDECHAR=1 | |
--disable-sdl | |
] | |
# Sharing Samba directories in QEMU requires the samba.org smbd which is | |
# incompatible with the macOS-provided version. This will lead to | |
# silent runtime failures, so we set it to a Homebrew path in order to | |
# obtain sensible runtime errors. This will also be compatible with | |
# Samba installations from external taps. | |
args << "--smbd=#{HOMEBREW_PREFIX}/sbin/samba-dot-org-smbd" | |
args += if OS.mac? | |
["--disable-gtk", "--enable-cocoa"] | |
else | |
["--enable-gtk"] | |
end | |
system "./configure", *args | |
system "make", "V=1", "install" | |
end | |
test do | |
expected = build.stable? ? version.to_s : "QEMU Project" | |
assert_match expected, shell_output("#{bin}/qemu-system-aarch64 --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-alpha --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-arm --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-cris --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-hppa --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-i386 --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-m68k --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-microblaze --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-microblazeel --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-mips --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-mips64 --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-mips64el --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-mipsel --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-nios2 --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-or1k --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-ppc --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-ppc64 --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-riscv32 --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-riscv64 --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-rx --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-s390x --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-sh4 --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-sh4eb --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-sparc --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-sparc64 --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-tricore --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-x86_64 --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-xtensa --version") | |
assert_match expected, shell_output("#{bin}/qemu-system-xtensaeb --version") | |
resource("homebrew-test-image").stage testpath | |
assert_match "file format: raw", shell_output("#{bin}/qemu-img info FLOPPY.img") | |
end | |
end |