summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron>2011-01-19 17:50:48 +0000
committertron <tron>2011-01-19 17:50:48 +0000
commitf2b81424f846d24498b859f8c79f28e1aa815080 (patch)
treeda642a436d129a70b088476b858375dc417399a2
parentd5afd77526184e18a8f24b6bc3267189122cec6f (diff)
downloadpkgsrc-f2b81424f846d24498b859f8c79f28e1aa815080.tar.gz
Add proper builtin support which detects that "libXvMCW" is missing
under NetBSD. Tested under NetBSD/amd64 5.1 ("libXvMCW" missing) and Mac OS 10.6.6 ("libXvMCW" present).
-rw-r--r--x11/libXvMC/buildlink3.mk10
-rw-r--r--x11/libXvMC/builtin.mk59
2 files changed, 60 insertions, 9 deletions
diff --git a/x11/libXvMC/buildlink3.mk b/x11/libXvMC/buildlink3.mk
index 244f454b685..258bb75b613 100644
--- a/x11/libXvMC/buildlink3.mk
+++ b/x11/libXvMC/buildlink3.mk
@@ -1,10 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.3 2009/03/20 19:25:46 joerg Exp $
-
-.include "../../mk/bsd.fast.prefs.mk"
-
-.if ${X11_TYPE} != "modular"
-.include "../../mk/x11.buildlink3.mk"
-.else
+# $NetBSD: buildlink3.mk,v 1.4 2011/01/19 17:50:48 tron Exp $
BUILDLINK_TREE+= libXvMC
@@ -21,5 +15,3 @@ BUILDLINK_PKGSRCDIR.libXvMC?= ../../x11/libXvMC
.endif # LIBXVMC_BUILDLINK3_MK
BUILDLINK_TREE+= -libXvMC
-
-.endif
diff --git a/x11/libXvMC/builtin.mk b/x11/libXvMC/builtin.mk
new file mode 100644
index 00000000000..1336d11d198
--- /dev/null
+++ b/x11/libXvMC/builtin.mk
@@ -0,0 +1,59 @@
+# $NetBSD: builtin.mk,v 1.1 2011/01/19 17:50:48 tron Exp $
+
+.include "../../mk/bsd.fast.prefs.mk"
+
+BUILTIN_PKG:= libXvMC
+
+BUILTIN_FIND_FILES_VAR:= PC_LIBXVMC LIB_XVMCW
+BUILTIN_FIND_FILES.PC_LIBXVMC= ${X11BASE}/lib/pkgconfig/xvmc.pc
+.if ${_OPSYS_SHLIB_TYPE} == "dylib"
+BUILTIN_FIND_FILES.LIB_XVMCW= ${X11BASE}/lib/libXvMCW.dylib
+.else
+BUILTIN_FIND_FILES.LIB_XVMCW= ${X11BASE}/lib/libXvMCW.so
+.endif
+
+.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 ${X11BASE} == ${LOCALBASE}
+IS_BUILTIN.libXvMC= no
+.elif !defined(IS_BUILTIN.libXvMC)
+IS_BUILTIN.libXvMC= no
+. if empty(PC_LIBXVMC:M__nonexistent__) && \
+ empty(LIB_XVMCW:M__nonexistent__)
+IS_BUILTIN.libXvMC= yes
+. endif
+.endif
+MAKEVARS+= IS_BUILTIN.libXvMC
+
+###
+### 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.libXvMC)
+. if ${PREFER.libXvMC} == "pkgsrc"
+USE_BUILTIN.libXvMC= no
+. else
+USE_BUILTIN.libXvMC= ${IS_BUILTIN.libXvMC}
+. if defined(BUILTIN_PKG.libXvMC) && \
+ !empty(IS_BUILTIN.libXvMC:M[yY][eE][sS])
+USE_BUILTIN.libXvMC= yes
+. for _dep_ in ${BUILDLINK_API_DEPENDS.libXvMC}
+. if !empty(USE_BUILTIN.libXvMC:M[yY][eE][sS])
+USE_BUILTIN.libXvMC!= \
+ if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.libXvMC:Q}; then \
+ ${ECHO} yes; \
+ else \
+ ${ECHO} no; \
+ fi
+. endif
+. endfor
+. endif
+. endif # PREFER.libXvMC
+.endif
+MAKEVARS+= USE_BUILTIN.libXvMC
+
+.include "../../mk/x11.builtin.mk"