summaryrefslogtreecommitdiff
path: root/x11/xorg-imake/Makefile
blob: 0347c3fa7d181b5e86307efb627f2d8c2c1b969c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# $NetBSD: Makefile,v 1.22 2005/12/05 20:51:20 rillig Exp $

DISTNAME=	${DISTFILES}
PKGNAME=	xorg-imake-${XORG_VER}
PKGREVISION=	2
CATEGORIES=	x11
MASTER_SITES=	${MASTER_SITE_XORG}
DISTFILES=	X11R${XORG_VER}-src1.tar.gz X11R${XORG_VER}-src3.tar.gz

MAINTAINER=	xtraeme@NetBSD.org
HOMEPAGE=	http://www.x.org/
COMMENT=	Imake and other utilities from X.org

PKG_INSTALLATION_TYPES= overwrite pkgviews

USE_DIRS+=		xorg-1.1
INSTALL_TARGET=		install install.man
NO_XORG_TARGETS=	yes

.include "../../mk/bsd.prefs.mk"

.if ${OPSYS} == "Linux"
DEPENDS+=	bison-[0-9]*:../../devel/bison
DEPENDS+=	flex-[0-9]*:../../devel/flex
PLIST_SUBST+=	LNDIR=
.elif ${OPSYS} == "OpenBSD"
PLIST_SUBST+=	LNDIR="@comment "
.else
PLIST_SUBST+=	LNDIR=
.endif

.include "../../meta-pkgs/xorg/Makefile.common"

post-extract:
	@${TOUCH} ${WRKSRC}/config/cf/date.def
	@${CP} ${PKGSRCDIR}/x11/xorg-libs/files/DragonFly.cf \
		${WRKSRC}/config/cf/
.for F in ${SYSTEMS}
	@${MV} ${WRKSRC}/config/cf/${F}.cf  ${WRKSRC}/config/cf/${F}.cf.in
.endfor
	@${SED} -e "s|CONFIGDIRSPEC|-I${X11ROOT}/lib/X11/config|" \
		${WRKSRC}/config/util/xmkmf.cpp > \
		${WRKSRC}/config/util/xmkmf.cpp.orig
	@${MV} ${WRKSRC}/config/util/xmkmf.cpp.orig \
		${WRKSRC}/config/util/xmkmf.cpp

pre-configure:
.for F in ${SYSTEMS}
	@${SED} -e "s|@@PKGSRC_CC@@|${CC}|g"		\
		-e "s|@@PKGSRC_CPP@@|${CPP}|g"		\
		-e "s|@@PKGSRC_CXX@@|${CXX}|g"		\
		-e "s|@@PKGSRC_CFLAGS@@|${CFLAGS}|g"	\
		-e "s|@@DARWIN_USE_QUARTZ@@|${DARWIN_USE_QUARTZ}|g"	\
		${WRKSRC}/config/cf/${F}.cf.in > ${WRKSRC}/config/cf/${F}.cf
.endfor
	@( \
	${ECHO} "#define XORG_VERSION_MAJOR  6";	\
	${ECHO} "#define XORG_VERSION_MINOR  8";	\
	${ECHO} "#define XORG_VERSION_PATCH  2";	\
	${ECHO} "#define XORG_VERSION_SNAP   0";	\
	) > ${WRKSRC}/config/cf/version.def

do-build:
	@${CP} ${FILESDIR}/xorgsite.def ${WRKSRC}/config/cf
	@${SED} -e "s|@PREFIX@|${X11ROOT}|g"		\
		-e "s|@BLNK@|${BUILDLINK_DIR}|g"	\
		-e "s|@LOCALBASE@|${LOCALBASE}|g "	\
		-e "s|@MAKE@|${MAKE_PROGRAM}|"	${FILESDIR}/host.def > \
		${WRKSRC}/config/cf/host.def
	cd ${WRKSRC} && ${MAKE_PROGRAM} Makefile.boot &&	\
	${MAKE_PROGRAM} -f xmakefile VerifyOS version.def Makefiles includes

pre-install:
	@${CP} ${WRKSRC}/xmakefile ${WRKSRC}/xmakefile.bak
	@${SED} 's/SUBDIRS = include/SUBDIRS =/' ${WRKSRC}/xmakefile.bak > \
		${WRKSRC}/xmakefile

post-install:
	${CHMOD} ${NONBINMODE} ${X11ROOT}/lib/X11/config/host.def
	@${CP} ${X11ROOT}/lib/X11/config/host.def		\
		${X11ROOT}/lib/X11/config/host.def.orig
	@${SED} -e "s|\#define ProjectRoot ${X11ROOT}||"	\
		${X11ROOT}/lib/X11/config/host.def.orig >	\
		${X11ROOT}/lib/X11/config/host.def
	@${RM} ${X11ROOT}/lib/X11/config/host.def.orig

	@( \
	${ECHO};					\
	${ECHO} "#ifdef BeforeVendorCF";		\
	${ECHO} "#define ProjectRoot ${X11ROOT}";	\
	${ECHO} "#endif";				\
	) >> ${X11ROOT}/lib/X11/config/host.def

.if !empty(MACHINE_PLATFORM:MNetBSD-1.6[M-Z]*) ||	\
    !empty(MACHINE_PLATFORM:MNetBSD-[2-9]*)
.  if exists(/usr/include/threadlib.h)
SUBST_CLASSES+=		thr
SUBST_STAGE.thr=	post-patch
SUBST_FILES.thr=	config/cf/NetBSD.cf.in
SUBST_SED.thr=		-e 's|@@NETBSD_THREADLIB@@|-DUSE_NBSD_THREADLIB|'
SUBST_MESSAGE.thr=	"Fixes for threadlib.h."
.  else
SUBST_CLASSES+=		nada
SUBST_STAGE.nada=	post-patch
SUBST_FILES.nada=	config/cf/NetBSD.cf.in
SUBST_SED.nada=		-e 's|@@NETBSD_THREADLIB@@||'
.  endif
.endif

.include "../../mk/bsd.pkg.mk"