pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/devel/meson



Module Name:    pkgsrc
Committed By:   riastradh
Date:           Sat Jan 25 09:49:47 UTC 2025

Modified Files:
        pkgsrc/devel/meson: build.mk

Log Message:
devel/meson/build.mk: New MESON_CROSS_BINARY_KEY.${bin}.

This controls the output of the [binaries] section of the meson
configuration, and defers expansion of the path.  This way, for
example, we can get:

[binaries]
/usr/pkg/bin/wayland-scanner = '/home/user/pkg/bin/wayland-scanner'

derived from PREFIX=/usr/pkg and TOOLBASE=/home/user/pkg, by setting:

MESON_CROSS_BINARIES+=                  wayland-scanner
MESON_CROSS_BINARY_KEY.wayland-scanner= ${PREFIX}/bin/wayland-scanner
MESON_CROSS_BINARY.wayland-scanner=     ${TOOLBASE}/bin/wayland-scanner

It's a bit of a kludge and generally we shouldn't have to do this --
usually meson builds use plain file names, not full absolute paths
under PREFIX, but in some cases it is necessary.

We can't just do this by writing:

MESON_CROSS_BINARIES+=  ${PREFIX}/bin/wayland-scanner
MESON_CROSS_BINARY.${PREFIX}/bin/wayland-scanner=       ...

because PREFIX isn't set by the time it has to be expanded (unless we
put it all the way at the end of the Makefile after bsd.pkg.mk, which
would be a worse kludge).


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 pkgsrc/devel/meson/build.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/devel/meson/build.mk
diff -u pkgsrc/devel/meson/build.mk:1.29 pkgsrc/devel/meson/build.mk:1.30
--- pkgsrc/devel/meson/build.mk:1.29    Sun Aug 11 00:19:14 2024
+++ pkgsrc/devel/meson/build.mk Sat Jan 25 09:49:47 2025
@@ -1,4 +1,4 @@
-# $NetBSD: build.mk,v 1.29 2024/08/11 00:19:14 js Exp $
+# $NetBSD: build.mk,v 1.30 2025/01/25 09:49:47 riastradh Exp $
 
 MESON_REQD?=   0
 .for version in ${MESON_REQD}
@@ -115,10 +115,11 @@ ${MESON_CROSS_FILE}:
        ${RUN}${ECHO} "endian = '${MESON_CPU_ENDIAN}'" >>${.TARGET}.tmp
        ${RUN}${ECHO} '[binaries]' >>${.TARGET}.tmp
 .  for _v_ in ${MESON_CROSS_BINARIES}
-.    if defined(MESON_CROSS_BINARY.${_v_})
-       ${RUN}${ECHO} ${_v_} = \'${MESON_CROSS_BINARY.${_v_}:Q}\' \
-               >>${.TARGET}.tmp
+.    if !defined(MESON_CROSS_BINARY.${_v_})
+.      error MESON_CROSS_BINARIES lists ${_v_} but MESON_CROSS_BINARY.${_v_} is undefined
 .    endif
+       ${RUN}${ECHO} ${MESON_CROSS_BINARY_KEY.${_v_}:U${_v_}} = \'${MESON_CROSS_BINARY.${_v_}:Q}\' \
+               >>${.TARGET}.tmp
 .  endfor
        ${RUN}${MV} -f ${.TARGET}.tmp ${.TARGET}
 MESON_CROSS_ARGS+=     --cross-file ${MESON_CROSS_FILE:Q}
@@ -188,7 +189,9 @@ _PKG_VARS.meson+=   USE_CMAKE MESON_ARGS
 _PKG_VARS.meson+=      MESON_CROSS_ARCH_VARS
 _PKG_VARS.meson+=      MESON_CROSS_OPSYS_VARS
 _PKG_VARS.meson+=      MESON_CROSS_VARS MESON_CROSS.*
-_PKG_VARS.meson+=      MESON_CROSS_BINARIES MESON_CROSS_BINARY.*
+_PKG_VARS.meson+=      MESON_CROSS_BINARIES
+_PKG_VARS.meson+=      MESON_CROSS_BINARY.*
+_PKG_VARS.meson+=      MESON_CROSS_BINARY_KEY.*
 _USER_VARS.meson=      MAKE_JOBS PKG_SYSCONFDIR
 _USE_VARS.meson=       TOOLS_PATH.false WRKDIR WRKSRC PREFIX PKGMANDIR
 _USE_VARS.meson+=      MACHINE_ARCH



Home | Main Index | Thread Index | Old Index