Tue Apr 22 12:21:15 2014 UTC ()
Detect builtin version if xextproto.pc is available (or assumed as 1.0.1,
same as current fake pc).


(obache)
diff -r1.8 -r1.9 pkgsrc/x11/xextproto/builtin.mk

cvs diff -r1.8 -r1.9 pkgsrc/x11/xextproto/Attic/builtin.mk (expand / switch to unified diff)

--- pkgsrc/x11/xextproto/Attic/builtin.mk 2014/03/10 11:56:02 1.8
+++ pkgsrc/x11/xextproto/Attic/builtin.mk 2014/04/22 12:21:15 1.9
@@ -1,43 +1,61 @@ @@ -1,43 +1,61 @@
1# $NetBSD: builtin.mk,v 1.8 2014/03/10 11:56:02 jperkin Exp $ 1# $NetBSD: builtin.mk,v 1.9 2014/04/22 12:21:15 obache Exp $
2 2
3BUILTIN_PKG:= xextproto 3BUILTIN_PKG:= xextproto
4 4
5BUILTIN_FIND_FILES_VAR:= H_XEXTPROTO 5BUILTIN_FIND_FILES_VAR:= H_XEXTPROTO PC_XEXTPROTO
6BUILTIN_FIND_FILES.H_XEXTPROTO= \ 6BUILTIN_FIND_FILES.H_XEXTPROTO= \
7 ${X11BASE}/include/X11/extensions/extutil.h 7 ${X11BASE}/include/X11/extensions/extutil.h
 8BUILTIN_FIND_FILES.PC_XEXTPROTO= ${X11BASE}/lib/pkgconfig/xextproto.pc
 9BUILTIN_FIND_FILES.PC_XEXTPROTO+= ${X11BASE}/lib${LIBABISUFFIX}/pkgconfig/xextproto.pc
 10BUILTIN_FIND_FILES.PC_XEXTPROTO+= ${X11BASE}/share/pkgconfig/xextproto.pc
8 11
9.include "../../mk/buildlink3/bsd.builtin.mk" 12.include "../../mk/buildlink3/bsd.builtin.mk"
10 13
11### 14###
12### Determine if there is a built-in implementation of the package and 15### Determine if there is a built-in implementation of the package and
13### set IS_BUILTIN.<pkg> appropriately ("yes" or "no"). 16### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
14### 17###
15.if ${X11BASE} == ${LOCALBASE} 18.if ${X11BASE} == ${LOCALBASE}
16IS_BUILTIN.xextproto= no 19IS_BUILTIN.xextproto= no
17.elif !defined(IS_BUILTIN.xextproto) 20.elif !defined(IS_BUILTIN.xextproto)
18IS_BUILTIN.xextproto= no 21IS_BUILTIN.xextproto= no
19# 22#
20# Here, we skip checking whether the files are under ${LOCALBASE} since 23# Here, we skip checking whether the files are under ${LOCALBASE} since
21# we'll consider this X11 package to be built-in even if it's a part 24# we'll consider this X11 package to be built-in even if it's a part
22# of one of the pkgsrc-installed X11 distributions. 25# of one of the pkgsrc-installed X11 distributions.
23# 26#
24. if empty(H_XEXTPROTO:M__nonexistent__) 27. if empty(H_XEXTPROTO:M__nonexistent__)
25IS_BUILTIN.xextproto= yes 28IS_BUILTIN.xextproto= yes
26. endif 29. endif
27.endif 30.endif
28MAKEVARS+= IS_BUILTIN.xextproto 31MAKEVARS+= IS_BUILTIN.xextproto
29 32
30### 33###
 34### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to
 35### a package name to represent the built-in package.
 36###
 37.if !defined(BUILTIN_PKG.xextproto) && \
 38 !empty(IS_BUILTIN.xextproto:M[yY][eE][sS])
 39. if empty(PC_XEXTPROTO:M__nonexistent__)
 40BUILTIN_VERSION.xextproto!= ${SED} -n -e 's/Version: //p' ${PC_XEXTPROTO}
 41. else
 42BUILTIN_VERSION.xextproto!= 1.0.1
 43. endif
 44BUILTIN_PKG.xextproto= xextproto-${BUILTIN_VERSION.xextproto}
 45.endif
 46MAKEVARS+= BUILTIN_PKG.xextproto
 47
 48###
31### Determine whether we should use the built-in implementation if it 49### Determine whether we should use the built-in implementation if it
32### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no"). 50### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
33### 51###
34.if !defined(USE_BUILTIN.xextproto) 52.if !defined(USE_BUILTIN.xextproto)
35. if ${PREFER.xextproto} == "pkgsrc" 53. if ${PREFER.xextproto} == "pkgsrc"
36USE_BUILTIN.xextproto= no 54USE_BUILTIN.xextproto= no
37. else 55. else
38USE_BUILTIN.xextproto= ${IS_BUILTIN.xextproto} 56USE_BUILTIN.xextproto= ${IS_BUILTIN.xextproto}
39. if defined(BUILTIN_PKG.xextproto) && \ 57. if defined(BUILTIN_PKG.xextproto) && \
40 !empty(IS_BUILTIN.xextproto:M[yY][eE][sS]) 58 !empty(IS_BUILTIN.xextproto:M[yY][eE][sS])
41USE_BUILTIN.xextproto= yes 59USE_BUILTIN.xextproto= yes
42. for _dep_ in ${BUILDLINK_API_DEPENDS.xextproto} 60. for _dep_ in ${BUILDLINK_API_DEPENDS.xextproto}
43. if !empty(USE_BUILTIN.xextproto:M[yY][eE][sS]) 61. if !empty(USE_BUILTIN.xextproto:M[yY][eE][sS])
@@ -56,36 +74,37 @@ MAKEVARS+= USE_BUILTIN.xextproto @@ -56,36 +74,37 @@ MAKEVARS+= USE_BUILTIN.xextproto
56 74
57### 75###
58### The section below only applies if we are not including this file 76### The section below only applies if we are not including this file
59### solely to determine whether a built-in implementation exists. 77### solely to determine whether a built-in implementation exists.
60### 78###
61 79
62.include "../../mk/x11.builtin.mk" 80.include "../../mk/x11.builtin.mk"
63 81
64CHECK_BUILTIN.xextproto?= no 82CHECK_BUILTIN.xextproto?= no
65.if !empty(CHECK_BUILTIN.xextproto:M[nN][oO]) 83.if !empty(CHECK_BUILTIN.xextproto:M[nN][oO])
66 84
67# If we are using the builtin version, check whether it has a xextproto.pc 85# If we are using the builtin version, check whether it has a xextproto.pc
68# file or not. If the latter, generate a fake one. 86# file or not. If the latter, generate a fake one.
69. if !empty(USE_BUILTIN.xextproto:M[Yy][Ee][Ss]) 87. if !empty(USE_BUILTIN.xextproto:M[Yy][Ee][Ss]) && \
 88 !empty(PC_XEXTPROTO:M__nonexistent__)
70BUILDLINK_TARGETS+= xextproto-fake-pc 89BUILDLINK_TARGETS+= xextproto-fake-pc
71 90
72xextproto-fake-pc: 91xextproto-fake-pc:
73 ${RUN} \ 92 ${RUN} \
74 for dir in lib lib${LIBABISUFFIX} share; do \ 93 for dir in lib lib${LIBABISUFFIX} share; do \
75 ${TEST} -f ${BUILDLINK_PREFIX.xextproto}/$${dir}/pkgconfig/xextproto.pc && exit; \ 94 ${TEST} -f ${BUILDLINK_PREFIX.xextproto}/$${dir}/pkgconfig/xextproto.pc && exit; \
76 done; \ 95 done; \
77 src=${BUILDLINK_PREFIX.xextproto}/lib/pkgconfig/xextproto.pc; \ 96 src=${BUILDLINK_PREFIX.xextproto}/lib/pkgconfig/xextproto.pc; \
78 dst=${BUILDLINK_DIR}/lib/pkgconfig/xextproto.pc; \ 97 dst=${BUILDLINK_DIR}/lib/pkgconfig/xextproto.pc; \
79 ${MKDIR} ${BUILDLINK_DIR}/lib/pkgconfig; \ 98 ${MKDIR} ${BUILDLINK_DIR}/lib/pkgconfig; \
80 if ${TEST} -f $${src}; then \ 99 if ${TEST} -f $${src}; then \
81 ${LN} -sf $${src} $${dst}; \ 100 ${LN} -sf $${src} $${dst}; \
82 else \ 101 else \
83 { ${ECHO} "Name: XExtensions"; \ 102 { ${ECHO} "Name: XExtensions"; \
84 ${ECHO} "Description: Sundry X extension headers"; \ 103 ${ECHO} "Description: Sundry X extension headers"; \
85 ${ECHO} "Version: 1.0.1"; \ 104 ${ECHO} "Version: ${BUILTIN_VERSION.xextproto}"; \
86 ${ECHO} "Cflags: -I${BUILDLINK_PREFIX.xextproto}/include"; \ 105 ${ECHO} "Cflags: -I${BUILDLINK_PREFIX.xextproto}/include"; \
87 } >$${dst}; \ 106 } >$${dst}; \
88 fi 107 fi
89. endif 108. endif
90 109
91.endif # CHECK_BUILTIN.xextproto 110.endif # CHECK_BUILTIN.xextproto