summaryrefslogtreecommitdiff
path: root/lang/ruby/Makefile.inc
blob: 578cd75e14446d72b8577b225bcaee1777fd30b2 (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
COMMENT-main ?=		object oriented script language with threads
COMMENT-ri_docs ?=	ri documentation files for ruby

DISTNAME ?=	ruby-${VERSION}

PKGNAME-main ?=		ruby-${VERSION}
PKGNAME-ri_docs ?=	ruby${BINREV}-ri_docs-${VERSION}

PKG_ARCH-ri_docs ?=	*
WANTLIB-ri_docs ?=	# empty

PKGSPEC-main ?=		ruby->=${REV},<${NEXTVER}

CATEGORIES ?=	lang

HOMEPAGE ?=	https://www.ruby-lang.org/

MAINTAINER ?=	Jeremy Evans <jeremy@openbsd.org>

# GPL/Artistic/BSD/Public Domain/Beer-Ware
PERMIT_PACKAGE?= Yes

SITES ?=		https://cache.ruby-lang.org/pub/ruby/${VERSION:R}/
SITES.p ?=		https://github.com/ruby/ruby/commit/
PATCH_DIST_STRIP ?=	-p1
PATCHORIG =		.orig

CONFIGURE_STYLE ?=	gnu
CONFIGURE_ARGS +=	--enable-shared \
			--program-suffix=${BINREV} \
			--with-soname=ruby${BINREV} \
			--with-ruby-version=${REV} \
			--with-mantype=doc \
			--with-setjmp-type=_setjmp \
			--enable-pthread \
			--enable-ipv6 \
			--without-baseruby \
			--without-bundled-libffi \
			--disable-option-checking
# dwz errors out if it encounters an already compressed debug section
CONFIGURE_ARGS +=	--with-compress-debug-sections=no

CONFIGURE_ENV +=	LIBruby${BINREV}_VERSION=${LIBruby${BINREV}_VERSION} \
			PREFIX="${PREFIX}" \
			optflags="" \
			CPPFLAGS="-DOPENSSL_NO_STATIC_ENGINE -I${LOCALBASE}/include" \
			LDFLAGS="-L${LOCALBASE}/lib" \
			DLDFLAGS="-L${LOCALBASE}/lib" \
			ac_cv_prog_DOXYGEN="" \
			ac_cv_prog_DOT=""

MAKE_ENV +=		DLDFLAGS="-I${LOCALBASE}/lib"

WANTLIB-main +=		c crypto ffi gmp m pthread ssl util yaml-0 z
LIB_DEPENDS-main +=	devel/gmp \
			devel/libyaml \
			devel/libffi

DEBUG_PACKAGES ?=	-main

ALL_TARGET =		V=1 main
INSTALL_TARGET =	V=1 install-nodoc

TEST_DEPENDS ?=		${FULLPKGNAME-main}:${BUILD_PKGPATH}

POST_EXTRACT ?=		rm -rf ${WRKSRC}/ext/fiddle/libffi-* \
				${WRKSRC}/tool/downloader.rb;

# cc(1) uses too much ram to build ext/ripper/ripper.c
# XXX remove arch if vmparam.h + login.conf give more than 1024M to pbuild
.if ${MACHINE_ARCH:Malpha} || ${MACHINE_ARCH:Marm} || ${MACHINE_ARCH:Mhppa}
CFLAGS_OVERRIDE =	-O1
.endif

FIX_RIPPER ?=	sed -i 's/%%CFLAGS_OVERRIDE%%/${CFLAGS_OVERRIDE}/g' \
			${WRKSRC}/ext/ripper/depend;

PRE_INSTALL ?=	find ${WRKSRC} -name '*.orig' -delete; \
		${INSTALL_DATA_DIR} ${PREFIX}/share/doc/ruby \
		${PREFIX}/lib/ruby/gems/${REV}/extensions/${SUB} \
		${PREFIX}/lib/ruby/gems/${REV}/extensions/${SUB}/${REV};

# Ruby itself is clean, but some extensions (e.g. devel/ruby-therubyracer)
# need W|X mappings.
USE_WXNEEDED ?=		Yes

REV ?=			${VERSION:R}
BINREV ?=		${REV:S/.//}
SUB ?=			${MACHINE_ARCH:S/amd64/x86_64/}-openbsd
SUBST_VARS +=		SUB REV
FILESDIR ?=		${.CURDIR}/../files

FIX_RBCONFIG ?=		sed 's/INSTALL_ARGS/-c -o ${BINOWN} -g ${BINGRP}/' < \
				${FILESDIR}/rbconfig_fix.rb >> \
				${PREFIX}/lib/ruby/${REV}/${SUB}/rbconfig.rb