Skip to content

Commit

Permalink
[NEW PORT] emulators/qemu-esp
Browse files Browse the repository at this point in the history
  • Loading branch information
trombik committed Oct 31, 2024
1 parent d8a24d3 commit f237a0e
Show file tree
Hide file tree
Showing 4 changed files with 238 additions and 0 deletions.
105 changes: 105 additions & 0 deletions emulators/qemu-esp/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
PORTNAME= qemu-esp
PORTVERSION= ${ESP_QEMU_VERSION}.${ESP_QEMU_SNAPDATE}
CATEGORIES= emulators devel

MAINTAINER= y@trombik.org
COMMENT?= QEMU emulator with espressif xtensa and riscv32 support
WWW= https://github.com/espressif/qemu

BUILD_DEPENDS= bash:shells/bash
LIB_DEPENDS= libslirp.so:net/libslirp
LIB_DEPENDS+= libfdt.so:sysutils/dtc \
libinotify.so:devel/libinotify \
libslirp.so:net/libslirp \
libgcrypt.so:security/libgcrypt

LICENSE= GPLv2

# build workflow: https://github.com/espressif/qemu/blob/esp-develop/.github/workflows/build.yml
# pre-requisites: https://github.com/espressif/qemu/blob/esp-develop/.github/workflows/scripts/prerequisites-old.sh
# configure: https://github.com/espressif/qemu/blob/esp-develop/.github/workflows/scripts/configure-native.sh

# see https://github.com/espressif/qemu/releases
ESP_QEMU_VERSION= 9.0.0
ESP_QEMU_SNAPDATE= 20240606
ESP_VERSION= ${ESP_QEMU_VERSION}-${ESP_QEMU_SNAPDATE}
ESP_RELEASE_TAG= esp-develop-${ESP_VERSION}
ESP_PREFIX= ${PREFIX}/${PORTNAME}
ESP_TARGET= xtensa-softmmu riscv32-softmmu

USE_GITHUB= yes
GH_ACCOUNT= espressif
GH_PROJECT= qemu
GH_TAGNAME= ${ESP_RELEASE_TAG}
PLIST_SUB+= PORTNAME=${PORTNAME}

# see subprojects/*.wrap
GH_TUPLE= \
qemu:keycodemapdb:f5772a62ec52591ff6870b7e8ef32482371f22c6:keycodemapdb/subprojects/keycodemapdb \
qemu:dtc:b6910bec11614980a21e46fbccc35934b671bd81:dtc/subprojects/dtc \
nutanix:libvfio-user:0b28d205572c80b568a1003db2c8f37ca333e4d7:libvfio/subprojects/libvfio-user \
qemu:meson:18427adbf21909f66a307a54ba4c47fd91e18fba:meson/meson \
qemu:berkeley-softfloat-3:b64af41c3276f97f0e181920400ee056b9c88037:berkeleysoftfloat3/subprojects/berkeley-softfloat-3 \
qemu:berkeley-testfloat-3:e7af9751d9f9fd3b47911f51a5cfd08af256a9ab:berkeleytestfloat3/subprojects/berkeley-testfloat-3

ONLY_FOR_ARCHS= amd64
HAS_CONFIGURE= yes
USES= cpe gmake gnome ninja perl5 pkgconfig python:build shebangfix tar:xz iconv:wchar_t sdl xorg
USE_GNOME= gdkpixbuf2
USE_SDL= sdl2
USE_XORG= x11 xext
X11_CONFIGURE_ENABLE= sdl

#SHEBANG_FILES= scripts/xml-preprocess.py
USE_GNOME= glib20
USE_PERL5= build

# see https://github.com/espressif/qemu/blob/esp-develop/.github/workflows/scripts/configure-native.sh
CONFIGURE_ARGS= --enable-gcrypt \
--enable-sdl \
--enable-slirp \
--enable-stack-protector \
--target-list="${ESP_TARGET}" \
--with-pkgversion="${ESP_VERSION}" \
--without-default-features

# see emulators/qemu/Makefile
CONFIGURE_ARGS+= --cc=${CC} \
--disable-kvm \
--disable-linux-aio \
--disable-linux-user \
--disable-xen \
--extra-cflags=-I${WRKSRC}\ -I${LOCALBASE}/include\ -DPREFIX=\\\"\"${ESP_PREFIX}\\\"\" \
--extra-ldflags=-L${LOCALBASE}/lib \
--extra-ldflags=-L/usr/lib \
--localstatedir=/var \
--mandir=${ESP_PREFIX}/share/man \
--prefix=${ESP_PREFIX} \
--python=${PYTHON_CMD} \
--enable-fdt=system

CFLAGS:= ${CFLAGS:C/-fno-tree-vrp//}
WITHOUT_CPU_CFLAGS= yes #to avoid problems with register allocation

.include <bsd.port.options.mk>

.if ${ARCH} == amd64
MAKE_ARGS+= ARCH=x86_64
.endif

post-extract:
${CP} ${WRKSRC}/subprojects/packagefiles/berkeley-softfloat-3/* \
${WRKSRC}/subprojects/berkeley-softfloat-3/
${CP} ${WRKSRC}/subprojects/packagefiles/berkeley-testfloat-3/* \
${WRKSRC}/subprojects/berkeley-testfloat-3/

do-build:
cd ${WRKSRC} && ${SETENVI} ${WRK_ENV} ${GMAKE} -j${MAKE_JOBS_NUMBER}

do-install:
cd ${WRKSRC} && ${SETENVI} ${WRK_ENV} DESTDIR=${STAGEDIR} ${GMAKE} install

post-install:
@${STRIP_CMD} ${STAGEDIR}${ESP_PREFIX}/bin/qemu-*

.include <bsd.port.mk>
15 changes: 15 additions & 0 deletions emulators/qemu-esp/distinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
TIMESTAMP = 1730331453
SHA256 (espressif-qemu-9.0.0.20240606-esp-develop-9.0.0-20240606_GH0.tar.gz) = fa404f9f52fd587259ba777afed509470ecd8438246fbf489933a066119e730e
SIZE (espressif-qemu-9.0.0.20240606-esp-develop-9.0.0-20240606_GH0.tar.gz) = 39621174
SHA256 (qemu-keycodemapdb-f5772a62ec52591ff6870b7e8ef32482371f22c6_GH0.tar.gz) = d014b53382dbb17b8196ad12f50de7f20d0ef1b9f7d54b0be51a6cbb14209195
SIZE (qemu-keycodemapdb-f5772a62ec52591ff6870b7e8ef32482371f22c6_GH0.tar.gz) = 29580
SHA256 (qemu-dtc-b6910bec11614980a21e46fbccc35934b671bd81_GH0.tar.gz) = e115f987eec23a1ba25150a46ced1675de3716072d3b4905afb3a9cda0f007c7
SIZE (qemu-dtc-b6910bec11614980a21e46fbccc35934b671bd81_GH0.tar.gz) = 205556
SHA256 (nutanix-libvfio-user-0b28d205572c80b568a1003db2c8f37ca333e4d7_GH0.tar.gz) = d2f60cd4f86f345aab1332953eb736cce3518159e6e99bcc2d10467c06f717fe
SIZE (nutanix-libvfio-user-0b28d205572c80b568a1003db2c8f37ca333e4d7_GH0.tar.gz) = 189943
SHA256 (qemu-meson-18427adbf21909f66a307a54ba4c47fd91e18fba_GH0.tar.gz) = f20b68de607426eaf5bdb4043c93fc435ac3abbf0d8f5ff33e3e403801a3fb9f
SIZE (qemu-meson-18427adbf21909f66a307a54ba4c47fd91e18fba_GH0.tar.gz) = 4815991
SHA256 (qemu-berkeley-softfloat-3-b64af41c3276f97f0e181920400ee056b9c88037_GH0.tar.gz) = faae889814ea6a292f7ca03d9b36e6c7e95bab2a64777804883cc822b8d48757
SIZE (qemu-berkeley-softfloat-3-b64af41c3276f97f0e181920400ee056b9c88037_GH0.tar.gz) = 148741
SHA256 (qemu-berkeley-testfloat-3-e7af9751d9f9fd3b47911f51a5cfd08af256a9ab_GH0.tar.gz) = e7a09d51dc7e96cb8422c919c85fc3833d4f788567638c9162ef5cd7db59b1df
SIZE (qemu-berkeley-testfloat-3-e7af9751d9f9fd3b47911f51a5cfd08af256a9ab_GH0.tar.gz) = 139308
7 changes: 7 additions & 0 deletions emulators/qemu-esp/pkg-descr
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Fork of QEMU with Espressif patches.

Espressif's QEMU project contains a fork of QEMU with patches for Espressif
chips support. We hope that these patches will eventually be mature enough to
become part of the upstream QEMU project.

https://github.com/espressif/esp-toolchain-docs/blob/main/qemu/README.md
111 changes: 111 additions & 0 deletions emulators/qemu-esp/pkg-plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
%%PORTNAME%%/bin/qemu-system-riscv32
%%PORTNAME%%/bin/qemu-system-xtensa
%%PORTNAME%%/share/applications/qemu.desktop
%%PORTNAME%%/share/icons/hicolor/128x128/apps/qemu.png
%%PORTNAME%%/share/icons/hicolor/16x16/apps/qemu.png
%%PORTNAME%%/share/icons/hicolor/24x24/apps/qemu.png
%%PORTNAME%%/share/icons/hicolor/256x256/apps/qemu.png
%%PORTNAME%%/share/icons/hicolor/32x32/apps/qemu.bmp
%%PORTNAME%%/share/icons/hicolor/32x32/apps/qemu.png
%%PORTNAME%%/share/icons/hicolor/48x48/apps/qemu.png
%%PORTNAME%%/share/icons/hicolor/512x512/apps/qemu.png
%%PORTNAME%%/share/icons/hicolor/64x64/apps/qemu.png
%%PORTNAME%%/share/icons/hicolor/scalable/apps/qemu.svg
%%PORTNAME%%/share/qemu/QEMU,cgthree.bin
%%PORTNAME%%/share/qemu/QEMU,tcx.bin
%%PORTNAME%%/share/qemu/bamboo.dtb
%%PORTNAME%%/share/qemu/bios-256k.bin
%%PORTNAME%%/share/qemu/bios-microvm.bin
%%PORTNAME%%/share/qemu/bios.bin
%%PORTNAME%%/share/qemu/canyonlands.dtb
%%PORTNAME%%/share/qemu/edk2-licenses.txt
%%PORTNAME%%/share/qemu/efi-e1000.rom
%%PORTNAME%%/share/qemu/efi-e1000e.rom
%%PORTNAME%%/share/qemu/efi-eepro100.rom
%%PORTNAME%%/share/qemu/efi-ne2k_pci.rom
%%PORTNAME%%/share/qemu/efi-pcnet.rom
%%PORTNAME%%/share/qemu/efi-rtl8139.rom
%%PORTNAME%%/share/qemu/efi-virtio.rom
%%PORTNAME%%/share/qemu/efi-vmxnet3.rom
%%PORTNAME%%/share/qemu/esp32-v3-rom-app.bin
%%PORTNAME%%/share/qemu/esp32-v3-rom.bin
%%PORTNAME%%/share/qemu/esp32c3-rom.bin
%%PORTNAME%%/share/qemu/esp32s3_rev0_rom.bin
%%PORTNAME%%/share/qemu/hppa-firmware.img
%%PORTNAME%%/share/qemu/hppa-firmware64.img
%%PORTNAME%%/share/qemu/keymaps/ar
%%PORTNAME%%/share/qemu/keymaps/bepo
%%PORTNAME%%/share/qemu/keymaps/cz
%%PORTNAME%%/share/qemu/keymaps/da
%%PORTNAME%%/share/qemu/keymaps/de
%%PORTNAME%%/share/qemu/keymaps/de-ch
%%PORTNAME%%/share/qemu/keymaps/en-gb
%%PORTNAME%%/share/qemu/keymaps/en-us
%%PORTNAME%%/share/qemu/keymaps/es
%%PORTNAME%%/share/qemu/keymaps/et
%%PORTNAME%%/share/qemu/keymaps/fi
%%PORTNAME%%/share/qemu/keymaps/fo
%%PORTNAME%%/share/qemu/keymaps/fr
%%PORTNAME%%/share/qemu/keymaps/fr-be
%%PORTNAME%%/share/qemu/keymaps/fr-ca
%%PORTNAME%%/share/qemu/keymaps/fr-ch
%%PORTNAME%%/share/qemu/keymaps/hr
%%PORTNAME%%/share/qemu/keymaps/hu
%%PORTNAME%%/share/qemu/keymaps/is
%%PORTNAME%%/share/qemu/keymaps/it
%%PORTNAME%%/share/qemu/keymaps/ja
%%PORTNAME%%/share/qemu/keymaps/lt
%%PORTNAME%%/share/qemu/keymaps/lv
%%PORTNAME%%/share/qemu/keymaps/mk
%%PORTNAME%%/share/qemu/keymaps/nl
%%PORTNAME%%/share/qemu/keymaps/no
%%PORTNAME%%/share/qemu/keymaps/pl
%%PORTNAME%%/share/qemu/keymaps/pt
%%PORTNAME%%/share/qemu/keymaps/pt-br
%%PORTNAME%%/share/qemu/keymaps/ru
%%PORTNAME%%/share/qemu/keymaps/sl
%%PORTNAME%%/share/qemu/keymaps/sv
%%PORTNAME%%/share/qemu/keymaps/th
%%PORTNAME%%/share/qemu/keymaps/tr
%%PORTNAME%%/share/qemu/kvmvapic.bin
%%PORTNAME%%/share/qemu/linuxboot.bin
%%PORTNAME%%/share/qemu/linuxboot_dma.bin
%%PORTNAME%%/share/qemu/multiboot.bin
%%PORTNAME%%/share/qemu/multiboot_dma.bin
%%PORTNAME%%/share/qemu/npcm7xx_bootrom.bin
%%PORTNAME%%/share/qemu/openbios-ppc
%%PORTNAME%%/share/qemu/openbios-sparc32
%%PORTNAME%%/share/qemu/openbios-sparc64
%%PORTNAME%%/share/qemu/opensbi-riscv32-generic-fw_dynamic.bin
%%PORTNAME%%/share/qemu/opensbi-riscv64-generic-fw_dynamic.bin
%%PORTNAME%%/share/qemu/palcode-clipper
%%PORTNAME%%/share/qemu/petalogix-ml605.dtb
%%PORTNAME%%/share/qemu/petalogix-s3adsp1800.dtb
%%PORTNAME%%/share/qemu/pvh.bin
%%PORTNAME%%/share/qemu/pxe-e1000.rom
%%PORTNAME%%/share/qemu/pxe-eepro100.rom
%%PORTNAME%%/share/qemu/pxe-ne2k_pci.rom
%%PORTNAME%%/share/qemu/pxe-pcnet.rom
%%PORTNAME%%/share/qemu/pxe-rtl8139.rom
%%PORTNAME%%/share/qemu/pxe-virtio.rom
%%PORTNAME%%/share/qemu/qboot.rom
%%PORTNAME%%/share/qemu/qemu-nsis.bmp
%%PORTNAME%%/share/qemu/qemu_vga.ndrv
%%PORTNAME%%/share/qemu/s390-ccw.img
%%PORTNAME%%/share/qemu/s390-netboot.img
%%PORTNAME%%/share/qemu/skiboot.lid
%%PORTNAME%%/share/qemu/slof.bin
%%PORTNAME%%/share/qemu/trace-events-all
%%PORTNAME%%/share/qemu/u-boot-sam460-20100605.bin
%%PORTNAME%%/share/qemu/u-boot.e500
%%PORTNAME%%/share/qemu/vgabios-ati.bin
%%PORTNAME%%/share/qemu/vgabios-bochs-display.bin
%%PORTNAME%%/share/qemu/vgabios-cirrus.bin
%%PORTNAME%%/share/qemu/vgabios-qxl.bin
%%PORTNAME%%/share/qemu/vgabios-ramfb.bin
%%PORTNAME%%/share/qemu/vgabios-stdvga.bin
%%PORTNAME%%/share/qemu/vgabios-virtio.bin
%%PORTNAME%%/share/qemu/vgabios-vmware.bin
%%PORTNAME%%/share/qemu/vgabios.bin
%%PORTNAME%%/share/qemu/vof-nvram.bin
%%PORTNAME%%/share/qemu/vof.bin

0 comments on commit f237a0e

Please sign in to comment.