summaryrefslogtreecommitdiff
path: root/devel/plan9port/Makefile
blob: f29c8e4a634c2cbede09b7623af5f6b49b55225c (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
# Created by: Serge Gagnon <serge.gagnon@b2b2c.ca>
# $FreeBSD$

PORTNAME=	plan9port
PORTVERSION=	20140306
PORTREVISION=	4
CATEGORIES=	devel plan9
MASTER_SITES=	http://swtch.com/${PORTNAME}/

MAINTAINER=	ports@FreeBSD.org
COMMENT=	Port of many Plan 9 programs to Unix-like operating systems

LICENSE=	LUCENT
LICENSE_NAME=	Lucent Public License Version 1.02
LICENSE_FILE=	${WRKSRC}/LICENSE
LICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept

BROKEN_ia64=	does not install: cleanname not found
BROKEN_sparc64=	does not install: cleanname not found

RUN_DEPENDS=	rc:${PORTSDIR}/shells/rc

USES=		perl5 shebangfix tar:tgz
SHEBANG_LANG=	rc
rc_OLD_CMD=	/bin/rc
rc_CMD=		${LOCALBASE}/bin/rc
SHEBANG_FILES=	acid/transcript \
		acid/window \
		mac/9term.app/Contents/MacOS/9term \
		mac/Plumb.app/Contents/MacOS/plumb \
		src/cmd/9660/mk9660.rc \
		src/cmd/dict/egfix \
		src/cmd/dict/egfix2 \
		src/cmd/dict/gefix \
		src/cmd/dict/getneeds \
		src/cmd/lp/lpsend.rc \
		src/cmd/map/map.rc \
		src/cmd/map/mapdemo.rc \
		src/cmd/spell/spell.rc \
		src/cmd/upas/filterkit/pipefrom.sample \
		unix/man/fixurls
USE_PERL5=	build
USE_XORG=	x11 xt xi xaw
WRKSRC=		${WRKDIR}/plan9
PLIST=		${WRKDIR}/.PLIST
SUB_FILES=	pkg-message
REINPLACE_ARGS=	-i ""		# necessary since installs via recursive copy

PLAN9=		${PREFIX}/plan9

EMPTY_DIRS=	plan9/log \
		plan9/bin/lpbin \
		plan9/dist/troff \
		plan9/mail/queue \
		plan9/dist/debian \
		plan9/dist/pkg

post-patch:
	@${FIND} ${WRKSRC}/man -type f -regex ".*\.[0-9?]$\" \
		| ${XARGS} ${REINPLACE_CMD} -e 's|\\\*9|${PLAN9}|'
	@${REINPLACE_CMD} -e 's|X11=/usr/X11R6|X11=${LOCALBASE}|' \
		${WRKSRC}/bin/9l ${WRKSRC}/src/cmd/devdraw/mkwsysrules.sh
	@${REINPLACE_CMD} -e 's|\[5-9\]\.||' ${WRKSRC}/bin/9l
	@${REINPLACE_CMD} -e 's|/lib/font/bit|${PLAN9}/font|' \
		${WRKSRC}/src/cmd/acme/acme.c
	@${SED} -e 's|util\.h|lib&|' ${WRKSRC}/src/cmd/9term/OpenBSD.c \
		> ${WRKSRC}/src/cmd/9term/${OPSYS}.c
	@${REINPLACE_CMD} -e 's|, swizz(void)|&, swizz8(void)|' \
		${WRKSRC}/src/cmd/xd.c
	@${REINPLACE_CMD} -e '/^cd $$PLAN9/d' ${WRKSRC}/lib/moveplan9.sh

do-build:
	cd ${WRKSRC} && CC9="${CC}" ./INSTALL

# Dynamic PLIST sucks, but it's over 8K lines, which sucks even more :(
post-build:
	${RM} -rf `${FIND} ${WRKSRC}/dist -type f ! -regex ".*\.png"`
	${RM} -rf `${FIND} ${WRKSRC} -name .hg -o -name .cvsignore`
	( cd ${WRKDIR} ; \
	  ${FIND} plan9 -type f; for D in ${EMPTY_DIRS}; do \
	    ${ECHO_CMD} "@exec ${MKDIR} ${PREFIX}/$${D}"; \
	  done; \
	  ${FIND} plan9 -type d | ${SORT} -r | ${SED} -e 's|^|@dirrm |'; \
	) | ${PERL} -pe '$$_ =~ s,plan9/bin/auxstats,\@group kmem\n\@mode\
	  2755\n$$&\n\@group\n\@mode,' > ${PLIST}

do-install:
	${CP} -a ${WRKSRC} ${STAGEDIR}${PREFIX}

post-install:
	cd ${STAGEDIR}${PLAN9} && ${SETENV} PLAN9=${PLAN9} \
		PATH=${PATH}:${STAGEDIR}${PLAN9}/bin \
			${SH} lib/moveplan9.sh ${WRKSRC}
	${CHMOD} 01777 ${STAGEDIR}${PLAN9}/news

install-user:
	@${MKDIR} ${HOME}/lib
	${INSTALL_DATA} ${PLAN9}/plumb/initial.plumbing ${HOME}/lib/plumbing

.include <bsd.port.mk>