Add Ruby 2.4.0

While here, remove local patches that are no longer needed and simplify
post-patch target.
This commit is contained in:
Steve Wills 2016-12-26 19:00:05 +00:00
parent 402fe64cc9
commit 39230bebc6
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=429566
11 changed files with 18020 additions and 2 deletions

View File

@ -76,7 +76,7 @@ PYTHON_DEFAULT?= 2.7
PYTHON2_DEFAULT?= 2.7
# Possible values: 3.3, 3.4, 3.5, 3.6
PYTHON3_DEFAULT?= 3.5
# Possible values: 2.1, 2.2, 2.3
# Possible values: 2.1, 2.2, 2.3, 2.4
RUBY_DEFAULT?= 2.2
# Possible values: base, openssl, openssl-devel, libressl, libressl-devel
.if !defined(SSL_DEFAULT)

View File

@ -180,13 +180,23 @@ RUBY_PORTEPOCH= 1
RUBY_PATCHLEVEL= 0
RUBY23= "" # PLIST_SUB helpers
. elif ${RUBY_VER} == 2.4
#
# Ruby 2.4
#
RUBY_RELVERSION= 2.4.0
RUBY_PORTREVISION= 0
RUBY_PORTEPOCH= 1
RUBY_PATCHLEVEL= 0
RUBY24= "" # PLIST_SUB helpers
# When adding a version, please keep the comment in
# Mk/bsd.default-versions.mk in sync.
. else
#
# Other versions
#
IGNORE= Only ruby 2.1, 2.2 and 2.3 are supported
IGNORE= Only ruby 2.1, 2.2, 2.3 and 2.4 are supported
_INVALID_RUBY_VER= 1
. endif
.endif # defined(RUBY_VER)
@ -196,6 +206,7 @@ _INVALID_RUBY_VER= 1
RUBY21?= "@comment "
RUBY22?= "@comment "
RUBY23?= "@comment "
RUBY24?= "@comment "
.if defined(BROKEN_RUBY${RUBY_VER:R}${RUBY_VER:E})
.if ${BROKEN_RUBY${RUBY_VER:R}${RUBY_VER:E}} == "yes"

View File

@ -298,6 +298,7 @@
SUBDIR += ruby21
SUBDIR += ruby22
SUBDIR += ruby23
SUBDIR += ruby24
SUBDIR += runawk
SUBDIR += rust
SUBDIR += rust-nightly

212
lang/ruby24/Makefile Normal file
View File

@ -0,0 +1,212 @@
# Created by: Akinori MUSHA aka knu <knu@idaemons.org>
# $FreeBSD$
PORTNAME= ruby
PORTVERSION= ${RUBY_PORTVERSION}
PORTREVISION= ${RUBY_PORTREVISION}
PORTEPOCH= ${RUBY_PORTEPOCH}
CATEGORIES= lang ruby ipv6
MASTER_SITES= RUBY/${MASTER_SITE_SUBDIR_RUBY}
DISTNAME= ${RUBY_DISTNAME}
DIST_SUBDIR= ruby
MAINTAINER= ruby@FreeBSD.org
COMMENT?= Object-oriented interpreted scripting language
LICENSE= BSD2CLAUSE RUBY
LICENSE_COMB= dual
LICENSE_FILE_BSD2CLAUSE=${WRKSRC}/BSDL
LICENSE_FILE_RUBY= ${WRKSRC}/COPYING
# Using LIB_DEPENDS finds the libffi from gcc which causes problems
BUILD_DEPENDS= libffi>=0:devel/libffi
LIB_DEPENDS= libyaml.so:textproc/libyaml
RUN_DEPENDS= libffi>=0:devel/libffi
CONFIGURE_ARGS= ${RUBY_CONFIGURE_ARGS} \
--disable-rpath \
--enable-pthread \
--enable-shared \
--enable-install-static-library \
--with-ruby-version=minor \
--with-sitedir="${PREFIX}/lib/ruby/site_ruby" \
--with-vendordir="${PREFIX}/lib/ruby/vendor_ruby"
CONFIGURE_ENV= LC_ALL=C debugflags=
CPPFLAGS+= -I${LOCALBASE}/include
GNU_CONFIGURE= yes
# Keep this, else ruby will fail to load libraries dependent of libpthread.
LIBS+= -lpthread -L${LOCALBASE}/lib
MAKE_ENV= LC_ALL=C
USE_LDCONFIG= yes
USES= autoreconf cpe execinfo ssl tar:xz
WRKSRC= ${RUBY_WRKSRC}
RUBY_VER= 2.4
USE_RUBY= yes
RUBY_NO_BUILD_DEPENDS= yes
RUBY_NO_RUN_DEPENDS= yes
NOT_FOR_ARCHS= ia64
NOT_FOR_ARCHS_REASON_ia64= does not build
OPTIONS_DEFINE= CAPIDOCS DEBUG DOCS EXAMPLES GMP RDOC
OPTIONS_DEFAULT= RDOC LIBEDIT
OPTIONS_SINGLE= EDIT
OPTIONS_SINGLE_EDIT= LIBEDIT READLINE
OPTIONS_SUB= yes
CAPIDOCS_DESC= Build and install C API documents
GMP_DESC= Use GMP to accelerate Bignum operations
RDOC_DESC= Build and install Rdoc indexes
EDIT_DESC= Which line editing lib to use
LIBEDIT_DESC= Use libedit
READLINE_DESC= Use libreadline
CAPIDOCS_BUILD_DEPENDS= doxygen>0:devel/doxygen \
dot:graphics/graphviz
CAPIDOCS_CONFIGURE_ENABLE= install-capi
GMP_CONFIGURE_WITH= gmp
GMP_LIB_DEPENDS= libgmp.so:math/gmp
LIBEDIT_CONFIGURE_ON= --enable-libedit --with-libedit-dir=${LOCALBASE}
LIBEDIT_USES= libedit
RDOC_CONFIGURE_ENABLE= install-rdoc
READLINE_BUILD_DEPENDS= readline>=0:devel/readline
READLINE_CONFIGURE_ON= --disable-libedit --with-readline-dir=${LOCALBASE}
READLINE_RUN_DEPENDS= readline>=0:devel/readline
CPE_VENDOR= ruby-lang
CPE_VERSION= ${RUBY_RELVERSION}
CPE_UPDATE= p${RUBY_PATCHLEVEL}
.include <bsd.port.pre.mk>
# PORTREVISION/PORTEPOCH hack
.if ${PORTREVISION} != 0
_SUF1= _${PORTREVISION}
.endif
.if ${PORTEPOCH} != 0
_SUF2= ,${PORTEPOCH}
.endif
.if ${OPSYS} == "FreeBSD"
.if exists(/usr/sbin/dtrace) && (${OSVERSION} > 1100032) && (${ARCH} == "amd64" || ${ARCH} == "i386")
CONFIGURE_ARGS+=--enable-dtrace
.else
CONFIGURE_ARGS+=--disable-dtrace
.endif
.endif
.if (${ARCH} == "powerpc64" || ${ARCH} == "powerpc")
USE_GCC= yes
.endif
.if ${ARCH} == "armv6" || ${ARCH} == "armv6hf"
CONFIGURE_ARGS+=--with-setjmp-type=_setjmp
CONFIGURE_ENV+= ac_cv_func__setjmp=yes
.endif
.if ${RUBY_VER} == ${RUBY_DEFAULT_VER}
MLINKS= ${RUBY_NAME}.1 ruby.1
PLIST_SUB+= IF_DEFAULT=""
.else
PKGNAMESUFFIX= ${RUBY_VER:C/\.//}
PLIST_SUB+= IF_DEFAULT="@comment "
.endif
INSTALLED_SCRIPTS= irb erb rdoc ri ruby
EXTSAMPLES= bigdecimal/sample/*.rb
EXTDOCS= readline/README \
ripper/README \
stringio/README.md \
syslog/syslog.txt
# Macros to change variables in rbconfig.rb
RB_SET_CONF_VAR=${SH} -c '${REINPLACE_CMD} -E -e "s,(CONFIG\[\"$$0\"\][[:space:]]*=[[:space:]]*)(\(?)(.*)(\)?),\1\2$$1\4," ${WRKSRC}/rbconfig.rb' --
post-patch:
@${FIND} ${WRKSRC}/ -name "*.orig" -delete
# We get these from other ports
.for d in bin/rake doc/rake lib/rake test/rake man/rake.1 lib/rake.rb ext/win32ole bin/gem
@${RM} -r ${BUILD_WRKSRC}/${d}
.endfor
# Used by databases/ruby-gdbm port
@${MV} ${BUILD_WRKSRC}/ext/gdbm ${WRKDIR}/
post-build:
#
# Hack to allow modules to be installed into separate PREFIX and/or under user
# privilegies
#
@${RB_SET_CONF_VAR} "prefix" "ENV['PREFIX'] || \3"
@${RB_SET_CONF_VAR} "INSTALL" "'/usr/bin/install -c'"
@${RB_SET_CONF_VAR} "INSTALL_PROGRAM" "ENV['RB_USER_INSTALL'] ? '${INSTALL} ${COPY} ${STRIP} -m ${BINMODE}' : '${INSTALL_PROGRAM}'"
@${RB_SET_CONF_VAR} "INSTALL_SCRIPT" "ENV['RB_USER_INSTALL'] ? '${INSTALL} ${COPY} -m ${BINMODE}' : '${INSTALL_SCRIPT}'"
@${RB_SET_CONF_VAR} "INSTALL_DATA" "ENV['RB_USER_INSTALL'] ? '${INSTALL} ${COPY} -m ${SHAREMODE}' : '${INSTALL_DATA}'"
post-build-CAPIDOCS-on:
@${FIND} ${WRKSRC}/doc -type d -empty -delete
pre-install:
${MKDIR} ${STAGEDIR}${RUBY_SITEARCHLIBDIR}
${MKDIR} ${STAGEDIR}${RUBY_VENDORARCHLIBDIR}
pre-install-DOCS-on:
${MKDIR} ${STAGEDIR}${RUBY_DOCDIR}
pre-install-EXAMPLES-on:
${MKDIR} ${STAGEDIR}${RUBY_EXAMPLESDIR}
pre-install-RDOC-on:
${MKDIR} ${STAGEDIR}${RUBY_RIDIR}
${MKDIR} ${STAGEDIR}${RUBY_SITERIDIR}
post-install:
#
# Link just installed "ruby" to "ruby24", etc.
#
.if ${RUBY_VER} == ${RUBY_DEFAULT_VER}
. for FILE in ${INSTALLED_SCRIPTS}
${LN} -fs ${FILE}${RUBY_SUFFIX} ${STAGEDIR}${PREFIX}/bin/${FILE}
. endfor
.endif
post-install-DEBUG-off:
#
# XXX: hack to strip ruby binary. Ruby uses its own install script that seems
# bogus to hack.
#
.if defined(STRIP) && ${STRIP} == -s
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${RUBY_NAME}
${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libruby${RUBY_SHLIBVER}.so.${RUBY_SHLIBVER}
${FIND} ${STAGEDIR}${RUBY_ARCHLIBDIR} -type f -name '*\.so' -exec ${STRIP_CMD} {} \;
.endif
post-install-DOCS-on:
# Create all dirs required (":u" isn't avaiable in STABLE yet :-()
${MKDIR} ${EXTDOCS:C|^([^/]+)/.*|\1|:S|^|${STAGEDIR}${RUBY_DOCDIR}/|}
.for FILE in ${EXTDOCS}
${INSTALL_DATA} ${WRKSRC}/ext/${FILE} \
${STAGEDIR}${RUBY_DOCDIR}/${FILE:C|^([^/]+)/.*|\1|}/
.endfor
@(cd ${WRKSRC}/doc/ && ${COPYTREE_SHARE} \* ${STAGEDIR}${RUBY_DOCDIR}/)
${INSTALL_DATA} ${WRKSRC}/COPYING* \
${WRKSRC}/ChangeLog \
${WRKSRC}/LEGAL \
${WRKSRC}/README* \
${STAGEDIR}${RUBY_DOCDIR}/
post-install-EXAMPLES-on:
# Create all dirs required (":u" isn't avaiable in STABLE yet :-()
${MKDIR} ${EXTSAMPLES:C|^([^/]+)/.*|\1|:S|^|${STAGEDIR}${RUBY_EXAMPLESDIR}/|}
.for FILE in ${EXTSAMPLES}
${INSTALL_DATA} ${WRKSRC}/ext/${FILE} \
${STAGEDIR}${RUBY_EXAMPLESDIR}/${FILE:C|^([^/]+)/.*|\1|}/
.endfor
(cd ${WRKSRC}/sample/ && ${COPYTREE_SHARE} . ${STAGEDIR}${RUBY_EXAMPLESDIR}/)
do-test:
cd ${WRKSRC} && ${MAKE_CMD} test
.include <bsd.port.post.mk>

3
lang/ruby24/distinfo Normal file
View File

@ -0,0 +1,3 @@
TIMESTAMP = 1482736961
SHA256 (ruby/ruby-2.4.0.tar.xz) = 3a87fef45cba48b9322236be60c455c13fd4220184ce7287600361319bb63690
SIZE (ruby/ruby-2.4.0.tar.xz) = 9906880

View File

@ -0,0 +1,11 @@
--- lib/mkmf.rb.orig 2015-12-16 09:25:48 UTC
+++ lib/mkmf.rb
@@ -235,7 +235,7 @@ module MakeMakefile
end
$extmk ||= false
if not $extmk and File.exist?(($hdrdir = RbConfig::CONFIG["rubyhdrdir"]) + "/ruby/ruby.h")
- $topdir = $hdrdir
+ $topdir = $hdrdir + "/" + "#{CONFIG['arch']}/ruby/"
$top_srcdir = $hdrdir
$arch_hdrdir = RbConfig::CONFIG["rubyarchhdrdir"]
elsif File.exist?(($hdrdir = ($top_srcdir ||= topdir) + "/include") + "/ruby.h")

View File

@ -0,0 +1,14 @@
--- tool/mkconfig.rb.orig 2015-12-09 20:53:21 UTC
+++ tool/mkconfig.rb
@@ -168,8 +168,9 @@ def vars.expand(val, config = self)
val.replace(newval) unless newval == val
val
end
-prefix = vars.expand(vars["prefix"] ||= "")
-rubyarchdir = vars.expand(vars["rubyarchdir"] ||= "")
+prefix = vars.expand(vars["rubyarchdir"])
+major, minor, *rest = RUBY_VERSION.split('.')
+rubyarchdir = "/lib/ruby/#{major}.#{minor}/#{arch}"
relative_archdir = rubyarchdir.rindex(prefix, 0) ? rubyarchdir[prefix.size..-1] : rubyarchdir
puts %[\
# frozen-string-literal: false

View File

@ -0,0 +1,130 @@
--- tool/rbinstall.rb.orig 2016-10-17 07:17:07.000000000 +0000
+++ tool/rbinstall.rb 2016-12-13 14:55:27.945769000 +0000
@@ -324,6 +324,7 @@
libdir = CONFIG[CONFIG.fetch("libdirname", "libdir"), true]
rubyhdrdir = CONFIG["rubyhdrdir", true]
archhdrdir = CONFIG["rubyarchhdrdir"] || (rubyhdrdir + "/" + CONFIG['arch'])
+libdatadir = CONFIG["prefix", true] + "/" + "libdata"
rubylibdir = CONFIG["rubylibdir", true]
archlibdir = CONFIG["rubyarchdir", true]
sitelibdir = CONFIG["sitelibdir"]
@@ -378,7 +379,7 @@
install?(:local, :arch, :data) do
pc = CONFIG["ruby_pc"]
if pc and File.file?(pc) and File.size?(pc)
- prepare "pkgconfig data", pkgconfigdir = File.join(libdir, "pkgconfig")
+ prepare "pkgconfig data", pkgconfigdir = File.join(libdatadir, "pkgconfig")
install pc, pkgconfigdir, :mode => $data_mode
end
end
@@ -694,110 +695,6 @@
# :startdoc:
-install?(:ext, :comm, :gem) do
- gem_dir = Gem.default_dir
- directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode)
- prepare "default gems", gem_dir, directories
-
- spec_dir = File.join(gem_dir, directories.grep(/^spec/)[0])
- default_spec_dir = "#{spec_dir}/default"
- makedirs(default_spec_dir)
-
- gems = Dir.glob(srcdir+"/{lib,ext}/**/*.gemspec").map {|src|
- spec = Gem::Specification.load(src) || raise("invalid spec in #{src}")
- file_collector = RbInstall::Specs::FileCollector.new(File.dirname(src))
- files = file_collector.collect
- next if files.empty?
- spec.files = files
- spec
- }
- gems.compact.sort_by(&:name).each do |gemspec|
- full_name = "#{gemspec.name}-#{gemspec.version}"
-
- puts "#{" "*30}#{gemspec.name} #{gemspec.version}"
- gemspec_path = File.join(default_spec_dir, "#{full_name}.gemspec")
- open_for_install(gemspec_path, $data_mode) do
- gemspec.to_ruby
- end
-
- unless gemspec.executables.empty? then
- bin_dir = File.join(gem_dir, 'gems', full_name, gemspec.bindir)
- makedirs(bin_dir)
-
- execs = gemspec.executables.map {|exec| File.join(srcdir, 'bin', exec)}
- install(execs, bin_dir, :mode => $script_mode)
- end
- end
-end
-
-install?(:ext, :comm, :gem) do
- gem_dir = Gem.default_dir
- directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode)
- prepare "bundle gems", gem_dir, directories
- install_dir = with_destdir(gem_dir)
- installed_gems = {}
- options = {
- :install_dir => install_dir,
- :bin_dir => with_destdir(bindir),
- :domain => :local,
- :ignore_dependencies => true,
- :dir_mode => $dir_mode,
- :data_mode => $data_mode,
- :prog_mode => $prog_mode,
- :wrappers => true,
- :format_executable => true,
- }
- gem_ext_dir = "#$extout/gems/#{CONFIG['arch']}"
- extensions_dir = Gem::StubSpecification.gemspec_stub("", gem_dir, gem_dir).extensions_dir
- Gem::Specification.each_gemspec([srcdir+'/gems/*']) do |path|
- dir = File.dirname(path)
- spec = Dir.chdir(dir) {
- Gem::Specification.load(File.basename(path))
- }
- next unless spec.platform == Gem::Platform::RUBY
- next unless spec.full_name == path[srcdir.size..-1][/\A\/gems\/([^\/]+)/, 1]
- spec.extension_dir = "#{extensions_dir}/#{spec.full_name}"
- if File.directory?(ext = "#{gem_ext_dir}/#{spec.full_name}")
- spec.extensions[0] ||= "-"
- end
- ins = RbInstall::UnpackedInstaller.new(spec, options)
- puts "#{" "*30}#{spec.name} #{spec.version}"
- ins.install
- File.chmod($data_mode, File.join(install_dir, "specifications", "#{spec.full_name}.gemspec"))
- unless spec.extensions.empty?
- install_recursive(ext, spec.extension_dir)
- end
- installed_gems[spec.full_name] = true
- end
- installed_gems, gems = Dir.glob(srcdir+'/gems/*.gem').partition {|gem| installed_gems.key?(File.basename(gem, '.gem'))}
- unless installed_gems.empty?
- install installed_gems, gem_dir+"/cache"
- end
- next if gems.empty?
- if defined?(Zlib)
- Gem.instance_variable_set(:@ruby, with_destdir(File.join(bindir, ruby_install_name)))
- silent = Gem::SilentUI.new
- gems.each do |gem|
- inst = Gem::Installer.new(gem, options)
- inst.spec.extension_dir = with_destdir(inst.spec.extension_dir)
- begin
- Gem::DefaultUserInteraction.use_ui(silent) {inst.install}
- rescue Gem::InstallError => e
- next
- end
- gemname = File.basename(gem)
- puts "#{" "*30}#{gemname}"
- end
- # fix directory permissions
- # TODO: Gem.install should accept :dir_mode option or something
- File.chmod($dir_mode, *Dir.glob(install_dir+"/**/"))
- # fix .gemspec permissions
- File.chmod($data_mode, *Dir.glob(install_dir+"/specifications/*.gemspec"))
- else
- puts "skip installing bundle gems because of lacking zlib"
- end
-end
-
parse_args()
include FileUtils

19
lang/ruby24/pkg-descr Normal file
View File

@ -0,0 +1,19 @@
Ruby is the interpreted scripting language for quick and
easy object-oriented programming. It has many features to
process text files and to do system management tasks (as in
Perl). It is simple, straight-forward, and extensible.
Features of Ruby are shown below.
+ Simple Syntax
+ *Normal* Object-Oriented features(ex. class, method calls)
+ *Advanced* Object-Oriented features(ex. Mix-in, Singleton-method)
+ Operator Overloading
+ Exception Handling
+ Iterators and Closures
+ Garbage Collection
+ Dynamic Loading of Object files(on some architecture)
+ Highly Portable(works on many UNIX machines, and on DOS,
Windows, Mac, BeOS etc.)
WWW: http://www.ruby-lang.org/en/

14
lang/ruby24/pkg-message Normal file
View File

@ -0,0 +1,14 @@
====
Some of the standard commands are provided as separate ports for ease
of upgrading:
devel/ruby-gems: gem - RubyGems package manager
devel/rubygem-rake: rake - Ruby Make
And some of the standard libraries are provided as separate ports
since they require extra dependencies:
databases/ruby-gdbm: GDBM module
Install them as occasion demands.
====

17603
lang/ruby24/pkg-plist Normal file

File diff suppressed because it is too large Load Diff