pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
libudev/builtin.mk: needs pkg-config handling (copypasta'd from libusb1)
Module Name: pkgsrc-wip
Committed By: Tobias Nygren <tnn%NetBSD.org@localhost>
Pushed By: tnn
Date: Thu Jul 21 14:07:13 2022 +0200
Changeset: 70de9a91a1da5b42b3f9e4b4afe98ed4fdb23b45
Modified Files:
libudev/builtin.mk
Log Message:
libudev/builtin.mk: needs pkg-config handling (copypasta'd from libusb1)
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=70de9a91a1da5b42b3f9e4b4afe98ed4fdb23b45
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
libudev/builtin.mk | 51 ++++++++++++++++++++++-----------------------------
1 file changed, 22 insertions(+), 29 deletions(-)
diffs:
diff --git a/libudev/builtin.mk b/libudev/builtin.mk
index cf238205ed..b5608c5a73 100644
--- a/libudev/builtin.mk
+++ b/libudev/builtin.mk
@@ -2,45 +2,38 @@
BUILTIN_PKG:= libudev
-BUILTIN_FIND_HEADERS_VAR:= LIBUDEV_H
-BUILTIN_FIND_HEADERS.LIBUDEV_H= libudev.h
+BUILTIN_FIND_PKGCONFIG_FILES_VAR:= LIBUDEV_PC
+BUILTIN_FIND_PKGCONFIG_FILES.LIBUDEV_PC= libudev.pc
.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}/*)
+. if empty(LIBUDEV_PC:M__nonexistent__)
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
+.if !defined(USE_BUILTIN.libudev)
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
+
+.if !empty(USE_BUILTIN.libudev:M[yY][eE][sS])
+. if !empty(USE_TOOLS:C/:.*//:Mpkg-config)
+do-configure-pre-hook: link-libudev-pkgconfig
+
+BLKDIR_PKGCFG= ${BUILDLINK_DIR}/lib/pkgconfig
+LIBUDEV_PKGCFGF= ${BUILTIN_FIND_PKGCONFIG_FILES.LIBUDEV_PC}
+
+.PHONY: link-libudev-pkgconfig link-message-libudev-pkgconfig
+link-libudev-pkgconfig: link-message-libudev-pkgconfig
+link-message-libudev-pkgconfig:
+ @${STEP_MSG} "Linking ${LIBUDEV_PC} file into ${BUILDLINK_DIR}."
+
+link-libudev-pkgconfig:
+ ${RUN} \
+ ${MKDIR} ${BLKDIR_PKGCFG}; \
+ ${LN} -sf ${LIBUDEV_PC} ${BLKDIR_PKGCFG}/${LIBUDEV_PKGCFGF}
. endif
-MAKEVARS+= USE_BUILTIN.libudev
.endif
Home |
Main Index |
Thread Index |
Old Index