def METHOD_NAME(sname):
    @subpackage(f"qemu-system-{sname}")
    def _system(self):
        self.pkgdesc = f"{pkgname} (system-{sname})"
        self.depends = [f"{pkgname}={pkgver}-r{pkgrel}"]
        self.options = ["foreignelf"]
        extras = []
        match sname:
            case "aarch64":
                extras = [
                    "usr/lib/qemu/edk2-aarch64-code.fd",
                    "usr/lib/qemu/firmware/60-edk2-aarch64.json",
                ]
            case "alpha":
                extras = ["usr/lib/qemu/palcode-clipper"]
            case "arm":
                extras = [
                    "usr/lib/qemu/edk2-arm-code.fd",
                    "usr/lib/qemu/edk2-arm-vars.fd",
                    "usr/lib/qemu/npcm7xx_bootrom.bin",
                    "usr/lib/qemu/firmware/60-edk2-arm.json",
                ]
            case "hppa":
                extras = [
                    "usr/lib/qemu/hppa-firmware.img",
                ]
                self.options += ["execstack"]
            case "i386":
                extras = [
                    "usr/lib/qemu/edk2-i386-code.fd",
                    "usr/lib/qemu/edk2-i386-secure-code.fd",
                    "usr/lib/qemu/edk2-i386-vars.fd",
                    "usr/lib/qemu/firmware/50-edk2-i386-secure.json",
                    "usr/lib/qemu/firmware/60-edk2-i386.json",
                ]
            case "ppc":
                extras = [
                    "usr/lib/qemu/openbios-ppc",
                    "usr/lib/qemu/u-boot.e500",
                    "usr/lib/qemu/u-boot-sam460-20100605.bin",
                ]
                self.options += ["execstack"]
            case "riscv32":
                extras = [
                    "usr/lib/qemu/opensbi-riscv32-generic-fw_dynamic.bin",
                ]
            case "riscv64":
                extras = [
                    "usr/lib/qemu/opensbi-riscv64-generic-fw_dynamic.bin",
                ]
            case "s390x":
                extras = [
                    "usr/lib/qemu/s390-ccw.img",
                    "usr/lib/qemu/s390-netboot.img",
                ]
                self.options += ["execstack", "textrels"]
            case "sparc":
                extras = [
                    "usr/lib/qemu/openbios-sparc32",
                ]
                self.options += ["execstack"]
            case "sparc64":
                extras = [
                    "usr/lib/qemu/openbios-sparc64",
                ]
                self.options += ["execstack"]
            case "x86_64":
                extras = [
                    "usr/lib/qemu/edk2-x86_64-code.fd",
                    "usr/lib/qemu/edk2-x86_64-secure-code.fd",
                    "usr/lib/qemu/firmware/50-edk2-x86_64-secure.json",
                    "usr/lib/qemu/firmware/60-edk2-x86_64.json",
                ]
        # never strip them
        self.nostrip_files = extras
        return [f"usr/bin/qemu-system-{sname}"] + extras