Permalink
Browse files

Massive cleanup of buildlink3.mk and builtin.mk files in pkgsrc.

Several changes are involved since they are all interrelated.  These
changes affect about 1000 files.

The first major change is rewriting bsd.builtin.mk as well as all of
the builtin.mk files to follow the new example in bsd.builtin.mk.
The loop to include all of the builtin.mk files needed by the package
is moved from bsd.builtin.mk and into bsd.buildlink3.mk.  bsd.builtin.mk
is now included by each of the individual builtin.mk files and provides
some common logic for all of the builtin.mk files.  Currently, this
includes the computation for whether the native or pkgsrc version of
the package is preferred.  This causes USE_BUILTIN.* to be correctly
set when one builtin.mk file includes another.

The second major change is teach the builtin.mk files to consider
files under ${LOCALBASE} to be from pkgsrc-controlled packages.  Most
of the builtin.mk files test for the presence of built-in software by
checking for the existence of certain files, e.g. <pthread.h>, and we
now assume that if that file is under ${LOCALBASE}, then it must be
from pkgsrc.  This modification is a nod toward LOCALBASE=/usr.  The
exceptions to this new check are the X11 distribution packages, which
are handled specially as noted below.

The third major change is providing builtin.mk and version.mk files
for each of the X11 distribution packages in pkgsrc.  The builtin.mk
file can detect whether the native X11 distribution is the same as
the one provided by pkgsrc, and the version.mk file computes the
version of the X11 distribution package, whether it's built-in or not.

The fourth major change is that the buildlink3.mk files for X11 packages
that install parts which are part of X11 distribution packages, e.g.
Xpm, Xcursor, etc., now use imake to query the X11 distribution for
whether the software is already provided by the X11 distribution.
This is more accurate than grepping for a symbol name in the imake
config files.  Using imake required sprinkling various builtin-imake.mk
helper files into pkgsrc directories.  These files are used as input
to imake since imake can't use stdin for that purpose.

The fifth major change is in how packages note that they use X11.
Instead of setting USE_X11, package Makefiles should now include
x11.buildlink3.mk instead.  This causes the X11 package buildlink3
and builtin logic to be executed at the correct place for buildlink3.mk
and builtin.mk files that previously set USE_X11, and fixes packages
that relied on buildlink3.mk files to implicitly note that X11 is
needed.  Package buildlink3.mk should also include x11.buildlink3.mk
when linking against the package libraries requires also linking
against the X11 libraries.  Where it was obvious, redundant inclusions
of x11.buildlink3.mk have been removed.
  • Loading branch information...
1 parent d43822c commit 3cc0f666b41044d30ba71edbfa6dd9b823134f0f jlam committed Jun 1, 2005
Showing 947 changed files with 5,002 additions and 3,819 deletions.
@@ -1,36 +1,67 @@
-# $NetBSD: builtin.mk,v 1.2 2004/03/29 05:43:28 jlam Exp $
+# $NetBSD: builtin.mk,v 1.3 2005/06/01 18:02:37 jlam Exp $
+BUILTIN_PKG:= bzip2
+
+BUILTIN_FIND_FILES_VAR:= H_BZIP2
+BUILTIN_FIND_FILES.H_BZIP2= /usr/include/bzlib.h
+BUILTIN_FIND_GREP.H_BZIP2= BZ2_
+
+.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 !defined(IS_BUILTIN.bzip2)
IS_BUILTIN.bzip2= no
-. if exists(/usr/include/bzlib.h)
-IS_BUILTIN.bzip2!= \
- if ${GREP} -q "BZ2_" /usr/include/bzlib.h; then \
- ${ECHO} "yes"; \
- else \
- ${ECHO} "no"; \
- fi
+. if empty(H_BZIP2:M${LOCALBASE}/*) && exists(${H_BZIP2})
+IS_BUILTIN.bzip2= yes
. endif
-BUILDLINK_VARS+= IS_BUILTIN.bzip2
-.endif # IS_BUILTIN.bzip2
+.endif
+MAKEVARS+= IS_BUILTIN.bzip2
+###
+### 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.bzip2)
-USE_BUILTIN.bzip2?= ${IS_BUILTIN.bzip2}
-PREFER.bzip2?= pkgsrc
-
-. if defined(USE_BZIP2)
-. if !empty(IS_BUILTIN.bzip2:M[nN][oO]) || \
- (${PREFER.bzip2} == "pkgsrc")
+. if ${PREFER.bzip2} == "pkgsrc"
USE_BUILTIN.bzip2= no
+. else
+USE_BUILTIN.bzip2= ${IS_BUILTIN.bzip2}
+. if defined(BUILTIN_PKG.bzip2) && \
+ !empty(IS_BUILTIN.bzip2:M[yY][eE][sS])
+USE_BUILTIN.bzip2= yes
+. for _dep_ in ${BUILDLINK_DEPENDS.bzip2}
+. if !empty(USE_BUILTIN.bzip2:M[yY][eE][sS])
+USE_BUILTIN.bzip2!= \
+ if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.bzip2:Q}; then \
+ ${ECHO} yes; \
+ else \
+ ${ECHO} no; \
+ fi
+. endif
+. endfor
. endif
-. endif
+#
+# Some platforms don't have a bzip2 implementation that can replace
+# pkgsrc bzip2.
+#
+_INCOMPAT_BZIP2?= SunOS-5.[678]-* Darwin-*-*
+. for _pattern_ in ${_INCOMPAT_BZIP2} ${INCOMPAT_BZIP2}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
+USE_BUILTIN.bzip2= no
+. endif
+. endfor
+. endif # PREFER.bzip2
+.endif
+MAKEVARS+= USE_BUILTIN.bzip2
-# Solaris 9 has bzip2 1.0.1, build it on older versions.
-# Darwin only has a static libbz2.a.
+# if USE_BZIP2 is defined, then force the use of a true bzip2
+# implementation.
#
-_INCOMPAT_BZIP2?= SunOS-5.[678]-* Darwin-*
-. for _pattern_ in ${_INCOMPAT_BZIP2} ${INCOMPAT_BZIP2}
-. if !empty(MACHINE_PLATFORM:M${_pattern_})
+.if defined(USE_BZIP2)
+. if !empty(IS_BUILTIN.bzip2:M[nN][oO])
USE_BUILTIN.bzip2= no
-. endif
-. endfor
-.endif # USE_BUILTIN.bzip2
+. endif
+.endif
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.19 2005/05/22 20:07:36 jlam Exp $
+# $NetBSD: Makefile,v 1.20 2005/06/01 18:02:37 jlam Exp $
DISTNAME= cxunzip-0.98
PKGREVISION= 2
@@ -11,7 +11,6 @@ COMMENT= Cloned Xunzip is a GNOME zip-archive uncompressing program
PKG_INSTALLATION_TYPES= overwrite pkgviews
-USE_X11= yes
GNU_CONFIGURE= yes
USE_TOOLS+= gmake
USE_LANGUAGES= c c++
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.22 2005/06/01 14:11:26 wiz Exp $
+# $NetBSD: Makefile,v 1.23 2005/06/01 18:02:37 jlam Exp $
DISTNAME= SDL_mixer-1.2.6
PKGREVISION= 2
@@ -14,7 +14,6 @@ CONFLICTS= SDL-mixer-[0-9]*
PKG_INSTALLATION_TYPES= overwrite pkgviews
USE_LIBTOOL= YES
-USE_X11= YES
GNU_CONFIGURE= YES
CPPFLAGS= -Dunix=1
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.12 2005/04/11 21:44:51 tv Exp $
+# $NetBSD: Makefile,v 1.13 2005/06/01 18:02:37 jlam Exp $
#
DISTNAME= SDL_sound-1.0.1
@@ -12,7 +12,6 @@ COMMENT= SDL library to handle the decoding of different file formats
GNU_CONFIGURE= YES
USE_LIBTOOL= YES
-USE_X11= YES
.include "../../audio/libmikmod/buildlink3.mk"
.include "../../audio/libvorbis/buildlink3.mk"
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.34 2005/05/22 20:07:37 jlam Exp $
+# $NetBSD: Makefile,v 1.35 2005/06/01 18:02:37 jlam Exp $
DISTNAME= audacity-src-1.2.3
PKGNAME= audacity-1.2.3
@@ -16,7 +16,6 @@ WRKSRC= ${WRKDIR}/audacity-src-1.2.3
USE_TOOLS+= gmake
USE_LIBTOOL= yes
USE_PKGLOCALEDIR= yes
-USE_X11= yes
GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --without-xaudio
CONFIGURE_ARGS+= --with-id3=system
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.10 2005/04/28 22:16:31 jlam Exp $
+# $NetBSD: Makefile.common,v 1.11 2005/06/01 18:02:37 jlam Exp $
#
DISTNAME= bmp-0.9.7
@@ -17,7 +17,6 @@ GNU_CONFIGURE= yes
USE_DIRS+= xdg-1.1
USE_LIBTOOL= yes
USE_PKGLOCALEDIR= yes
-USE_X11= yes
CONFIGURE_ARGS+= --disable-alsa
CONFIGURE_ARGS+= --disable-esd
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2005/05/22 20:07:37 jlam Exp $
+# $NetBSD: Makefile,v 1.4 2005/06/01 18:02:37 jlam Exp $
#
DISTNAME= cdplayer-0.4.2
@@ -10,7 +10,6 @@ HOMEPAGE= http://gsburn.sourceforge.net/
COMMENT= GNUstep CD player with CDDB support
WRKSRC= ${WRKDIR}/${PKGBASE}
-USE_X11= YES
USE_TOOLS+= gmake
MAKEFILE= GNUmakefile
MAKE_ENV+= ADDITIONAL_CPPFLAGS="-Wno-import"
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2005/05/23 20:40:47 ben Exp $
+# $NetBSD: Makefile,v 1.7 2005/06/01 18:02:37 jlam Exp $
#
DISTNAME= csound-4.23f13gbs.0
@@ -16,7 +16,6 @@ CONFLICTS+= csound-dev-4*
USE_TOOLS+= gmake
GNU_CONFIGURE= yes
USE_MAKEINFO= yes
-USE_X11= yes
TEXINFO_REQD= 4.2
CONFIGURE_ARGS+= --enable-debug
CFLAGS+= -g
View
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.23 2005/04/11 21:44:51 tv Exp $
+# $NetBSD: Makefile,v 1.24 2005/06/01 18:02:37 jlam Exp $
DISTNAME= dap-2.1.2
PKGREVISION= 5
@@ -14,7 +14,6 @@ MAKEFILE= Makefile.netbsd
MAKE_ENV+= X11PREFIX=${X11PREFIX}
-USE_X11= yes
USE_LANGUAGES= c c++
do-install:
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.46 2005/05/22 20:07:37 jlam Exp $
+# $NetBSD: Makefile,v 1.47 2005/06/01 18:02:37 jlam Exp $
#
DISTNAME= easytag-1.1
@@ -15,7 +15,6 @@ BUILD_USES_MSGFMT= yes # xgettext, really
GNU_CONFIGURE= yes
USE_DIRS+= xdg-1.1
USE_TOOLS+= gmake
-USE_X11= yes
USE_PKGLOCALEDIR= yes
USE_LIBTOOL= yes
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.39 2005/05/22 20:07:37 jlam Exp $
+# $NetBSD: Makefile,v 1.40 2005/06/01 18:02:37 jlam Exp $
DISTNAME= festival-1.95-beta
PKGNAME= festival-1.95beta
@@ -14,7 +14,6 @@ COMMENT= Advanced multi-lingual speech synthesis system
WRKSRC= ${WRKDIR}
USE_TOOLS+= gmake
-USE_X11= yes
SPEECHTOOLS= ${WRKSRC}/speech_tools
FESTIVAL= ${WRKSRC}/festival
@@ -94,4 +93,5 @@ do-install:
${INSTALL_MAN} ${FESTIVAL}/doc/festival_client.1 ${PREFIX}/man/man1/festival_client.1
.include "../../audio/nas/buildlink3.mk"
+.include "../../mk/x11.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2005/04/11 21:44:52 tv Exp $
+# $NetBSD: Makefile,v 1.16 2005/06/01 18:02:37 jlam Exp $
#
DISTNAME= freezetag-0.9.2
@@ -10,7 +10,6 @@ MAINTAINER= tech-pkg@NetBSD.org
HOMEPAGE= http://katz.linuxpower.org/freezetag/
COMMENT= Id3 tag editor for GTK+-1.2.0 and higher
-USE_X11= YES
GNU_CONFIGURE= YES
.include "../../x11/gtk/buildlink3.mk"
View
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.28 2005/04/11 21:44:52 tv Exp $
+# $NetBSD: Makefile,v 1.29 2005/06/01 18:02:38 jlam Exp $
#
DISTNAME= gdcd-0.2.1
@@ -11,7 +11,6 @@ HOMEPAGE= http://gdcd.undergrid.net/
COMMENT= CD player for the X Window System using the GIMP Tool Kit (GTK)
USE_DIRS+= xdg-1.1
-USE_X11= YES
GNU_CONFIGURE= YES
.include "../../audio/libcdaudio/buildlink3.mk"
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.21 2005/04/11 21:44:52 tv Exp $
+# $NetBSD: Makefile,v 1.22 2005/06/01 18:02:38 jlam Exp $
DISTNAME= mp3info-0.8.4
PKGNAME= g${DISTNAME}
@@ -14,8 +14,6 @@ COMMENT= Utility to read and modify the ID3 tags of MP3 files
CONFLICTS= mp3info-[0-9]*
-USE_X11= YES
-
# wgetnstr()
INCOMPAT_CURSES= NetBSD-1.5-* NetBSD-1.5.*-* NetBSD-1.5[A-U]-*
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.14 2005/05/24 13:53:13 rillig Exp $
+# $NetBSD: Makefile,v 1.15 2005/06/01 18:02:38 jlam Exp $
#
DISTNAME= gnome-audio-2.0.0
@@ -14,7 +14,8 @@ COMMENT= Set of audio files for GNOME
NO_CONFIGURE= YES
NO_BUILD= YES
USE_DIRS+= xdg-1.1
-USE_X11= YES
+
+.include "../../mk/x11.buildlink3.mk"
do-install:
cd ${WRKSRC}/sounds && for f in *.wav */*.wav; do \
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.16 2005/05/22 20:07:38 jlam Exp $
+# $NetBSD: Makefile,v 1.17 2005/06/01 18:02:38 jlam Exp $
#
DISTNAME= gnome-speech-0.3.6
@@ -17,7 +17,6 @@ BUILD_USES_MSGFMT= yes
USE_TOOLS+= gmake
USE_PKGLOCALEDIR= yes
USE_LIBTOOL= yes
-USE_X11= yes
GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --disable-gtk-doc
@@ -31,4 +30,5 @@ PKGCONFIG_OVERRIDE+= gnome-speech-1.0.pc.in
.include "../../devel/libbonobo/buildlink3.mk"
.include "../../devel/pkgconfig/buildlink3.mk"
.include "../../net/ORBit2/buildlink3.mk"
+.include "../../mk/x11.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2005/05/31 15:13:57 wiz Exp $
+# $NetBSD: Makefile,v 1.8 2005/06/01 18:02:38 jlam Exp $
DISTNAME= gqmpeg-0.91.1
PKGREVISION= 2
@@ -18,7 +18,6 @@ USE_DIRS+= gnome2-1.5
USE_DIRS+= xdg-1.2
USE_PKGINSTALL= YES
USE_PKGLOCALEDIR= YES
-USE_X11= YES
GNU_CONFIGURE= YES
CONFIGURE_ARGS+= --without-included-gettext
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.85 2005/05/31 12:20:11 wiz Exp $
+# $NetBSD: Makefile,v 1.86 2005/06/01 18:02:38 jlam Exp $
DISTNAME= gqmpeg-0.20.0
PKGREVISION= 8
@@ -18,7 +18,6 @@ USE_DIRS+= gnome1-1.5
USE_DIRS+= xdg-1.2
USE_PKGINSTALL= YES
USE_PKGLOCALEDIR= YES
-USE_X11= YES
GNU_CONFIGURE= YES
DEINSTALL_EXTRA_TMPL+= ${.CURDIR}/DEINSTALL
View
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2005/04/11 21:44:53 tv Exp $
+# $NetBSD: Makefile,v 1.5 2005/06/01 18:02:38 jlam Exp $
DISTNAME= kmp-0.01
PKGREVISION= 1
@@ -12,7 +12,6 @@ COMMENT= Qt client for the Music Player Daemon
USE_LANGUAGES= c++
USE_LIBTOOL= yes
-USE_X11= yes
HAS_CONFIGURE= yes
CONFIGURE_ARGS+= ${PREFIX}
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2004/11/16 14:49:41 adam Exp $
+# $NetBSD: Makefile,v 1.12 2005/06/01 18:02:38 jlam Exp $
.include "../libao/Makefile.common"
@@ -9,9 +9,9 @@ COMMENT+= (arts plugin)
CONFIGURE_ARGS:= ${CONFIGURE_ARGS:S/disable-arts/enable-arts/g}
BUILD_DIRS= ${WRKSRC}/src/plugins/arts
INSTALL_DIRS= ${WRKSRC}/src/plugins/arts
-USE_X11= YES
.include "../../audio/arts/buildlink3.mk"
.include "../../audio/libao/buildlink3.mk"
.include "../../mk/pthread.buildlink3.mk"
+.include "../../mk/x11.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2005/04/11 21:44:54 tv Exp $
+# $NetBSD: Makefile,v 1.4 2005/06/01 18:02:38 jlam Exp $
#
DISTNAME= libvisual-plugins-0.2.0
@@ -13,7 +13,6 @@ CONFLICTS= libvisual-nebulus-[0-9]* libvisual-gforce-[0-9]*
USE_PKGLOCALEDIR= yes
USE_LIBTOOL= yes
-USE_X11= yes
GNU_CONFIGURE= yes
# sigsegfaults in 0.2.0 because of:
@@ -27,4 +26,5 @@ CONFIGURE_ARGS+= --disable-dancingparticles
.include "../../graphics/MesaLib/buildlink3.mk"
# currently not useful, since libgdkpixbuf plugin is not configurable
#.include "../../x11/gtk2/buildlink3.mk"
+.include "../../mk/x11.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
Oops, something went wrong.

0 comments on commit 3cc0f66

Please sign in to comment.