Changeset View
Standalone View
sysutils/uefi-edk2-bhyve/Makefile
# $FreeBSD$ | # $FreeBSD$ | ||||
PORTNAME= uefi-edk2-bhyve | PORTNAME= uefi-edk2-bhyve | ||||
DISTVERSIONPREFIX= v | DISTVERSION= g20190424 | ||||
DISTVERSION= 0.2 | PORTEPOCH= 2 | ||||
mat: The tag says `...stable201903` which looks a lot like "march 2019", is there a reason the… | |||||
Done Inline ActionsI know, it _should_ be 20190307, the date the tag was added - but I guess it's dated for when the port was updated. I'd prefer not to change it now, but instead wait until I update it to the next edk2-stable201911 tag. bcran: I know, it _should_ be 20190307, the date the tag was added - but I guess it's dated for when… | |||||
araujoUnsubmitted Done Inline ActionsWhy did you bump PORTEPOCH? araujo: Why did you bump PORTEPOCH? | |||||
bcranAuthorUnsubmitted Done Inline ActionsBecause otherwise portlint said the version was going backwards. That is, that "0.2" is a higher version number than "g20190424". bcran: Because otherwise portlint said the version was going backwards. That is, that "0.2" is a… | |||||
araujoUnsubmitted Done Inline ActionsOK, PORTEPOCH is ok then. araujo: OK, PORTEPOCH is ok then. | |||||
PORTREVISION= 1 | |||||
PORTEPOCH= 1 | |||||
CATEGORIES= sysutils | CATEGORIES= sysutils | ||||
MAINTAINER= araujo@FreeBSD.org | MAINTAINER= bcran@FreeBSD.org | ||||
COMMENT?= UEFI-EDK2 firmware for bhyve | COMMENT= UEFI-EDK2 firmware for bhyve | ||||
LICENSE= BSD2CLAUSE | LICENSE= BSD2CLAUSE | ||||
ONLY_FOR_ARCHS= amd64 | ONLY_FOR_ARCHS= amd64 | ||||
BUILD_DEPENDS= bash:shells/bash \ | BUILD_DEPENDS= bash:shells/bash \ | ||||
Done Inline Actionsbash is not in the base system, so it will not be found in PATH unless shells/bash is installed. mat: bash is not in the base system, so it will not be found in PATH unless shells/bash is installed. | |||||
Done Inline ActionsI thought this line caused it to be installed? Could you check the changes I've made to see if they're better/worse please? bcran: I thought this line caused it to be installed? Could you check the changes I've made to see if… | |||||
nasm:devel/nasm \ | nasm:devel/nasm \ | ||||
${PYTHON_LIBDIR}/lib-dynload/_sqlite3.so:databases/py-sqlite3@${PY_FLAVOR} | gcc${GCC_DEFAULT}:lang/gcc${GCC_DEFAULT} \ | ||||
${PYTHON_PKGNAMEPREFIX}sqlite3>=3.4:databases/py-sqlite3@${PY_FLAVOR} | |||||
USES= gmake \ | USES= gmake \ | ||||
python:2.7,build | python:3.4+,build | ||||
USE_GCC= 4.8 | |||||
USE_GITHUB= yes | USE_GITHUB= yes | ||||
GH_ACCOUNT= freebsd | GH_ACCOUNT= freebsd openssl:ssl | ||||
GH_PROJECT= uefi-edk2 | GH_PROJECT= uefi-edk2 openssl:ssl | ||||
GH_TAGNAME= aa8d718 | GH_TAGNAME= bhyve/edk2-stable201903 OpenSSL_1_1_0j:ssl | ||||
GH_SUBDIR= CryptoPkg/Library/OpensslLib/openssl:ssl | |||||
PLIST_FILES= ${PREFIX}/share/uefi-firmware/BHYVE_UEFI${PLIST_SUFFIX}.fd | MAKE_ARGS= EXTRA_LDFLAGS=-static | ||||
Done Inline ActionsAre there slave ports using this one as a master port ? If not, don't use +=. mat: Are there slave ports using this one as a master port ?
If not, don't use `+=`. | |||||
OPTIONS_DEFINE= DEBUG | PLIST_FILES= share/uefi-firmware/BHYVE_UEFI_CODE${PLIST_SUFFIX}-devel.fd \ | ||||
share/uefi-firmware/BHYVE_UEFI_VARS${PLIST_SUFFIX}-devel.fd | |||||
OPTIONS_DEFINE= DEBUG HTTP_BOOT | |||||
OPTIONS_DEFAULT=HTTP_BOOT | |||||
DEBUG_DESC= Build a debug configuration | |||||
HTTP_BOOT_DESC= Build with HTTP(S) boot support | |||||
Done Inline ActionsThese should go before the options block. See Chapter 15. Order of Variables in Port Makefiles. mat: These should go before the options block. See [[ https://www.freebsd.org/doc/en/books/porters… | |||||
DEBUG_VARS= uefi_target=DEBUG | DEBUG_VARS= uefi_target=DEBUG | ||||
DEBUG_VARS_OFF= uefi_target=RELEASE | DEBUG_VARS_OFF= uefi_target=RELEASE | ||||
HTTP_BOOT_VARS= build_args+=-DHTTP_BOOT_ENABLE=TRUE | |||||
MAKE_ARGS+= AS=${LOCALBASE}/bin/as \ | BUILD_ARGS= -DDEBUG_ON_SERIAL_PORT=TRUE | ||||
AR=${LOCALBASE}/bin/ar \ | |||||
LD=${LOCALBASE}/bin/ld \ | |||||
OBJCOPY=${LOCALBASE}/bin/objcopy \ | |||||
CC=${LOCALBASE}/bin/gcc48 \ | |||||
CXX=${LOCALBASE}/bin/g++48 | |||||
BUILD_ARGS=-DDEBUG_ON_SERIAL_PORT=TRUE -D FD_SIZE_2MB | post-patch: | ||||
${MKDIR} ${WRKSRC}/BaseTools/Bin/FreeBSD-${MACHINE}; | |||||
Done Inline ActionsThis is a standard framework variable, goes before options, with MAKE_ARGS. mat: This is a standard framework variable, goes before options, with MAKE_ARGS. | |||||
${LN} -sf ${LOCALBASE}/bin/gcc${GCC_DEFAULT} ${WRKSRC}/BaseTools/Bin/FreeBSD-${MACHINE}/gcc | |||||
${LN} -sf ${LOCALBASE}/bin/gcc${GCC_DEFAULT} ${WRKSRC}/BaseTools/Bin/FreeBSD-${MACHINE}/cc | |||||
${LN} -sf ${LOCALBASE}/bin/g++${GCC_DEFAULT} ${WRKSRC}/BaseTools/Bin/FreeBSD-${MACHINE}/g++ | |||||
${LN} -sf ${LOCALBASE}/bin/ld ${WRKSRC}/BaseTools/Bin/FreeBSD-${MACHINE}/ld | |||||
${LN} -sf ${LOCALBASE}/bin/gmake ${WRKSRC}/BaseTools/Bin/FreeBSD-${MACHINE}/make | |||||
${LN} -sf ${LOCALBASE}/bin/gcc-ar${GCC_DEFAULT} ${WRKSRC}/BaseTools/Bin/FreeBSD-${MACHINE}/gcc-ar | |||||
${LN} -sf ${LOCALBASE}/bin/gcc-nm${GCC_DEFAULT} ${WRKSRC}/BaseTools/Bin/FreeBSD-${MACHINE}/gcc-nm | |||||
${LN} -sf ${LOCALBASE}/bin/objcopy ${WRKSRC}/BaseTools/Bin/FreeBSD-${MACHINE}/objcopy | |||||
${LN} -sf ${PYTHON_CMD} ${WRKSRC}/BaseTools/Bin/FreeBSD-${MACHINE}/python | |||||
${LN} -sf ${LOCALBASE}/bin/nasm ${WRKSRC}/BaseTools/Bin/FreeBSD-${MACHINE}/nasm | |||||
Done Inline ActionsThis is in the USES/USE_* block, should be just after USES. mat: This is in the USES/USE_* block, should be just after USES. | |||||
.include <bsd.port.options.mk> | |||||
.if defined(WITH_CSM) | |||||
PLIST_SUFFIX= _CSM | |||||
BUILD_ARGS+= -DCSM_ENABLE=TRUE | |||||
.endif | |||||
post-extract: | |||||
@${REINPLACE_CMD} -e 's|python|${PYTHON_CMD}|' ${WRKSRC}/BaseTools/Tests/GNUmakefile \ | |||||
${WRKSRC}/BaseTools/BinWrappers/PosixLike/* | |||||
do-build: | do-build: | ||||
unset ARCH; unset MAKEFLAGS; ${MAKE_CMD} ${MAKE_ARGS} -C ${BUILD_WRKSRC}/BaseTools | bash -c "cd ${WRKSRC}; . ./edksetup.sh; ${MAKE_CMD} -j${MAKE_JOBS_NUMBER} -C ${WRKSRC}/BaseTools" | ||||
Done Inline ActionsAll those are out of order. See Chapter 15. Order of Variables in Port Makefiles. Order is :
mat: All those are out of order. See [[ https://www.freebsd.org/doc/en/books/porters… | |||||
Done Inline Actions-j4 is so wrong, a port should not force or decide which number of build jobs it is going to use. This is set by the user, globally, and is available through MAKE_JOBS_NUMBER. You should use -j${MAKE_JOBS_NUMBER}. Also, technically, you should not be using MAKE_CMD directly, but DO_MAKE_BUILD, probably something along the lines of: ${DO_MAKE_BUILD} -C ${WRKSRC}/BaseTools mat: `-j4` is so wrong, a port should not force or decide which number of build jobs it is going to… | |||||
Done Inline ActionsIt looks like I can't use ${DO_MAKE_BUILD} because it uses its own environment and won't work with the Makefile that EDK2 uses: for example EDK2 invokes "make" within the Makefiles. bcran: It looks like I can't use ${DO_MAKE_BUILD} because it uses its own environment and won't work… | |||||
${MKDIR} ${BUILD_WRKSRC}/Build; | |||||
${LN} -sf ${LOCALBASE}/bin/gcc48 ${BUILD_WRKSRC}/Build/gcc | |||||
${LN} -sf ${LOCALBASE}/bin/ld ${BUILD_WRKSRC}/Build/ld | |||||
${LN} -sf ${LOCALBASE}/bin/gmake ${BUILD_WRKSRC}/Build/make | |||||
${LN} -sf ${LOCALBASE}/bin/ar ${BUILD_WRKSRC}/Build/ar | |||||
${LN} -sf ${LOCALBASE}/bin/objcopy ${BUILD_WRKSRC}/Build/objcopy | |||||
${LN} -sf ${LOCALBASE}/bin/nasm ${BUILD_WRKSRC}/Build/nasm | |||||
.if defined(WITH_CSM) | |||||
bash -c " \ | bash -c " \ | ||||
cd ${BUILD_WRKSRC}; \ | cd ${WRKSRC}; \ | ||||
source edksetup.sh;\ | |||||
unset ARCH; unset MAKEFLAGS; \ | unset ARCH; unset MAKEFLAGS; \ | ||||
${MAKE_CMD} ${MAKE_ARGS} GCC48_BIN=${BUILD_WRKSRC}/Build/ -C ${BUILD_WRKSRC}/BhyvePkg/Csm/BhyveCsm16/" | . ./edksetup.sh; \ | ||||
.endif | build -t GCC5 -a X64 -b ${UEFI_TARGET} -p OvmfPkg/OvmfPkgX64.dsc ${BUILD_ARGS} \ | ||||
bash -c " \ | |||||
cd ${BUILD_WRKSRC}; \ | |||||
source edksetup.sh;\ | |||||
unset ARCH; unset MAKEFLAGS; \ | |||||
export GCC48_BIN=${BUILD_WRKSRC}/Build/; \ | |||||
build -t GCC48 -a X64 -b ${UEFI_TARGET} -p BhyvePkg/BhyvePkgX64.dsc ${BUILD_ARGS} \ | |||||
" | " | ||||
do-install: | do-install: | ||||
${MKDIR} ${STAGEDIR}${PREFIX}/share/uefi-firmware/ | ${MKDIR} ${STAGEDIR}${PREFIX}/share/uefi-firmware/ | ||||
${INSTALL} ${BUILD_WRKSRC}/Build/BhyveX64/${UEFI_TARGET}_GCC48/FV/BHYVE.fd \ | ${INSTALL} ${WRKSRC}/Build/OvmfX64/${UEFI_TARGET}_GCC5/FV/OVMF_CODE.fd \ | ||||
${STAGEDIR}${PREFIX}/share/uefi-firmware/BHYVE_UEFI${PLIST_SUFFIX}.fd | ${STAGEDIR}${PREFIX}/share/uefi-firmware/BHYVE_UEFI_CODE${PLIST_SUFFIX}-devel.fd | ||||
${INSTALL} ${WRKSRC}/Build/OvmfX64/${UEFI_TARGET}_GCC5/FV/OVMF_VARS.fd \ | |||||
${STAGEDIR}${PREFIX}/share/uefi-firmware/BHYVE_UEFI_VARS${PLIST_SUFFIX}-devel.fd | |||||
Done Inline ActionsI have not checked, but it feels like _GCC5 is strange, we don't have gcc5 in the tree, and the default is 8 or 9 depending on the arch. mat: I have not checked, but it feels like `_GCC5` is strange, we don't have gcc5 in the tree, and… | |||||
Done Inline ActionsThat's the EDK2 toolchain, which supports everything from GCC 5 and newer with the same "GCC5" toolchain definition. bcran: That's the EDK2 toolchain, which supports everything from GCC 5 and newer with the same "GCC5"… | |||||
.include <bsd.port.mk> | .include <bsd.port.mk> | ||||
RUN_DEPENDS:= ${RUN_DEPENDS:Ngcc*} |
The tag says ...stable201903 which looks a lot like "march 2019", is there a reason the version up there says april 2019 and not march?