1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-20 00:21:35 +00:00

Add ruby25 2.5.0 (copied from ruby24)

This commit is contained in:
Sunpoet Po-Chuan Hsieh 2017-12-27 19:51:11 +00:00
parent 95ad0a601c
commit 5d8d3b7c8d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=457387
11 changed files with 18094 additions and 2 deletions

View File

@ -180,13 +180,23 @@ RUBY_PORTEPOCH= 1
RUBY_PATCHLEVEL= 0
RUBY24= "" # PLIST_SUB helpers
. elif ${RUBY_VER} == 2.5
#
# Ruby 2.5
#
RUBY_RELVERSION= 2.5.0
RUBY_PORTREVISION= 0
RUBY_PORTEPOCH= 1
RUBY_PATCHLEVEL= 0
RUBY25= "" # 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.2, 2.3 and 2.4 are supported
IGNORE= Only ruby 2.2, 2.3, 2.4 and 2.5 are supported
_INVALID_RUBY_VER= 1
. endif
.endif # defined(RUBY_VER)
@ -196,6 +206,7 @@ _INVALID_RUBY_VER= 1
RUBY22?= "@comment "
RUBY23?= "@comment "
RUBY24?= "@comment "
RUBY25?= "@comment "
.if defined(BROKEN_RUBY${RUBY_VER:R}${RUBY_VER:E})
.if ${BROKEN_RUBY${RUBY_VER:R}${RUBY_VER:E}} == "yes"
@ -312,7 +323,8 @@ PLIST_SUB+= ${PLIST_RUBY_DIRS:C,DIR="(${LOCALBASE}|${PREFIX})/,DIR=",} \
RUBY_DEFAULT_SUFFIX="${RUBY_DEFAULT_SUFFIX}" \
RUBY22=${RUBY22} \
RUBY23=${RUBY23} \
RUBY24=${RUBY24}
RUBY24=${RUBY24} \
RUBY25=${RUBY25}
.if defined(USE_RUBY_RDOC)
MAKE_ENV+= RUBY_RDOC=${RUBY_RDOC}

View File

@ -302,6 +302,7 @@
SUBDIR += ruby22
SUBDIR += ruby23
SUBDIR += ruby24
SUBDIR += ruby25
SUBDIR += runawk
SUBDIR += rust
SUBDIR += rust-nightly

216
lang/ruby25/Makefile Normal file
View File

@ -0,0 +1,216 @@
# 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= 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
USE_LDCONFIG= yes
USES= autoreconf cpe ssl tar:xz
WRKSRC= ${RUBY_WRKSRC}
RUBY_VER= 2.5
USE_RUBY= yes
RUBY_NO_BUILD_DEPENDS= yes
RUBY_NO_RUN_DEPENDS= yes
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>=1.8.13,2: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_CONFIGURE_ON= --disable-libedit --with-readline-dir=${LOCALBASE}
READLINE_USES= readline:port
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
# keep in sync with all platforms where libunwind is available
.if (${ARCH} == amd64 || ${ARCH} == i386)
LIB_DEPENDS+= libunwind.so:devel/libunwind
.endif
.if (${ARCH} == powerpc || ${ARCH} == powerpc64)
USE_GCC= yes
.endif
.if ${ARCH} == armv6 || ${ARCH} == armv7
CONFIGURE_ARGS+=--with-setjmp-type=_setjmp
CONFIGURE_ENV+= ac_cv_func__setjmp=yes
.endif
.if ${PORT_OPTIONS:MCAPIDOCS}
MAKE_JOBS_UNSAFE= 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 "ruby25", 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/ruby25/distinfo Normal file
View File

@ -0,0 +1,3 @@
TIMESTAMP = 1514299252
SHA256 (ruby/ruby-2.5.0.tar.xz) = 1da0afed833a0dab94075221a615c14487b05d0c407f991c8080d576d985b49b
SIZE (ruby/ruby-2.5.0.tar.xz) = 11292472

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,20 @@
--- ./lib/rdoc/generator/json_index.rb.orig 2017-11-12 19:37:25.144883000 -0500
+++ ./lib/rdoc/generator/json_index.rb 2017-11-12 19:37:44.551836000 -0500
@@ -175,7 +175,7 @@
debug_msg "Writing gzipped search index to %s" % outfile
Zlib::GzipWriter.open(outfile) do |gz|
- gz.mtime = File.mtime(search_index_file)
+ gz.mtime = 1
gz.orig_name = search_index_file.basename.to_s
gz.write search_index
gz.close
@@ -193,7 +193,7 @@
debug_msg "Writing gzipped file to %s" % outfile
Zlib::GzipWriter.open(outfile) do |gz|
- gz.mtime = File.mtime(dest)
+ gz.mtime = 1
gz.orig_name = dest.basename.to_s
gz.write data
gz.close

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,156 @@
--- tool/rbinstall.rb.orig 2017-10-30 05:45:20 UTC
+++ tool/rbinstall.rb
@@ -325,6 +325,7 @@ bindir = CONFIG["bindir", true]
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 @@ end
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
@@ -699,136 +700,6 @@ end
# :startdoc:
-install?(:ext, :comm, :gem, :'default-gems', :'default-gems-comm') do
- install_default_gem('lib', srcdir)
-end
-install?(:ext, :arch, :gem, :'default-gems', :'default-gems-arch') do
- install_default_gem('ext', srcdir) do |path|
- # assume that gemspec and extconf.rb are placed in the same directory
- success = false
- begin
- IO.foreach(File.dirname(path[(srcdir.size+1)..-1]) + "/Makefile") do |l|
- break success = true if /^TARGET\s*=/ =~ l
- end
- rescue Errno::ENOENT
- end
- success
- end
-end
-
-def load_gemspec(file)
- code = File.read(file, encoding: "utf-8:-")
- code.gsub!(/`git.*?`/m, '""')
- begin
- spec = eval(code, binding, file)
- rescue SignalException, SystemExit
- raise
- rescue SyntaxError, Exception
- end
- raise("invalid spec in #{file}") unless spec
- spec.loaded_from = file
- spec
-end
-
-def install_default_gem(dir, srcdir)
- gem_dir = Gem.default_dir
- directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode)
- prepare "default gems from #{dir}", 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}/#{dir}/**/*.gemspec").map {|src|
- next if block_given? and !yield(src)
- load_gemspec(src)
- }
- gems.compact.sort_by(&:name).each do |gemspec|
- full_name = "#{gemspec.name}-#{gemspec.version}"
-
- puts "#{INDENT}#{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)
-
- gemspec.executables.map {|exec|
- $script_installer.install(File.join(srcdir, 'bin', exec),
- File.join(bin_dir, exec))
- }
- end
- end
-end
-
-install?(:ext, :comm, :gem, :'bundled-gems') do
- gem_dir = Gem.default_dir
- directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode)
- prepare "bundled 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|
- spec = load_gemspec(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 "#{INDENT}#{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 "#{INDENT}#{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 bundled gems because of lacking zlib"
- end
-end
-
parse_args()
include FileUtils

19
lang/ruby25/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: https://www.ruby-lang.org/en/

14
lang/ruby25/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.
====

17626
lang/ruby25/pkg-plist Normal file

File diff suppressed because it is too large Load Diff