summaryrefslogtreecommitdiff
path: root/devel/ruby-langscan/Makefile
blob: 085fb203633eaac380280c348e59dc2d8c8978ff (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
# Created by: TAKATSU Tomonari <tota@FreeBSD.org>
# $FreeBSD$

PORTNAME=	langscan
PORTVERSION=	1.2.20070115
CATEGORIES=	devel ruby
MASTER_SITES=	LOCAL/tota/${PORTNAME}
PKGNAMEPREFIX=	${RUBY_PKGNAMEPREFIX}
DIST_SUBDIR=	${RUBY_PKGNAMEPREFIX:S|${RUBY_SUFFIX}-||}

MAINTAINER=	tota@FreeBSD.org
COMMENT=	Program analyzer for source code search engine

LICENSE=	GPLv2

RUN_DEPENDS=	p5-PPI>=0:${PORTSDIR}/textproc/p5-PPI
BUILD_DEPENDS=	flex>=2.5.31:${PORTSDIR}/textproc/flex

USES=		perl5
USE_AUTOTOOLS=	aclocal:env automake:env autoconf:env
USE_RUBY=	yes
USE_PERL5=	run
USE_OCAML=	yes
NO_OCAML_RUNDEPENDS=	yes
HAS_CONFIGURE=	yes

WRKSRC=	${WRKDIR}/${PORTNAME}

PORTDOCS=	ChangeLog NEWS README
DOCSDIR=	${RUBY_MODDOCDIR}

OPTIONS_DEFINE=	DOCS
OPTIONSFILE=	${PORT_DBDIR}/ruby-${PORTNAME}/options

CFLAGS+=	-fPIC

CFLAGS+=	-I${LOCALBASE}/include/ruby-${RUBY_VER} \
		-I${LOCALBASE}/include/ruby-${RUBY_VER}/${RUBY_ARCH}
PLIST_SUB+=	RIPPER="@comment "

post-patch:
	${REINPLACE_CMD} "s|\(flex --version\)|${LOCALBASE}/bin/\1|" ${WRKSRC}/autogen.sh
	${FIND} ${WRKSRC} -name Makefile.am | ${XARGS} ${REINPLACE_CMD} "s|flex|${LOCALBASE}/bin/flex|"

pre-configure:
	cd ${CONFIGURE_WRKSRC}; ${SH} autogen.sh

post-install:
	${CHMOD} ${BINMODE} ${STAGEDIR}${RUBY_SITEARCHLIBDIR}/${PORTNAME}/ocaml/camlexer
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
.for f in ${PORTDOCS}
	${INSTALL_DATA} ${INSTALL_WRKSRC}/${f} ${STAGEDIR}${DOCSDIR}/
.endfor

x-generate-plist:
	${ECHO} %%RUBY_SITELIBDIR%%/langscan.rb > pkg-plist.new
	${FIND} ${RUBY_SITEARCHLIBDIR}/${PORTNAME} -type f | ${SORT} | ${SED} -e 's,${RUBY_SITEARCHLIBDIR},%%RUBY_SITEARCHLIBDIR%%,' >> pkg-plist.new
	${FIND} ${RUBY_SITELIBDIR}/${PORTNAME} -type f | ${SORT} | ${SED} -e 's,${RUBY_SITELIBDIR},%%RUBY_SITELIBDIR%%,' >> pkg-plist.new
	${FIND} ${RUBY_SITELIBDIR}/${PORTNAME} -type d -depth | ${SORT} -r | ${SED} -e 's,${RUBY_SITELIBDIR},@dirrm %%RUBY_SITELIBDIR%%,' >> pkg-plist.new
	${FIND} ${RUBY_SITEARCHLIBDIR}/${PORTNAME} -type d -depth | ${SORT} -r | ${SED} -e 's,${RUBY_SITEARCHLIBDIR},@dirrm %%RUBY_SITEARCHLIBDIR%%,' >> pkg-plist.new

.include <bsd.port.pre.mk>

.if ${RUBY_VER} >= 2.1
BROKEN=		Does not build
.endif

.include <bsd.port.post.mk>