summaryrefslogtreecommitdiff
path: root/Mk/bsd.ruby.mk
diff options
context:
space:
mode:
authorMuhammad Moinur Rahman <bofh@FreeBSD.org>2023-01-14 17:05:28 -0600
committerMuhammad Moinur Rahman <bofh@FreeBSD.org>2023-01-14 17:08:33 -0600
commit18c6e18276691edf5274406bf82a3b06792ff9ae (patch)
tree23a66e6997d92422bec9960a22edc07e5386d547 /Mk/bsd.ruby.mk
parentdevel/py-types-Pillow: update 9.4.0.1 → 9.4.0.2 (diff)
Mk/**ruby.mk: Switch from USE_RUBY=yes to USES=ruby
Switch from Mk/bsd.ruby.mk to Mk/Uses/ruby.mk Notable changes are. - Mk/bsd.ruby.mk is moved to Mk/Uses/ruby.mk. - USE_RUBY=yes is replaced with USES=ruby. - USE_RUBY_EXTCONF is replaced with USES=ruby:extconf. - USE_RUBY_RDOC is replaced with USES=ruby:rdoc. - USE_RUBY_SETUP is replaces with USES=ruby:setup. - RUBY_NO_BUILD_DEPENDS and RUBY_NO_RUN_DEPENDS are replaced with USES=ruby:{build,none,run}. - RUBY_REQUIRE isn't used anywhere, so removed. - USES=gem now implies USES=ruby. This is mainly the work of yasu@ at https://reviews.freebsd.org/D27863 I have just made some cosmetic changes and ran exp-run to test that the tree is not in a BROKEN state. Approved by: portmgr Differential Revision: https://reviews.freebsd.org/D37925
Diffstat (limited to '')
-rw-r--r--Mk/Uses/ruby.mk (renamed from Mk/bsd.ruby.mk)65
1 files changed, 41 insertions, 24 deletions
diff --git a/Mk/bsd.ruby.mk b/Mk/Uses/ruby.mk
index a9a6ce42574e..da2e4ea30a4e 100644
--- a/Mk/bsd.ruby.mk
+++ b/Mk/Uses/ruby.mk
@@ -1,11 +1,16 @@
-# bsd.ruby.mk - Utility definitions for Ruby related ports.
+# Provide support for Ruby releated ports.
#
-
-.if !defined(Ruby_Include)
-
-Ruby_Include= bsd.ruby.mk
-Ruby_Include_MAINTAINER= ruby@FreeBSD.org
-
+# Feature: ruby
+# Usage: USES=ruby[:args,..]
+# Valid ARGS: build, extconf, run, setup
+# ARGS description:
+# build Says that ruby is required only for build time.
+# extconf Says that the port uses extconf.rb to configure.
+# none Says that no dependency is added to the port.
+# Intended to be used with lang/ruby*.
+# run Says that ruby is required only for run time.
+# setup Says that the port uses setup.rb to configure and
+# build.
#
# [variables that a user may define]
#
@@ -23,20 +28,12 @@ Ruby_Include_MAINTAINER= ruby@FreeBSD.org
# 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).
-# USE_RUBY - Says that the port uses ruby for building and running.
-# 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.
-# 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).
-# USE_RUBYGEMS - Do not use this -- instead USES=gem
#
# [variables that each port should not (re)define]
#
@@ -44,7 +41,7 @@ Ruby_Include_MAINTAINER= ruby@FreeBSD.org
# (default: ruby${RUBY_SUFFIX}-)
# RUBY_VERSION - Full version of ruby without preview/beta suffix in
# the form of `x.y.z' (see below for current value).
-# RUBY_VERSION_CODE - Integer version of RUBY_VERSION in the form of
+# RUBY_VERSION_CODE - Integer version of RUBY_VERSION in the form of
# `xyz'.
# RUBY_DISTVERSION - DISTVERSION for the standard ruby ports (ruby,
# ruby-gdbm, etc.).
@@ -93,6 +90,25 @@ Ruby_Include_MAINTAINER= ruby@FreeBSD.org
# RUBY_MODDOCDIR - Installation path for the module's documents.
# RUBY_MODEXAMPLESDIR - Installation path for the module's examples.
#
+# MAINTAINER: ruby@FreeBSD.org
+
+.if !defined(_INCLUDE_USES_RUBY_MK)
+_INCLUDE_USES_RUBY_MK= yes
+
+_valid_ARGS= build extconf none run setup
+
+# "USES=gem" implies "USES=ruby"
+. if defined(_INCLUDE_USES_GEM_MK)
+ruby_ARGS=
+. endif
+
+# Sanity check
+. for arg in ${ruby_ARGS}
+. if empty(_valid_ARGS:M${arg})
+IGNORE= Incorrect 'USES+= ruby:${ruby_ARGS}' usage: argument [${arg}] is not recognized
+. endif
+. endfor
+
. if defined(RUBY_DEFAULT_VER)
WARNING+= "RUBY_DEFAULT_VER is defined, consider using DEFAULT_VERSIONS=ruby=${RUBY_DEFAULT_VER} instead"
@@ -282,8 +298,7 @@ RUBY_FLAGS+= -d
#
# extconf.rb support
#
-. if defined(USE_RUBY_EXTCONF)
-USE_RUBY= yes
+. if ${ruby_ARGS:Mextconf}
RUBY_EXTCONF?= extconf.rb
CONFIGURE_ARGS+= --with-opt-dir="${LOCALBASE}"
@@ -308,7 +323,7 @@ ruby-extconf-configure:
#
# setup.rb support
#
-. if defined(USE_RUBY_SETUP)
+. if ${ruby_ARGS:Msetup}
RUBY_SETUP?= setup.rb
do-configure: ruby-setup-configure
@@ -333,15 +348,17 @@ ruby-setup-install:
${SETENV} ${MAKE_ENV} ${RUBY} ${RUBY_FLAGS} ${RUBY_SETUP} install --prefix=${STAGEDIR}
. endif
-. if defined(USE_RUBY)
-. if !defined(RUBY_NO_BUILD_DEPENDS)
+. if !${ruby_ARGS:Mbuild} && !${ruby_ARGS:Mrun} && !${ruby_ARGS:Mnone}
EXTRACT_DEPENDS+= ${DEPEND_RUBY}
PATCH_DEPENDS+= ${DEPEND_RUBY}
BUILD_DEPENDS+= ${DEPEND_RUBY}
-. endif
-. if !defined(RUBY_NO_RUN_DEPENDS)
RUN_DEPENDS+= ${DEPEND_RUBY}
-. endif
+. elif ${ruby_ARGS:Mbuild}
+EXTRACT_DEPENDS+= ${DEPEND_RUBY}
+PATCH_DEPENDS+= ${DEPEND_RUBY}
+BUILD_DEPENDS+= ${DEPEND_RUBY}
+. elif ${ruby_ARGS:Mrun}
+RUN_DEPENDS+= ${DEPEND_RUBY}
. endif
. endif # _INVALID_RUBY_VER