pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/meta-pkgs/modular-xorg-drivers modular-xorg-drivers: A...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a04446ee6260
branches:  trunk
changeset: 770557:a04446ee6260
user:      nia <nia%pkgsrc.org@localhost>
date:      Thu Dec 02 17:40:40 2021 +0000

description:
modular-xorg-drivers: Add a common builtin.mk fragment

diffstat:

 meta-pkgs/modular-xorg-drivers/builtin-common.mk |  63 ++++++++++++++++++++++++
 1 files changed, 63 insertions(+), 0 deletions(-)

diffs (67 lines):

diff -r 4d5251f71403 -r a04446ee6260 meta-pkgs/modular-xorg-drivers/builtin-common.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/meta-pkgs/modular-xorg-drivers/builtin-common.mk  Thu Dec 02 17:40:40 2021 +0000
@@ -0,0 +1,63 @@
+# $NetBSD: builtin-common.mk,v 1.1 2021/12/02 17:40:40 nia Exp $
+
+BUILTIN_PKG:=  ${X11_BUILTIN_NAME}
+
+BUILTIN_FIND_FILES_VAR:=               ${X11_DRV_NAME:tu}
+BUILTIN_FIND_FILES.${X11_DRV_NAME:tu}= ${X11BASE}/lib/modules/drivers/${X11_DRV_NAME}.so
+BUILTIN_FIND_FILES.${X11_DRV_NAME:tu}+=        ${X11BASE}/lib/xorg/modules/drivers/${X11_DRV_NAME}.so
+
+.include "../../mk/buildlink3/bsd.builtin.mk"
+
+###
+### Determine if there is a built-in implementation of the package and
+### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
+###
+.if !defined(IS_BUILTIN.${X11_BUILTIN_NAME})
+.  if empty(${X11_DRV_NAME:tu}:M__nonexistent__)
+IS_BUILTIN.${X11_BUILTIN_NAME}=        yes
+.  else
+IS_BUILTIN.${X11_BUILTIN_NAME}=        no
+.  endif
+.endif
+MAKEVARS+=             IS_BUILTIN.${X11_BUILTIN_NAME}
+
+###
+### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to
+### a package name to represent the built-in package.
+###
+.if !defined(BUILTIN_PKG.${X11_BUILTIN_NAME}) && \
+    !empty(IS_BUILTIN.${X11_BUILTIN_NAME}:M[yY][eE][sS]) && \
+    empty(${X11_DRV_NAME:tu}:M__nonexistent__)
+
+# we're more worried about existence, rather than actual version
+BUILTIN_VERSION.${X11_BUILTIN_NAME}=   0
+
+BUILTIN_PKG.${X11_BUILTIN_NAME}=       ${X11_BUILTIN_NAME}-${BUILTIN_VERSION.${X11_BUILTIN_NAME}}
+.endif
+MAKEVARS+=             BUILTIN_PKG.${X11_BUILTIN_NAME}
+
+###
+### Determine whether we should use the built-in implementation if it
+### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
+###
+.if !defined(USE_BUILTIN.${X11_BUILTIN_NAME})
+.  if ${PREFER.${X11_BUILTIN_NAME}} == "pkgsrc"
+USE_BUILTIN.${X11_BUILTIN_NAME}=       no
+.  else
+USE_BUILTIN.${X11_BUILTIN_NAME}=       ${IS_BUILTIN.${X11_BUILTIN_NAME}}
+.    if defined(BUILTIN_PKG.${X11_BUILTIN_NAME}) && \
+        !empty(IS_BUILTIN.${X11_BUILTIN_NAME}:M[yY][eE][sS])
+USE_BUILTIN.${X11_BUILTIN_NAME}=       yes
+.      for _dep_ in ${BUILDLINK_API_DEPENDS.${X11_BUILTIN_NAME}}
+.        if !empty(USE_BUILTIN.${X11_BUILTIN_NAME}:M[yY][eE][sS])
+USE_BUILTIN.${X11_BUILTIN_NAME}!=                                              \
+       if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.${X11_BUILTIN_NAME}:Q}; then \
+               ${ECHO} yes;                                            \
+       else                                                            \
+               ${ECHO} no;                                             \
+       fi
+.        endif
+.      endfor
+.    endif
+.  endif  # PREFER.${X11_BUILTIN_NAME}
+.endif



Home | Main Index | Thread Index | Old Index