summaryrefslogtreecommitdiff
path: root/devel/libusb
diff options
context:
space:
mode:
authorhans <hans@pkgsrc.org>2011-04-21 13:05:35 +0000
committerhans <hans@pkgsrc.org>2011-04-21 13:05:35 +0000
commit14778db11fbd7cdcf3b23b98b918fb749e18640b (patch)
treec5818f089b954fbb9d546ae96be4304fc3110186 /devel/libusb
parent26541a5b39a8a53300d6c79c124ed14b1ffa921b (diff)
downloadpkgsrc-14778db11fbd7cdcf3b23b98b918fb749e18640b.tar.gz
Recent versions of SunOS have a native libusb. Add a builtin.mk to allow
packages depending on devel/libusb to be built on SunOS.
Diffstat (limited to 'devel/libusb')
-rw-r--r--devel/libusb/builtin.mk37
1 files changed, 37 insertions, 0 deletions
diff --git a/devel/libusb/builtin.mk b/devel/libusb/builtin.mk
new file mode 100644
index 00000000000..d112daac9c9
--- /dev/null
+++ b/devel/libusb/builtin.mk
@@ -0,0 +1,37 @@
+# $NetBSD: builtin.mk,v 1.1 2011/04/21 13:05:35 hans Exp $
+
+BUILTIN_PKG:= libusb
+PKGCONFIG_FILE.libusb= /usr/bin/libusb-config
+BUILTIN_VERSION_SCRIPT.libusb= ${PKGCONFIG_FILE.libusb} --version \#
+.include "../../mk/buildlink3/pkgconfig-builtin.mk"
+
+.if !empty(USE_BUILTIN.libusb:M[yY][eE][sS])
+BUILDLINK_FILES.libusb= bin/libusb-config
+
+. if !empty(USE_TOOLS:C/:.*//:Mpkg-config)
+do-configure-pre-hook: override-libusb-pkgconfig
+
+BLKDIR_PKGCFG= ${BUILDLINK_DIR}/lib/pkgconfig
+LIBUSB_PKGCFGF= libusb.pc
+
+override-libusb-pkgconfig: override-message-libusb-pkgconfig
+override-message-libusb-pkgconfig:
+ @${STEP_MSG} "Magical transformations for libusb on Solaris."
+
+override-libusb-pkgconfig:
+ ${RUN} \
+ ${MKDIR} ${BLKDIR_PKGCFG}; \
+ { \
+ ${ECHO} "prefix=/usr"; \
+ ${ECHO} "exec_prefix=\$${prefix}"; \
+ ${ECHO} "libdir=\$${exec_prefix}/lib"; \
+ ${ECHO} "includedir=\$${prefix}/include"; \
+ ${ECHO} ""; \
+ ${ECHO} "Name: libusb"; \
+ ${ECHO} "Description: library for USB access"; \
+ ${ECHO} "Version: ${BUILTIN_VERSION.libusb"; \
+ ${ECHO} "Libs: -Wl,-R\$${libdir} -L\$${libdir} -lusb"; \
+ ${ECHO} "Cflags: -I\$${includedir}"; \
+ } >> ${BLKDIR_PKGCFG}/${LIBUSB_PKGCFGF};
+. endif
+.endif \ No newline at end of file