SUMMARY="QEMU is a generic and open source machine emulator and virtualizer."
DESCRIPTION="QEMU is a generic and open source machine emulator and virtualizer."
HOMEPAGE="http://wiki.qemu.org/"
SRC_URI="git+https://github.com/mmlr/qemu-haiku.git#1b50193d3b850f1e64b76e9a0ee7b007387ac99b"
COPYRIGHT="2003-2008 Fabrice Bellard"
LICENSE="GNU GPL v2"
REVISION="1"
CHECKSUM_MD5="489f26907f807bde3c4579e4d11e1195"
ARCHITECTURES="x86"

PROVIDES="
	qemu = $portVersion
	cmd:qemu = $portVersion
	cmd:qemu_img = $portVersion
	cmd:qemu_io = $portVersion
	cmd:qemu_system_arm = $portVersion
	cmd:qemu_system_cris = $portVersion
	cmd:qemu_system_lm32 = $portVersion
	cmd:qemu_system_m68k = $portVersion
	cmd:qemu_system_microblaze = $portVersion
	cmd:qemu_system_microblazeel = $portVersion
	cmd:qemu_system_mips = $portVersion
	cmd:qemu_system_mips64 = $portVersion
	cmd:qemu_system_mips64el = $portVersion
	cmd:qemu_system_mipsel = $portVersion
	cmd:qemu_system_ppc = $portVersion
	cmd:qemu_system_ppc64 = $portVersion
	cmd:qemu_system_ppcemb = $portVersion
	cmd:qemu_system_s390x = $portVersion
	cmd:qemu_system_sh4 = $portVersion
	cmd:qemu_system_sh4eb = $portVersion
	cmd:qemu_system_sparc = $portVersion
	cmd:qemu_system_sparc64 = $portVersion
	cmd:qemu_system_x86_64 = $portVersion
"

REQUIRES="
	haiku >= $haikuVersion
	lib:libz
"

BUILD_REQUIRES="
	haiku_devel >= $haikuVersion
	devel:libz
"

BUILD_PREREQUIRES="
	cmd:gcc
	cmd:ld
	cmd:make
"

GLOBAL_WRITABLE_FILES="
	settings/etc/qemu/target-x86_64.conf keep-old
"

BUILD()
{
	chmod +x configure
	./configure --prefix=$prefix --mandir=$manDir --datadir=$dataDir \
		--docdir=$docDir --bindir=$binDir --libdir=$libDir \
		--sysconfdir=$settingsDir/etc
	make $jobArgs
}

INSTALL()
{
	make install
}
