public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/ruby/, dev-lang/ruby/files/3.0/
@ 2020-12-28  7:46 Hans de Graaff
  0 siblings, 0 replies; 2+ messages in thread
From: Hans de Graaff @ 2020-12-28  7:46 UTC (permalink / raw
  To: gentoo-commits

commit:     0d1dad9e3d8b05fee719937f55b49c49d972ad19
Author:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 28 07:37:23 2020 +0000
Commit:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
CommitDate: Mon Dec 28 07:46:43 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0d1dad9e

dev-lang/ruby: add ruby 3.0.0

Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org>

 dev-lang/ruby/Manifest                             |   1 +
 .../ruby/files/3.0/010-default-gem-location.patch  |  20 ++
 dev-lang/ruby/ruby-3.0.0.ebuild                    | 262 +++++++++++++++++++++
 3 files changed, 283 insertions(+)

diff --git a/dev-lang/ruby/Manifest b/dev-lang/ruby/Manifest
index 5f4cd990dfe..a474614b377 100644
--- a/dev-lang/ruby/Manifest
+++ b/dev-lang/ruby/Manifest
@@ -1,3 +1,4 @@
 DIST ruby-2.5.8.tar.xz 11298404 BLAKE2B 3256c0448e72b63c0bd89f89a27fa9c09c8feed54d42cd79899b7d5cfe9dbc29ca708d12c630b3f52ff85b0c6a4011ae7ff0483d64b2fd445700a72a91028035 SHA512 2886be764a454425c5beef2777c64a70ee0d048b07896b327633d904f5077fea4299526689f9e2ac4dcd2fc4811cf9a6c8ce75367ed35d29dfe1a54222872e0d
 DIST ruby-2.6.6.tar.xz 11567284 BLAKE2B 45e910dd9b128c46bff3003834c4fdcbbc2e2e4d3e44f298ff4356a285de2c375d6b6021a3aa28d89336b32a1655fa4a7c086d07f4a0f6bcd578a11dd4a894da SHA512 86caf93dbf61d03781767ab5375a7edf4761f13ba08ccfefe16c0a7550499237e7390c2f72a95d42670d4fe76b2401b4218936187c62ec1572799e9e04c50d62
 DIST ruby-2.7.2.tar.xz 12037052 BLAKE2B a4ad22295b3fed4e8064fc6e77adb8642d1fa7ae1f4ef912d7bde19c735cb25b1a3e3aefba53dad944046d844d608bcefba61c314cf1e52747f50d7d91f4c436 SHA512 7972278b096aa768c7adf2befd26003e18781a29ca317640317d30d93d6e963ded197724c8e2f1dfe1e838c5647176d414a74732a62e931fb50d6f2e0f777349
+DIST ruby-3.0.0.tar.xz 14374176 BLAKE2B 9e7520e0b1ae6644285449c4ae92983d306772b3dd5366a17da709a55797c798d099424a5628c78c842b825fb336c6a769ac9c371ef276f42bf3550fd0761ebe SHA512 2a23c2894e62e24bb20cec6b2a016b66d7df05083668726b6f70af8338211cfec417aa3624290d1f5ccd130f65ee7b52b5db7d428abc4a9460459c9a5dd1a450

diff --git a/dev-lang/ruby/files/3.0/010-default-gem-location.patch b/dev-lang/ruby/files/3.0/010-default-gem-location.patch
new file mode 100644
index 00000000000..060579b4f33
--- /dev/null
+++ b/dev-lang/ruby/files/3.0/010-default-gem-location.patch
@@ -0,0 +1,20 @@
+--- a/tool/rbinstall.rb.~1~	2020-12-25 04:33:01.000000000 +0100
++++ b/tool/rbinstall.rb	2020-12-25 10:05:34.629096405 +0100
+@@ -897,7 +897,7 @@
+ end
+ 
+ def install_default_gem(dir, srcdir)
+-  gem_dir = Gem.default_dir
++  gem_dir = ENV['GEM_DESTDIR']
+   install_dir = with_destdir(gem_dir)
+   prepare "default gems from #{dir}", gem_dir
+   makedirs(Gem.ensure_default_gem_subdirectories(install_dir, $dir_mode).map {|d| File.join(gem_dir, d)})
+@@ -943,7 +943,7 @@
+ end
+ 
+ install?(:ext, :comm, :gem, :'bundled-gems') do
+-  gem_dir = Gem.default_dir
++  gem_dir = ENV['GEM_DESTDIR']
+   install_dir = with_destdir(gem_dir)
+   prepare "bundled gems", gem_dir
+   makedirs(Gem.ensure_gem_subdirectories(install_dir, $dir_mode).map {|d| File.join(gem_dir, d)})

diff --git a/dev-lang/ruby/ruby-3.0.0.ebuild b/dev-lang/ruby/ruby-3.0.0.ebuild
new file mode 100644
index 00000000000..cdedfadfa7b
--- /dev/null
+++ b/dev-lang/ruby/ruby-3.0.0.ebuild
@@ -0,0 +1,262 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools flag-o-matic multilib
+
+MY_P="${PN}-$(ver_cut 1-3)"
+S=${WORKDIR}/${MY_P}
+
+SLOT=$(ver_cut 1-2)
+MY_SUFFIX=$(ver_rs 1 '' ${SLOT})
+RUBYVERSION=${SLOT}.0
+
+DESCRIPTION="An object-oriented scripting language"
+HOMEPAGE="https://www.ruby-lang.org/"
+SRC_URI="https://cache.ruby-lang.org/pub/ruby/${SLOT}/${MY_P}.tar.xz"
+
+LICENSE="|| ( Ruby-BSD BSD-2 )"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="berkdb debug doc examples gdbm ipv6 jemalloc jit libressl +rdoc rubytests socks5 +ssl static-libs systemtap tk xemacs"
+
+RDEPEND="
+	berkdb? ( sys-libs/db:= )
+	gdbm? ( sys-libs/gdbm:= )
+	jemalloc? ( dev-libs/jemalloc )
+	jit? ( || ( sys-devel/gcc:* sys-devel/clang:* ) )
+	ssl? (
+		!libressl? ( dev-libs/openssl:0= )
+		libressl? ( dev-libs/libressl )
+	)
+	socks5? ( >=net-proxy/dante-1.1.13 )
+	systemtap? ( dev-util/systemtap )
+	tk? (
+		dev-lang/tcl:0=[threads]
+		dev-lang/tk:0=[threads]
+	)
+	dev-libs/libyaml
+	dev-libs/libffi:=
+	sys-libs/readline:0=
+	sys-libs/zlib
+	>=app-eselect/eselect-ruby-20201225
+"
+
+DEPEND="${RDEPEND}"
+
+BUNDLED_GEMS="
+	>=dev-ruby/minitest-5.14.2[ruby_targets_ruby30]
+	>=dev-ruby/power_assert-1.2.0[ruby_targets_ruby30]
+	>=dev-ruby/rake-13.0.3[ruby_targets_ruby30]
+	>=dev-ruby/rbs-1.0.0[ruby_targets_ruby30]
+	>=dev-ruby/rexml-3.2.4[ruby_targets_ruby30]
+	>=dev-ruby/rss-0.2.9[ruby_targets_ruby30]
+	>=dev-ruby/test-unit-3.3.7[ruby_targets_ruby30]
+	>=dev-ruby/typeprof-0.11.0[ruby_targets_ruby30]
+"
+
+PDEPEND="
+	${BUNDLED_GEMS}
+	virtual/rubygems[ruby_targets_ruby30]
+	>=dev-ruby/bundler-2.1.4[ruby_targets_ruby30]
+	>=dev-ruby/did_you_mean-1.5.0[ruby_targets_ruby30]
+	>=dev-ruby/json-2.5.1[ruby_targets_ruby30]
+	rdoc? ( >=dev-ruby/rdoc-6.3.0[ruby_targets_ruby30] )
+	xemacs? ( app-xemacs/ruby-modes )"
+
+src_prepare() {
+	eapply "${FILESDIR}"/"${SLOT}"/010*.patch
+
+	einfo "Unbundling gems..."
+	cd "$S"
+	# Remove bundled gems that we will install via PDEPEND, bug
+	# 539700.
+	rm -fr gems/* || die
+	touch gems/bundled_gems || die
+	# Don't install CLI tools since they will clash with the gem
+	rm -f bin/{racc,racc2y,y2racc} || die
+	sed -i -e '/executables/ s:^:#:' lib/racc/racc.gemspec || die
+
+	einfo "Removing bundled libraries..."
+	rm -fr ext/fiddle/libffi-3.2.1 || die
+
+	if use prefix ; then
+		# Fix hardcoded SHELL var in mkmf library
+		sed -i -e "s#\(SHELL = \).*#\1${EPREFIX}/bin/sh#" lib/mkmf.rb || die
+
+		if [[ ${CHOST} == *darwin* ]] ; then
+			# avoid symlink loop on Darwin (?!)
+			sed -i \
+				-e '/LIBRUBY_ALIASES=/s/lib$(RUBY_INSTALL_NAME).$(SOEXT)//' \
+				configure.ac || die
+
+			# make ar/libtool hack for Darwin work
+			sed -i \
+				-e "s/ac_cv_prog_ac_ct_AR='libtool/ac_cv_prog_AR='${CHOST}-libtool/" \
+				configure.ac || die
+		fi
+	fi
+
+	eapply_user
+
+	eautoreconf
+}
+
+src_configure() {
+	local modules= myconf=
+
+	# -fomit-frame-pointer makes ruby segfault, see bug #150413.
+	filter-flags -fomit-frame-pointer
+	# In many places aliasing rules are broken; play it safe
+	# as it's risky with newer compilers to leave it as it is.
+	append-flags -fno-strict-aliasing
+
+	# Socks support via dante
+	if use socks5 ; then
+		# Socks support can't be disabled as long as SOCKS_SERVER is
+		# set and socks library is present, so need to unset
+		# SOCKS_SERVER in that case.
+		unset SOCKS_SERVER
+	fi
+
+	# Increase GC_MALLOC_LIMIT if set (default is 8000000)
+	if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then
+		append-flags "-DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}"
+	fi
+
+	# ipv6 hack, bug 168939. Needs --enable-ipv6.
+	use ipv6 || myconf="${myconf} --with-lookup-order-hack=INET"
+
+	# Determine which modules *not* to build depending in the USE flags.
+	if ! use berkdb ; then
+		modules="${modules},dbm"
+	fi
+	if ! use gdbm ; then
+		modules="${modules},gdbm"
+	fi
+	if ! use ssl ; then
+		modules="${modules},openssl"
+	fi
+	if ! use tk ; then
+		modules="${modules},tk"
+	fi
+
+	# Provide an empty LIBPATHENV because we disable rpath but we do not
+	# need LD_LIBRARY_PATH by default since that breaks USE=multitarget
+	# #564272
+	INSTALL="${EPREFIX}/usr/bin/install -c" LIBPATHENV="" econf \
+		--program-suffix=${MY_SUFFIX} \
+		--with-soname=ruby${MY_SUFFIX} \
+		--with-readline-dir="${EPREFIX}"/usr \
+		--enable-shared \
+		--enable-pthread \
+		--disable-rpath \
+		--with-out-ext="${modules}" \
+		$(use_with jemalloc jemalloc) \
+		$(use_enable jit jit-support ) \
+		$(use_enable socks5 socks) \
+		$(use_enable systemtap dtrace) \
+		$(use_enable doc install-doc) \
+		--enable-ipv6 \
+		$(use_enable static-libs static) \
+		$(use_enable static-libs install-static-library) \
+		$(use_with static-libs static-linked-ext) \
+		$(use_enable debug) \
+		${myconf} \
+		--enable-option-checking=no
+
+	# Makefile is broken because it lacks -ldl
+	rm -rf ext/-test-/popen_deadlock || die
+}
+
+src_compile() {
+	emake V=1 EXTLDFLAGS="${LDFLAGS}" MJIT_CFLAGS="${CFLAGS}" MJIT_OPTFLAGS="" MJIT_DEBUGFLAGS=""
+}
+
+src_test() {
+	emake -j1 V=1 test
+
+	elog "Ruby's make test has been run. Ruby also ships with a make check"
+	elog "that cannot be run until after ruby has been installed."
+	elog
+	if use rubytests; then
+		elog "You have enabled rubytests, so they will be installed to"
+		elog "/usr/share/${PN}-${SLOT}/test. To run them you must be a user other"
+		elog "than root, and you must place them into a writeable directory."
+		elog "Then call: "
+		elog
+		elog "ruby${MY_SUFFIX} -C /location/of/tests runner.rb"
+	else
+		elog "Enable the rubytests USE flag to install the make check tests"
+	fi
+}
+
+src_install() {
+	# Remove the remaining bundled gems. We do this late in the process
+	# since they are used during the build to e.g. create the
+	# documentation.
+	rm -rf ext/json || die
+	rm -rf lib/bundler* lib/rdoc/rdoc.gemspec || die
+
+	# Ruby is involved in the install process, we don't want interference here.
+	unset RUBYOPT
+
+	local MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby)
+
+	LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
+
+	if [[ ${CHOST} == *darwin* ]] ; then
+		DYLD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${DYLD_LIBRARY_PATH+:}${DYLD_LIBRARY_PATH}"
+		export DYLD_LIBRARY_PATH
+	fi
+
+	RUBYLIB="${S}:${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}"
+	for d in $(find "${S}/ext" -type d) ; do
+		RUBYLIB="${RUBYLIB}:$d"
+	done
+	export LD_LIBRARY_PATH RUBYLIB
+
+	# Create directory for the default gems
+	local gem_home="${EPREFIX}/usr/$(get_libdir)/ruby/gems/${RUBYVERSION}"
+	mkdir -p "${D}/${gem_home}" || die "mkdir gem home failed"
+
+	emake V=1 DESTDIR="${D}" GEM_DESTDIR=${gem_home} install
+
+	# Remove installed rubygems and rdoc copy
+	rm -rf "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}/rubygems" || die "rm rubygems failed"
+	rm -rf "${ED}/usr/bin/"gem"${MY_SUFFIX}" || die "rm rdoc bins failed"
+	rm -rf "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}"/rdoc* || die "rm rdoc failed"
+	rm -rf "${ED}/usr/bin/"{bundle,bundler,ri,rdoc}"${MY_SUFFIX}" || die "rm rdoc bins failed"
+
+	if use doc; then
+		emake DESTDIR="${D}" GEM_DESTDIR=${gem_home} install-doc
+	fi
+
+	if use examples; then
+		dodoc -r sample
+	fi
+
+	dodoc ChangeLog NEWS.md doc/NEWS* README*
+
+	if use rubytests; then
+		pushd test
+		insinto /usr/share/${PN}-${SLOT}/test
+		doins -r .
+		popd
+	fi
+}
+
+pkg_postinst() {
+	if [[ ! -n $(readlink "${EROOT}"/usr/bin/ruby) ]] ; then
+		eselect ruby set ruby${MY_SUFFIX}
+	fi
+
+	elog
+	elog "To switch between available Ruby profiles, execute as root:"
+	elog "\teselect ruby set ruby(23|24|...)"
+	elog
+}
+
+pkg_postrm() {
+	eselect ruby cleanup
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/ruby/, dev-lang/ruby/files/3.0/
@ 2020-12-29 10:35 Hans de Graaff
  0 siblings, 0 replies; 2+ messages in thread
From: Hans de Graaff @ 2020-12-29 10:35 UTC (permalink / raw
  To: gentoo-commits

commit:     628ac95758dbf75a9008e370c032890355eca716
Author:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 29 10:34:20 2020 +0000
Commit:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
CommitDate: Tue Dec 29 10:34:57 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=628ac957

dev-lang/ruby: fix compilation with USE=socks5

Thanks to Phobos Kappa for providing the patch both to use and upstream.

Closes: https://bugs.gentoo.org/762253
Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org>

 dev-lang/ruby/files/3.0/001-socksocket-fix.patch |  15 ++
 dev-lang/ruby/ruby-3.0.0-r1.ebuild               | 262 +++++++++++++++++++++++
 2 files changed, 277 insertions(+)

diff --git a/dev-lang/ruby/files/3.0/001-socksocket-fix.patch b/dev-lang/ruby/files/3.0/001-socksocket-fix.patch
new file mode 100644
index 00000000000..1a79e25491c
--- /dev/null
+++ b/dev-lang/ruby/files/3.0/001-socksocket-fix.patch
@@ -0,0 +1,15 @@
+Fix compilation with socks5 USE flag.
+
+Patch by Phobos Kappa in https://bugs.gentoo.org/762253
+
+--- a/ext/socket/sockssocket.c	2020-12-25 05:33:01.000000000 +0200
++++ b/ext/socket/sockssocket.c	2020-12-28 15:42:50.310029778 +0200
+@@ -34,7 +34,7 @@
+ 	init = 1;
+     }
+ 
+-    return rsock_init_inetsock(sock, host, port, Qnil, Qnil, INET_SOCKS, Qnil);
++    return rsock_init_inetsock(sock, host, port, Qnil, Qnil, INET_SOCKS, Qnil, Qnil);
+ }
+ 
+ #ifdef SOCKS5

diff --git a/dev-lang/ruby/ruby-3.0.0-r1.ebuild b/dev-lang/ruby/ruby-3.0.0-r1.ebuild
new file mode 100644
index 00000000000..2ac7bec3231
--- /dev/null
+++ b/dev-lang/ruby/ruby-3.0.0-r1.ebuild
@@ -0,0 +1,262 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools flag-o-matic multilib
+
+MY_P="${PN}-$(ver_cut 1-3)"
+S=${WORKDIR}/${MY_P}
+
+SLOT=$(ver_cut 1-2)
+MY_SUFFIX=$(ver_rs 1 '' ${SLOT})
+RUBYVERSION=${SLOT}.0
+
+DESCRIPTION="An object-oriented scripting language"
+HOMEPAGE="https://www.ruby-lang.org/"
+SRC_URI="https://cache.ruby-lang.org/pub/ruby/${SLOT}/${MY_P}.tar.xz"
+
+LICENSE="|| ( Ruby-BSD BSD-2 )"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="berkdb debug doc examples gdbm ipv6 jemalloc jit libressl +rdoc rubytests socks5 +ssl static-libs systemtap tk xemacs"
+
+RDEPEND="
+	berkdb? ( sys-libs/db:= )
+	gdbm? ( sys-libs/gdbm:= )
+	jemalloc? ( dev-libs/jemalloc )
+	jit? ( || ( sys-devel/gcc:* sys-devel/clang:* ) )
+	ssl? (
+		!libressl? ( dev-libs/openssl:0= )
+		libressl? ( dev-libs/libressl )
+	)
+	socks5? ( >=net-proxy/dante-1.1.13 )
+	systemtap? ( dev-util/systemtap )
+	tk? (
+		dev-lang/tcl:0=[threads]
+		dev-lang/tk:0=[threads]
+	)
+	dev-libs/libyaml
+	dev-libs/libffi:=
+	sys-libs/readline:0=
+	sys-libs/zlib
+	>=app-eselect/eselect-ruby-20201225
+"
+
+DEPEND="${RDEPEND}"
+
+BUNDLED_GEMS="
+	>=dev-ruby/minitest-5.14.2[ruby_targets_ruby30]
+	>=dev-ruby/power_assert-1.2.0[ruby_targets_ruby30]
+	>=dev-ruby/rake-13.0.3[ruby_targets_ruby30]
+	>=dev-ruby/rbs-1.0.0[ruby_targets_ruby30]
+	>=dev-ruby/rexml-3.2.4[ruby_targets_ruby30]
+	>=dev-ruby/rss-0.2.9[ruby_targets_ruby30]
+	>=dev-ruby/test-unit-3.3.7[ruby_targets_ruby30]
+	>=dev-ruby/typeprof-0.11.0[ruby_targets_ruby30]
+"
+
+PDEPEND="
+	${BUNDLED_GEMS}
+	virtual/rubygems[ruby_targets_ruby30]
+	>=dev-ruby/bundler-2.1.4[ruby_targets_ruby30]
+	>=dev-ruby/did_you_mean-1.5.0[ruby_targets_ruby30]
+	>=dev-ruby/json-2.5.1[ruby_targets_ruby30]
+	rdoc? ( >=dev-ruby/rdoc-6.3.0[ruby_targets_ruby30] )
+	xemacs? ( app-xemacs/ruby-modes )"
+
+src_prepare() {
+	eapply "${FILESDIR}"/"${SLOT}"/{001,010}*.patch
+
+	einfo "Unbundling gems..."
+	cd "$S"
+	# Remove bundled gems that we will install via PDEPEND, bug
+	# 539700.
+	rm -fr gems/* || die
+	touch gems/bundled_gems || die
+	# Don't install CLI tools since they will clash with the gem
+	rm -f bin/{racc,racc2y,y2racc} || die
+	sed -i -e '/executables/ s:^:#:' lib/racc/racc.gemspec || die
+
+	einfo "Removing bundled libraries..."
+	rm -fr ext/fiddle/libffi-3.2.1 || die
+
+	if use prefix ; then
+		# Fix hardcoded SHELL var in mkmf library
+		sed -i -e "s#\(SHELL = \).*#\1${EPREFIX}/bin/sh#" lib/mkmf.rb || die
+
+		if [[ ${CHOST} == *darwin* ]] ; then
+			# avoid symlink loop on Darwin (?!)
+			sed -i \
+				-e '/LIBRUBY_ALIASES=/s/lib$(RUBY_INSTALL_NAME).$(SOEXT)//' \
+				configure.ac || die
+
+			# make ar/libtool hack for Darwin work
+			sed -i \
+				-e "s/ac_cv_prog_ac_ct_AR='libtool/ac_cv_prog_AR='${CHOST}-libtool/" \
+				configure.ac || die
+		fi
+	fi
+
+	eapply_user
+
+	eautoreconf
+}
+
+src_configure() {
+	local modules= myconf=
+
+	# -fomit-frame-pointer makes ruby segfault, see bug #150413.
+	filter-flags -fomit-frame-pointer
+	# In many places aliasing rules are broken; play it safe
+	# as it's risky with newer compilers to leave it as it is.
+	append-flags -fno-strict-aliasing
+
+	# Socks support via dante
+	if use socks5 ; then
+		# Socks support can't be disabled as long as SOCKS_SERVER is
+		# set and socks library is present, so need to unset
+		# SOCKS_SERVER in that case.
+		unset SOCKS_SERVER
+	fi
+
+	# Increase GC_MALLOC_LIMIT if set (default is 8000000)
+	if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then
+		append-flags "-DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}"
+	fi
+
+	# ipv6 hack, bug 168939. Needs --enable-ipv6.
+	use ipv6 || myconf="${myconf} --with-lookup-order-hack=INET"
+
+	# Determine which modules *not* to build depending in the USE flags.
+	if ! use berkdb ; then
+		modules="${modules},dbm"
+	fi
+	if ! use gdbm ; then
+		modules="${modules},gdbm"
+	fi
+	if ! use ssl ; then
+		modules="${modules},openssl"
+	fi
+	if ! use tk ; then
+		modules="${modules},tk"
+	fi
+
+	# Provide an empty LIBPATHENV because we disable rpath but we do not
+	# need LD_LIBRARY_PATH by default since that breaks USE=multitarget
+	# #564272
+	INSTALL="${EPREFIX}/usr/bin/install -c" LIBPATHENV="" econf \
+		--program-suffix=${MY_SUFFIX} \
+		--with-soname=ruby${MY_SUFFIX} \
+		--with-readline-dir="${EPREFIX}"/usr \
+		--enable-shared \
+		--enable-pthread \
+		--disable-rpath \
+		--with-out-ext="${modules}" \
+		$(use_with jemalloc jemalloc) \
+		$(use_enable jit jit-support ) \
+		$(use_enable socks5 socks) \
+		$(use_enable systemtap dtrace) \
+		$(use_enable doc install-doc) \
+		--enable-ipv6 \
+		$(use_enable static-libs static) \
+		$(use_enable static-libs install-static-library) \
+		$(use_with static-libs static-linked-ext) \
+		$(use_enable debug) \
+		${myconf} \
+		--enable-option-checking=no
+
+	# Makefile is broken because it lacks -ldl
+	rm -rf ext/-test-/popen_deadlock || die
+}
+
+src_compile() {
+	emake V=1 EXTLDFLAGS="${LDFLAGS}" MJIT_CFLAGS="${CFLAGS}" MJIT_OPTFLAGS="" MJIT_DEBUGFLAGS=""
+}
+
+src_test() {
+	emake -j1 V=1 test
+
+	elog "Ruby's make test has been run. Ruby also ships with a make check"
+	elog "that cannot be run until after ruby has been installed."
+	elog
+	if use rubytests; then
+		elog "You have enabled rubytests, so they will be installed to"
+		elog "/usr/share/${PN}-${SLOT}/test. To run them you must be a user other"
+		elog "than root, and you must place them into a writeable directory."
+		elog "Then call: "
+		elog
+		elog "ruby${MY_SUFFIX} -C /location/of/tests runner.rb"
+	else
+		elog "Enable the rubytests USE flag to install the make check tests"
+	fi
+}
+
+src_install() {
+	# Remove the remaining bundled gems. We do this late in the process
+	# since they are used during the build to e.g. create the
+	# documentation.
+	rm -rf ext/json || die
+	rm -rf lib/bundler* lib/rdoc/rdoc.gemspec || die
+
+	# Ruby is involved in the install process, we don't want interference here.
+	unset RUBYOPT
+
+	local MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby)
+
+	LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
+
+	if [[ ${CHOST} == *darwin* ]] ; then
+		DYLD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${DYLD_LIBRARY_PATH+:}${DYLD_LIBRARY_PATH}"
+		export DYLD_LIBRARY_PATH
+	fi
+
+	RUBYLIB="${S}:${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}"
+	for d in $(find "${S}/ext" -type d) ; do
+		RUBYLIB="${RUBYLIB}:$d"
+	done
+	export LD_LIBRARY_PATH RUBYLIB
+
+	# Create directory for the default gems
+	local gem_home="${EPREFIX}/usr/$(get_libdir)/ruby/gems/${RUBYVERSION}"
+	mkdir -p "${D}/${gem_home}" || die "mkdir gem home failed"
+
+	emake V=1 DESTDIR="${D}" GEM_DESTDIR=${gem_home} install
+
+	# Remove installed rubygems and rdoc copy
+	rm -rf "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}/rubygems" || die "rm rubygems failed"
+	rm -rf "${ED}/usr/bin/"gem"${MY_SUFFIX}" || die "rm rdoc bins failed"
+	rm -rf "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}"/rdoc* || die "rm rdoc failed"
+	rm -rf "${ED}/usr/bin/"{bundle,bundler,ri,rdoc}"${MY_SUFFIX}" || die "rm rdoc bins failed"
+
+	if use doc; then
+		emake DESTDIR="${D}" GEM_DESTDIR=${gem_home} install-doc
+	fi
+
+	if use examples; then
+		dodoc -r sample
+	fi
+
+	dodoc ChangeLog NEWS.md doc/NEWS* README*
+
+	if use rubytests; then
+		pushd test
+		insinto /usr/share/${PN}-${SLOT}/test
+		doins -r .
+		popd
+	fi
+}
+
+pkg_postinst() {
+	if [[ ! -n $(readlink "${EROOT}"/usr/bin/ruby) ]] ; then
+		eselect ruby set ruby${MY_SUFFIX}
+	fi
+
+	elog
+	elog "To switch between available Ruby profiles, execute as root:"
+	elog "\teselect ruby set ruby(23|24|...)"
+	elog
+}
+
+pkg_postrm() {
+	eselect ruby cleanup
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-29 10:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-28  7:46 [gentoo-commits] repo/gentoo:master commit in: dev-lang/ruby/, dev-lang/ruby/files/3.0/ Hans de Graaff
  -- strict thread matches above, loose matches on Subject: below --
2020-12-29 10:35 Hans de Graaff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox