summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjmmv <jmmv>2004-04-14 15:26:41 +0000
committerjmmv <jmmv>2004-04-14 15:26:41 +0000
commitc3a5b3c67d05f039d56dca0471b8dd3b3bdc1a64 (patch)
treef6c7a498a69efa61adb9a84dba84dca241ea297b /mk
parentfa9e52c1a0886e75af836c2ff6d3fcfee87e9813 (diff)
downloadpkgsrc-c3a5b3c67d05f039d56dca0471b8dd3b3bdc1a64.tar.gz
Rework the way to use the -dirs packages (ATM, xdg-dirs, xdg-x11-dirs,
gnome1-dirs and gnome2-dirs): - Introduce a global USE_DIRS variable, which takes pairs of names and versions. For example, an xdg-1.1 value will request the use of the xdg-dirs package, at least version 1.1. This variable must always be appended to. If there are duplicates with different versions, the one with the higher number will be picked up. - Introduce the mk/dirs.mk file, which is automatically included by bsd.pkg.mk when USE_DIRS is not empty. It parses the variable's value and includes the required dirs.mk files, present in each -dirs package. - For each -dirs package, add a dirs.mk file that defines a variable holding the list of directories provided by it, adds a dependency on that package, and modifies the PRINT_PLIST_AWK variable to output comments for the directories handled by it. - Drop some Makefile.common files that only make things difficult and more confusing now (in favour of the new dirs.mk files). The only thing to worry about is to keep version numbers consistent across xdg-* and gnome*-* packages, but that will be easier to handle. The main reason for this change is to be able to modify PRINT_PLIST_AWK in a clean way, but I hope this will improve clarity too. Also, this simplifies the addition of future -dirs packages (if needed) in a consistent way.
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.pkg.mk6
-rw-r--r--mk/dirs.mk47
2 files changed, 52 insertions, 1 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index f6c955b82fd..ac91780b2ae 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1440 2004/04/12 20:48:07 jmmv Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1441 2004/04/14 15:26:41 jmmv Exp $
#
# This file is in the public domain.
#
@@ -1385,6 +1385,10 @@ NO_BUILDLINK= # defined
.include "../../mk/tools.mk"
+.if defined(USE_DIRS) && !empty(USE_DIRS)
+. include "../../mk/dirs.mk"
+.endif
+
_PREPENDED_TO_PATH?= # empty
.for _dir_ in ${PREPEND_PATH}
. if empty(_PREPENDED_TO_PATH:M${_dir_})
diff --git a/mk/dirs.mk b/mk/dirs.mk
new file mode 100644
index 00000000000..2ea0beeca4f
--- /dev/null
+++ b/mk/dirs.mk
@@ -0,0 +1,47 @@
+# $NetBSD: dirs.mk,v 1.1 2004/04/14 15:26:41 jmmv Exp $
+#
+
+.if !defined(DIRS_MK)
+DIRS_MK= # defined
+
+_USE_GNOME1_DIRS= # empty
+_USE_GNOME2_DIRS= # empty
+_USE_XDG_DIRS= # empty
+_USE_XDG_X11_DIRS= # empty
+
+.for dir in ${USE_DIRS}
+pkg:= ${dir:C/-[^-]*$//}
+ver:= ${dir:C/^.*-//}
+
+. if ${pkg} == "gnome1" && ${_USE_GNOME1_DIRS} < ${ver}
+_USE_GNOME1_DIRS:= ${ver}
+. elif ${pkg} == "gnome2" && ${_USE_GNOME2_DIRS} < ${ver}
+_USE_GNOME2_DIRS:= ${ver}
+. elif ${pkg} == "xdg" && ${_USE_XDG_DIRS} < ${ver}
+_USE_XDG_DIRS:= ${ver}
+. elif ${pkg} == "xdg-x11" && ${_USE_XDG_DIRS_DIRS} < ${ver}
+_USE_XDG_X11_DIRS:= ${ver}
+. endif
+
+.endfor
+.undef ver
+.undef pkg
+.undef dir
+
+.if !empty(_USE_GNOME1_DIRS)
+. include "../../misc/gnome1-dirs/dirs.mk"
+.endif
+
+.if !empty(_USE_GNOME2_DIRS)
+. include "../../misc/gnome2-dirs/dirs.mk"
+.endif
+
+.if !empty(_USE_XDG_DIRS)
+. include "../../misc/xdg-dirs/dirs.mk"
+.endif
+
+.if !empty(_USE_XDG_X11_DIRS)
+. include "../../misc/xdg-x11-dirs/dirs.mk"
+.endif
+
+.endif # !defined(DIRS_MK)