2000-09-06 20:06:58 +00:00
|
|
|
# bsd.ruby.mk - Utility definitions for Ruby related ports.
|
|
|
|
#
|
|
|
|
|
2000-09-16 11:37:37 +00:00
|
|
|
.if !defined(Ruby_Include)
|
|
|
|
|
2000-09-06 20:06:58 +00:00
|
|
|
Ruby_Include= bsd.ruby.mk
|
2011-12-15 19:47:53 +00:00
|
|
|
Ruby_Include_MAINTAINER= ruby@FreeBSD.org
|
2000-09-06 20:06:58 +00:00
|
|
|
|
2001-06-04 14:54:32 +00:00
|
|
|
#
|
|
|
|
# [variables that a user may define]
|
|
|
|
#
|
|
|
|
# RUBY_VER - (See below)
|
2021-04-06 15:46:38 +00:00
|
|
|
# RUBY_DEFAULT_VER - Set to (e.g.) "2.7" if you want to refer to "ruby27"
|
2007-01-02 19:43:02 +00:00
|
|
|
# just as "ruby".
|
2001-06-04 14:54:32 +00:00
|
|
|
# RUBY_ARCH - (See below)
|
2007-01-02 19:43:02 +00:00
|
|
|
#
|
2000-09-06 22:40:09 +00:00
|
|
|
# [variables that each port can define]
|
2000-09-06 20:06:58 +00:00
|
|
|
#
|
2007-01-02 19:43:02 +00:00
|
|
|
# RUBY - Set to full path of ruby. If you set this, the values
|
|
|
|
# of the following variables are automatically obtained
|
|
|
|
# from the ruby executable: RUBY_VER, RUBY_VERSION,
|
2021-11-01 21:19:25 +00:00
|
|
|
# RUBY_ARCH, RUBY_LIBDIR, RUBY_ARCHLIBDIR,
|
2007-01-02 19:43:02 +00:00
|
|
|
# RUBY_SITELIBDIR, and RUBY_SITEARCHLIBDIR.
|
|
|
|
# RUBY_VER - Set to the alternative short version of ruby in the
|
|
|
|
# form of `x.y' (see below for current value).
|
2000-09-06 20:06:58 +00:00
|
|
|
# USE_RUBY - Says that the port uses ruby for building and running.
|
2000-09-16 11:37:37 +00:00
|
|
|
# RUBY_NO_BUILD_DEPENDS - Says that the port should not build-depend on ruby.
|
|
|
|
# RUBY_NO_RUN_DEPENDS - Says that the port should not run-depend on ruby.
|
2007-01-02 19:43:02 +00:00
|
|
|
# USE_RUBY_EXTCONF - Says that the port uses extconf.rb to configure.
|
|
|
|
# Implies USE_RUBY.
|
|
|
|
# RUBY_EXTCONF - Set to the alternative name of extconf.rb
|
|
|
|
# (default: extconf.rb).
|
|
|
|
# RUBY_EXTCONF_SUBDIRS - Set to list of subdirectories, if multiple modules
|
|
|
|
# are included.
|
|
|
|
# USE_RUBY_SETUP - Says that the port uses setup.rb to configure and
|
|
|
|
# build.
|
|
|
|
# RUBY_SETUP - Set to the alternative name of setup.rb
|
|
|
|
# (default: setup.rb).
|
2016-04-27 16:36:41 +00:00
|
|
|
# USE_RUBYGEMS - Do not use this -- instead USES=gem
|
2000-09-06 20:06:58 +00:00
|
|
|
#
|
2001-06-04 14:54:32 +00:00
|
|
|
# [variables that each port should not (re)define]
|
2000-09-06 20:06:58 +00:00
|
|
|
#
|
2007-01-02 19:43:02 +00:00
|
|
|
# RUBY_PKGNAMEPREFIX - Common PKGNAMEPREFIX for ruby ports
|
|
|
|
# (default: ruby${RUBY_SUFFIX}-)
|
2019-11-06 05:20:59 +00:00
|
|
|
# RUBY_VERSION - Full version of ruby without preview/beta suffix in
|
2007-01-02 19:43:02 +00:00
|
|
|
# the form of `x.y.z' (see below for current value).
|
2019-11-06 05:20:59 +00:00
|
|
|
# RUBY_VERSION_CODE - Integer version of RUBY_VERSION in the form of
|
2013-06-23 06:57:46 +00:00
|
|
|
# `xyz'.
|
2021-11-09 15:19:42 +00:00
|
|
|
# RUBY_DISTVERSION - DISTVERSION for the standard ruby ports (ruby,
|
|
|
|
# ruby-gdbm, etc.).
|
2007-01-02 19:43:02 +00:00
|
|
|
# RUBY_PORTVERSION - PORTVERSION for the standard ruby ports (ruby,
|
|
|
|
# ruby-gdbm, etc.).
|
2007-04-04 12:52:04 +00:00
|
|
|
# RUBY_PORTREVISION - PORTREVISION for the standard ruby ports.
|
|
|
|
# RUBY_PORTEPOCH - PORTEPOCH for the standard ruby ports.
|
2007-01-02 19:43:02 +00:00
|
|
|
# RUBY_DISTNAME - DISTNAME for the standard ruby ports, i.e. the
|
|
|
|
# basename of the ruby distribution tarball.
|
|
|
|
# RUBY_PATCHFILES - PATCHFILES for the standard ruby ports, i.e. the
|
|
|
|
# basename of the ruby distribution tarball.
|
Allow users to define RUBY variable to utilize ruby ports with
custom-installed Ruby. :)
For instance, if you have built Ruby from the latest snapshot and
installed, you can install ruby modules from ports only by typing
"make RUBY=/usr/local/bin/ruby install". bsd.ruby.mk will take care
of everything including RUBY_VER, RUBY_LIBDIR, CONFIGURE_TARGET, etc.
Introduce version requirement checking mechanism. You can set
RUBY_REQUIRE to any ruby expression(s) to check Ruby's version (or
other modules' versions, in future). The result will be set in
RUBY_PROVIDED.
Define RUBY_VERSION_CODE which holds full integer version of Ruby.
Define RUBY_PORTVERSION, RUBY_DISTNAME and RUBY_WRKSRC for the
standard ruby ports so as not to change PORTVERSION, DISTNAME and
RUBY_WRKSRC of ruby, ruby-gdbm, ruby-tcltklib, ruby-tk, etc. everytime
Ruby is updated.
Rename RUBY_DEPENDS to DEPEND_RUBY, etc. for a cosmetic reason.
2000-10-20 19:43:58 +00:00
|
|
|
# RUBY_WRKSRC - WRKSRC for the ruby port.
|
2002-12-12 12:53:03 +00:00
|
|
|
# MASTER_SITE_SUBDIR_RUBY - MASTER_SITE_SUBDIR for the ruby distfiles.
|
Allow users to define RUBY variable to utilize ruby ports with
custom-installed Ruby. :)
For instance, if you have built Ruby from the latest snapshot and
installed, you can install ruby modules from ports only by typing
"make RUBY=/usr/local/bin/ruby install". bsd.ruby.mk will take care
of everything including RUBY_VER, RUBY_LIBDIR, CONFIGURE_TARGET, etc.
Introduce version requirement checking mechanism. You can set
RUBY_REQUIRE to any ruby expression(s) to check Ruby's version (or
other modules' versions, in future). The result will be set in
RUBY_PROVIDED.
Define RUBY_VERSION_CODE which holds full integer version of Ruby.
Define RUBY_PORTVERSION, RUBY_DISTNAME and RUBY_WRKSRC for the
standard ruby ports so as not to change PORTVERSION, DISTNAME and
RUBY_WRKSRC of ruby, ruby-gdbm, ruby-tcltklib, ruby-tk, etc. everytime
Ruby is updated.
Rename RUBY_DEPENDS to DEPEND_RUBY, etc. for a cosmetic reason.
2000-10-20 19:43:58 +00:00
|
|
|
#
|
2007-01-02 19:43:02 +00:00
|
|
|
# RUBY_SHLIBVER - Major version of libruby (see below for current
|
|
|
|
# value).
|
|
|
|
# RUBY_ARCH - Set to target architecture name.
|
|
|
|
# (e.g. i386-freebsd7)
|
|
|
|
# RUBY_SUFFIX - Suffix for ruby binaries and directories
|
|
|
|
# (${RUBY_VER:S/.//}).
|
2001-05-06 16:42:57 +00:00
|
|
|
# RUBY_WITHOUT_SUFFIX - Always ${LOCALBASE}/bin/ruby.
|
2004-02-26 19:20:09 +00:00
|
|
|
# RUBY_WITH_SUFFIX - Always ${RUBY_WITHOUT_SUFFIX}${RUBY_SUFFIX}.
|
2000-09-06 20:06:58 +00:00
|
|
|
#
|
2002-10-06 20:54:37 +00:00
|
|
|
# RUBY_MODNAME - Set to the module name (default: ${PORTNAME}).
|
|
|
|
#
|
2007-01-02 19:43:02 +00:00
|
|
|
# RUBY_BASE_PORT - Port path of base ruby without PORTSDIR, without
|
|
|
|
# suffix except version.
|
2001-06-04 14:54:32 +00:00
|
|
|
# RUBY_PORT - Port path of ruby without PORTSDIR.
|
2000-09-06 20:06:58 +00:00
|
|
|
#
|
2001-06-04 14:54:32 +00:00
|
|
|
# DEPEND_RUBY - BUILD_DEPENDS/RUN_DEPENDS entry for ruby.
|
2000-09-06 20:06:58 +00:00
|
|
|
#
|
2007-01-02 19:43:02 +00:00
|
|
|
# RUBY_LIBDIR - Installation path for architecture independent
|
|
|
|
# libraries.
|
|
|
|
# RUBY_ARCHLIBDIR - Installation path for architecture dependent
|
|
|
|
# libraries.
|
|
|
|
# RUBY_SITELIBDIR - Installation path for site architecture independent
|
|
|
|
# libraries.
|
|
|
|
# RUBY_SITEARCHLIBDIR - Installation path for site architecture dependent
|
|
|
|
# libraries.
|
2000-09-06 20:06:58 +00:00
|
|
|
# RUBY_DOCDIR - Installation path for documents.
|
|
|
|
# RUBY_EXAMPLESDIR - Installation path for examples.
|
2007-01-02 19:43:02 +00:00
|
|
|
# RUBY_RIDIR - Installation path for site architecture independent ri
|
|
|
|
# documents.
|
|
|
|
# RUBY_SITERIDIR - Installation path for site architecture dependent ri
|
|
|
|
# documents.
|
2002-10-06 20:54:37 +00:00
|
|
|
# RUBY_MODDOCDIR - Installation path for the module's documents.
|
|
|
|
# RUBY_MODEXAMPLESDIR - Installation path for the module's examples.
|
2000-09-06 20:06:58 +00:00
|
|
|
#
|
|
|
|
|
2022-04-24 10:00:20 +00:00
|
|
|
. if defined(RUBY_DEFAULT_VER)
|
2013-09-27 06:18:40 +00:00
|
|
|
WARNING+= "RUBY_DEFAULT_VER is defined, consider using DEFAULT_VERSIONS=ruby=${RUBY_DEFAULT_VER} instead"
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
2013-09-19 08:16:43 +00:00
|
|
|
|
|
|
|
RUBY_DEFAULT_VER?= ${RUBY_DEFAULT}
|
2003-01-11 12:13:05 +00:00
|
|
|
|
|
|
|
RUBY_VER?= ${RUBY_DEFAULT_VER}
|
2002-10-06 19:49:32 +00:00
|
|
|
|
2022-04-24 10:00:20 +00:00
|
|
|
. if defined(RUBY)
|
|
|
|
. if !exists(${RUBY})
|
2016-08-26 08:42:27 +00:00
|
|
|
IGNORE= cannot install: you set the variable RUBY to "${RUBY}", but it does not seem to exist. Please specify an already installed ruby executable
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
2000-09-06 20:06:58 +00:00
|
|
|
|
2014-04-13 02:44:45 +00:00
|
|
|
_RUBY_TEST!= ${RUBY} -e 'begin; require "rbconfig"; puts "ok" ; rescue LoadError; puts "error"; end'
|
2022-04-24 10:00:20 +00:00
|
|
|
. if !empty(_RUBY_TEST) && ${_RUBY_TEST} != "ok"
|
2016-08-26 08:42:27 +00:00
|
|
|
IGNORE= cannot install: you set the variable RUBY to "${RUBY}", but it failed to include rbconfig. Please specify a properly installed ruby executable
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
Allow users to define RUBY variable to utilize ruby ports with
custom-installed Ruby. :)
For instance, if you have built Ruby from the latest snapshot and
installed, you can install ruby modules from ports only by typing
"make RUBY=/usr/local/bin/ruby install". bsd.ruby.mk will take care
of everything including RUBY_VER, RUBY_LIBDIR, CONFIGURE_TARGET, etc.
Introduce version requirement checking mechanism. You can set
RUBY_REQUIRE to any ruby expression(s) to check Ruby's version (or
other modules' versions, in future). The result will be set in
RUBY_PROVIDED.
Define RUBY_VERSION_CODE which holds full integer version of Ruby.
Define RUBY_PORTVERSION, RUBY_DISTNAME and RUBY_WRKSRC for the
standard ruby ports so as not to change PORTVERSION, DISTNAME and
RUBY_WRKSRC of ruby, ruby-gdbm, ruby-tcltklib, ruby-tk, etc. everytime
Ruby is updated.
Rename RUBY_DEPENDS to DEPEND_RUBY, etc. for a cosmetic reason.
2000-10-20 19:43:58 +00:00
|
|
|
|
2014-04-13 02:44:45 +00:00
|
|
|
_RUBY_CONFIG= ${RUBY} -r rbconfig -e 'C = RbConfig::CONFIG' -e
|
Allow users to define RUBY variable to utilize ruby ports with
custom-installed Ruby. :)
For instance, if you have built Ruby from the latest snapshot and
installed, you can install ruby modules from ports only by typing
"make RUBY=/usr/local/bin/ruby install". bsd.ruby.mk will take care
of everything including RUBY_VER, RUBY_LIBDIR, CONFIGURE_TARGET, etc.
Introduce version requirement checking mechanism. You can set
RUBY_REQUIRE to any ruby expression(s) to check Ruby's version (or
other modules' versions, in future). The result will be set in
RUBY_PROVIDED.
Define RUBY_VERSION_CODE which holds full integer version of Ruby.
Define RUBY_PORTVERSION, RUBY_DISTNAME and RUBY_WRKSRC for the
standard ruby ports so as not to change PORTVERSION, DISTNAME and
RUBY_WRKSRC of ruby, ruby-gdbm, ruby-tcltklib, ruby-tk, etc. everytime
Ruby is updated.
Rename RUBY_DEPENDS to DEPEND_RUBY, etc. for a cosmetic reason.
2000-10-20 19:43:58 +00:00
|
|
|
|
2014-04-13 02:44:45 +00:00
|
|
|
RUBY_VERSION!= ${_RUBY_CONFIG} 'puts C["ruby_version"]'
|
Allow users to define RUBY variable to utilize ruby ports with
custom-installed Ruby. :)
For instance, if you have built Ruby from the latest snapshot and
installed, you can install ruby modules from ports only by typing
"make RUBY=/usr/local/bin/ruby install". bsd.ruby.mk will take care
of everything including RUBY_VER, RUBY_LIBDIR, CONFIGURE_TARGET, etc.
Introduce version requirement checking mechanism. You can set
RUBY_REQUIRE to any ruby expression(s) to check Ruby's version (or
other modules' versions, in future). The result will be set in
RUBY_PROVIDED.
Define RUBY_VERSION_CODE which holds full integer version of Ruby.
Define RUBY_PORTVERSION, RUBY_DISTNAME and RUBY_WRKSRC for the
standard ruby ports so as not to change PORTVERSION, DISTNAME and
RUBY_WRKSRC of ruby, ruby-gdbm, ruby-tcltklib, ruby-tk, etc. everytime
Ruby is updated.
Rename RUBY_DEPENDS to DEPEND_RUBY, etc. for a cosmetic reason.
2000-10-20 19:43:58 +00:00
|
|
|
RUBY_SUFFIX?= # empty
|
|
|
|
|
|
|
|
RUBY_ARCH!= ${_RUBY_CONFIG} 'puts C["target"]'
|
|
|
|
|
|
|
|
_RUBY_SYSLIBDIR!= ${_RUBY_CONFIG} 'puts C["libdir"]'
|
|
|
|
_RUBY_SITEDIR!= ${_RUBY_CONFIG} 'puts C["sitedir"]'
|
2008-04-06 08:58:21 +00:00
|
|
|
_RUBY_VENDORDIR!= ${_RUBY_CONFIG} 'puts C["vendordir"]'
|
2022-04-24 10:00:20 +00:00
|
|
|
. else
|
2021-11-01 21:19:25 +00:00
|
|
|
RUBY?= ${LOCALBASE}/bin/ruby${RUBY_SUFFIX}
|
Allow users to define RUBY variable to utilize ruby ports with
custom-installed Ruby. :)
For instance, if you have built Ruby from the latest snapshot and
installed, you can install ruby modules from ports only by typing
"make RUBY=/usr/local/bin/ruby install". bsd.ruby.mk will take care
of everything including RUBY_VER, RUBY_LIBDIR, CONFIGURE_TARGET, etc.
Introduce version requirement checking mechanism. You can set
RUBY_REQUIRE to any ruby expression(s) to check Ruby's version (or
other modules' versions, in future). The result will be set in
RUBY_PROVIDED.
Define RUBY_VERSION_CODE which holds full integer version of Ruby.
Define RUBY_PORTVERSION, RUBY_DISTNAME and RUBY_WRKSRC for the
standard ruby ports so as not to change PORTVERSION, DISTNAME and
RUBY_WRKSRC of ruby, ruby-gdbm, ruby-tcltklib, ruby-tk, etc. everytime
Ruby is updated.
Rename RUBY_DEPENDS to DEPEND_RUBY, etc. for a cosmetic reason.
2000-10-20 19:43:58 +00:00
|
|
|
|
2022-04-24 10:00:20 +00:00
|
|
|
. if defined(RUBY_VER)
|
2016-04-14 13:34:25 +00:00
|
|
|
# When adding a version, please keep the comment in
|
|
|
|
# Mk/bsd.default-versions.mk in sync.
|
2022-04-24 10:00:20 +00:00
|
|
|
. if ${RUBY_VER} == 2.7
|
2020-01-25 18:18:41 +00:00
|
|
|
#
|
|
|
|
# Ruby 2.7
|
|
|
|
#
|
2022-11-24 20:28:04 +00:00
|
|
|
RUBY_DISTVERSION= 2.7.7
|
|
|
|
RUBY_PORTREVISION= 0
|
2020-01-25 18:18:41 +00:00
|
|
|
RUBY_PORTEPOCH= 1
|
|
|
|
|
2022-04-24 10:00:20 +00:00
|
|
|
. elif ${RUBY_VER} == 3.0
|
2020-10-12 03:02:34 +00:00
|
|
|
#
|
|
|
|
# Ruby 3.0
|
|
|
|
#
|
2022-11-24 20:39:58 +00:00
|
|
|
RUBY_DISTVERSION= 3.0.5
|
|
|
|
RUBY_PORTREVISION= 0
|
2020-10-12 03:02:34 +00:00
|
|
|
RUBY_PORTEPOCH= 1
|
2022-04-24 10:00:20 +00:00
|
|
|
. elif ${RUBY_VER} == 3.1
|
2021-11-09 15:19:42 +00:00
|
|
|
#
|
|
|
|
# Ruby 3.1
|
|
|
|
#
|
2022-11-24 21:08:03 +00:00
|
|
|
RUBY_DISTVERSION= 3.1.3
|
|
|
|
RUBY_PORTREVISION= 0
|
2021-11-09 15:19:42 +00:00
|
|
|
RUBY_PORTEPOCH= 1
|
2020-10-12 03:02:34 +00:00
|
|
|
|
2022-04-24 10:00:20 +00:00
|
|
|
. elif ${RUBY_VER} == 3.2
|
2022-04-03 18:05:05 +00:00
|
|
|
#
|
|
|
|
# Ruby 3.2
|
|
|
|
#
|
2022-11-15 02:44:59 +00:00
|
|
|
RUBY_DISTVERSION= 3.2.0-rc1
|
|
|
|
RUBY_PORTREVISION= 0
|
2022-04-03 18:05:05 +00:00
|
|
|
RUBY_PORTEPOCH= 1
|
|
|
|
|
2016-04-14 13:34:25 +00:00
|
|
|
# When adding a version, please keep the comment in
|
|
|
|
# Mk/bsd.default-versions.mk in sync.
|
2022-04-24 10:00:20 +00:00
|
|
|
. else
|
2008-04-06 08:58:21 +00:00
|
|
|
#
|
|
|
|
# Other versions
|
|
|
|
#
|
2022-04-03 18:05:05 +00:00
|
|
|
IGNORE= Only ruby 2.7, 3.0, 3.1 and 3.2 are supported
|
2015-03-30 19:17:33 +00:00
|
|
|
_INVALID_RUBY_VER= 1
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
2021-11-09 15:19:42 +00:00
|
|
|
RUBY_VERSION= ${RUBY_DISTVERSION:C/^([0-9]+\.[0-9]+\.[0-9]+).*/\1/}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif # defined(RUBY_VER)
|
2002-03-10 20:42:48 +00:00
|
|
|
|
2022-04-24 10:00:20 +00:00
|
|
|
. if !defined(_INVALID_RUBY_VER)
|
2015-03-30 19:17:33 +00:00
|
|
|
|
2020-01-25 18:18:41 +00:00
|
|
|
RUBY27?= "@comment "
|
2020-10-12 03:02:34 +00:00
|
|
|
RUBY30?= "@comment "
|
2021-11-09 15:19:42 +00:00
|
|
|
RUBY31?= "@comment "
|
2022-04-03 18:05:05 +00:00
|
|
|
RUBY32?= "@comment "
|
2015-02-20 23:51:55 +00:00
|
|
|
|
2022-04-24 10:00:20 +00:00
|
|
|
. if defined(BROKEN_RUBY${RUBY_VER:R}${RUBY_VER:E})
|
|
|
|
. if ${BROKEN_RUBY${RUBY_VER:R}${RUBY_VER:E}} == "yes"
|
2015-08-29 10:02:33 +00:00
|
|
|
BROKEN= does not build with Ruby ${RUBY_VER}
|
2022-04-24 10:00:20 +00:00
|
|
|
. else
|
2015-08-29 10:02:33 +00:00
|
|
|
BROKEN= ${BROKEN_RUBY${RUBY_VER:R}${RUBY_VER:E}}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. endif
|
2015-08-29 10:02:33 +00:00
|
|
|
|
2021-11-09 15:19:42 +00:00
|
|
|
RUBY_WRKSRC= ${WRKDIR}/ruby-${RUBY_DISTVERSION}
|
2014-02-15 07:23:56 +00:00
|
|
|
|
|
|
|
RUBY_CONFIGURE_ARGS+= --with-rubyhdrdir="${PREFIX}/include/ruby-${RUBY_VER}/" \
|
|
|
|
--with-rubylibprefix="${PREFIX}/lib/ruby" \
|
|
|
|
--docdir="${RUBY_DOCDIR}" \
|
|
|
|
--with-soname=ruby${RUBY_SUFFIX}
|
|
|
|
|
2014-05-05 09:45:36 +00:00
|
|
|
CONFIGURE_TARGET?= ${ARCH}-portbld-${OPSYS:tl}${OSREL:C/\..*//}
|
2003-11-24 12:43:40 +00:00
|
|
|
|
2014-05-05 09:45:36 +00:00
|
|
|
RUBY_ARCH?= ${ARCH}-${OPSYS:tl}${OSREL:C/\..*//}
|
2002-03-10 20:42:48 +00:00
|
|
|
|
2007-01-02 16:23:42 +00:00
|
|
|
_RUBY_SYSLIBDIR?= ${PREFIX}/lib
|
2002-03-10 20:42:48 +00:00
|
|
|
_RUBY_SITEDIR?= ${_RUBY_SYSLIBDIR}/ruby/site_ruby
|
2008-04-06 08:58:21 +00:00
|
|
|
_RUBY_VENDORDIR?= ${_RUBY_SYSLIBDIR}/ruby/vendor_ruby
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. endif
|
2002-03-10 20:42:48 +00:00
|
|
|
# defined(RUBY)
|
2000-09-06 20:06:58 +00:00
|
|
|
|
2022-04-24 10:00:20 +00:00
|
|
|
. if !defined(_INVALID_RUBY_VER)
|
2015-03-30 19:17:33 +00:00
|
|
|
|
2001-06-04 14:54:32 +00:00
|
|
|
RUBY_DEFAULT_SUFFIX?= ${RUBY_DEFAULT_VER:S/.//}
|
|
|
|
|
2021-11-09 15:19:42 +00:00
|
|
|
RUBY_PORTVERSION?= ${RUBY_DISTVERSION:tl:C/([a-z])[a-z]+/\1/g:C/([0-9])([a-z])/\1.\2/g:C/:(.)/\1/g:C/[^a-z0-9+]+/./g}
|
2002-12-24 18:12:20 +00:00
|
|
|
MASTER_SITE_SUBDIR_RUBY?= ${RUBY_VER}
|
2021-11-09 15:19:42 +00:00
|
|
|
RUBY_DISTNAME?= ruby-${RUBY_DISTVERSION}
|
2001-04-10 07:23:49 +00:00
|
|
|
|
2001-07-31 16:46:55 +00:00
|
|
|
RUBY_WRKSRC?= ${WRKDIR}/${RUBY_DISTNAME}
|
Allow users to define RUBY variable to utilize ruby ports with
custom-installed Ruby. :)
For instance, if you have built Ruby from the latest snapshot and
installed, you can install ruby modules from ports only by typing
"make RUBY=/usr/local/bin/ruby install". bsd.ruby.mk will take care
of everything including RUBY_VER, RUBY_LIBDIR, CONFIGURE_TARGET, etc.
Introduce version requirement checking mechanism. You can set
RUBY_REQUIRE to any ruby expression(s) to check Ruby's version (or
other modules' versions, in future). The result will be set in
RUBY_PROVIDED.
Define RUBY_VERSION_CODE which holds full integer version of Ruby.
Define RUBY_PORTVERSION, RUBY_DISTNAME and RUBY_WRKSRC for the
standard ruby ports so as not to change PORTVERSION, DISTNAME and
RUBY_WRKSRC of ruby, ruby-gdbm, ruby-tcltklib, ruby-tk, etc. everytime
Ruby is updated.
Rename RUBY_DEPENDS to DEPEND_RUBY, etc. for a cosmetic reason.
2000-10-20 19:43:58 +00:00
|
|
|
|
2013-06-23 06:57:46 +00:00
|
|
|
RUBY_RELVERSION_CODE?= ${RUBY_RELVERSION:S/.//g}
|
Allow users to define RUBY variable to utilize ruby ports with
custom-installed Ruby. :)
For instance, if you have built Ruby from the latest snapshot and
installed, you can install ruby modules from ports only by typing
"make RUBY=/usr/local/bin/ruby install". bsd.ruby.mk will take care
of everything including RUBY_VER, RUBY_LIBDIR, CONFIGURE_TARGET, etc.
Introduce version requirement checking mechanism. You can set
RUBY_REQUIRE to any ruby expression(s) to check Ruby's version (or
other modules' versions, in future). The result will be set in
RUBY_PROVIDED.
Define RUBY_VERSION_CODE which holds full integer version of Ruby.
Define RUBY_PORTVERSION, RUBY_DISTNAME and RUBY_WRKSRC for the
standard ruby ports so as not to change PORTVERSION, DISTNAME and
RUBY_WRKSRC of ruby, ruby-gdbm, ruby-tcltklib, ruby-tk, etc. everytime
Ruby is updated.
Rename RUBY_DEPENDS to DEPEND_RUBY, etc. for a cosmetic reason.
2000-10-20 19:43:58 +00:00
|
|
|
RUBY_VERSION_CODE?= ${RUBY_VERSION:S/.//g}
|
2007-01-02 16:23:42 +00:00
|
|
|
RUBY_VER= ${RUBY_VERSION:C/([[:digit:]]+\.[[:digit:]]+).*/\1/}
|
2005-02-05 04:59:26 +00:00
|
|
|
RUBY_SUFFIX= ${RUBY_VER:S/.//}
|
2001-10-08 06:39:54 +00:00
|
|
|
|
2005-11-14 09:46:15 +00:00
|
|
|
RUBY_WITHOUT_SUFFIX?= ${LOCALBASE}/bin/ruby
|
2004-02-26 19:20:09 +00:00
|
|
|
RUBY_WITH_SUFFIX?= ${RUBY_WITHOUT_SUFFIX}${RUBY_SUFFIX}
|
2001-05-05 23:02:32 +00:00
|
|
|
|
2004-02-26 19:20:09 +00:00
|
|
|
RUBY_PKGNAMEPREFIX?= ruby${RUBY_SUFFIX}-
|
2001-06-04 14:54:32 +00:00
|
|
|
RUBY_SHLIBVER?= ${RUBY_VER:S/.//}
|
Allow users to define RUBY variable to utilize ruby ports with
custom-installed Ruby. :)
For instance, if you have built Ruby from the latest snapshot and
installed, you can install ruby modules from ports only by typing
"make RUBY=/usr/local/bin/ruby install". bsd.ruby.mk will take care
of everything including RUBY_VER, RUBY_LIBDIR, CONFIGURE_TARGET, etc.
Introduce version requirement checking mechanism. You can set
RUBY_REQUIRE to any ruby expression(s) to check Ruby's version (or
other modules' versions, in future). The result will be set in
RUBY_PROVIDED.
Define RUBY_VERSION_CODE which holds full integer version of Ruby.
Define RUBY_PORTVERSION, RUBY_DISTNAME and RUBY_WRKSRC for the
standard ruby ports so as not to change PORTVERSION, DISTNAME and
RUBY_WRKSRC of ruby, ruby-gdbm, ruby-tcltklib, ruby-tk, etc. everytime
Ruby is updated.
Rename RUBY_DEPENDS to DEPEND_RUBY, etc. for a cosmetic reason.
2000-10-20 19:43:58 +00:00
|
|
|
|
2003-11-24 12:43:40 +00:00
|
|
|
RUBY_CONFIGURE_ARGS+= --program-prefix=""
|
2000-09-06 20:06:58 +00:00
|
|
|
|
2022-04-24 10:00:20 +00:00
|
|
|
. if ${RUBY_VER} != ${RUBY_DEFAULT_VER}
|
2017-06-06 00:15:20 +00:00
|
|
|
DEPENDS_ARGS+= RUBY_VER=${RUBY_VER}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
2004-05-22 18:49:49 +00:00
|
|
|
|
2001-06-04 14:54:32 +00:00
|
|
|
RUBY_CONFIGURE_ARGS+= --program-suffix="${RUBY_SUFFIX}"
|
|
|
|
|
2002-10-06 20:54:37 +00:00
|
|
|
RUBY_MODNAME?= ${PORTNAME}
|
|
|
|
|
2000-09-06 20:06:58 +00:00
|
|
|
# Ports
|
2003-08-07 13:21:05 +00:00
|
|
|
RUBY_BASE_PORT?= lang/ruby${RUBY_VER:S/.//}
|
2005-02-05 04:59:26 +00:00
|
|
|
RUBY_PORT?= ${RUBY_BASE_PORT}
|
2000-09-06 20:06:58 +00:00
|
|
|
|
|
|
|
# Depends
|
2016-03-27 01:23:25 +00:00
|
|
|
DEPEND_RUBY?= ${RUBY}:${RUBY_PORT}
|
2000-09-06 20:06:58 +00:00
|
|
|
|
|
|
|
# Directories
|
Allow users to define RUBY variable to utilize ruby ports with
custom-installed Ruby. :)
For instance, if you have built Ruby from the latest snapshot and
installed, you can install ruby modules from ports only by typing
"make RUBY=/usr/local/bin/ruby install". bsd.ruby.mk will take care
of everything including RUBY_VER, RUBY_LIBDIR, CONFIGURE_TARGET, etc.
Introduce version requirement checking mechanism. You can set
RUBY_REQUIRE to any ruby expression(s) to check Ruby's version (or
other modules' versions, in future). The result will be set in
RUBY_PROVIDED.
Define RUBY_VERSION_CODE which holds full integer version of Ruby.
Define RUBY_PORTVERSION, RUBY_DISTNAME and RUBY_WRKSRC for the
standard ruby ports so as not to change PORTVERSION, DISTNAME and
RUBY_WRKSRC of ruby, ruby-gdbm, ruby-tcltklib, ruby-tk, etc. everytime
Ruby is updated.
Rename RUBY_DEPENDS to DEPEND_RUBY, etc. for a cosmetic reason.
2000-10-20 19:43:58 +00:00
|
|
|
RUBY_LIBDIR?= ${_RUBY_SYSLIBDIR}/ruby/${RUBY_VER}
|
2000-09-06 20:06:58 +00:00
|
|
|
RUBY_ARCHLIBDIR?= ${RUBY_LIBDIR}/${RUBY_ARCH}
|
Allow users to define RUBY variable to utilize ruby ports with
custom-installed Ruby. :)
For instance, if you have built Ruby from the latest snapshot and
installed, you can install ruby modules from ports only by typing
"make RUBY=/usr/local/bin/ruby install". bsd.ruby.mk will take care
of everything including RUBY_VER, RUBY_LIBDIR, CONFIGURE_TARGET, etc.
Introduce version requirement checking mechanism. You can set
RUBY_REQUIRE to any ruby expression(s) to check Ruby's version (or
other modules' versions, in future). The result will be set in
RUBY_PROVIDED.
Define RUBY_VERSION_CODE which holds full integer version of Ruby.
Define RUBY_PORTVERSION, RUBY_DISTNAME and RUBY_WRKSRC for the
standard ruby ports so as not to change PORTVERSION, DISTNAME and
RUBY_WRKSRC of ruby, ruby-gdbm, ruby-tcltklib, ruby-tk, etc. everytime
Ruby is updated.
Rename RUBY_DEPENDS to DEPEND_RUBY, etc. for a cosmetic reason.
2000-10-20 19:43:58 +00:00
|
|
|
RUBY_SITELIBDIR?= ${_RUBY_SITEDIR}/${RUBY_VER}
|
2000-09-06 20:06:58 +00:00
|
|
|
RUBY_SITEARCHLIBDIR?= ${RUBY_SITELIBDIR}/${RUBY_ARCH}
|
2008-04-06 08:58:21 +00:00
|
|
|
RUBY_VENDORLIBDIR?= ${_RUBY_VENDORDIR}/${RUBY_VER}
|
|
|
|
RUBY_VENDORARCHLIBDIR?= ${RUBY_VENDORLIBDIR}/${RUBY_ARCH}
|
2021-11-01 21:19:25 +00:00
|
|
|
RUBY_DOCDIR?= ${PREFIX}/share/doc/ruby${RUBY_SUFFIX}
|
|
|
|
RUBY_EXAMPLESDIR?= ${PREFIX}/share/examples/ruby${RUBY_SUFFIX}
|
2007-01-02 16:23:42 +00:00
|
|
|
RUBY_RIDIR?= ${PREFIX}/share/ri/${RUBY_VER}/system
|
|
|
|
RUBY_SITERIDIR?= ${PREFIX}/share/ri/${RUBY_VER}/site
|
2002-10-06 20:54:37 +00:00
|
|
|
RUBY_MODDOCDIR?= ${RUBY_DOCDIR}/${RUBY_MODNAME}
|
|
|
|
RUBY_MODEXAMPLESDIR?= ${RUBY_EXAMPLESDIR}/${RUBY_MODNAME}
|
2000-09-06 20:06:58 +00:00
|
|
|
|
|
|
|
# PLIST
|
|
|
|
PLIST_RUBY_DIRS= RUBY_LIBDIR="${RUBY_LIBDIR}" \
|
|
|
|
RUBY_ARCHLIBDIR="${RUBY_ARCHLIBDIR}" \
|
|
|
|
RUBY_SITELIBDIR="${RUBY_SITELIBDIR}" \
|
|
|
|
RUBY_SITEARCHLIBDIR="${RUBY_SITEARCHLIBDIR}" \
|
2008-04-06 08:58:21 +00:00
|
|
|
RUBY_VENDORLIBDIR="${RUBY_VENDORLIBDIR}" \
|
|
|
|
RUBY_VENDORARCHLIBDIR="${RUBY_VENDORARCHLIBDIR}" \
|
2007-01-02 16:23:42 +00:00
|
|
|
RUBY_MODDOCDIR="${RUBY_MODDOCDIR}" \
|
|
|
|
RUBY_MODEXAMPLESDIR="${RUBY_MODEXAMPLESDIR}" \
|
2000-09-06 20:06:58 +00:00
|
|
|
RUBY_DOCDIR="${RUBY_DOCDIR}" \
|
2001-05-11 19:43:03 +00:00
|
|
|
RUBY_EXAMPLESDIR="${RUBY_EXAMPLESDIR}" \
|
2004-08-12 09:45:08 +00:00
|
|
|
RUBY_RIDIR="${RUBY_RIDIR}" \
|
2016-09-19 16:46:34 +00:00
|
|
|
RUBY_SITERIDIR="${RUBY_SITERIDIR}"
|
2000-09-06 20:06:58 +00:00
|
|
|
|
2008-04-06 08:58:21 +00:00
|
|
|
PLIST_SUB+= ${PLIST_RUBY_DIRS:C,DIR="(${LOCALBASE}|${PREFIX})/,DIR=",} \
|
2007-01-02 16:23:42 +00:00
|
|
|
RUBY_VERSION="${RUBY_VERSION}" \
|
2000-09-06 20:06:58 +00:00
|
|
|
RUBY_VER="${RUBY_VER}" \
|
|
|
|
RUBY_SHLIBVER="${RUBY_SHLIBVER}" \
|
|
|
|
RUBY_ARCH="${RUBY_ARCH}" \
|
|
|
|
RUBY_SUFFIX="${RUBY_SUFFIX}" \
|
2022-05-22 04:27:00 +00:00
|
|
|
RUBY_DEFAULT_SUFFIX="${RUBY_DEFAULT_SUFFIX}"
|
2004-02-26 19:20:09 +00:00
|
|
|
|
2022-04-24 10:00:20 +00:00
|
|
|
. if ${PORT_OPTIONS:MDEBUG}
|
2001-04-02 04:36:09 +00:00
|
|
|
RUBY_FLAGS+= -d
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
2001-04-02 04:36:09 +00:00
|
|
|
|
2008-04-06 08:58:21 +00:00
|
|
|
#
|
|
|
|
# extconf.rb support
|
|
|
|
#
|
2022-04-24 10:00:20 +00:00
|
|
|
. if defined(USE_RUBY_EXTCONF)
|
2000-09-06 20:06:58 +00:00
|
|
|
USE_RUBY= yes
|
|
|
|
|
|
|
|
RUBY_EXTCONF?= extconf.rb
|
2005-11-14 09:46:15 +00:00
|
|
|
CONFIGURE_ARGS+= --with-opt-dir="${LOCALBASE}"
|
2014-08-25 18:49:34 +00:00
|
|
|
CONFIGURE_ENV+= RB_USER_INSTALL=yes
|
2000-09-06 20:06:58 +00:00
|
|
|
|
|
|
|
do-configure: ruby-extconf-configure
|
|
|
|
|
|
|
|
ruby-extconf-configure:
|
2022-04-24 10:00:20 +00:00
|
|
|
. if defined(RUBY_EXTCONF_SUBDIRS)
|
|
|
|
. for d in ${RUBY_EXTCONF_SUBDIRS}
|
2000-09-06 20:06:58 +00:00
|
|
|
@${ECHO_MSG} "===> Running ${RUBY_EXTCONF} in ${d} to configure"
|
2002-07-07 19:02:49 +00:00
|
|
|
@cd ${CONFIGURE_WRKSRC}/${d}; \
|
2001-04-02 04:36:09 +00:00
|
|
|
${SETENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_FLAGS} ${RUBY_EXTCONF} ${CONFIGURE_ARGS}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endfor
|
|
|
|
. else
|
2000-09-06 20:06:58 +00:00
|
|
|
@${ECHO_MSG} "===> Running ${RUBY_EXTCONF} to configure"
|
2002-07-07 19:02:49 +00:00
|
|
|
@cd ${CONFIGURE_WRKSRC}; \
|
2001-04-02 04:36:09 +00:00
|
|
|
${SETENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_FLAGS} ${RUBY_EXTCONF} ${CONFIGURE_ARGS}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. endif
|
2000-09-06 20:06:58 +00:00
|
|
|
|
2008-04-06 08:58:21 +00:00
|
|
|
#
|
|
|
|
# setup.rb support
|
|
|
|
#
|
2022-04-24 10:00:20 +00:00
|
|
|
. if defined(USE_RUBY_SETUP)
|
2000-09-06 20:06:58 +00:00
|
|
|
RUBY_SETUP?= setup.rb
|
|
|
|
|
|
|
|
do-configure: ruby-setup-configure
|
|
|
|
|
|
|
|
ruby-setup-configure:
|
|
|
|
@${ECHO_MSG} "===> Running ${RUBY_SETUP} to configure"
|
2002-07-07 19:02:49 +00:00
|
|
|
@cd ${BUILD_WRKSRC}; \
|
2001-04-02 04:36:09 +00:00
|
|
|
${SETENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_FLAGS} ${RUBY_SETUP} config ${CONFIGURE_ARGS}
|
2000-09-06 20:06:58 +00:00
|
|
|
|
|
|
|
do-build: ruby-setup-build
|
|
|
|
|
|
|
|
ruby-setup-build:
|
|
|
|
@${ECHO_MSG} "===> Running ${RUBY_SETUP} to build"
|
2002-07-07 19:02:49 +00:00
|
|
|
@cd ${BUILD_WRKSRC}; \
|
2001-04-02 04:36:09 +00:00
|
|
|
${SETENV} ${MAKE_ENV} ${RUBY} ${RUBY_FLAGS} ${RUBY_SETUP} setup
|
2000-09-07 07:20:02 +00:00
|
|
|
|
|
|
|
do-install: ruby-setup-install
|
|
|
|
|
|
|
|
ruby-setup-install:
|
|
|
|
@${ECHO_MSG} "===> Running ${RUBY_SETUP} to install"
|
2014-02-09 03:05:21 +00:00
|
|
|
@cd ${INSTALL_WRKSRC}; \
|
2014-02-09 01:54:56 +00:00
|
|
|
${SETENV} ${MAKE_ENV} ${RUBY} ${RUBY_FLAGS} ${RUBY_SETUP} install --prefix=${STAGEDIR}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
2000-09-06 20:06:58 +00:00
|
|
|
|
2022-04-24 10:00:20 +00:00
|
|
|
. if defined(USE_RUBY)
|
|
|
|
. if !defined(RUBY_NO_BUILD_DEPENDS)
|
2003-05-13 19:46:29 +00:00
|
|
|
EXTRACT_DEPENDS+= ${DEPEND_RUBY}
|
|
|
|
PATCH_DEPENDS+= ${DEPEND_RUBY}
|
Allow users to define RUBY variable to utilize ruby ports with
custom-installed Ruby. :)
For instance, if you have built Ruby from the latest snapshot and
installed, you can install ruby modules from ports only by typing
"make RUBY=/usr/local/bin/ruby install". bsd.ruby.mk will take care
of everything including RUBY_VER, RUBY_LIBDIR, CONFIGURE_TARGET, etc.
Introduce version requirement checking mechanism. You can set
RUBY_REQUIRE to any ruby expression(s) to check Ruby's version (or
other modules' versions, in future). The result will be set in
RUBY_PROVIDED.
Define RUBY_VERSION_CODE which holds full integer version of Ruby.
Define RUBY_PORTVERSION, RUBY_DISTNAME and RUBY_WRKSRC for the
standard ruby ports so as not to change PORTVERSION, DISTNAME and
RUBY_WRKSRC of ruby, ruby-gdbm, ruby-tcltklib, ruby-tk, etc. everytime
Ruby is updated.
Rename RUBY_DEPENDS to DEPEND_RUBY, etc. for a cosmetic reason.
2000-10-20 19:43:58 +00:00
|
|
|
BUILD_DEPENDS+= ${DEPEND_RUBY}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. if !defined(RUBY_NO_RUN_DEPENDS)
|
Allow users to define RUBY variable to utilize ruby ports with
custom-installed Ruby. :)
For instance, if you have built Ruby from the latest snapshot and
installed, you can install ruby modules from ports only by typing
"make RUBY=/usr/local/bin/ruby install". bsd.ruby.mk will take care
of everything including RUBY_VER, RUBY_LIBDIR, CONFIGURE_TARGET, etc.
Introduce version requirement checking mechanism. You can set
RUBY_REQUIRE to any ruby expression(s) to check Ruby's version (or
other modules' versions, in future). The result will be set in
RUBY_PROVIDED.
Define RUBY_VERSION_CODE which holds full integer version of Ruby.
Define RUBY_PORTVERSION, RUBY_DISTNAME and RUBY_WRKSRC for the
standard ruby ports so as not to change PORTVERSION, DISTNAME and
RUBY_WRKSRC of ruby, ruby-gdbm, ruby-tcltklib, ruby-tk, etc. everytime
Ruby is updated.
Rename RUBY_DEPENDS to DEPEND_RUBY, etc. for a cosmetic reason.
2000-10-20 19:43:58 +00:00
|
|
|
RUN_DEPENDS+= ${DEPEND_RUBY}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
|
|
|
. endif
|
2000-09-06 20:06:58 +00:00
|
|
|
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif # _INVALID_RUBY_VER
|
2000-09-16 11:37:37 +00:00
|
|
|
.endif
|