summaryrefslogtreecommitdiff
path: root/pkgtools/buildlink-x11
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2001-07-02 21:00:44 +0000
committerjlam <jlam@pkgsrc.org>2001-07-02 21:00:44 +0000
commitb965ea4acdf80be179edade6c4917dc54c5dd7e3 (patch)
tree9a25029ff1a511fa097df120a5af836e699ca4e5 /pkgtools/buildlink-x11
parentc6c5683360fcc0dfa232212f4b99b4bb5bc6a50a (diff)
downloadpkgsrc-b965ea4acdf80be179edade6c4917dc54c5dd7e3.tar.gz
buildlink-x11: allows X11 pkgs to be built using the buildlink.mk
infrastructure, even if they use Imake.
Diffstat (limited to 'pkgtools/buildlink-x11')
-rw-r--r--pkgtools/buildlink-x11/Makefile54
-rw-r--r--pkgtools/buildlink-x11/files/buildlinkX11.def64
-rw-r--r--pkgtools/buildlink-x11/files/buildlinkX11.rules75
-rw-r--r--pkgtools/buildlink-x11/pkg/DEINSTALL42
-rw-r--r--pkgtools/buildlink-x11/pkg/DESCR3
-rw-r--r--pkgtools/buildlink-x11/pkg/INSTALL41
-rw-r--r--pkgtools/buildlink-x11/pkg/PLIST3
7 files changed, 282 insertions, 0 deletions
diff --git a/pkgtools/buildlink-x11/Makefile b/pkgtools/buildlink-x11/Makefile
new file mode 100644
index 00000000000..859059103a3
--- /dev/null
+++ b/pkgtools/buildlink-x11/Makefile
@@ -0,0 +1,54 @@
+# $NetBSD: Makefile,v 1.1.1.1 2001/07/02 21:00:44 jlam Exp $
+
+DISTNAME= buildlink-x11-0.4
+CATEGORIES= pkgtools devel x11
+MASTER_SITES= # empty
+DISTFILES= # empty
+
+MAINTAINER= jlam@netbsd.org
+HOMEPAGE= ftp://ftp.netbsd.org/pub/NetBSD/packages/pkgsrc/Packages.txt
+COMMENT= allows X11 pkgs to be built using the buildlink.mk infrastructure
+
+EXTRACT_ONLY= # empty
+NO_CHECKSUM= # defined
+NO_WRKSUBDIR= # defined
+NO_CONFIGURE= # defined
+NO_BUILD= # defined
+NO_MTREE= # defined
+USE_X11BASE= # defined
+
+DEINSTALL_FILE= ${WRKDIR}/DEINSTALL
+INSTALL_FILE= ${WRKDIR}/INSTALL
+
+.include "../../mk/bsd.prefs.mk"
+
+.if (${OPSYS} == SunOS)
+DEPENDS+= diffutils>=2.7:../../devel/diffutils
+DIFF= ${LOCALBASE}/bin/gdiff
+.else
+DIFF= /usr/bin/diff
+.endif
+
+FILES_SUBST= X11BASE=${X11BASE}
+FILES_SUBST+= PREFIX=${PREFIX}
+FILES_SUBST+= CP=${CP:Q}
+FILES_SUBST+= DIFF=${DIFF:Q}
+FILES_SUBST+= GREP=${GREP:Q}
+FILES_SUBST+= RM=${RM:Q}
+FILES_SUBST+= RMDIR=${RMDIR:Q}
+FILES_SUBST+= TRUE=${TRUE:Q}
+FILES_SUBST_SED= ${FILES_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/}
+
+pre-install:
+ ${SED} ${FILES_SUBST_SED} ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE}
+ ${SED} ${FILES_SUBST_SED} ${PKGDIR}/INSTALL > ${INSTALL_FILE}
+
+do-install:
+ ${INSTALL_DATA_DIR} ${PREFIX}/lib/X11/config
+ ${INSTALL_DATA} ${FILESDIR}/buildlinkX11.def ${PREFIX}/lib/X11/config
+ ${INSTALL_DATA} ${FILESDIR}/buildlinkX11.rules ${PREFIX}/lib/X11/config
+
+post-install:
+ PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} POST-INSTALL
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/pkgtools/buildlink-x11/files/buildlinkX11.def b/pkgtools/buildlink-x11/files/buildlinkX11.def
new file mode 100644
index 00000000000..4d724ced60e
--- /dev/null
+++ b/pkgtools/buildlink-x11/files/buildlinkX11.def
@@ -0,0 +1,64 @@
+/* $NetBSD: buildlinkX11.def,v 1.1.1.1 2001/07/02 21:00:44 jlam Exp $ */
+
+#ifdef AfterVendorCF
+
+#ifdef UseInstalled
+# ifdef BuildLink
+# ifndef ProjectRulesFile
+# define ProjectRulesFile <buildlinkX11.rules>
+# endif
+
+/*
+ * Force the buildlink include and lib directories to the head of the
+ * compiler search paths. The include directory is added through the
+ * C{,plusplus}DebugFlags, which are the first options given to the
+ * compiler. It is _required_ that BUILDLINK_DIR be defined in the
+ * environment.
+ */
+
+# ifndef BuildLinkCppFlags
+# define BuildLinkCppFlags -I$(BUILDLINK_DIR)/include $(PKGSRC_CPPFLAGS)
+# endif
+# ifndef BuildLinkLdFlags
+# define BuildLinkLdFlags -L$(BUILDLINK_DIR)/lib $(PKGSRC_LDFLAGS)
+# endif
+# ifndef BuildLinkImakeCmd
+# ifdef X11ProjectRoot
+# define ImakeConfigDir -I$(PREFIX)/lib/X11/config
+# else
+# define ImakeConfigDir /**/
+# endif
+# ifdef BuildLinkX11
+# define BuildLinkImakeCmd imake -DBuildLink -DBuildLinkX11 ImakeConfigDir
+# else
+# define BuildLinkImakeCmd imake -DBuildLink ImakeConfigDir
+# endif
+# endif
+# ifdef DependFlags
+# undef DependFlags
+# endif
+# define DependFlags BuildLinkCppFlags
+# ifdef OptimizedCDebugFlags
+# undef OptimizedCDebugFlags
+# endif
+# define OptimizedCDebugFlags -O2 BuildLinkCppFlags $(PKGSRC_CFLAGS)
+# ifdef OptimizedCplusplusDebugFlags
+# undef OptimizedCplusplusDebugFlags
+# endif
+# define OptimizedCplusplusDebugFlags -O2 BuildLinkCppFlags $(PKGSRC_CXXFLAGS)
+# ifdef LdPreLib
+# undef LdPreLib
+# endif
+# define LdPreLib BuildLinkLdFlags
+# ifdef LdPostLib
+# undef LdPostLib
+# endif
+# define LdPostLib BuildLinkLdFlags
+# ifdef ImakeCmd
+# undef ImakeCmd
+# endif
+# define ImakeCmd BuildLinkImakeCmd
+# endif /* BuildLink */
+#endif /* UseInstalled */
+
+#endif /* AfterVendorCF */
diff --git a/pkgtools/buildlink-x11/files/buildlinkX11.rules b/pkgtools/buildlink-x11/files/buildlinkX11.rules
new file mode 100644
index 00000000000..628c8824dfa
--- /dev/null
+++ b/pkgtools/buildlink-x11/files/buildlinkX11.rules
@@ -0,0 +1,75 @@
+/* $NetBSD: buildlinkX11.rules,v 1.1.1.1 2001/07/02 21:00:44 jlam Exp $ */
+
+#ifdef UseInstalled
+# ifdef BuildLink
+# ifdef TopInclude
+# undef TopInclude
+# endif
+# define TopInclude -I$(BUILDLINK_DIR)/include
+# ifdef BuildLinkX11
+# ifdef TopXInclude
+# undef TopXInclude
+# endif
+# define TopXInclude -I$(BUILDLINK_DIR)/include
+# else
+# ifdef TopXInclude
+# undef TopXInclude
+# endif
+# ifdef X11ProjectRoot
+# define TopXInclude -I$(XPROJECTROOT)/include
+# else
+# define TopXInclude -I$(INCROOT)
+# endif
+# endif /* BuildLinkX11 */
+# endif /* BuildLink */
+#endif /* UseInstalled */
+
+#include <X11.rules>
+
+#ifdef UseInstalled
+# ifdef BuildLink
+# ifdef BuildLinkX11
+# ifdef XLdPreLibs
+# undef XLdPreLibs
+# endif
+# define XLdPreLibs -L$(BUILDLINK_DIR)/lib
+# ifdef LdPreLibs
+# undef LdPreLibs
+# endif
+# define LdPreLibs LdPreLib XLdPreLibs
+# ifdef XLdPostLibs
+# undef XLdPostLibs
+# endif
+# define XLdPostLibs -L$(BUILDLINK_DIR)/lib
+# ifdef LdPostLibs
+# undef LdPostLibs
+# endif
+# define LdPostLibs LdPostLib XLdPostLibs
+# else
+# ifdef XLdPreLibs
+# undef XLdPreLibs
+# endif
+# ifdef X11ProjectRoot
+# define XLdPreLibs -L$(XPROJECTROOT)/lib
+# else
+# define XLdPreLibs -L$(USRLIBDIR)
+# endif
+# ifdef LdPreLibs
+# undef LdPreLibs
+# endif
+# define LdPreLibs LdPreLib XLdPreLibs
+# ifdef XLdPostLibs
+# undef XLdPostLibs
+# endif
+# ifdef X11ProjectRoot
+# define XLdPostLibs -L$(XPROJECTROOT)/lib
+# else
+# define XLdPostLibs -L$(USRLIBDIR)
+# endif
+# ifdef LdPostLibs
+# undef LdPostLibs
+# endif
+# define LdPostLibs LdPostLib XLdPostLibs
+# endif /* BuildLinkX11 */
+# endif /* BuildLink */
+#endif /* UseInstalled */
diff --git a/pkgtools/buildlink-x11/pkg/DEINSTALL b/pkgtools/buildlink-x11/pkg/DEINSTALL
new file mode 100644
index 00000000000..57514d082cd
--- /dev/null
+++ b/pkgtools/buildlink-x11/pkg/DEINSTALL
@@ -0,0 +1,42 @@
+#!/bin/sh
+#
+# $NetBSD: DEINSTALL,v 1.1.1.1 2001/07/02 21:00:44 jlam Exp $
+
+PKGNAME=$1
+STAGE=$2
+
+CP="@CP@"
+DIFF="@DIFF@"
+GREP="@GREP@"
+RM="@RM@"
+RMDIR="@RMDIR@"
+TRUE="@TRUE@"
+
+X11BASE=@X11BASE@
+X11_HOSTDEF=${X11BASE}/lib/X11/config/host.def
+HOSTDEF=${PKG_PREFIX}/lib/X11/config/host.def
+
+case ${STAGE} in
+DEINSTALL)
+ ;;
+
+POST-DEINSTALL)
+ echo -n "Updating ${HOSTDEF}..."
+ ${CP} -f ${HOSTDEF} ${HOSTDEF}.bak
+ ( ${GREP} -v buildlinkX11 ${HOSTDEF}.bak || ${TRUE} ) > ${HOSTDEF}
+ ${RM} -f ${HOSTDEF}.bak
+ if [ ${PKG_PREFIX} != ${X11BASE} ] && \
+ ${DIFF} -q ${X11_HOSTDEF} ${HOSTDEF} >/dev/null
+ then
+ ${RM} -f ${HOSTDEF}
+ fi
+ echo "done."
+ ${RMDIR} -p ${PKG_PREFIX}/lib/X11/config 2>/dev/null || ${TRUE}
+ ;;
+
+*)
+ echo "Unexpected argument: ${STAGE}"
+ exit 1
+ ;;
+esac
+exit 0
diff --git a/pkgtools/buildlink-x11/pkg/DESCR b/pkgtools/buildlink-x11/pkg/DESCR
new file mode 100644
index 00000000000..2b7b83fc322
--- /dev/null
+++ b/pkgtools/buildlink-x11/pkg/DESCR
@@ -0,0 +1,3 @@
+Buildlink-x11 is a hack that allows NetBSD users to compile X11 pkgs from
+pkgsrc using the buildlink.mk infrastructure described in Packages.txt,
+even if they use Imake.
diff --git a/pkgtools/buildlink-x11/pkg/INSTALL b/pkgtools/buildlink-x11/pkg/INSTALL
new file mode 100644
index 00000000000..2534cce6fee
--- /dev/null
+++ b/pkgtools/buildlink-x11/pkg/INSTALL
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# $NetBSD: INSTALL,v 1.1.1.1 2001/07/02 21:00:44 jlam Exp $
+
+PKGNAME=$1
+STAGE=$2
+
+CP="@CP@"
+GREP="@GREP@"
+RM="@RM@"
+
+X11BASE=@X11BASE@
+X11_HOSTDEF=${X11BASE}/lib/X11/config/host.def
+HOSTDEF=${PKG_PREFIX}/lib/X11/config/host.def
+
+case ${STAGE} in
+PRE-INSTALL)
+ ;;
+
+POST-INSTALL)
+ if [ ${PKG_PREFIX} = ${X11BASE} -o -f ${HOSTDEF} ]
+ then
+ echo -n "Updating ${HOSTDEF}..."
+ ${CP} -f ${HOSTDEF} ${HOSTDEF}.bak
+ else
+ echo -n "Creating ${HOSTDEF}..."
+ ${CP} -f ${X11_HOSTDEF} ${HOSTDEF}.bak
+ fi
+ ( ${GREP} -v buildlinkX11 ${HOSTDEF}.bak; \
+ echo '#include <buildlinkX11.def>'; \
+ ) > ${HOSTDEF}
+ ${RM} -f ${HOSTDEF}.bak
+ echo "done."
+ ;;
+
+*)
+ echo "Unexpected argument: ${STAGE}"
+ exit 1
+ ;;
+esac
+exit 0
diff --git a/pkgtools/buildlink-x11/pkg/PLIST b/pkgtools/buildlink-x11/pkg/PLIST
new file mode 100644
index 00000000000..be36c28dc76
--- /dev/null
+++ b/pkgtools/buildlink-x11/pkg/PLIST
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2001/07/02 21:00:44 jlam Exp $
+lib/X11/config/buildlinkX11.def
+lib/X11/config/buildlinkX11.rules