Index: sysutils/edk2/Makefile =================================================================== --- sysutils/edk2/Makefile +++ sysutils/edk2/Makefile @@ -11,7 +11,7 @@ ONLY_FOR_ARCHS_REASON= only provides firmware for aarch64 and amd64 PKGNAMESUFFIX= -${FLAVOR:C/_/-/g} -FLAVORS= macchiatobin fvp rpi3 rpi4 xen_x64 +FLAVORS= macchiatobin fvp rpi3 rpi4 xen_x64 bhyve FLAVOR?= macchiatobin USES= cpe gmake python:3.7+,build @@ -94,7 +94,33 @@ PLAT_FILENAME= XEN_X64_EFI.fd .endif +.if ${FLAVOR} == bhyve +ONLY_FOR_ARCHS= amd64 +ONLY_FOR_ARCHS_REASON= Bhyve only runs on x64 +PLAT= bhyve +PLAT_ARCH= X64 +PLAT_TARGET= RELEASE +PLATFILE= OvmfPkg/Bhyve/BhyveX64.dsc +PLAT_RESULT= BhyveX64/${PLAT_TARGET}_GCC5/FV/BHYVE.fd +PLAT_RESULT_CODE= BhyveX64/${PLAT_TARGET}_GCC5/FV/BHYVE_CODE.fd +PLAT_RESULT_VARS= BhyveX64/${PLAT_TARGET}_GCC5/FV/BHYVE_VARS.fd +PLAT_FILENAME= BHYVE_UEFI.fd +PLAT_FILENAME_CODE = BHYVE_UEFI_CODE.fd +PLAT_FILENAME_VARS = BHYVE_UEFI_VARS.fd +.endif + PLIST_FILES= ${PREFIX}/share/${PORTNAME}-${PLAT}/${PLAT_FILENAME} +.if defined(PLAT_FILENAME_CODE) +PLIST_FILES+= ${PREFIX}/share/${PORTNAME}-${PLAT}/${PLAT_FILENAME_CODE} +.endif +.if defined(PLAT_FILENAME_VARS) +PLIST_FILES+= ${PREFIX}/share/${PORTNAME}-${PLAT}/${PLAT_FILENAME_VARS} +.endif +.if ${FLAVOR} == bhyve +PLIST_FILES+= ${PREFIX}/share/uefi-firmware/${PLAT_FILENAME} +PLIST_FILES+= ${PREFIX}/share/uefi-firmware/${PLAT_FILENAME_CODE} +PLIST_FILES+= ${PREFIX}/share/uefi-firmware/${PLAT_FILENAME_VARS} +.endif # Emulate source edk2/edksetup.sh MAKE_ENV+= WORKSPACE=${WRKDIR} \ @@ -133,5 +159,18 @@ do-install: ${MKDIR} ${STAGEDIR}/${PREFIX}/share/${PORTNAME}-${PLAT}/ ${INSTALL_DATA} ${WRKDIR}/Build/${PLAT_RESULT} ${STAGEDIR}/${PREFIX}/share/${PORTNAME}-${PLAT}/${PLAT_FILENAME} +.if defined(PLAT_FILENAME_CODE) + ${INSTALL_DATA} ${WRKDIR}/Build/${PLAT_RESULT_CODE} ${STAGEDIR}/${PREFIX}/share/${PORTNAME}-${PLAT}/${PLAT_FILENAME_CODE} +.endif +.if defined(PLAT_FILENAME_VARS) + ${INSTALL_DATA} ${WRKDIR}/Build/${PLAT_RESULT_VARS} ${STAGEDIR}/${PREFIX}/share/${PORTNAME}-${PLAT}/${PLAT_FILENAME_VARS} +.endif +.if ${FLAVOR} == bhyve + # For backwards compatibility + ${MKDIR} ${STAGEDIR}/${PREFIX}/share/uefi-firmware/ + ${RLN} ${STAGEDIR}/${PREFIX}/share/${PORTNAME}-${PLAT}/${PLAT_FILENAME} ${STAGEDIR}/${PREFIX}/share/uefi-firmware/${PLAT_FILENAME} + ${RLN} ${STAGEDIR}/${PREFIX}/share/${PORTNAME}-${PLAT}/${PLAT_FILENAME_CODE} ${STAGEDIR}/${PREFIX}/share/uefi-firmware/${PLAT_FILENAME_CODE} + ${RLN} ${STAGEDIR}/${PREFIX}/share/${PORTNAME}-${PLAT}/${PLAT_FILENAME_VARS} ${STAGEDIR}/${PREFIX}/share/uefi-firmware/${PLAT_FILENAME_VARS} +.endif .include