Files
jeremy edb2f90a9c Fix WANTLIB for Ruby 3.1 and 3.2, other minor changes
This sets PATCHORIG = .orig, because the build infrastructure handles
that better and it requires less work when updating plists.

This sets optflags="", so that the build infrastructure does not
override the default optimization flags.

This removes ncurses, readline, and yaml from WANTLIB, and adds yaml-0
to WANTLIB. For Ruby 3.1 and 3.2, ncurses and readline are added back.
Ruby 3.3 drops the readline extension, so those libraries are no longer
needed.

This drops the gdbm subpackage code from Makefile.inc, since it
is no longer used by any supported Ruby version.

OK tb@, gkoehler@
2023-12-27 20:06:42 +00:00

96 lines
2.7 KiB
Makefile

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