Thu Jan 24 10:40:07 2013 UTC ()
Pullup ticket #4032 - requested by tron
pkgtools/x11-links: avoid spurious warnings for MacOS

Revisions pulled up:
- pkgtools/x11-links/xorg-version.mk                            1.3

-------------------------------------------------------------------
   Module Name:	pkgsrc
   Committed By:	tron
   Date:		Wed Jan 23 15:25:05 UTC 2013

   Modified Files:
   	pkgsrc/pkgtools/x11-links: xorg-version.mk

   Log Message:
   Remove code which tries to use "Xquartz" to find out the X.org version
   (presumably only under Mac OS X Mountain Lion). "Xquarty" simply doesn't
   print out anything if you run it with "-version".

   This avoids a lot of warning messages from "bmake" while building packages
   that use X11.

   To generate a diff of this commit:
   cvs rdiff -u -r1.2 -r1.3 pkgsrc/pkgtools/x11-links/xorg-version.mk


(spz)
diff -r1.2 -r1.2.12.1 pkgsrc/pkgtools/x11-links/xorg-version.mk

cvs diff -r1.2 -r1.2.12.1 pkgsrc/pkgtools/x11-links/xorg-version.mk (expand / switch to unified diff)

--- pkgsrc/pkgtools/x11-links/xorg-version.mk 2011/09/09 09:08:07 1.2
+++ pkgsrc/pkgtools/x11-links/xorg-version.mk 2013/01/24 10:40:07 1.2.12.1
@@ -1,51 +1,46 @@ @@ -1,51 +1,46 @@
1# $NetBSD: xorg-version.mk,v 1.2 2011/09/09 09:08:07 abs Exp $ 1# $NetBSD: xorg-version.mk,v 1.2.12.1 2013/01/24 10:40:07 spz Exp $
2# 2#
3# This Makefile fragment is included by Makefiles that need to access 3# This Makefile fragment is included by Makefiles that need to access
4# the X11_TYPE and version number of an X.org distribution. 4# the X11_TYPE and version number of an X.org distribution.
5# 5#
6# The following variables are provided by this file: 6# The following variables are provided by this file:
7# 7#
8# BUILTIN_X11_TYPE.xorg is the X11_TYPE of the X.org distribution 8# BUILTIN_X11_TYPE.xorg is the X11_TYPE of the X.org distribution
9# and is simply "xorg". 9# and is simply "xorg".
10# 10#
11# BUILTIN_X11_VERSION.xorg is the version number of the X.org 11# BUILTIN_X11_VERSION.xorg is the version number of the X.org
12# distribution detected on the system. 12# distribution detected on the system.
13# 13#
14 14
15BUILTIN_X11_TYPE.xorg= xorg 15BUILTIN_X11_TYPE.xorg= xorg
16 16
17BUILTIN_FIND_FILES_VAR:= CF_XORG CF_XORG_VERSION CF_VERSION_OLD XQUARTZ 17BUILTIN_FIND_FILES_VAR:= CF_XORG CF_XORG_VERSION CF_VERSION_OLD XQUARTZ
18BUILTIN_FIND_FILES.CF_XORG= ${X11BASE}/lib/X11/config/xorg.cf 18BUILTIN_FIND_FILES.CF_XORG= ${X11BASE}/lib/X11/config/xorg.cf
19BUILTIN_FIND_FILES.CF_XORG_VERSION= ${X11BASE}/lib/X11/config/xorgversion.def 19BUILTIN_FIND_FILES.CF_XORG_VERSION= ${X11BASE}/lib/X11/config/xorgversion.def
20BUILTIN_FIND_FILES.CF_VERSION_OLD= ${X11BASE}/lib/X11/config/version.def 20BUILTIN_FIND_FILES.CF_VERSION_OLD= ${X11BASE}/lib/X11/config/version.def
21BUILTIN_FIND_FILES.XQUARTZ= ${X11BASE}/bin/Xquartz 
22.include "../../mk/buildlink3/find-files.mk" 21.include "../../mk/buildlink3/find-files.mk"
23 22
24.if !defined(BUILTIN_XORG_VERSION_FILE) 23.if !defined(BUILTIN_XORG_VERSION_FILE)
25BUILTIN_XORG_VERSION_FILE= __nonexistent__ 24BUILTIN_XORG_VERSION_FILE= __nonexistent__
26. if exists(${CF_XORG_VERSION}) 25. if exists(${CF_XORG_VERSION})
27BUILTIN_XORG_VERSION_FILE= ${CF_XORG_VERSION} 26BUILTIN_XORG_VERSION_FILE= ${CF_XORG_VERSION}
28. elif exists(${CF_VERSION_OLD}) 27. elif exists(${CF_VERSION_OLD})
29BUILTIN_XORG_VERSION_FILE= ${CF_VERSION_OLD} 28BUILTIN_XORG_VERSION_FILE= ${CF_VERSION_OLD}
30. endif 29. endif
31.endif 30.endif
32MAKEVARS+= BUILTIN_XORG_VERSION_FILE 31MAKEVARS+= BUILTIN_XORG_VERSION_FILE
33 32
34.if !defined(BUILTIN_X11_VERSION.xorg) 33.if !defined(BUILTIN_X11_VERSION.xorg)
35. if exists(${XQUARTZ}) 34. if exists(${BUILTIN_XORG_VERSION_FILE})
36BUILTIN_X11_VERSION.xorg!= \ 
37 ${XQUARTZ} -version 2>&1 | \ 
38 ${AWK} '/X.org Release / { print $$3 }' 
39. elif exists(${BUILTIN_XORG_VERSION_FILE}) 
40BUILTIN_X11_VERSION.xorg!= \ 35BUILTIN_X11_VERSION.xorg!= \
41 ${AWK} '/\#define[ ]*XORG_VERSION_MAJOR/ { M = $$3 } \ 36 ${AWK} '/\#define[ ]*XORG_VERSION_MAJOR/ { M = $$3 } \
42 /\#define[ ]*XORG_VERSION_MINOR/ { m = "."$$3 } \ 37 /\#define[ ]*XORG_VERSION_MINOR/ { m = "."$$3 } \
43 /\#define[ ]*XORG_VERSION_PATCH/ { p = "."$$3 } \ 38 /\#define[ ]*XORG_VERSION_PATCH/ { p = "."$$3 } \
44 /\#define[ ]*XORG_VERSION_SNAP/ { s = "."$$3 } \ 39 /\#define[ ]*XORG_VERSION_SNAP/ { s = "."$$3 } \
45 END { if (s == ".0") s = ""; \ 40 END { if (s == ".0") s = ""; \
46 if (p == ".0" && s == "") p = ""; \ 41 if (p == ".0" && s == "") p = ""; \
47 printf "%s%s%s%s\n", M, m, p, s }' \ 42 printf "%s%s%s%s\n", M, m, p, s }' \
48 ${BUILTIN_XORG_VERSION_FILE} 43 ${BUILTIN_XORG_VERSION_FILE}
49. endif 44. endif
50.endif 45.endif
51MAKEVARS+= BUILTIN_X11_VERSION.xorg 46MAKEVARS+= BUILTIN_X11_VERSION.xorg