2000-09-06 20:06:58 +00:00
#
# bsd.ruby.mk - Utility definitions for Ruby related ports.
#
# Created by: Akinori MUSHA <knu@FreeBSD.org>
#
# $FreeBSD$
#
2000-09-16 11:37:37 +00:00
. i f ! d e f i n e d ( R u b y _ I n c l u d e )
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)
2013-10-31 12:15:50 +00:00
# RUBY_DEFAULT_VER - Set to (e.g.) "1.9" if you want to refer to "ruby19"
2007-01-02 19:43:02 +00:00
# just as "ruby".
2001-06-04 14:54:32 +00:00
# RUBY_ARCH - (See below)
2002-12-27 21:39:06 +00:00
# RUBY_RD_HTML - Define if you want HTML files generated from RD files.
2000-09-06 20:06:58 +00:00
#
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,
# RUBY_NAME, RUBY_ARCH, RUBY_LIBDIR, RUBY_ARCHLIBDIR,
# 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.
2000-09-06 20:06:58 +00:00
# USE_LIBRUBY - Says that the port uses libruby.
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).
2002-10-06 19:49:32 +00:00
# USE_RUBY_RDTOOL - Says that the port uses rdtool to generate documents.
# USE_RUBY_RDOC - Says that the port uses rdoc to generate documents.
2007-01-02 19:43:02 +00:00
# USE_RUBY_FEATURES - Says that the port requires some of the following
# features for building and/or running (default: none):
2007-02-13 10:33:46 +00:00
# iconv
2007-01-02 19:43:02 +00:00
# RUBY_REQUIRE - Set to a Ruby expression to evaluate before building
# the port. The constant "Ruby" is set to the integer
# version number of ruby, and the result of the
# expression will be set to RUBY_PROVIDED, which is
# left undefined if the result is nil, false or a
# zero-length string. Implies USE_RUBY.
2000-09-30 17:34:44 +00:00
# RUBY_SHEBANG_FILES - Specify the files which shebang lines you want to fix.
2007-01-02 19:43:02 +00:00
# RUBY_RD_FILES - Specify the RD files which you want to generate HTML
# documents from. If this is defined and not empty,
# USE_RUBY_RDTOOL is implied and RUBY_RD_HTML_FILES is
# defined.
2009-02-13 23:31:32 +00:00
# USE_RUBYGEMS - Says that the port uses rubygems packaging system.
# RUBYGEM_AUTOPLIST - Generate packing list for rubygems based port
# automatically.
2007-01-02 19:43:02 +00:00
#
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}-)
2013-06-23 06:57:46 +00:00
# RUBY_RELVERSION - 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).
2013-06-23 06:57:46 +00:00
# RUBY_RELVERSION_CODE - Integer version of RUBY_RELVERSION in the form of
# `xyz'.
# RUBY_VERSION - Composite version of RUBY_RELVERSION and
# RUBY_PATCHLEVEL in the form of `x.y.z.p'.
# (default: ${RUBY_RELVERSION}.${RUBY_PATCHLEVEL})
# RUBY_VERSION_CODE - Composite integer version of RUBY_VERSION in the form
# of `xyzp'.
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.
2001-04-12 16:57:17 +00:00
# RUBY_DISTVERSION - The version number part of RUBY_DISTNAME.
2007-01-02 19:43:02 +00:00
# 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
# RUBY_NAME - Ruby's name with trailing suffix.
#
2002-10-06 20:54:37 +00:00
# RUBY_MODNAME - Set to the module name (default: ${PORTNAME}).
#
2002-10-06 19:49:32 +00:00
# RUBY_RD2 - Full path of rd2 executable.
# RUBY_RDOC - Full path of rdoc executable.
2000-09-06 20:06:58 +00:00
#
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.
2002-10-06 19:49:32 +00:00
# RUBY_RDTOOL_PORT - Port path of rdtool without PORTSDIR.
# RUBY_RDOC_PORT - Port path of rdoc without PORTSDIR.
2004-03-23 09:03:32 +00:00
# RUBY_ICONV_PORT - Port path of ruby-iconv without PORTSDIR.
2000-09-06 20:06:58 +00:00
#
2001-06-04 14:54:32 +00:00
# DEPEND_LIBRUBY - LIB_DEPENDS entry for libruby.
# DEPEND_RUBY - BUILD_DEPENDS/RUN_DEPENDS entry for ruby.
2002-10-06 19:49:32 +00:00
# DEPEND_RUBY_RDTOOL - BUILD_DEPENDS entry for rdtool.
# DEPEND_RUBY_RDOC - BUILD_DEPENDS entry for rdoc.
2004-03-23 09:03:32 +00:00
# DEPEND_RUBY_ICONV - BUILD_DEPENDS/RUN_DEPENDS entry for ruby-iconv.
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.
2001-05-11 19:43:03 +00:00
# RUBY_ELISPDIR - Installation path for emacs lisp files.
2000-09-06 20:06:58 +00:00
#
2013-09-19 08:16:43 +00:00
. i n c l u d e "${PORTSDIR}/Mk/bsd.default-versions.mk"
. i f d e f i n e d ( R U B Y _ D E F A U L T _ V E R )
2013-09-27 06:18:40 +00:00
WARNING += " RUBY_DEFAULT_VER is defined, consider using DEFAULT_VERSIONS=ruby= ${ RUBY_DEFAULT_VER } instead "
2013-09-19 08:16:43 +00:00
. e n d i f
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
2005-11-14 09:46:15 +00:00
. i f d e f i n e d ( R U B Y )
2007-08-04 11:37:24 +00:00
. i f ! e x i s t s ( $ { R U B Y } )
* Change all bogus uses of BROKEN to IGNORE. Note: the BROKEN_WITH_*
forms are retained for compatibility but deprecated [1]
* Add sha256 to CHECKSUM_ALGORITHMS [2]
* Remove some whitespace [2]
* Add USE_SCONS and bsd.scons.mk for the Python-based SCons build system [3]
* Fix USE_LDCONFIG with non-default PREFIX [4]
* Add USE_WX and friends, and bsd.wx.mk, for common code for WxWidgets
support [5]
* Add 'make missing' to show missing dependencies [6]
* Fix DESKTOP_ENTRIES processing on 4.x [7]
PR: 92445 [1], 98206 [2], 98731 [3], 99370 [4], 89398 [5],
93601 [6], 98891 [7]
Submitted by: linimon [1], edwin [2], alex at foxybanana dot com [3],
gerald [4], flz [4], alepulver [5], alex at fafula dot com [6],
shaun [7]
2006-07-05 02:18:09 +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.
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
. e n d i f
2000-09-06 20:06:58 +00:00
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_TEST != ${ RUBY } -e 'begin; require "rbconfig"; rescue LoadError; puts "error"; end'
. i f ! e m p t y ( _ R U B Y _ T E S T )
* Change all bogus uses of BROKEN to IGNORE. Note: the BROKEN_WITH_*
forms are retained for compatibility but deprecated [1]
* Add sha256 to CHECKSUM_ALGORITHMS [2]
* Remove some whitespace [2]
* Add USE_SCONS and bsd.scons.mk for the Python-based SCons build system [3]
* Fix USE_LDCONFIG with non-default PREFIX [4]
* Add USE_WX and friends, and bsd.wx.mk, for common code for WxWidgets
support [5]
* Add 'make missing' to show missing dependencies [6]
* Fix DESKTOP_ENTRIES processing on 4.x [7]
PR: 92445 [1], 98206 [2], 98731 [3], 99370 [4], 89398 [5],
93601 [6], 98891 [7]
Submitted by: linimon [1], edwin [2], alex at foxybanana dot com [3],
gerald [4], flz [4], alepulver [5], alex at fafula dot com [6],
shaun [7]
2006-07-05 02:18:09 +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.
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
. e n d i f
2007-08-04 11:37:24 +00:00
_RUBY_CONFIG = ${ RUBY } -r rbconfig -e 'C = Config::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
RUBY_VERSION != ${ _RUBY_CONFIG } 'puts VERSION'
RUBY_SUFFIX ?= # empty
RUBY_ARCH != ${ _RUBY_CONFIG } 'puts C["target"]'
RUBY_NAME != ${ _RUBY_CONFIG } 'puts C["ruby_install_name"]'
_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"]'
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
. e l s e
2005-11-14 09:46:15 +00:00
RUBY ?= ${ LOCALBASE } /bin/${ RUBY_NAME }
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
2008-04-06 08:58:21 +00:00
. i f d e f i n e d ( R U B Y _ V E R )
2013-10-31 12:15:50 +00:00
. i f ${RUBY_VER} = = 1.9
2008-04-06 08:58:21 +00:00
#
# Ruby 1.9
#
2011-11-21 20:59:09 +00:00
RUBY_RELVERSION = 1.9.3
2014-03-23 15:31:43 +00:00
RUBY_PORTREVISION = 2
2008-04-06 08:58:21 +00:00
RUBY_PORTEPOCH = 1
2013-11-23 03:10:04 +00:00
RUBY_PATCHLEVEL = 484
2008-04-06 08:58:21 +00:00
#
# PLIST_SUB helpers
#
RUBY19 = ""
2013-02-24 15:37:23 +00:00
RUBY20 = "@comment "
2014-02-18 15:35:42 +00:00
RUBY21 = "@comment "
2013-02-24 15:37:23 +00:00
. e l i f ${RUBY_VER} = = 2.0
#
# Ruby 2.0
#
RUBY_RELVERSION = 2.0.0
2014-03-23 15:31:43 +00:00
RUBY_PORTREVISION = 5
2013-02-24 15:37:23 +00:00
RUBY_PORTEPOCH = 1
2013-11-23 03:10:04 +00:00
RUBY_PATCHLEVEL = 353
2013-02-24 15:37:23 +00:00
#
# PLIST_SUB helpers
#
RUBY19 = "@comment "
RUBY20 = ""
2014-02-18 15:35:42 +00:00
RUBY21 = "@comment "
. e l i f ${RUBY_VER} = = 2.1
#
# Ruby 2.1
#
2014-02-25 04:23:14 +00:00
RUBY_RELVERSION = 2.1.1
2014-03-23 15:31:43 +00:00
RUBY_PORTREVISION = 1
2014-02-18 15:35:42 +00:00
RUBY_PORTEPOCH = 1
RUBY_PATCHLEVEL = 0
#
# PLIST_SUB helpers
#
RUBY19 = "@comment "
RUBY20 = "@comment "
RUBY21 = ""
2013-02-24 15:37:23 +00:00
2008-04-06 08:58:21 +00:00
. e l s e
#
# Other versions
#
2014-02-18 15:35:42 +00:00
IGNORE = Only ruby 1.9, 2.0 and 2.1 are supported
2008-04-06 08:58:21 +00:00
. e n d i f
. e n d i f # defined(RUBY_VER)
2002-03-10 20:42:48 +00:00
2014-02-18 15:35:42 +00:00
. i f ${RUBY_PATCHLEVEL} = = 0
RUBY_VERSION ?= ${ RUBY_RELVERSION }
RUBY_DISTVERSION ?= ${ RUBY_RELVERSION }
. e l s e
2014-02-15 07:23:56 +00:00
RUBY_VERSION ?= ${ RUBY_RELVERSION } .${ RUBY_PATCHLEVEL }
RUBY_DISTVERSION ?= ${ RUBY_RELVERSION } -p${ RUBY_PATCHLEVEL }
2014-02-18 15:35:42 +00:00
. e n d i f
2014-02-15 07:23:56 +00:00
RUBY_WRKSRC = ${ WRKDIR } /ruby-${ RUBY_DISTVERSION }
RUBY_CONFIGURE_ARGS += --with-rubyhdrdir= " ${ PREFIX } /include/ruby- ${ RUBY_VER } / " \
--with-rubylibprefix= " ${ PREFIX } /lib/ruby " \
--docdir= " ${ RUBY_DOCDIR } " \
--with-soname= ruby${ RUBY_SUFFIX }
2014-02-21 18:53:16 +00:00
CONFIGURE_TARGET ?= ${ ARCH } -portbld-${ OPSYS : L } ${ OSREL : C / \. .*// }
2003-11-24 12:43:40 +00:00
2014-02-21 18:53:16 +00:00
RUBY_ARCH ?= ${ ARCH } -${ OPSYS : L } ${ OSREL : C / \. .*// }
2002-03-10 20:42:48 +00:00
RUBY_NAME ?= ruby${ RUBY_SUFFIX }
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
2002-03-10 20:42:48 +00:00
. e n d i f
# defined(RUBY)
2000-09-06 20:06:58 +00:00
2014-02-01 16:29:36 +00:00
. i f d e f i n e d ( L A N G ) & & ! e m p t y ( L A N G )
GEM_ENV += LANG = ${ LANG }
. e l s e
GEM_ENV += LANG = en_US.UTF-8
. e n d i f
. i f d e f i n e d ( L C _ A L L ) & & ! e m p t y ( L C _ A L L )
GEM_ENV += LC_ALL = ${ LC_ALL }
. e l s e
GEM_ENV += LC_ALL = en_US.UTF-8
. e n d i f
. i f d e f i n e d ( L C _ C T Y P E ) & & ! e m p t y ( L C _ C T Y P E )
GEM_ENV += LC_CTYPE = ${ LC_CTYPE }
. e l s e
GEM_ENV += LC_CTYPE = UTF-8
. e n d i f
2001-06-04 14:54:32 +00:00
RUBY_DEFAULT_SUFFIX ?= ${ RUBY_DEFAULT_VER : S /.// }
2001-05-05 22:03:07 +00:00
RUBY_DISTVERSION ?= ${ RUBY_VERSION }
2001-05-11 18:22:57 +00:00
RUBY_PORTVERSION ?= ${ RUBY_VERSION }
2002-12-24 18:12:20 +00:00
MASTER_SITE_SUBDIR_RUBY ?= ${ RUBY_VER }
2001-04-12 16:57:17 +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
2005-02-05 04:59:26 +00:00
DEPENDS_ARGS += RUBY_VER = " ${ RUBY_VER } "
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
# Commands
2005-11-14 09:46:15 +00:00
RUBY_RD2 ?= ${ LOCALBASE } /bin/rd2
2011-08-21 04:03:37 +00:00
RUBY_RDOC ?= ${ LOCALBASE } /bin/rdoc${ RUBY_VER : S /.// }
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 }
2002-10-06 19:49:32 +00:00
RUBY_RDTOOL_PORT ?= textproc/ruby-rdtool
RUBY_RDOC_PORT ?= textproc/ruby-rdoc
2004-03-23 09:03:32 +00:00
RUBY_ICONV_PORT ?= converters/ruby-iconv
2000-09-06 20:06:58 +00:00
# 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
DEPEND_LIBRUBY ?= ${ RUBY_NAME } .${ RUBY_SHLIBVER } :${ PORTSDIR } /${ RUBY_PORT }
DEPEND_RUBY ?= ${ RUBY } :${ PORTSDIR } /${ RUBY_PORT }
2002-10-06 19:49:32 +00:00
DEPEND_RUBY_RDTOOL ?= ${ RUBY_RD2 } :${ PORTSDIR } /${ RUBY_RDTOOL_PORT }
2004-03-23 09:03:32 +00:00
DEPEND_RUBY_ICONV = ${ RUBY_ARCHLIBDIR } /iconv.so:${ PORTSDIR } /${ RUBY_ICONV_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 }
2007-01-02 16:23:42 +00:00
RUBY_DOCDIR ?= ${ PREFIX } /share/doc/${ RUBY_NAME }
RUBY_EXAMPLESDIR ?= ${ PREFIX } /share/examples/${ RUBY_NAME }
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 }
2007-01-02 16:23:42 +00:00
RUBY_ELISPDIR ?= ${ PREFIX } /lib/ruby/elisp
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 } " \
RUBY_SITERIDIR = " ${ RUBY_SITERIDIR } " \
2001-05-11 19:43:03 +00:00
RUBY_ELISPDIR = " ${ RUBY_ELISPDIR } "
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 } " \
RUBY_NAME = " ${ RUBY_NAME } " \
2008-04-06 08:58:21 +00:00
RUBY_DEFAULT_SUFFIX = " ${ RUBY_DEFAULT_SUFFIX } " \
2013-02-24 15:37:23 +00:00
RUBY19 = ${ RUBY19 } \
2014-02-18 15:35:42 +00:00
RUBY20 = ${ RUBY20 } \
RUBY21 = ${ RUBY21 }
2004-02-26 19:20:09 +00:00
2011-08-21 04:03:37 +00:00
. i f d e f i n e d ( U S E _ R U B Y _ R D O C )
MAKE_ENV += RUBY_RDOC = ${ RUBY_RDOC }
. e n d i f
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
# require check
. i f d e f i n e d ( R U B Y _ R E Q U I R E )
USE_RUBY = yes
2000-10-21 19:57:53 +00:00
. i f e x i s t s ( $ { R U B Y } )
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_PROVIDED != ${ RUBY } -e ' \
2013-06-23 06:57:46 +00:00
Ruby = ${ RUBY_RELVERSION_CODE } ; \
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
value = begin; ${ RUBY_REQUIRE } ; end and puts value'
2000-10-21 19:57:53 +00:00
. e l s e
RUBY_PROVIDED = "should be" # the latest version is going to be installed
. e n d i f
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
. i f e m p t y ( R U B Y _ P R O V I D E D )
. u n d e f R U B Y _ P R O V I D E D
. e n d i f
. e n d i f
2000-09-30 17:34:44 +00:00
# fix shebang lines
. i f d e f i n e d ( R U B Y _ S H E B A N G _ F I L E S ) & & ! e m p t y ( R U B Y _ S H E B A N G _ F I L E S )
USE_RUBY = yes
post-patch : ruby -shebang -patch
ruby-shebang-patch :
2002-12-06 17:17:38 +00:00
@cd ${ WRKSRC } ; for f in ${ RUBY_SHEBANG_FILES } ; do \
2000-09-30 17:34:44 +00:00
${ ECHO_MSG } " ===> Fixing the #! line of $$ f " ; \
2008-04-06 08:58:21 +00:00
TMPFILE = ` mktemp -t rubyshebang` ; \
cp $$ f $$ TMPFILE; \
${ AWK } ' BEGIN { flag = 0; } \
{ \
if ( flag = = 0) { \
if ( $$ 0 ~ /^#!/) { \
sub( /#!( .*\/ ) ?( env[ [ :space:] ] +) ?ruby/, " #! ${ RUBY } " , $$ 0) ; \
print $$ 0; \
} \
else { \
print " #! ${ RUBY } " ; \
print $$ 0; \
} \
flag = 1; \
} else { \
print $$ 0; \
} \
} ' $$ TMPFILE > $$ f; \
rm -f $$ TMPFILE; \
2000-09-30 17:34:44 +00:00
done
. e n d i f
2013-01-11 22:05:13 +00:00
.if ${PORT_OPTIONS : MDEBUG }
2001-04-02 04:36:09 +00:00
RUBY_FLAGS += -d
. e n d i f
2008-04-06 08:58:21 +00:00
#
# RubyGems support
#
. i f d e f i n e d ( U S E _ R U B Y G E M S )
BUILD_DEPENDS += ${ RUBYGEMBIN } :${ PORTSDIR } /devel/ruby-gems
2011-08-21 04:03:37 +00:00
RUN_DEPENDS += ${ RUBYGEMBIN } :${ PORTSDIR } /devel/ruby-gems
2008-04-06 08:58:21 +00:00
PKGNAMEPREFIX ?= rubygem-
EXTRACT_SUFX = .gem
EXTRACT_ONLY =
DIST_SUBDIR = rubygem
2013-02-24 06:02:06 +00:00
EXTRACT_DEPENDS += ${ RUBYGEMBIN } :${ PORTSDIR } /devel/ruby-gems
2008-04-06 08:58:21 +00:00
GEMS_BASE_DIR = lib/ruby/gems/${ RUBY_VER }
GEMS_DIR = ${ GEMS_BASE_DIR } /gems
DOC_DIR = ${ GEMS_BASE_DIR } /doc
CACHE_DIR = ${ GEMS_BASE_DIR } /cache
SPEC_DIR = ${ GEMS_BASE_DIR } /specifications
GEM_NAME ?= ${ PORTNAME } -${ PORTVERSION }
2009-02-13 22:48:51 +00:00
GEM_LIB_DIR ?= ${ GEMS_DIR } /${ GEM_NAME }
GEM_DOC_DIR ?= ${ DOC_DIR } /${ GEM_NAME }
GEM_SPEC ?= ${ SPEC_DIR } /${ GEM_NAME } .gemspec
GEM_CACHE ?= ${ CACHE_DIR } /${ GEM_NAME } .gem
2008-04-06 08:58:21 +00:00
PLIST_SUB += PORTVERSION = " ${ PORTVERSION } " \
REV = " ${ RUBY_GEM } " \
GEMS_BASE_DIR = " lib/ruby/gems/ ${ RUBY_VER } " \
GEMS_DIR = " ${ GEMS_DIR } " \
DOC_DIR = " ${ DOC_DIR } " \
CACHE_DIR = " ${ CACHE_DIR } " \
SPEC_DIR = " ${ SPEC_DIR } " \
PORT = " ${ PORTNAME } - ${ PORTVERSION } " \
GEM_NAME = " ${ GEM_NAME } " \
GEM_LIB_DIR = " ${ GEM_LIB_DIR } " \
GEM_DOC_DIR = " ${ GEM_DOC_DIR } " \
GEM_SPEC = " ${ GEM_SPEC } " \
GEM_CACHE = " ${ GEM_CACHE } " \
EXTRACT_SUFX = " ${ EXTRACT_SUFX } "
RUBYGEMBIN = ${ LOCALBASE } /bin/gem${ RUBY_VER : S /.// }
. i f d e f i n e d ( D I S T F I L E S )
GEMFILES = ${ DISTFILES : C / : [^ : ]+ $// }
. e l s e
GEMFILES = ${ DISTNAME } ${ EXTRACT_SUFX }
. e n d i f
2013-10-17 13:28:50 +00:00
. i f d e f i n e d ( N O _ S T A G E )
RUBYGEM_ARGS = -l --no-update-sources --no-ri --install-dir ${ PREFIX } /lib/ruby/gems/${ RUBY_VER }
. e l s e
RUBYGEM_ARGS = -l --no-update-sources --no-ri --install-dir ${ STAGEDIR } ${ PREFIX } /lib/ruby/gems/${ RUBY_VER } --ignore-dependencies --bindir= ${ STAGEDIR } ${ PREFIX } /bin
2014-01-22 20:47:04 +00:00
GEM_ENV += RB_USER_INSTALL = yes
2013-10-17 13:28:50 +00:00
. e n d i f
2010-09-01 23:39:33 +00:00
. i f d e f i n e d ( N O P O R T D O C S )
RUBYGEM_ARGS += --no-rdoc
. e n d i f
2013-02-24 06:02:06 +00:00
do-extract :
@${ SETENV } ${ GEM_ENV } ${ RUBYGEMBIN } unpack --target= ${ WRKDIR } ${ DISTDIR } /${ DIST_SUBDIR } /${ GEMFILES }
@${ TAR } -xOzf ${ DISTDIR } /${ DIST_SUBDIR } /${ GEMFILES } metadata.gz | ${ GZCAT } > ${ BUILD_WRKSRC } /${ GEMFILES } spec
do-build :
@( cd ${ BUILD_WRKSRC } ; if ! ${ SETENV } ${ GEM_ENV } ${ RUBYGEMBIN } build --force ${ GEMFILES } spec ; then \
2013-07-06 12:53:57 +00:00
if [ -n " ${ BUILD_FAIL_MESSAGE } " ] ; then \
2013-02-24 06:02:06 +00:00
${ ECHO_MSG } "===> Compilation failed unexpectedly." ; \
2013-07-06 12:53:57 +00:00
( ${ ECHO_CMD } " ${ BUILD_FAIL_MESSAGE } " ) | ${ FMT } 75 79 ; \
2013-02-24 06:02:06 +00:00
fi ; \
${ FALSE } ; \
fi )
2008-04-06 08:58:21 +00:00
do-install :
2013-02-24 06:02:06 +00:00
@( cd ${ BUILD_WRKSRC } ; ${ SETENV } ${ GEM_ENV } ${ RUBYGEMBIN } install ${ RUBYGEM_ARGS } ${ GEMFILES } -- --build-args ${ CONFIGURE_ARGS } )
2008-04-06 08:58:21 +00:00
2009-02-13 22:48:51 +00:00
. i f d e f i n e d ( R U B Y G E M _ A U T O P L I S T )
. i f ! t a r g e t ( p o s t - i n s t a l l - s c r i p t )
post-install-script :
@${ ECHO } ${ GEM_CACHE } >> ${ TMPPLIST }
@${ ECHO } ${ GEM_SPEC } >> ${ TMPPLIST }
2010-09-01 23:39:33 +00:00
. i f ! d e f i n e d ( N O P O R T D O C S )
2013-10-17 13:28:50 +00:00
@${ FIND } -ds ${ STAGEDIR } ${ PREFIX } /${ GEM_DOC_DIR } -type f -print | ${ SED } -E -e \
's,^${STAGEDIR}${PREFIX}/?,,' >> ${ TMPPLIST }
@${ FIND } -ds ${ STAGEDIR } ${ PREFIX } /${ GEM_DOC_DIR } -type d -print | ${ SED } -E -e \
's,^${STAGEDIR}${PREFIX}/?,@dirrm ,' >> ${ TMPPLIST }
2010-09-01 23:39:33 +00:00
. e n d i f
2013-10-17 13:28:50 +00:00
@${ FIND } -ds ${ STAGEDIR } ${ PREFIX } /${ GEM_LIB_DIR } -type f -print | ${ SED } -E -e \
's,^${STAGEDIR}${PREFIX}/?,,' >> ${ TMPPLIST }
@${ FIND } -ds ${ STAGEDIR } ${ PREFIX } /${ GEM_LIB_DIR } -type d -print | ${ SED } -E -e \
2013-10-17 16:45:07 +00:00
's,^${STAGEDIR}${PREFIX}/?,@dirrm ,' >> ${ TMPPLIST }
2009-02-13 22:48:51 +00:00
@${ ECHO_CMD } " @unexec rmdir %D/ ${ GEMS_DIR } 2>/dev/null || true " >> ${ TMPPLIST }
2010-09-01 23:39:33 +00:00
. i f ! d e f i n e d ( N O P O R T D O C S )
2009-02-13 22:48:51 +00:00
@${ ECHO_CMD } " @unexec rmdir %D/ ${ DOC_DIR } 2>/dev/null || true " >> ${ TMPPLIST }
2010-09-01 23:39:33 +00:00
. e n d i f
2009-02-13 22:48:51 +00:00
@${ ECHO_CMD } " @unexec rmdir %D/ ${ CACHE_DIR } 2>/dev/null || true " >> ${ TMPPLIST }
@${ ECHO_CMD } " @unexec rmdir %D/ ${ SPEC_DIR } 2>/dev/null || true " >> ${ TMPPLIST }
@${ ECHO_CMD } " @unexec rmdir %D/ ${ GEMS_BASE_DIR } 2>/dev/null || true " >> ${ TMPPLIST }
@${ ECHO_CMD } "@unexec rmdir %D/lib/ruby/gems 2>/dev/null || true" >> ${ TMPPLIST }
@${ ECHO_CMD } "@unexec rmdir %D/lib/ruby 2>/dev/null || true" >> ${ TMPPLIST }
. e n d i f
. e n d i f
2008-04-06 08:58:21 +00:00
. e n d i f # USE_RUBYGEMS
#
# extconf.rb support
#
2000-09-06 20:06:58 +00:00
. i f d e f i n e d ( U S E _ R U B Y _ E X T C O N F )
USE_RUBY = yes
RUBY_EXTCONF ?= extconf.rb
2005-11-14 09:46:15 +00:00
CONFIGURE_ARGS += --with-opt-dir= " ${ LOCALBASE } "
2000-09-06 20:06:58 +00:00
do-configure : ruby -extconf -configure
ruby-extconf-configure :
. i f d e f i n e d ( R U B Y _ E X T C O N F _ S U B D I R S )
. f o r d i n $ { R U B Y _ E X T C O N F _ S U B D I R S }
@${ 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 }
2000-09-06 20:06:58 +00:00
. e n d f o r
. e l s e
@${ 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 }
2000-09-06 20:06:58 +00:00
. e n d i f
. e n d i f
2008-04-06 08:58:21 +00:00
#
# setup.rb support
#
2000-09-06 20:06:58 +00:00
. i f d e f i n e d ( U S E _ R U B Y _ S E T U P )
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 01:54:56 +00:00
. i f d e f i n e d ( N O _ S T A G E )
2014-02-09 03:05:21 +00:00
@cd ${ INSTALL_WRKSRC } ; \
2001-04-02 04:36:09 +00:00
${ SETENV } ${ MAKE_ENV } ${ RUBY } ${ RUBY_FLAGS } ${ RUBY_SETUP } install
2014-02-09 01:54:56 +00:00
. e l s e
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 }
. e n d i f
2000-09-06 20:06:58 +00:00
. e n d i f
. i f d e f i n e d ( U S E _ L I B R U B Y )
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
LIB_DEPENDS += ${ DEPEND_LIBRUBY }
2000-09-06 20:06:58 +00:00
. e n d i f
. i f d e f i n e d ( U S E _ R U B Y )
2000-09-16 11:37:37 +00:00
. i f ! d e f i n e d ( R U B Y _ N O _ B U I L D _ D E P E N D S )
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 }
2000-09-16 11:37:37 +00:00
. e n d i f
. i f ! d e f i n e d ( R U B Y _ N O _ R U N _ D E P E N D 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
RUN_DEPENDS += ${ DEPEND_RUBY }
2000-09-06 20:06:58 +00:00
. e n d i f
2000-09-16 11:37:37 +00:00
. e n d i f
2000-09-06 20:06:58 +00:00
2002-09-21 07:06:39 +00:00
. i f d e f i n e d ( U S E _ R U B Y _ F E A T U R E S )
2004-03-23 09:03:32 +00:00
_use = ${ USE_RUBY_FEATURES : Miconv }
. i f ! e m p t y ( _ u s e )
2013-10-31 12:15:50 +00:00
. i f (${RUBY_VER} = = 1.9)
2004-03-23 09:03:32 +00:00
BUILD_DEPENDS += ${ DEPEND_RUBY_ICONV }
RUN_DEPENDS += ${ DEPEND_RUBY_ICONV }
. e n d i f
2013-02-24 15:37:23 +00:00
. e n d i f
2004-03-23 09:03:32 +00:00
. u n d e f _ u s e
2002-09-21 07:06:39 +00:00
. e n d i f
2008-04-06 08:58:21 +00:00
. i f d e f i n e d ( U S E _ R A K E )
2011-04-06 19:36:50 +00:00
BUILD_DEPENDS += ${ LOCALBASE } /bin/rake:${ PORTSDIR } /devel/rubygem-rake
2010-08-31 03:28:05 +00:00
RAKE_BIN = ${ LOCALBASE } /bin/rake
2008-04-06 08:58:21 +00:00
. e n d i f
2002-11-22 14:53:06 +00:00
# documents
2002-12-06 17:17:38 +00:00
RUBY_NO_RD_HTML = yes
2002-12-27 21:39:06 +00:00
. i f d e f i n e d ( R U B Y _ R D _ H T M L )
. u n d e f R U B Y _ N O _ R D _ H T M L
2002-10-05 07:47:28 +00:00
. e n d i f
2002-12-27 21:39:06 +00:00
. i f d e f i n e d ( N O P O R T D O C S )
RUBY_NO_RD_HTML = yes
. e n d i f
2002-12-06 17:17:38 +00:00
. i f d e f i n e d ( R U B Y _ R D _ F I L E S ) & & ! d e f i n e d ( R U B Y _ N O _ R D _ H T M L )
2002-11-22 14:53:06 +00:00
USE_RUBY_RDTOOL = yes
2002-12-06 17:17:38 +00:00
RUBY_RD_HTML_FILES = ${ RUBY_RD_FILES : S /.rb $// : S /.rd././ : S /.rd $// : S / $/.html/ }
2002-11-22 14:53:06 +00:00
2002-12-06 17:17:38 +00:00
PLIST_SUB += RUBY_RD_HTML_FILES = ""
pre-install : ruby -rd -build
2002-11-22 14:53:06 +00:00
ruby-rd-build :
2002-12-06 17:17:38 +00:00
. i f ! e m p t y ( R U B Y _ R D _ F I L E S )
2002-11-22 14:53:06 +00:00
@${ ECHO_MSG } "===> Generating HTML documents from RD documents"
2002-12-06 17:17:38 +00:00
@cd ${ WRKSRC } ; for rd in ${ RUBY_RD_FILES } ; do \
html = $$ ( echo $$ rd | ${ SED } 's/\.rb$$//;s/\.rd\././;s/\.rd$$//' ) .html; \
2002-11-22 14:53:06 +00:00
${ ECHO_MSG } " ${ RUBY_RD2 } $$ rd > $$ html " ; \
${ RUBY_RD2 } $$ rd > $$ html; \
done
2002-12-06 17:17:38 +00:00
. e l s e
@${ DO_NADA }
2002-11-22 14:53:06 +00:00
. e n d i f
2002-12-06 17:17:38 +00:00
. e l s e
RUBY_RD_HTML_FILES = # empty
PLIST_SUB += RUBY_RD_HTML_FILES = "@comment "
2002-11-22 14:53:06 +00:00
. e n d i f
2002-10-06 19:49:32 +00:00
. i f ! d e f i n e d ( N O P O R T D O C S ) & & d e f i n e d ( U S E _ R U B Y _ R D T O O L )
BUILD_DEPENDS += ${ DEPEND_RUBY_RDTOOL }
. e n d i f
2000-09-16 11:37:37 +00:00
. e n d i f