pkgsrc-WIP-changes archive

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

libudev: add builtin.mk



Module Name:	pkgsrc-wip
Committed By:	Tobias Nygren <tnn%NetBSD.org@localhost>
Pushed By:	tnn
Date:		Thu Jul 21 13:36:47 2022 +0200
Changeset:	405c79252bc6ce2182edaae2a3df7b0171e70656

Added Files:
	libudev/builtin.mk

Log Message:
libudev: add builtin.mk

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=405c79252bc6ce2182edaae2a3df7b0171e70656

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

diffstat:
 libudev/builtin.mk | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diffs:
diff --git a/libudev/builtin.mk b/libudev/builtin.mk
new file mode 100644
index 0000000000..cf238205ed
--- /dev/null
+++ b/libudev/builtin.mk
@@ -0,0 +1,46 @@
+# $NetBSD$
+
+BUILTIN_PKG:=	libudev
+
+BUILTIN_FIND_HEADERS_VAR:=	LIBUDEV_H
+BUILTIN_FIND_HEADERS.LIBUDEV_H=	libudev.h
+
+.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.libudev)
+IS_BUILTIN.libudev=	no
+.  if empty(LIBUDEV_H:M__nonexistent__) && empty(LIBUDEV_H:M${LOCALBASE}/*)
+IS_BUILTIN.libudev=	yes
+.  endif
+.endif
+MAKEVARS+=		IS_BUILTIN.libudev
+
+###
+### 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.libudev) && \
+    !empty(IS_BUILTIN.libudev:M[yY][eE][sS]) && \
+    empty(LIBUDEV_H:M__nonexistent__)
+
+###
+### 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.libudev)
+.    if ${PREFER.libudev} == "pkgsrc"
+USE_BUILTIN.libudev=	no
+.    else
+USE_BUILTIN.libudev=	${IS_BUILTIN.libudev}
+.      if defined(BUILTIN_PKG.libudev) && \
+        !empty(IS_BUILTIN.libudev:M[yY][eE][sS])
+USE_BUILTIN.libudev=	yes
+.      endif
+.    endif  # PREFER.libudev
+.  endif
+MAKEVARS+=		USE_BUILTIN.libudev
+.endif


Home | Main Index | Thread Index | Old Index