summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjlam <jlam>2002-09-27 09:22:58 +0000
committerjlam <jlam>2002-09-27 09:22:58 +0000
commitb14427a95110443e8037fe113b6a1b17479b7c64 (patch)
treeab23a40fa63327e998107315ef50b72d2aa50d51
parentf3da806b572d3ce4a3eda968efb43a0aebae9ee3 (diff)
downloadpkgsrc-b14427a95110443e8037fe113b6a1b17479b7c64.tar.gz
Create a new variable USE_X11_LINKS that controls whether packages that
use buildlink2 and set USE_X11 will use x11-links, or if they will simply symlink the X11 files directly into ${BUILDLINK_DIR}. If USE_X11_LINKS is "YES" (the default), then x11-links is used. If USE_X11_LINKS is "NO", then the X11 files are symlinked directly. There is a choice here between speed and flexibility. Using x11-links is faster since you don't need to spend time symlinking all of the X11 files into ${BUILDLINK_DIR}. However, if you update your X11 installation, then the x11-links package will likely be out-of-date. Conversely, directly symlinking the X11 files will protect you from changes in your X11 installation when you update, but there is a (small) time penalty to have to do it for every package that uses X11.
-rw-r--r--mk/buildlink2/bsd.buildlink2.mk15
-rw-r--r--mk/x11.buildlink2.mk17
-rw-r--r--pkgtools/x11-links/Makefile10
-rw-r--r--pkgtools/x11-links/openwin.buildlink2.mk10
-rw-r--r--pkgtools/x11-links/xfree.buildlink2.mk10
5 files changed, 39 insertions, 23 deletions
diff --git a/mk/buildlink2/bsd.buildlink2.mk b/mk/buildlink2/bsd.buildlink2.mk
index 37a1b7d6215..8bb76ac28b3 100644
--- a/mk/buildlink2/bsd.buildlink2.mk
+++ b/mk/buildlink2/bsd.buildlink2.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.buildlink2.mk,v 1.32 2002/09/27 00:22:06 jlam Exp $
+# $NetBSD: bsd.buildlink2.mk,v 1.33 2002/09/27 09:22:59 jlam Exp $
#
# An example package buildlink2.mk file:
#
@@ -47,10 +47,14 @@ _BLNK_OPSYS= ${OPSYS}
CONFIGURE_ENV+= BUILDLINK_UPDATE_CACHE=no
.if defined(USE_X11) || defined(USE_X11BASE) || defined(USE_IMAKE)
-. if !defined(_FOR_X11_LINKS_ONLY)
+USE_X11_LINKS?= YES
+. if !empty(USE_X11_LINKS:M[nN][oO])
+. include "../../mk/x11.buildlink2.mk"
+BUILDLINK_X11_DIR= ${BUILDLINK_X11PKG_DIR}
+. else
BUILD_DEPENDS+= x11-links>=0.8:../../pkgtools/x11-links
-. endif
BUILDLINK_X11_DIR= ${LOCALBASE}/share/x11-links
+. endif
CONFIGURE_ENV+= BUILDLINK_X11_DIR="${BUILDLINK_X11_DIR}"
MAKE_ENV+= BUILDLINK_X11_DIR="${BUILDLINK_X11_DIR}"
_BLNK_CPPFLAGS+= -I${X11BASE}/include
@@ -216,8 +220,13 @@ _BLNK_TRANSFORM+= I:${LOCALBASE}:${BUILDLINK_DIR}
_BLNK_TRANSFORM+= L:${LOCALBASE}:${BUILDLINK_DIR}
_BLNK_TRANSFORM+= ${BUILDLINK_TRANSFORM}
.if defined(USE_X11) || defined(USE_X11BASE) || defined(USE_IMAKE)
+. if !empty(USE_X11_LINKS:M[nN][oO])
+_BLNK_TRANSFORM+= I:${X11BASE}:${BUILDLINK_X11PKG_DIR}
+_BLNK_TRANSFORM+= L:${X11BASE}:${BUILDLINK_X11PKG_DIR}
+. else
_BLNK_TRANSFORM+= II:${X11BASE}:${BUILDLINK_X11PKG_DIR},${BUILDLINK_X11_DIR}
_BLNK_TRANSFORM+= LL:${X11BASE}:${BUILDLINK_X11PKG_DIR},${BUILDLINK_X11_DIR}
+. endif
.endif
.for _localbase_ in /usr/pkg /usr/local
. if ${LOCALBASE} != ${_localbase_}
diff --git a/mk/x11.buildlink2.mk b/mk/x11.buildlink2.mk
new file mode 100644
index 00000000000..814f463f7ef
--- /dev/null
+++ b/mk/x11.buildlink2.mk
@@ -0,0 +1,17 @@
+# $NetBSD: x11.buildlink2.mk,v 1.1 2002/09/27 09:22:58 jlam Exp $
+
+.if !defined(X11_BUILDLINK2_MK)
+X11_BUILDLINK2_MK= # defined
+
+USE_X11= # defined
+USE_X11_LINKS= no
+
+.include "../../mk/bsd.prefs.mk"
+
+.if !empty(X11BASE:M*openwin)
+. include "../../pkgtools/x11-links/openwin.buildlink2.mk"
+.else
+. include "../../pkgtools/x11-links/xfree.buildlink2.mk"
+.endif
+
+.endif # X11_BUILDLINK2_MK
diff --git a/pkgtools/x11-links/Makefile b/pkgtools/x11-links/Makefile
index fb4d9b8274c..9090ad24712 100644
--- a/pkgtools/x11-links/Makefile
+++ b/pkgtools/x11-links/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.17 2002/09/20 23:53:32 jlam Exp $
+# $NetBSD: Makefile,v 1.18 2002/09/27 09:22:59 jlam Exp $
#
# NOTE: If you update this package, then you'll likely need to also update
# the x11-links dependency in mk/x11.buildlink.mk and in
@@ -21,12 +21,11 @@ WRKSRC= ${WRKDIR}
NO_BUILD= # defined
NO_MTREE= # defined
USE_X11= # defined
+USE_X11_LINKS= no
PLIST_SRC= ${WRKDIR}/.PLIST_SRC
BUILDLINK_X11_SUBDIR= share/x11-links
-_FOR_X11_LINKS_ONLY=- # needed to use x11-links/buildlink.mk
-
.include "../../mk/bsd.prefs.mk"
.if !exists(${X11BASE}/include/X11/X.h)
@@ -43,9 +42,4 @@ do-install:
| ${SED} "s|^\./||g" | ${SORT} -u >> ${PLIST_SRC}
${ECHO} "@unexec ${RM} -rf %D/${BUILDLINK_X11_SUBDIR}" >> ${PLIST_SRC}
-.if !empty(X11BASE:M*openwin)
-. include "openwin.buildlink2.mk"
-.else
-. include "xfree.buildlink2.mk"
-.endif
.include "../../mk/bsd.pkg.mk"
diff --git a/pkgtools/x11-links/openwin.buildlink2.mk b/pkgtools/x11-links/openwin.buildlink2.mk
index 1fbc4e6b899..f8d6fb70365 100644
--- a/pkgtools/x11-links/openwin.buildlink2.mk
+++ b/pkgtools/x11-links/openwin.buildlink2.mk
@@ -1,8 +1,7 @@
-# $NetBSD: openwin.buildlink2.mk,v 1.3 2002/08/26 06:28:21 jlam Exp $
+# $NetBSD: openwin.buildlink2.mk,v 1.4 2002/09/27 09:23:00 jlam Exp $
-.if defined(_FOR_X11_LINKS_ONLY)
-.if !defined(X11_LINKS_BUILDLINK_MK)
-X11_LINKS_BUILDLINK_MK= # defined
+.if !defined(OPENWIN_BUILDLINK2_MK)
+OPENWIN_BUILDLINK2_MK= # defined
BUILDLINK_PACKAGES+= openwin
BUILDLINK_PREFIX.openwin= ${X11BASE}
@@ -1011,5 +1010,4 @@ BUILDLINK_TARGETS+= openwin-buildlink
openwin-buildlink: _BUILDLINK_USE
-.endif # X11_LINKS_BUILDLINK_MK
-.endif # _FOR_X11_LINKS_ONLY
+.endif # OPENWIN_BUILDLINK2_MK
diff --git a/pkgtools/x11-links/xfree.buildlink2.mk b/pkgtools/x11-links/xfree.buildlink2.mk
index 848ff379b5d..40e6dae7c6a 100644
--- a/pkgtools/x11-links/xfree.buildlink2.mk
+++ b/pkgtools/x11-links/xfree.buildlink2.mk
@@ -1,8 +1,7 @@
-# $NetBSD: xfree.buildlink2.mk,v 1.3 2002/08/26 06:28:21 jlam Exp $
+# $NetBSD: xfree.buildlink2.mk,v 1.4 2002/09/27 09:23:00 jlam Exp $
-.if defined(_FOR_X11_LINKS_ONLY)
-.if !defined(X11_LINKS_BUILDLINK_MK)
-X11_LINKS_BUILDLINK_MK= # defined
+.if !defined(XFREE_BUILDLINK2_MK)
+XFREE_BUILDLINK2_MK= # defined
BUILDLINK_PACKAGES+= XFree
BUILDLINK_PREFIX.XFree= ${X11BASE}
@@ -545,5 +544,4 @@ _REQUIRE_BUILTIN_XPM= YES
XFree-buildlink: _BUILDLINK_USE
-.endif # X11_LINKS_BUILDLINK_MK
-.endif # _FOR_X11_LINKS_ONLY
+.endif # XFREE_BUILDLINK2_MK