summaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authorhans <hans>2011-04-21 13:05:35 +0000
committerhans <hans>2011-04-21 13:05:35 +0000
commit1596ad77250418619aa4024bec69c1d29a9d29bf (patch)
treec5818f089b954fbb9d546ae96be4304fc3110186 /devel
parent7efff9c2dd7e82b0c60fb52b35b3d6e122810667 (diff)
downloadpkgsrc-1596ad77250418619aa4024bec69c1d29a9d29bf.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')
-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