head	1.10;
access;
symbols
	pkgsrc-2026Q2:1.7.0.4
	pkgsrc-2026Q2-base:1.7
	pkgsrc-2026Q1:1.7.0.2
	pkgsrc-2026Q1-base:1.7
	pkgsrc-2025Q4:1.4.0.2
	pkgsrc-2025Q4-base:1.4
	pkgsrc-2025Q3:1.2.0.2
	pkgsrc-2025Q3-base:1.2;
locks; strict;
comment	@# @;


1.10
date	2026.09.02.19.04.38;	author wiz;	state Exp;
branches;
next	1.9;
commitid	vXszxoxOqka005UG;

1.9
date	2026.08.26.11.10.45;	author bouyer;	state Exp;
branches;
next	1.8;
commitid	7EzTla5Qj5wBz8TG;

1.8
date	2026.06.23.09.52.57;	author wiz;	state Exp;
branches;
next	1.7;
commitid	skBOMvOEdliPfUKG;

1.7
date	2026.03.17.19.00.00;	author bouyer;	state Exp;
branches;
next	1.6;
commitid	V49rAJcuZOgaqmyG;

1.6
date	2026.03.01.12.38.38;	author gdt;	state Exp;
branches;
next	1.5;
commitid	xaHXyYFajPgHPgwG;

1.5
date	2025.12.27.19.19.13;	author prlw1;	state Exp;
branches;
next	1.4;
commitid	cp9yThh12Rw465oG;

1.4
date	2025.11.13.16.54.19;	author bouyer;	state Exp;
branches;
next	1.3;
commitid	vvDA5wrFi6KhIpiG;

1.3
date	2025.10.23.20.39.28;	author wiz;	state Exp;
branches;
next	1.2;
commitid	1V2hBZn9ypXaCJfG;

1.2
date	2025.08.22.13.09.40;	author bouyer;	state Exp;
branches;
next	1.1;
commitid	uzLYP0A6WJtF8J7G;

1.1
date	2025.08.22.09.00.12;	author bouyer;	state Exp;
branches;
next	;
commitid	Ltq5S1fi9LiRKH7G;


desc
@@


1.10
log
@*: recursive bump for pcre2 10.48
@
text
@# $NetBSD: Makefile,v 1.9 2026/08/26 11:10:45 bouyer Exp $
#
# VERSION is set in version.mk as it is shared with other packages
#PKGREVISION=        1
PKGREVISION=        1
.include        "version.mk"
PKGNAME=		xentools420-${VERSION:S/-//g}

CATEGORIES=		sysutils

MAINTAINER=		bouyer@@NetBSD.org
HOMEPAGE=		https://xenproject.org/
COMMENT=		Userland Tools for Xen 4.20.x
LICENSE=		gnu-gpl-v2

# XXX add version check: Xen requires dev86 >= 0.16.14
TOOL_DEPENDS+=	dev86-[0-9]*:../../devel/dev86 # needed to build firmware
.if !exists(/usr/bin/iasl)
TOOL_DEPENDS+=	acpica-utils-[0-9]*:../../sysutils/acpica-utils
.endif

TOOL_DEPENDS+=  ninja-build-[0-9]*:../../devel/ninja-build
TOOL_DEPENDS+=  ${PYPKGPREFIX}-distlib-[0-9]*:../../devel/py-distlib
TOOL_DEPENDS+=  ${PYPKGPREFIX}-setuptools-[0-9]*:../../devel/py-setuptools
PYTHON_VERSIONS_INCOMPATIBLE=	27

PKG_SYSCONFSUBDIR=	xen

ONLY_FOR_PLATFORM+=	NetBSD-1[0-9]*-x86_64
ONLY_FOR_PLATFORM+=	NetBSD-9.99.*-x86_64
ONLY_FOR_PLATFORM+=	NetBSD-9.[1-9]-x86_64
ONLY_FOR_PLATFORM+=	NetBSD-9.[1-9]_*-x86_64
ONLY_FOR_PLATFORM+=	NetBSD-9.0_STABLE-x86_64

SSP_SUPPORTED=		no
MKPIE_SUPPORTED=	no

CONFLICTS+=		libxen-[0-9]*
CONFLICTS+=		xenstoretools-[0-9]*

CHECK_PORTABILITY_SKIP=	tools/examples/* \
			tools/qemu-xen/scripts/qemu-binfmt-conf.sh
CHECK_RELRO_SKIP=	libexec/xen/boot/hvmloader
CHECK_RELRO_SKIP+=	libexec/xen/boot/xen-shim
CHECK_RELRO_SKIP+=	lib/debug${PREFIX}/libexec/xen/boot/xen-shim-syms
CHECK_RELRO_SKIP+=	libexec/xen/lib/libfdt.a

CHECK_SHLIBS_SKIP+=	libexec/xen/bin/qemu-system-i386

EGDIR=			${PREFIX}/share/examples/xen
MESSAGE_SUBST+=		EGDIR=${EGDIR}

USE_TOOLS+=		pod2man gmake pkg-config makeinfo perl bash cmake gsed bison
USE_LANGUAGES=		c c++

GNU_CONFIGURE=		YES
CONFIGURE_ARGS+=	--enable-rpath --disable-golang
CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFBASE}
CONFIGURE_ARGS+=	--enable-ipxe
CONFIGURE_ARGS+=	--with-system-ovmf=${PREFIX}/share/ovmf/OVMFX64.fd

MAKE_ENV+=		PREFIX=${prefix:Q} WRKSRC=${WRKSRC}
MAKE_ENV+=		APPEND_LIB=${LDFLAGS:Q}
MAKE_ENV+=		XEN_EXAMPLES_DIR=${EGDIR}
MAKE_ENV+=		MV=${MV:Q} CP=${CP:Q}
MAKE_ENV+=		PYTHON=${PYTHONBIN:Q} PYTHON_COMMAND=${PYTHONBIN:Q}
MAKE_ENV+=		SED=${SED:Q}
MAKE_ENV+=		V=YES
MAKE_ENV+=		BARE_CPP="gcc -E"
#MAKE_ENV+=		NO_WERROR=1

#BUILDLINK_TRANSFORM+=	rm:-Werror

PY_PATCHPLIST=		yes
REPLACE_PYTHON+=	tools/python/scripts/convert-legacy-stream
REPLACE_PYTHON+=	tools/python/scripts/verify-stream-v2
REPLACE_PYTHON+=	tools/xenmon/xenmon.py tools/misc/xencov_split

REPLACE_PERL+=		tools/firmware/rombios/makesym.perl
REPLACE_PERL+=		tools/qemu-xen/scripts/get_maintainer.pl
REPLACE_PERL+=		tools/qemu-xen/scripts/checkpatch.pl

SUBST_CLASSES+=		conf
SUBST_STAGE.conf=	pre-configure
SUBST_FILES.conf=	docs/misc/block-scripts.txt
SUBST_FILES.conf+=	docs/misc/vtd.txt
SUBST_SED.conf=		-e "s,@@XENDCONFDIR@@,${PKG_SYSCONFDIR},g"

XEND_SCRIPTS=		block vif-bridge vif-ip qemu-ifup hotplugpath.sh locking.sh

SUBST_CLASSES+=		getopt
SUBST_STAGE.getopt=	pre-configure
SUBST_MESSAGE.getopt=	Fixing getopt_long_only
SUBST_FILES.getopt+=	tools/fuzz/x86_instruction_emulator/afl-harness.c
SUBST_SED.getopt+=	-e 's,getopt_long_only,getopt_long,'

OPSYSVARS+=		PROCPATH
PROCPATH.NetBSD=	/kern
PROCPATH.*=		/proc

.include "../../mk/bsd.prefs.mk"

.if ${OPSYS} == "NetBSD"
MESSAGE_SRC=		${.CURDIR}/MESSAGE ${.CURDIR}/MESSAGE.NetBSD
.endif

RCD_SCRIPTS=		xen-watchdog xencommons xendomains
FILES_SUBST+=		RCD_INTERPRETER=${PYTHONBIN:Q}
FILES_SUBST+=		PROCPATH=${PROCPATH:Q}
FILES_SUBST+=		PKG_SYSCONFDIR=${PKG_SYSCONFDIR}
FILES_SUBST+=		PREFIX=${PREFIX}

CONF_FILES+=		${EGDIR}/xl.conf ${PKG_SYSCONFDIR}/xl.conf
CONF_FILES+=		${EGDIR}/oxenstored.conf ${PKG_SYSCONFDIR}/oxenstored.conf

OWN_DIRS=		${PKG_SYSCONFDIR}/scripts ${VARBASE}/log/xen

.for s in ${XEND_SCRIPTS}
CONF_FILES_PERMS+=	${EGDIR}/scripts/${s} ${PKG_SYSCONFDIR}/scripts/${s} \
			${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 0755
.endfor

post-extract:
	${MV} ${WRKDIR}/${QEMU_DIST} ${WRKSRC}/tools/qemu-xen
#${MV} ${WRKDIR}/${QEMUTRAD_DIST} ${WRKSRC}/tools/qemu-xen-traditional

pre-build:
	rm -f ${WRKSRC}/check/check_x11_devel
	${SED} -e "s,@@XENDCONFDIR@@,${PKG_SYSCONFDIR},g" \
		${WRKSRC}/docs/man/xenstore-chmod.1.pod |\
	    pod2man -n xenstore-chmod >${WRKDIR}/xenstore-chmod.1
	${SED} -e "s,@@XENDCONFDIR@@,${PKG_SYSCONFDIR},g" \
		${WRKSRC}/docs/man/xenstore-ls.1.pod |\
	    pod2man -n xenstore-ls >${WRKDIR}/xenstore-ls.1
	${SED} -e "s,@@XENDCONFDIR@@,${PKG_SYSCONFDIR},g" \
		${WRKSRC}/docs/man/xenstore.1.pod |\
	    pod2man -n xenstore >${WRKDIR}/xenstore.1
	${SED} -e "s,@@XENDCONFDIR@@,${PKG_SYSCONFDIR},g" \
		${WRKSRC}/docs/man/xentop.1.pod |\
	    pod2man -n xentop >${WRKDIR}/xentop.1
	${SED} -e "s,@@XENDCONFDIR@@,${PKG_SYSCONFDIR},g" \
		${WRKSRC}/docs/man/xentrace.8.pod |\
	    pod2man -n xentrace >${WRKDIR}/xentrace.8
	${SED} -e "s,@@XENDCONFDIR@@,${PKG_SYSCONFDIR},g" \
		${WRKSRC}/docs/man/xl.cfg.5.pod.in |\
	    pod2man -n xl.cfg >${WRKDIR}/xl.cfg.5
	${SED} -e "s,@@XENDCONFDIR@@,${PKG_SYSCONFDIR},g" \
		${WRKSRC}/docs/man/xl.conf.5.pod |\
	    pod2man -n xl.conf >${WRKDIR}/xl.conf.5
	${SED} -e "s,@@XENDCONFDIR@@,${PKG_SYSCONFDIR},g" \
		${WRKSRC}/docs/man/xl.1.pod.in |\
	    pod2man -n xl >${WRKDIR}/xl.1
	${SED} -e "s,@@XENDCONFDIR@@,${PKG_SYSCONFDIR},g" \
		${WRKSRC}/docs/man/xlcpupool.cfg.5.pod |\
	    pod2man -n xlcpupool.cfg >${WRKDIR}/xlcpupool.cfg.5
	${SED} -e "s,@@XENDCONFDIR@@,${PKG_SYSCONFDIR},g" \
		${WRKSRC}/docs/man/xl-disk-configuration.5.pod |\
	    pod2man -n xl-disk-configuration >${WRKDIR}/xl-disk-configuration.5

INSTALLATION_DIRS=	${EGDIR} ${PKGMANDIR}/man1 ${PKGMANDIR}/man5
INSTALLATION_DIRS+=	${PKGMANDIR}/man8 share/doc/xen
INSTALLATION_DIRS+=	${PYSITELIB}

BUILD_DEFS+=		VARBASE

do-build:
	cd ${WRKSRC} && ${BUILD_MAKE_CMD} V=1 build-tools
	cd ${WRKSRC} && ${BUILD_MAKE_CMD} build-docs

do-install:
	cd ${WRKSRC} && ${BUILD_MAKE_CMD} DESTDIR=${DESTDIR} install-tools
	cd ${WRKSRC} && ${BUILD_MAKE_CMD} DESTDIR=${DESTDIR} install-docs

post-install:
	${INSTALL_MAN} ${WRKDIR}/xenstore-chmod.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
	${INSTALL_MAN} ${WRKDIR}/xenstore-ls.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
	${INSTALL_MAN} ${WRKDIR}/xenstore.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
	${INSTALL_MAN} ${WRKDIR}/xentop.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
	${INSTALL_MAN} ${WRKDIR}/xentrace.8 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8
	${INSTALL_MAN} ${WRKDIR}/xl.cfg.5 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man5
	${INSTALL_MAN} ${WRKDIR}/xl.conf.5 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man5
	${INSTALL_MAN} ${WRKDIR}/xl.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
	${INSTALL_MAN} ${WRKDIR}/xlcpupool.cfg.5 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man5
.for f in \
    gamd-ucode-container.txt       gqemu-backends.txt \
    gblock-scripts.txt             gqemu-deprivilege.txt \
    gconsole.txt                   gstubdom.txt \
    gcrashdb.txt                   gvtd-pi.txt \
    gdistro_mapping.txt            gvtd.txt \
    gdump-core-format.txt          gvtpm-platforms.txt \
    ggrant-tables.txt              gxen-error-handling.txt \
    gkconfig-language.txt          gxenmon.txt \
    gkconfig.txt                   gxenpaging.txt \
    gkexec_and_kdump.txt           gxenstore-ring.txt \
    glibxl_memory.txt              gxenstore.txt \
    gprintk-formats.txt            gxsm-flask.txt \
	${INSTALL_DATA} ${WRKSRC}/docs/misc/$f ${DESTDIR}${PREFIX}/share/doc/xen
.endfor

.if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} < 069900
CPPFLAGS+=	-Dshm_open=open -Dshm_unlink=unlink
.endif

.include "../../mk/compiler.mk"
EXTRA_CFLAGS+=	-Wno-error=char-subscripts \
	-Wno-error=declaration-after-statement \
	-Wno-error=maybe-uninitialized \
	-Wno-error=unused-value
EXTRA_HOSTCFLAGS+=	-Wno-error=char-subscripts \
	-Wno-error=declaration-after-statement \
	-Wno-error=unused-value
.if !empty(PKGSRC_COMPILER:Mclang)
EXTRA_HOSTCFLAGS+=	-Wno-error=ignored-attributes
EXTRA_CFLAGS+=	-Wno-error=ignored-attributes -no-integrated-as \
		-Wno-error=tautological-compare -Wno-error=null-dereference \
		-Wno-error=empty-body -Wno-error=self-assign \
		-Wno-error=sometimes-uninitialized \
		-Wno-error=unused-function -Wno-error=format \
		-Wno-error=unused-const-variable \
		-Wno-error=gnu-designator -Wno-error=uninitialized \
		-Wno-error=parentheses-equality \
		-Wno-error=enum-conversion \
		-Wno-error=address-of-packed-member
BUILDLINK_TRANSFORM+=	rm:-falign-jumps=1 rm:-falign-loops=1 \
			rm:-mpreferred-stack-boundary=2
.endif

MAKE_ENV+=	EXTRA_HOSTCFLAGS=${EXTRA_HOSTCFLAGS:Q} EXTRA_CFLAGS=${EXTRA_CFLAGS:M*:Q} TARGET_CC=${TARGET_CC}

# \todo Considering installing xen-command-line(7), perhaps by pandoc,
# and perhaps by some mechanism that does not cause portability
# issues.

.include "../../lang/python/batteries-included.mk"
.include "../../lang/python/application.mk"
.include "../../lang/python/extension.mk"
# SDL2 is forced off via a patch.  With that removed and the bl3
# uncommented, the build completes with one additional file.  However,
# there is no reason to add SDL2.
#.include "../../devel/SDL2/buildlink3.mk"
.include "../../lang/ocaml/buildlink3.mk"
.include "../../devel/ocaml-findlib/buildlink3.mk"
BUILDLINK_API_DEPENDS.pciutils+=	pciutils>=3.8
.include "../../sysutils/pciutils/buildlink3.mk"
.include "../../archivers/zstd/buildlink3.mk"
.include "../../devel/glib2/buildlink3.mk"
.include "../../devel/yajl/buildlink3.mk"
.include "../../devel/argp/buildlink3.mk"
.include "../../devel/gettext-tools/buildlink3.mk"
.include "../../security/libgcrypt/buildlink3.mk"
.include "../../x11/pixman/buildlink3.mk"

.include "../../mk/curses.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
@


1.9
log
@update xenkernel420, xentools420 and xenstoretools to 20260825 (this is past
Xen 4.20.4).
pkgsrc CHANGES:
- set SHADOW_PAGING to yes because NetBSD PV guests relies on it (at last
  on my hardware).  Note that this is not security-supported upstream.
- update xenkernel420 DESCR and MESSAGE to reflect current state.

upstream CHANGES:
- various fixes; including better support for some hardware
- fix XSA-497, XSA-499, XSA-500, XSA-501, XSA-502, XSA-503,
  XSA-504, XSA-505, XSA-506, XSA-507, XSA-508

Note that as SHADOW_PAGING is enabled, XSA-495 is not fixed.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.8 2026/06/23 09:52:57 wiz Exp $
d5 1
@


1.8
log
@*: recursive bump for argp 1.5
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.7 2026/03/17 19:00:00 bouyer Exp $
a4 1
PKGREVISION=        1
@


1.7
log
@Update xenkernel420, xentools420 and xenstoretools to 20260317.
Changes since 20251113: mostly bug fixes and small improvements on
some hardware, including security fixes up to XSA481
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.6 2026/03/01 12:38:38 gdt Exp $
d5 1
@


1.6
log
@*: revbump for lang/ocaml micro (security) update
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.5 2025/12/27 19:19:13 prlw1 Exp $
a4 1
PKGREVISION=        1
@


1.5
log
@xentools420: build fix

*** Ouch! ***

found no usable distlib, please install it
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.4 2025/11/13 16:54:19 bouyer Exp $
d5 1
@


1.4
log
@update xenkernel420 and xentools420 to 20251113, matching upstream's 4.20.2
release.
CHANGES: mostly bug fixes, including security fixes up to and including
XSA-476.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.3 2025/10/23 20:39:28 wiz Exp $
d22 1
@


1.3
log
@*: recursive bump for pcre2

Running an old binary against the new pcre doesn't work:
/usr/pkg/lib/libpcre2-8.so.0: version PCRE2_10.47 required by /usr/pkg/lib/libglib-2.0.so.0 not defined
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.2 2025/08/22 13:09:40 bouyer Exp $
a4 1
PKGREVISION=        1
@


1.2
log
@During build, gettext-tools is pulled in via bison; but it's needed at runtime
too do explicitely include gettext-tools/buildlink3.mk
No PKGREVISION bump, ride the initial commit this morning
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.1 2025/08/22 09:00:12 bouyer Exp $
d5 1
@


1.1
log
@Add xenkernel420 and xentools420 packages version 20250821, providing Xen
kernels and tools from the stable-4.20 branch (as of 20250821).
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.8 2025/07/01 16:55:06 bouyer Exp $
d247 1
@

