git: 0b6166cc3081 - main - sysutils/bhyve+: Fix build on 14-CURRENT
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 02 Apr 2023 13:05:34 UTC
The branch main has been updated by ashish: URL: https://cgit.FreeBSD.org/ports/commit/?id=0b6166cc308181f4d0fcd686c331ba25d82a6c46 commit 0b6166cc308181f4d0fcd686c331ba25d82a6c46 Author: PÁLI Gábor János <pali.gabor@gmail.com> AuthorDate: 2023-04-01 15:06:31 +0000 Commit: Ashish SHUKLA <ashish@FreeBSD.org> CommitDate: 2023-04-02 13:05:15 +0000 sysutils/bhyve+: Fix build on 14-CURRENT - Refactor code for better consistency --- sysutils/bhyve+/Makefile | 25 ++++++++++++++-- sysutils/bhyve+/files/freebsd-12/patch-libvmmapi | 16 +++++------ .../bhyve+/files/freebsd-12/patch-msi-x-mappings | 4 +-- sysutils/bhyve+/files/freebsd-12/patch-virtio-9p | 6 ++-- .../bhyve+/files/freebsd-13/1/patch-custom-libs | 6 ++-- sysutils/bhyve+/files/freebsd-13/1/patch-lib9p | 4 +-- sysutils/bhyve+/files/freebsd-13/1/patch-libvmmapi | 18 ++++++------ sysutils/bhyve+/files/freebsd-14/patch-bhyvectl | 12 -------- sysutils/bhyve+/files/freebsd-14/patch-bhyveload | 11 -------- sysutils/bhyve+/files/freebsd-14/patch-custom-libs | 14 ++++----- sysutils/bhyve+/files/freebsd-14/patch-libvmmapi | 33 +++++++++++++++++++--- sysutils/bhyve+/files/patch-lib9p | 2 +- sysutils/bhyve+/pkg-plist | 4 +-- 13 files changed, 88 insertions(+), 67 deletions(-) diff --git a/sysutils/bhyve+/Makefile b/sysutils/bhyve+/Makefile index 849ab4848bc6..14aa08a4533c 100644 --- a/sysutils/bhyve+/Makefile +++ b/sysutils/bhyve+/Makefile @@ -35,12 +35,19 @@ GH_TAGNAME= 7ef466772108856ee3e093735033232a6f1a3f04 USE_LDCONFIG= yes +LIBVMMAPI_VERSION= 5.1 +LIB9P_VERSION= 1.1 + +PLIST_SUB= 9P_SHLIB_MAJOR=${LIB9P_VERSION} \ + VMMAPI_SHLIB_MAJOR=${LIBVMMAPI_VERSION} + .if 1200000 <= ${OSVERSION} && ${OSVERSION} < 1300000 EXTRA_PATCHES= ${PATCHDIR}/freebsd-12 ${PATCHDIR}/freebsd-12/3 .elif 1301000 <= ${OSVERSION} && ${OSVERSION} < 1400000 EXTRA_PATCHES= ${PATCHDIR}/freebsd-13/1 .elif 1400000 <= ${OSVERSION} && ${OSVERSION} < 1500000 -EXTRA_PATCHES= ${PATCHDIR}/freebsd-14 +EXTRA_PATCHES= ${PATCHDIR}/freebsd-14 +LIBVMMAPI_VERSION= 6.1 .else . if empty(IGNORE) IGNORE+= cannot build: unsupported system @@ -71,6 +78,18 @@ post-extract: .endfor @cd ${FILESDIR} && ${COPYTREE_SHARE} kernconf ${WRKSRC} +post-patch: + @cd ${WRKSRC} && \ + ${REINPLACE_CMD} 's/%%9P_SHLIB_MAJOR%%/${LIB9P_VERSION}/g' \ + contrib/lib9p/Makefile \ + usr.sbin/bhyve/Makefile + @cd ${WRKSRC} && \ + ${REINPLACE_CMD} 's/%%VMMAPI_SHLIB_MAJOR%%/${LIBVMMAPI_VERSION}/g' \ + lib/libvmmapi/Makefile \ + usr.sbin/bhyve/Makefile \ + usr.sbin/bhyvectl/Makefile \ + usr.sbin/bhyveload/Makefile + do-build: @cd ${WRKSRC}/contrib/lib9p && \ ${MAKE} SRCTOP=${WRKSRC} SYSDIR=${SRC_BASE}/sys LIB9PDIR= @@ -83,8 +102,8 @@ do-build: .endfor do-install: - ${INSTALL_LIB} ${WRKSRC}/contrib/lib9p/lib9p.so.1.1 ${STAGEDIR}${PREFIX}/lib - ${INSTALL_LIB} ${WRKSRC}/lib/libvmmapi/libvmmapi.so.5.1 ${STAGEDIR}${PREFIX}/lib + ${INSTALL_LIB} ${WRKSRC}/contrib/lib9p/lib9p.so.${LIB9P_VERSION} ${STAGEDIR}${PREFIX}/lib + ${INSTALL_LIB} ${WRKSRC}/lib/libvmmapi/libvmmapi.so.${LIBVMMAPI_VERSION} ${STAGEDIR}${PREFIX}/lib .for _bin in bhyve bhyveload bhyvectl ${INSTALL_PROGRAM} ${WRKSRC}/usr.sbin/${_bin}/${_bin} ${STAGEDIR}${PREFIX}/sbin ${INSTALL_MAN} ${WRKSRC}/usr.sbin/${_bin}/${_bin}.8.gz ${STAGEDIR}${PREFIX}/man/man8 diff --git a/sysutils/bhyve+/files/freebsd-12/patch-libvmmapi b/sysutils/bhyve+/files/freebsd-12/patch-libvmmapi index 16f14a57bf9a..6131d5eaebcf 100644 --- a/sysutils/bhyve+/files/freebsd-12/patch-libvmmapi +++ b/sysutils/bhyve+/files/freebsd-12/patch-libvmmapi @@ -1,33 +1,33 @@ ---- lib/libvmmapi/Makefile.orig 2021-09-04 01:05:23.110816000 UTC +--- lib/libvmmapi/Makefile.orig +++ lib/libvmmapi/Makefile @@ -6,6 +6,7 @@ INCS= vmmapi.h WARNS?= 2 -+SHLIB_MAJOR?= 5.1 ++SHLIB_MAJOR= %%VMMAPI_SHLIB_MAJOR%% LIBADD= util ---- usr.sbin/bhyvectl/Makefile.orig 2021-09-04 02:33:12.704720000 +0200 -+++ usr.sbin/bhyvectl/Makefile 2021-09-04 02:34:28.740202000 +0200 +--- usr.sbin/bhyvectl/Makefile.orig ++++ usr.sbin/bhyvectl/Makefile @@ -8,7 +8,8 @@ MAN= bhyvectl.8 -LIBADD= vmmapi util +LIBADD= util -+LDADD= ../../lib/libvmmapi/libvmmapi.so.5.1 ++LDADD= ../../lib/libvmmapi/libvmmapi.so.%%VMMAPI_SHLIB_MAJOR%% WARNS?= 3 ---- usr.sbin/bhyveload/Makefile.orig 2021-09-04 02:33:20.942548000 +0200 -+++ usr.sbin/bhyveload/Makefile 2021-09-04 02:35:58.712996000 +0200 +--- usr.sbin/bhyveload/Makefile.orig ++++ usr.sbin/bhyveload/Makefile @@ -5,7 +5,7 @@ MAN= bhyveload.8 PACKAGE= bhyve -LIBADD= vmmapi -+LDADD= ../../lib/libvmmapi/libvmmapi.so.5.1 ++LDADD= ../../lib/libvmmapi/libvmmapi.so.%%VMMAPI_SHLIB_MAJOR%% WARNS?= 3 diff --git a/sysutils/bhyve+/files/freebsd-12/patch-msi-x-mappings b/sysutils/bhyve+/files/freebsd-12/patch-msi-x-mappings index 4c8f453abbbb..76becc6a97a3 100644 --- a/sysutils/bhyve+/files/freebsd-12/patch-msi-x-mappings +++ b/sysutils/bhyve+/files/freebsd-12/patch-msi-x-mappings @@ -1,4 +1,4 @@ ---- usr.sbin/bhyve/pci_emul.h.orig 2021-08-19 23:00:57 UTC +--- usr.sbin/bhyve/pci_emul.h.orig +++ usr.sbin/bhyve/pci_emul.h @@ -146,6 +146,7 @@ struct pci_devinst { struct msix_table_entry *table; /* allocated at runtime */ @@ -8,7 +8,7 @@ } pi_msix; void *pi_arg; /* devemu-private data */ ---- usr.sbin/bhyve/pci_passthru.c.orig 2021-08-19 23:00:57 UTC +--- usr.sbin/bhyve/pci_passthru.c.orig +++ usr.sbin/bhyve/pci_passthru.c @@ -324,13 +324,14 @@ msix_table_read(struct passthru_softc *sc, uint64_t of return (data); diff --git a/sysutils/bhyve+/files/freebsd-12/patch-virtio-9p b/sysutils/bhyve+/files/freebsd-12/patch-virtio-9p index 1e14bcd58d61..d24cd4db2fb4 100644 --- a/sysutils/bhyve+/files/freebsd-12/patch-virtio-9p +++ b/sysutils/bhyve+/files/freebsd-12/patch-virtio-9p @@ -1,4 +1,4 @@ ---- usr.sbin/bhyve/Makefile.orig 2021-08-19 23:00:57 UTC +--- usr.sbin/bhyve/Makefile.orig +++ usr.sbin/bhyve/Makefile @@ -3,6 +3,7 @@ # @@ -22,11 +22,11 @@ -LIBADD= vmmapi md pthread z util sbuf cam +LIBADD= md pthread z util sbuf cam casper cap_pwd cap_grp -+LDADD= ../../contrib/lib9p/lib9p.so.1.1 ../../lib/libvmmapi/libvmmapi.so.5.1 ++LDADD= ../../contrib/lib9p/lib9p.so.%%9P_SHLIB_MAJOR%% ../../lib/libvmmapi/libvmmapi.so.%%VMMAPI_SHLIB_MAJOR%% .if ${MK_INET_SUPPORT} != "no" CFLAGS+=-DINET ---- usr.sbin/bhyve/pci_virtio_9p.c.orig 2021-08-19 22:44:10 UTC +--- usr.sbin/bhyve/pci_virtio_9p.c.orig +++ usr.sbin/bhyve/pci_virtio_9p.c @@ -0,0 +1,344 @@ +/*- diff --git a/sysutils/bhyve+/files/freebsd-13/1/patch-custom-libs b/sysutils/bhyve+/files/freebsd-13/1/patch-custom-libs index cee70aee6367..61b6a93ce908 100644 --- a/sysutils/bhyve+/files/freebsd-13/1/patch-custom-libs +++ b/sysutils/bhyve+/files/freebsd-13/1/patch-custom-libs @@ -1,5 +1,5 @@ ---- usr.sbin/bhyve/Makefile.orig 2022-04-26 00:11:28.231312000 +0000 -+++ usr.sbin/bhyve/Makefile 2022-04-26 00:12:31.807022000 +0000 +--- usr.sbin/bhyve/Makefile.orig ++++ usr.sbin/bhyve/Makefile @@ -3,7 +3,7 @@ # @@ -15,7 +15,7 @@ -LIBADD= vmmapi md nv pthread z util sbuf cam 9p +LIBADD= md nv pthread z util sbuf cam -+LDADD= ../../contrib/lib9p/lib9p.so.1.1 ../../lib/libvmmapi/libvmmapi.so.5.1 ++LDADD= ../../contrib/lib9p/lib9p.so.%%9P_SHLIB_MAJOR%% ../../lib/libvmmapi/libvmmapi.so.%%VMMAPI_SHLIB_MAJOR%% .if ${MK_CASPER} != "no" LIBADD+= casper diff --git a/sysutils/bhyve+/files/freebsd-13/1/patch-lib9p b/sysutils/bhyve+/files/freebsd-13/1/patch-lib9p index b60692f4f5a5..8a0eefb16f83 100644 --- a/sysutils/bhyve+/files/freebsd-13/1/patch-lib9p +++ b/sysutils/bhyve+/files/freebsd-13/1/patch-lib9p @@ -1,5 +1,5 @@ ---- share/mk/src.libnames.mk.orig 2022-04-26 00:33:13.464870000 +0000 -+++ share/mk/src.libnames.mk 2022-04-26 00:34:36.615330000 +0000 +--- share/mk/src.libnames.mk.orig ++++ share/mk/src.libnames.mk @@ -265,6 +265,9 @@ # 2nd+ order consumers. Auto-generating this would be better. _DP_80211= sbuf bsdxml diff --git a/sysutils/bhyve+/files/freebsd-13/1/patch-libvmmapi b/sysutils/bhyve+/files/freebsd-13/1/patch-libvmmapi index 5bb87bd36d46..1ce7f3e3e829 100644 --- a/sysutils/bhyve+/files/freebsd-13/1/patch-libvmmapi +++ b/sysutils/bhyve+/files/freebsd-13/1/patch-libvmmapi @@ -1,33 +1,33 @@ ---- usr.sbin/bhyvectl/Makefile.orig 2022-04-26 00:35:36.192928000 +0000 -+++ usr.sbin/bhyvectl/Makefile 2022-04-26 00:36:35.181368000 +0000 +--- usr.sbin/bhyvectl/Makefile.orig ++++ usr.sbin/bhyvectl/Makefile @@ -10,7 +10,8 @@ MAN= bhyvectl.8 -LIBADD= vmmapi util +LIBADD= util -+LDADD= ../../lib/libvmmapi/libvmmapi.so.5.1 ++LDADD= ../../lib/libvmmapi/libvmmapi.so.%%VMMAPI_SHLIB_MAJOR%% WARNS?= 3 ---- usr.sbin/bhyveload/Makefile.orig 2022-04-26 00:36:44.251099000 +0000 -+++ usr.sbin/bhyveload/Makefile 2022-04-26 00:37:15.919627000 +0000 +--- usr.sbin/bhyveload/Makefile.orig ++++ usr.sbin/bhyveload/Makefile @@ -5,7 +5,7 @@ MAN= bhyveload.8 PACKAGE= bhyve -LIBADD= vmmapi -+LDADD= ../../lib/libvmmapi/libvmmapi.so.5.1 ++LDADD= ../../lib/libvmmapi/libvmmapi.so.%%VMMAPI_SHLIB_MAJOR%% WARNS?= 3 ---- lib/libvmmapi/Makefile.orig 2022-04-26 00:37:35.557718000 +0000 -+++ lib/libvmmapi/Makefile 2022-04-26 00:38:23.135897000 +0000 +--- lib/libvmmapi/Makefile.orig ++++ lib/libvmmapi/Makefile @@ -5,6 +5,8 @@ SRCS= vmmapi.c vmmapi_freebsd.c INCS= vmmapi.h -+SHLIB_MAJOR?= 5.1 ++SHLIB_MAJOR= %%VMMAPI_SHLIB_MAJOR%% + LIBADD= util diff --git a/sysutils/bhyve+/files/freebsd-14/patch-bhyvectl b/sysutils/bhyve+/files/freebsd-14/patch-bhyvectl deleted file mode 100644 index ae14ada4fc5f..000000000000 --- a/sysutils/bhyve+/files/freebsd-14/patch-bhyvectl +++ /dev/null @@ -1,12 +0,0 @@ ---- usr.sbin/bhyvectl/Makefile.orig 2021-09-04 02:33:12.704720000 +0200 -+++ usr.sbin/bhyvectl/Makefile 2021-09-04 02:34:28.740202000 +0200 -@@ -10,7 +10,8 @@ - - MAN= bhyvectl.8 - --LIBADD= vmmapi util -+LIBADD= util -+LDADD= ${SRCTOP}/lib/libvmmapi/libvmmapi.so.5.1 - - WARNS?= 3 - diff --git a/sysutils/bhyve+/files/freebsd-14/patch-bhyveload b/sysutils/bhyve+/files/freebsd-14/patch-bhyveload deleted file mode 100644 index 616f68b1fc2c..000000000000 --- a/sysutils/bhyve+/files/freebsd-14/patch-bhyveload +++ /dev/null @@ -1,11 +0,0 @@ ---- usr.sbin/bhyveload/Makefile.orig 2021-09-25 15:07:46.189926000 +0000 -+++ usr.sbin/bhyveload/Makefile 2021-09-25 15:08:40.718294000 +0000 -@@ -5,7 +5,7 @@ - MAN= bhyveload.8 - PACKAGE= bhyve - --LIBADD= vmmapi -+LDADD= ${SRCTOP}/lib/libvmmapi/libvmmapi.so.5.1 - - WARNS?= 3 - diff --git a/sysutils/bhyve+/files/freebsd-14/patch-custom-libs b/sysutils/bhyve+/files/freebsd-14/patch-custom-libs index 8bc50391d41b..721ea1e559e9 100644 --- a/sysutils/bhyve+/files/freebsd-14/patch-custom-libs +++ b/sysutils/bhyve+/files/freebsd-14/patch-custom-libs @@ -1,5 +1,5 @@ ---- usr.sbin/bhyve/Makefile.orig 2021-09-04 02:15:16.364660000 +0200 -+++ usr.sbin/bhyve/Makefile 2021-09-04 02:21:26.014446000 +0200 +--- usr.sbin/bhyve/Makefile.orig ++++ usr.sbin/bhyve/Makefile @@ -3,7 +3,7 @@ # @@ -9,13 +9,13 @@ CFLAGS+=-I${SRCTOP}/sys .PATH: ${SRCTOP}/sys/cam/ctl -@@ -83,7 +83,8 @@ +@@ -88,7 +88,8 @@ .PATH: ${BHYVE_SYSDIR}/sys/amd64/vmm SRCS+= vmm_instruction_emul.c -LIBADD= vmmapi md nv pthread z util sbuf cam 9p -+LIBADD= md nv pthread z util sbuf cam -+LDADD= ${SRCTOP}/contrib/lib9p/lib9p.so.1.1 ${SRCTOP}/lib/libvmmapi/libvmmapi.so.5.1 ++LIBADD= md nv pthread z util sbuf cam 9p ++LDADD= ${SRCTOP}/contrib/lib9p/lib9p.so.%%9P_SHLIB_MAJOR%% ${SRCTOP}/lib/libvmmapi/libvmmapi.so.%%VMMAPI_SHLIB_MAJOR%% - .if ${MK_CASPER} != "no" - LIBADD+= casper + .if ${MK_BHYVE_SNAPSHOT} != "no" + LIBADD+= ucl xo diff --git a/sysutils/bhyve+/files/freebsd-14/patch-libvmmapi b/sysutils/bhyve+/files/freebsd-14/patch-libvmmapi index d54c9340ca0c..66890febaf6f 100644 --- a/sysutils/bhyve+/files/freebsd-14/patch-libvmmapi +++ b/sysutils/bhyve+/files/freebsd-14/patch-libvmmapi @@ -1,9 +1,34 @@ ---- lib/libvmmapi/Makefile.orig 2021-09-04 01:05:23.110816000 UTC +--- lib/libvmmapi/Makefile.orig +++ lib/libvmmapi/Makefile -@@ -6,6 +6,7 @@ +@@ -2,7 +2,7 @@ + + PACKAGE=lib${LIB} + LIB= vmmapi +-SHLIB_MAJOR= 6 ++SHLIB_MAJOR= %%VMMAPI_SHLIB_MAJOR%% + SRCS= vmmapi.c vmmapi_freebsd.c INCS= vmmapi.h -+SHLIB_MAJOR?= 5.1 +--- usr.sbin/bhyvectl/Makefile.orig ++++ usr.sbin/bhyvectl/Makefile +@@ -10,7 +10,8 @@ + + MAN= bhyvectl.8 + +-LIBADD= vmmapi util ++LIBADD= util ++LDADD= ${SRCTOP}/lib/libvmmapi/libvmmapi.so.%%VMMAPI_SHLIB_MAJOR%% + + WARNS?= 3 + +--- usr.sbin/bhyveload/Makefile.orig ++++ usr.sbin/bhyveload/Makefile +@@ -5,7 +5,7 @@ + MAN= bhyveload.8 + PACKAGE= bhyve + +-LIBADD= vmmapi ++LDADD= ${SRCTOP}/lib/libvmmapi/libvmmapi.so.%%VMMAPI_SHLIB_MAJOR%% - LIBADD= util + WARNS?= 3 diff --git a/sysutils/bhyve+/files/patch-lib9p b/sysutils/bhyve+/files/patch-lib9p index f48b6a8efa91..8818ca5f926f 100644 --- a/sysutils/bhyve+/files/patch-lib9p +++ b/sysutils/bhyve+/files/patch-lib9p @@ -5,7 +5,7 @@ LIB= 9p -SHLIB_MAJOR= 1 -+SHLIB_MAJOR= 1.1 ++SHLIB_MAJOR= %%9P_SHLIB_MAJOR%% SRCS= pack.c \ connection.c \ request.c log.c \ diff --git a/sysutils/bhyve+/pkg-plist b/sysutils/bhyve+/pkg-plist index 4744907bb592..e7314210a479 100644 --- a/sysutils/bhyve+/pkg-plist +++ b/sysutils/bhyve+/pkg-plist @@ -1,8 +1,8 @@ sbin/bhyve sbin/bhyvectl sbin/bhyveload -lib/lib9p.so.1.1 -lib/libvmmapi.so.5.1 +lib/lib9p.so.%%9P_SHLIB_MAJOR%% +lib/libvmmapi.so.%%VMMAPI_SHLIB_MAJOR%% man/man8/bhyve.8.gz man/man8/bhyvectl.8.gz man/man8/bhyveload.8.gz