Skip to content

Commit

Permalink
Mk/**ruby.mk: Switch from USE_RUBY=yes to USES=ruby
Browse files Browse the repository at this point in the history
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
  • Loading branch information
5u623l20 committed Jan 14, 2023
1 parent 74d5524 commit 18c6e18
Show file tree
Hide file tree
Showing 2,868 changed files with 167 additions and 3,006 deletions.
3 changes: 3 additions & 0 deletions Mk/Uses/gem.mk
Expand Up @@ -19,6 +19,9 @@ IGNORE= Incorrect 'USES+= gem:${gem_ARGS}' usage: argument [${arg}] is not recog
. endif
. endfor

# "USES=gem" implies "USES=ruby"
.include "${USESDIR}/ruby.mk"

PKGNAMEPREFIX?= rubygem-
EXTRACT_SUFX= .gem
EXTRACT_ONLY=
Expand Down
65 changes: 41 additions & 24 deletions Mk/bsd.ruby.mk → 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]
#
Expand All @@ -23,28 +28,20 @@ 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]
#
# RUBY_PKGNAMEPREFIX - Common PKGNAMEPREFIX for ruby ports
# (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.).
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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}"
Expand All @@ -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
Expand All @@ -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
Expand Down
10 changes: 1 addition & 9 deletions Mk/bsd.port.mk
Expand Up @@ -371,9 +371,6 @@ FreeBSD_MAINTAINER= portmgr@FreeBSD.org
# USE_OCAML - If set, this port relies on the OCaml language.
# Implies inclusion of bsd.ocaml.mk. (Also see
# that file for more information on USE_OCAML*).
# USE_RUBY - If set, this port relies on the Ruby language.
# Implies inclusion of bsd.ruby.mk. (Also see
# that file for more information on USE_RUBY_*).
##
# USE_GECKO - If set, this port uses the Gecko/Mozilla product.
# See bsd.gecko.mk for more details.
Expand Down Expand Up @@ -1391,10 +1388,6 @@ PKGCOMPATDIR?= ${LOCALBASE}/lib/compat/pkg
.include "${PORTSDIR}/Mk/bsd.java.mk"
. endif

. if defined(USE_RUBY)
.include "${PORTSDIR}/Mk/bsd.ruby.mk"
. endif

. if defined(USE_OCAML)
.include "${PORTSDIR}/Mk/bsd.ocaml.mk"
. endif
Expand Down Expand Up @@ -1640,8 +1633,7 @@ QA_ENV+= STAGEDIR=${STAGEDIR} \
DISABLE_LICENSES="${DISABLE_LICENSES:Dyes}" \
PORTNAME=${PORTNAME} \
NO_ARCH=${NO_ARCH} \
"NO_ARCH_IGNORE=${NO_ARCH_IGNORE}" \
USE_RUBY=${USE_RUBY}
"NO_ARCH_IGNORE=${NO_ARCH_IGNORE}"
. if !empty(USES:Mssl)
QA_ENV+= USESSSL=yes
. endif
Expand Down
13 changes: 12 additions & 1 deletion Mk/bsd.sanity.mk
Expand Up @@ -161,6 +161,10 @@ DEV_ERROR+= "USE_TCL and USE_TK are no longer supported, please use USES=tcl or
DEV_ERROR+= "USE_FPC=yes is no longer supported, please use USES=fpc"
.endif

.if ! empty(USES:Mruby) && ! empty(USES:Mgem)
DEV_ERROR= "'USES=gem' implies 'USES=ruby'. You should not specify both of them"
.endif

.for _type in EXAMPLES DOCS
. if defined(PORT${_type}) && empty(_REALLY_ALL_POSSIBLE_OPTIONS:M${_type})
DEV_ERROR+= "PORT${_type} does not do anything unless the ${_type} option is present."
Expand Down Expand Up @@ -203,7 +207,9 @@ SANITY_UNSUPPORTED= USE_OPENAL USE_FAM USE_MAKESELF USE_ZIP USE_LHA USE_CMAKE \
INSTALLS_EGGINFO USE_DOS2UNIX NO_STAGE USE_RUBYGEMS USE_GHOSTSCRIPT \
USE_GHOSTSCRIPT_BUILD USE_GHOSTSCRIPT_RUN USE_AUTOTOOLS APACHE_PORT \
USE_FPC_RUN WANT_FPC_BASE WANT_FPC_ALL USE_QT4 USE_QT5 QT_NONSTANDARD \
XORG_CAT CARGO_USE_GITHUB CARGO_USE_GITLAB CARGO_GIT_SUBDIR
XORG_CAT CARGO_USE_GITHUB CARGO_USE_GITLAB CARGO_GIT_SUBDIR \
USE_RUBY USE_RUBY_EXTCONF USE_RUBY_SETUP RUBY_NO_BUILD_DEPENDS \
RUBY_NO_RUN_DEPENDS
SANITY_DEPRECATED= MLINKS \
USE_MYSQL WANT_MYSQL_VER \
PYDISTUTILS_INSTALLNOSINGLE \
Expand Down Expand Up @@ -294,6 +300,11 @@ XORG_CAT_ALT= USES=xorg-cat:${XORG_CAT}
CARGO_USE_GITHUB_ALT= CARGO_CRATES \(regenerate it with make cargo-crates\)
CARGO_USE_GITLAB_ALT= CARGO_CRATES \(regenerate it with make cargo-crates\)
CARGO_GIT_SUBDIR_ALT= CARGO_CRATES \(regenerate it with make cargo-crates\)
USE_RUBY_ALT= USES=ruby
USE_RUBY_EXTCONF_ALT= USES=ruby:extconf
USE_RUBY_SETUP_ALT= USES=ruby:setup
RUBY_NO_BUILD_DEPENDS_ALT= USES=ruby:run
RUBY_NO_RUN_DEPENDS_ALT= USES=ruby:build

.for a in ${SANITY_DEPRECATED}
. if defined(${a})
Expand Down
1 change: 0 additions & 1 deletion accessibility/rubygem-atk/Makefile
Expand Up @@ -15,7 +15,6 @@ RUN_DEPENDS= rubygem-glib2>=${PORTVERSION}:devel/rubygem-glib2

USES= gem gnome
USE_GNOME= atk
USE_RUBY= yes

NO_ARCH= yes

Expand Down
1 change: 0 additions & 1 deletion archivers/rubygem-archive-tar-minitar/Makefile
Expand Up @@ -14,7 +14,6 @@ RUN_DEPENDS= rubygem-minitar>=${PORTVERSION}<1:archivers/rubygem-minitar \
rubygem-minitar-cli>=${PORTVERSION}<1:archivers/rubygem-minitar-cli

USES= gem
USE_RUBY= yes

NO_ARCH= yes

Expand Down
1 change: 0 additions & 1 deletion archivers/rubygem-archive-zip/Makefile
Expand Up @@ -13,7 +13,6 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= rubygem-io-like>=0.3.0<0.4:devel/rubygem-io-like

USES= gem
USE_RUBY= yes

NO_ARCH= yes

Expand Down
1 change: 0 additions & 1 deletion archivers/rubygem-bzip2-ruby/Makefile
Expand Up @@ -11,7 +11,6 @@ WWW= https://github.com/brianmario/bzip2-ruby
LICENSE= BSD2CLAUSE RUBY
LICENSE_COMB= dual

USE_RUBY= yes
USES= gem

.include <bsd.port.mk>
1 change: 0 additions & 1 deletion archivers/rubygem-fpm/Makefile
Expand Up @@ -19,7 +19,6 @@ RUN_DEPENDS= rubygem-arr-pm>=0.0.11<0.1:devel/rubygem-arr-pm \
rubygem-stud>=0:devel/rubygem-stud

USES= gem
USE_RUBY= yes

NO_ARCH= yes

Expand Down
1 change: 0 additions & 1 deletion archivers/rubygem-libarchive/Makefile
Expand Up @@ -10,7 +10,6 @@ WWW= https://bitbucket.org/winebarrel/libarchive-ruby

LICENSE= BSD3CLAUSE

USE_RUBY= yes
USES= dos2unix gem libarchive

DOS2UNIX_FILES= ext/depend
Expand Down
1 change: 0 additions & 1 deletion archivers/rubygem-minitar-cli/Makefile
Expand Up @@ -17,7 +17,6 @@ RUN_DEPENDS= rubygem-minitar>=0.8.0<1:archivers/rubygem-minitar \
rubygem-powerbar>=1.0<2:devel/rubygem-powerbar

USES= gem
USE_RUBY= yes

NO_ARCH= yes

Expand Down
1 change: 0 additions & 1 deletion archivers/rubygem-minitar/Makefile
Expand Up @@ -13,7 +13,6 @@ LICENSE_FILE_BSD2CLAUSE=${WRKSRC}/docs/bsdl.txt
LICENSE_FILE_RUBY= ${WRKSRC}/docs/ruby.txt

USES= gem
USE_RUBY= yes

NO_ARCH= yes

Expand Down
1 change: 0 additions & 1 deletion archivers/rubygem-ruby-xz/Makefile
Expand Up @@ -11,7 +11,6 @@ LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE

USES= gem
USE_RUBY= yes

NO_ARCH= yes

Expand Down
1 change: 0 additions & 1 deletion archivers/rubygem-rubyzip/Makefile
Expand Up @@ -11,7 +11,6 @@ LICENSE= BSD2CLAUSE RUBY
LICENSE_COMB= dual

USES= cpe gem
USE_RUBY= yes

NO_ARCH= yes

Expand Down
1 change: 0 additions & 1 deletion archivers/rubygem-rubyzip13/Makefile
Expand Up @@ -12,7 +12,6 @@ LICENSE= BSD2CLAUSE RUBY
LICENSE_COMB= dual

USES= cpe gem
USE_RUBY= yes

NO_ARCH= yes

Expand Down
1 change: 0 additions & 1 deletion archivers/rubygem-rubyzip2/Makefile
Expand Up @@ -9,7 +9,6 @@ WWW= https://github.com/postmodern/rubyzip2

NO_ARCH= yes

USE_RUBY= yes
USES= cpe gem

CPE_VENDOR= rubyzip_project
Expand Down
1 change: 0 additions & 1 deletion archivers/rubygem-rubyzip20/Makefile
Expand Up @@ -12,7 +12,6 @@ LICENSE= BSD2CLAUSE RUBY
LICENSE_COMB= dual

USES= cpe gem
USE_RUBY= yes

NO_ARCH= yes

Expand Down
1 change: 0 additions & 1 deletion archivers/rubygem-snappy/Makefile
Expand Up @@ -14,7 +14,6 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.txt
LIB_DEPENDS= libsnappy.so:archivers/snappy

USES= gem shebangfix
USE_RUBY= yes

SHEBANG_FILES= smoke.sh \
vendor/snappy/config.status \
Expand Down
4 changes: 1 addition & 3 deletions audio/ruby-smf/Makefile
Expand Up @@ -12,9 +12,7 @@ WWW= http://www.funaba.org/code #smf

LICENSE= BSD2CLAUSE

USE_RUBY= yes
USES= shebangfix
USE_RUBY_SETUP= yes
USES= ruby:setup shebangfix
RUBY_SETUP= install.rb
SHEBANG_FILES= sample/*.rb

Expand Down
3 changes: 1 addition & 2 deletions audio/ruby-taglib/Makefile
Expand Up @@ -17,8 +17,7 @@ LIB_DEPENDS= libtag.so:audio/taglib

NO_ARCH= yes
NO_BUILD= yes
USE_RUBY= yes
USES= tar:bzip2
USES= ruby tar:bzip2

OPTIONS_DEFINE= DOCS

Expand Down
1 change: 0 additions & 1 deletion audio/rubygem-librmpd/Makefile
Expand Up @@ -11,7 +11,6 @@ LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/COPYING

USES= gem
USE_RUBY= yes

NO_ARCH= yes

Expand Down
1 change: 0 additions & 1 deletion audio/rubygem-ruby-mp3info/Makefile
Expand Up @@ -10,7 +10,6 @@ WWW= https://github.com/moumar/ruby-mp3info
LICENSE= MIT

NO_ARCH= yes
USE_RUBY= yes
USES= gem

.include <bsd.port.mk>
1 change: 0 additions & 1 deletion audio/rubygem-ruby-ogginfo/Makefile
Expand Up @@ -10,7 +10,6 @@ WWW= https://github.com/moumar/ruby-ogginfo
LICENSE= GPLv3

NO_ARCH= yes
USE_RUBY= yes
USES= gem

.include <bsd.port.mk>
1 change: 0 additions & 1 deletion audio/rubygem-ruby-shout/Makefile
Expand Up @@ -12,7 +12,6 @@ LICENSE= BSD3CLAUSE
LIB_DEPENDS= libshout.so:audio/libshout

CONFIGURE_ARGS= --with-opt-include="${LOCALBASE}/include"
USE_RUBY= yes
USES= gem

.include <bsd.port.mk>
3 changes: 1 addition & 2 deletions audio/squash/Makefile
Expand Up @@ -18,8 +18,7 @@ LIB_DEPENDS+= libao.so:audio/libao \
libvorbis.so:audio/libvorbis
RUN_DEPENDS= id3v2:audio/id3v2

USES= compiler:c11 gmake ncurses tar:bzip2
USE_RUBY= yes
USES= compiler:c11 gmake ncurses ruby tar:bzip2
MAKE_ARGS= CC="${CC}"
CFLAGS+= -fcommon

Expand Down
1 change: 0 additions & 1 deletion benchmarks/rubygem-benchmark-ips/Makefile
Expand Up @@ -11,7 +11,6 @@ LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE

USES= gem
USE_RUBY= yes

NO_ARCH= yes

Expand Down
1 change: 0 additions & 1 deletion benchmarks/rubygem-benchmark-memory/Makefile
Expand Up @@ -13,7 +13,6 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.md
RUN_DEPENDS= rubygem-memory_profiler>=1<2:devel/rubygem-memory_profiler

USES= gem
USE_RUBY= yes

NO_ARCH= yes

Expand Down
1 change: 0 additions & 1 deletion benchmarks/rubygem-benchmark/Makefile
Expand Up @@ -12,7 +12,6 @@ LICENSE_COMB= dual
LICENSE_FILE_BSD2CLAUSE=${WRKSRC}/LICENSE.txt

USES= gem
USE_RUBY= yes

NO_ARCH= yes

Expand Down

0 comments on commit 18c6e18

Please sign in to comment.