summaryrefslogtreecommitdiff
path: root/lang/ruby/Makefile.common
blob: 234cf6d4b03b065def69a935f09519649cfb8449 (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
# $NetBSD: Makefile.common,v 1.32 2015/01/25 15:58:29 taca Exp $
#
# Ruby base distribution common definition
# used by databases/ruby-gdbm/Makefile
# used by devel/ruby-curses/Makefile
# used by devel/ruby-readline/Makefile
# used by devel/ruby-mode/Makefile
# used by devel/ruby-fiddle/Makefile
# used by lang/ruby18/Makefile
# used by lang/ruby18-base/Makefile
# used by lang/ruby193/Makefile
# used by lang/ruby193-base/Makefile
# used by lang/ruby200/Makefile
# used by lang/ruby200-base/Makefile
# used by lang/ruby21/Makefile
# used by lang/ruby21-base/Makefile
# used by textproc/ruby-psych/Makefile
# used by x11/ruby-tk/Makefile
#
# RUBY_EXTNAME
#	RUBY_EXTNAME defines name of extension which included in
#	the Ruby's distribution file.
#

# Ruby's license
.if ${RUBY_VER} == "18"
LICENSE=		gnu-gpl-v2 OR ruby-license
.else
LICENSE=		2-clause-bsd OR ruby-license
.endif

#
# Ruby distribution sites.
#
RUBY_SITE_SUBDIR=	${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}

MASTER_SITE_RUBY?= \
	http://cache.ruby-lang.org/pub/ruby/${RUBY_SITE_SUBDIR}/ \
	ftp://ftp.ruby-lang.org/pub/ruby/${RUBY_SITE_SUBDIR}/ \
	ftp://www.ibiblio.org/pub/languages/ruby/${RUBY_SITE_SUBDIR}/ \
	ftp://xyz.lcs.mit.edu/pub/ruby/${RUBY_SITE_SUBDIR}/ \
	ftp://gd.tuwien.ac.at/languages/ruby/${RUBY_SITE_SUBDIR}/ \
	ftp://ftp.fu-berlin.de/unix/languages/ruby/${RUBY_SITE_SUBDIR}/ \
	ftp://ftp.easynet.be/ruby/ruby/${RUBY_SITE_SUBDIR}/ \
	ftp://ftp.ntua.gr/pub/lang/ruby/${RUBY_SITE_SUBDIR}/ \
	ftp://sunsite.dk/mirrors/ruby/${RUBY_SITE_SUBDIR}/ \
	ftp://ruby.cdpa.nsysu.edu.tw/ruby/${RUBY_SITE_SUBDIR}/ \
	ftp://ftp.chg.ru/pub/lang/ruby/${RUBY_SITE_SUBDIR}/ \
	ftp://ftp.ring.gr.jp/pub/lang/ruby/${RUBY_SITE_SUBDIR}/ \
	ftp://ftp.iij.ad.jp/pub/lang/ruby/${RUBY_SITE_SUBDIR}/ \
	ftp://ftp.idaemons.org/pub/mirror/ftp.ruby-lang.org/ruby/${RUBY_SITE_SUBDIR}/

# Ruby distribution
RUBY_DISTINFO_FILE=	${.CURDIR}/${RUBY_SRCDIR}/distinfo

RUBY_HOMEPAGE=		http://www.ruby-lang.org/en/

RUBY_WRKSRC?=		${WRKDIR}/${RUBY_DISTNAME}
EXTRACT_SUFX=		.tar.bz2
STRIP?=			strip

#
# substitutions
#
MESSAGE_SUBST+=		RUBY_DISTNAME=${RUBY_DISTNAME}
PLIST_SUBST+=		RUBY_SHLIBVER=${RUBY_SHLIBVER:Q} \
			RUBY_SHLIBMAJOR=${RUBY_SHLIBMAJOR:Q} \
			RUBY_NOSHLIBMAJOR=${RUBY_NOSHLIBMAJOR} \
			RUBY_NAME=${RUBY_NAME:Q}

.if !empty(RUBY_EXTNAME)

PKGNAME?=		${RUBY_PKGPREFIX}-${RUBY_EXTNAME}-${RUBY_VERSION_FULL}
DISTINFO_FILE=		${.CURDIR}/${RUBY_SRCDIR}/distinfo
PATCHDIR=		${.CURDIR}/${RUBY_SRCDIR}/patches
do-patch:
	${_PKG_SILENT}${_PKG_DEBUG}	\
	cd ${WRKSRC};			\
	for p in `${EGREP} -l '^\+\+\+ ext/${RUBY_EXTNAME}/' ${PATCHDIR}/patch-*`;do \
		${SED} -e 's,^+++ ext/${RUBY_EXTNAME}/,+++ ,' $$p | \
		${PATCH} ${PATCH_ARGS}; \
	done || ${TRUE}
.endif

.include "replace.mk"

.if !empty(RUBY_USE_PTHREAD:M[nN][oO])
CONFIGURE_ARGS+=	--disable-pthread
.else
CONFIGURE_ARGS+=	--enable-pthread

PTHREAD_OPTS+=		native
PTHREAD_AUTO_VARS=	yes

.include "../../mk/pthread.buildlink3.mk"
.endif
.include "../../mk/dlopen.buildlink3.mk"