summaryrefslogtreecommitdiff
path: root/x11
diff options
context:
space:
mode:
authorobache <obache@pkgsrc.org>2014-04-22 12:21:15 +0000
committerobache <obache@pkgsrc.org>2014-04-22 12:21:15 +0000
commit6045d01a53b2c7dd0726ca609baf1f4a090ea46e (patch)
tree7805397ed339e27ee86cbe8c81a4ffb5a76219f4 /x11
parent766e2e65089f273316d0232e49839ae545d0af85 (diff)
downloadpkgsrc-6045d01a53b2c7dd0726ca609baf1f4a090ea46e.tar.gz
Detect builtin version if xextproto.pc is available (or assumed as 1.0.1,
same as current fake pc).
Diffstat (limited to 'x11')
-rw-r--r--x11/xextproto/builtin.mk27
1 files changed, 23 insertions, 4 deletions
diff --git a/x11/xextproto/builtin.mk b/x11/xextproto/builtin.mk
index 350b8e401f1..b1830559c27 100644
--- a/x11/xextproto/builtin.mk
+++ b/x11/xextproto/builtin.mk
@@ -1,10 +1,13 @@
-# $NetBSD: builtin.mk,v 1.8 2014/03/10 11:56:02 jperkin Exp $
+# $NetBSD: builtin.mk,v 1.9 2014/04/22 12:21:15 obache Exp $
BUILTIN_PKG:= xextproto
-BUILTIN_FIND_FILES_VAR:= H_XEXTPROTO
+BUILTIN_FIND_FILES_VAR:= H_XEXTPROTO PC_XEXTPROTO
BUILTIN_FIND_FILES.H_XEXTPROTO= \
${X11BASE}/include/X11/extensions/extutil.h
+BUILTIN_FIND_FILES.PC_XEXTPROTO= ${X11BASE}/lib/pkgconfig/xextproto.pc
+BUILTIN_FIND_FILES.PC_XEXTPROTO+= ${X11BASE}/lib${LIBABISUFFIX}/pkgconfig/xextproto.pc
+BUILTIN_FIND_FILES.PC_XEXTPROTO+= ${X11BASE}/share/pkgconfig/xextproto.pc
.include "../../mk/buildlink3/bsd.builtin.mk"
@@ -28,6 +31,21 @@ IS_BUILTIN.xextproto= yes
MAKEVARS+= IS_BUILTIN.xextproto
###
+### 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.xextproto) && \
+ !empty(IS_BUILTIN.xextproto:M[yY][eE][sS])
+. if empty(PC_XEXTPROTO:M__nonexistent__)
+BUILTIN_VERSION.xextproto!= ${SED} -n -e 's/Version: //p' ${PC_XEXTPROTO}
+. else
+BUILTIN_VERSION.xextproto!= 1.0.1
+. endif
+BUILTIN_PKG.xextproto= xextproto-${BUILTIN_VERSION.xextproto}
+.endif
+MAKEVARS+= BUILTIN_PKG.xextproto
+
+###
### Determine whether we should use the built-in implementation if it
### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
###
@@ -66,7 +84,8 @@ CHECK_BUILTIN.xextproto?= no
# If we are using the builtin version, check whether it has a xextproto.pc
# file or not. If the latter, generate a fake one.
-. if !empty(USE_BUILTIN.xextproto:M[Yy][Ee][Ss])
+. if !empty(USE_BUILTIN.xextproto:M[Yy][Ee][Ss]) && \
+ !empty(PC_XEXTPROTO:M__nonexistent__)
BUILDLINK_TARGETS+= xextproto-fake-pc
xextproto-fake-pc:
@@ -82,7 +101,7 @@ xextproto-fake-pc:
else \
{ ${ECHO} "Name: XExtensions"; \
${ECHO} "Description: Sundry X extension headers"; \
- ${ECHO} "Version: 1.0.1"; \
+ ${ECHO} "Version: ${BUILTIN_VERSION.xextproto}"; \
${ECHO} "Cflags: -I${BUILDLINK_PREFIX.xextproto}/include"; \
} >$${dst}; \
fi