[dev-libs/Ice] bump to ruby 2.7; 3.7 is untested.

This commit is contained in:
Robert Förster 2020-07-17 13:51:01 +02:00
parent 83c59871c8
commit 7defcc765e
3 changed files with 78 additions and 60 deletions

View File

@ -1,12 +1,12 @@
# Copyright 1999-2019 Gentoo Authors # Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
EAPI=7 EAPI=7
PYTHON_COMPAT=( python3_{6,7,8,9} ) PYTHON_COMPAT=( python3_{7..9} )
RUBY_OPTIONAL="yes" RUBY_OPTIONAL="yes"
USE_RUBY="ruby26" USE_RUBY="ruby27"
PHP_EXT_NAME="IcePHP" PHP_EXT_NAME="IcePHP"
PHP_EXT_INI="yes" PHP_EXT_INI="yes"
@ -41,7 +41,7 @@ RDEPEND=">=dev-libs/expat-2.0.1
) )
dev-cpp/libmcpp dev-cpp/libmcpp
python? ( ${PYTHON_DEPS} ) python? ( ${PYTHON_DEPS} )
ruby? ( $(ruby_implementation_depend ruby26) ) ruby? ( $(ruby_implementation_depend ruby27) )
mono? ( dev-lang/mono )" mono? ( dev-lang/mono )"
DEPEND="${RDEPEND} DEPEND="${RDEPEND}
readline? ( sys-libs/readline:0= ) readline? ( sys-libs/readline:0= )
@ -58,8 +58,8 @@ PHP_EXT_S="${S}/php"
PATCHES=( PATCHES=(
"${FILESDIR}/${PN}-3.6.3-no-arch-opts.patch" "${FILESDIR}/${PN}-3.6.3-no-arch-opts.patch"
"${FILESDIR}/${PN}-3.6.5-db6.patch" "${FILESDIR}/${P}-db6.patch"
"${FILESDIR}/${PN}-3.6.5-csharp.patch" "${FILESDIR}/${P}-csharp.patch"
) )
pkg_setup() { pkg_setup() {
@ -159,25 +159,25 @@ src_configure() {
fi fi
if use ruby; then if use ruby; then
SITERUBY="$(ruby26 -r rbconfig -e 'print RbConfig::CONFIG["sitelibdir"]')" SITERUBY="$(ruby27 -r rbconfig -e 'print RbConfig::CONFIG["sitelibdir"]')"
SITERUBYARCH="$(ruby26 -r rbconfig -e 'print RbConfig::CONFIG["sitearchdir"]')" SITERUBYARCH="$(ruby27 -r rbconfig -e 'print RbConfig::CONFIG["sitearchdir"]')"
MAKE_RULES_RUBY=( MAKE_RULES_RUBY=(
"install_rubydir=\"${ED}/${SITERUBY}\"" "install_rubydir=\"${ED}/${SITERUBY}\""
"install_libdir=\"${ED}/${SITERUBYARCH}\"" "install_libdir=\"${ED}/${SITERUBYARCH}\""
) )
# make it use ruby26 only # make it use ruby27 only
sed -i \ sed -i \
-e 's|RUBY = ruby|\026|' \ -e 's|RUBY = ruby|\027|' \
ruby/config/Make.rules || die ruby/config/Make.rules || die
sed -i \ sed -i \
-e 's|env ruby|\026|' \ -e 's|env ruby|\027|' \
ruby/config/s2rb.rb || die ruby/config/s2rb.rb || die
sed -i \ sed -i \
-e 's|env ruby|\026|' \ -e 's|env ruby|\027|' \
ruby/scripts/slice2rb || die ruby/scripts/slice2rb || die
sed -i \ sed -i \
-e 's|output.write("ruby|\026|' \ -e 's|output.write("ruby|\027|' \
scripts/TestUtil.py || die scripts/TestUtil.py || die
fi fi

View File

@ -3,10 +3,10 @@
EAPI=7 EAPI=7
PYTHON_COMPAT=( python3_{7,8,9} ) PYTHON_COMPAT=( python3_{7..9} )
RUBY_OPTIONAL="yes" RUBY_OPTIONAL="yes"
USE_RUBY="ruby26" USE_RUBY="ruby27"
PHP_EXT_NAME="IcePHP" PHP_EXT_NAME="IcePHP"
PHP_EXT_INI="yes" PHP_EXT_INI="yes"
@ -46,7 +46,7 @@ RDEPEND=">=dev-libs/expat-2.0.1
) )
dev-cpp/libmcpp dev-cpp/libmcpp
python? ( ${PYTHON_DEPS} ) python? ( ${PYTHON_DEPS} )
ruby? ( $(ruby_implementation_depend ruby26) ) ruby? ( $(ruby_implementation_depend ruby27) )
mono? ( dev-lang/mono )" mono? ( dev-lang/mono )"
DEPEND="${RDEPEND} DEPEND="${RDEPEND}
readline? ( sys-libs/readline:0= ) readline? ( sys-libs/readline:0= )
@ -164,25 +164,25 @@ src_configure() {
fi fi
if use ruby; then if use ruby; then
SITERUBY="$(ruby26 -r rbconfig -e 'print RbConfig::CONFIG["sitelibdir"]')" SITERUBY="$(ruby27 -r rbconfig -e 'print RbConfig::CONFIG["sitelibdir"]')"
SITERUBYARCH="$(ruby26 -r rbconfig -e 'print RbConfig::CONFIG["sitearchdir"]')" SITERUBYARCH="$(ruby27 -r rbconfig -e 'print RbConfig::CONFIG["sitearchdir"]')"
MAKE_RULES_RUBY=( MAKE_RULES_RUBY=(
"install_rubydir=\"${ED}/${SITERUBY}\"" "install_rubydir=\"${ED}/${SITERUBY}\""
"install_libdir=\"${ED}/${SITERUBYARCH}\"" "install_libdir=\"${ED}/${SITERUBYARCH}\""
) )
# make it use ruby26 only # make it use ruby27 only
sed -i \ sed -i \
-e 's|RUBY = ruby|\026|' \ -e 's|RUBY = ruby|\027|' \
ruby/config/Make.rules || die ruby/config/Make.rules || die
sed -i \ sed -i \
-e 's|env ruby|\026|' \ -e 's|env ruby|\027|' \
ruby/config/s2rb.rb || die ruby/config/s2rb.rb || die
sed -i \ sed -i \
-e 's|env ruby|\026|' \ -e 's|env ruby|\027|' \
ruby/scripts/slice2rb || die ruby/scripts/slice2rb || die
sed -i \ sed -i \
-e 's|output.write("ruby|\026|' \ -e 's|output.write("ruby|\027|' \
scripts/TestUtil.py || die scripts/TestUtil.py || die
fi fi

View File

@ -1,9 +1,9 @@
# Copyright 1999-2019 Gentoo Authors # Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
EAPI=7 EAPI=7
PYTHON_COMPAT=( python3_{7,8,9} ) PYTHON_COMPAT=( python3_{7..9} )
RUBY_OPTIONAL="yes" RUBY_OPTIONAL="yes"
USE_RUBY="ruby27" USE_RUBY="ruby27"
@ -29,6 +29,7 @@ SLOT="0/37"
KEYWORDS="" KEYWORDS=""
# XXX: readline # XXX: readline
IUSE="debug examples libressl php python ruby test" IUSE="debug examples libressl php python ruby test"
RESTRICT="test"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
RDEPEND=">=dev-libs/expat-2.0.1 RDEPEND=">=dev-libs/expat-2.0.1
@ -38,7 +39,7 @@ RDEPEND=">=dev-libs/expat-2.0.1
dev-db/lmdb dev-db/lmdb
dev-cpp/libmcpp dev-cpp/libmcpp
python? ( ${PYTHON_DEPS} ) python? ( ${PYTHON_DEPS} )
ruby? ( $(ruby_implementation_depend ruby26) )" ruby? ( $(ruby_implementation_depend ruby27) )"
DEPEND="${RDEPEND} DEPEND="${RDEPEND}
test? ( test? (
${PYTHON_DEPS} ${PYTHON_DEPS}
@ -48,7 +49,7 @@ DEPEND="${RDEPEND}
# Maintainer notes: # Maintainer notes:
# TODO: java bindings # TODO: java bindings
S="${WORKDIR}/${PN}" #S="${WORKDIR}/${P,}"
PHP_EXT_S="${S}/php" PHP_EXT_S="${S}/php"
pkg_setup() { pkg_setup() {
@ -65,22 +66,32 @@ src_prepare() {
default default
sed -i \ sed -i \
-e 's|-O2 ||g' \ -e 's|-L\$\(libdir\)||' \
cpp/config/Make.rules || die
sed -i \
-e 's|-Werror ||g' \ -e 's|-Werror ||g' \
config/Make.rules.Linux || die "sed failed" cpp/config/Make.rules.Linux || die
# IceUtil/stacktrace fails with USE=debug
# skip udp test due to multicast # skip udp test due to multicast
# skip IceGrid/admin bug #649850
# skip IceSSL tests due to requirement of internet connection # skip IceSSL tests due to requirement of internet connection
# IceGrid/admin fails, no idea why # skip IceStorm/single bug #636834
# sed -i \ # IceUtil/stacktrace and IceStorm/stress fail with USE=debug
# -e 's|allTests.py|allTests.py --rfilter=IceUtil\/stacktrace --rfilter=udp --rfilter=IceSSL --rfilter=IceGrid\/admin|' \ # Glacier2/staticFiltering requires network access
# cpp/Makefile || die "sed failed" sed -i \
-e 's|allTests.py|allTests.py --rfilter=udp --rfilter=IceGrid\/admin --rfilter=IceSSL --rfilter=IceStorm\/single --rfilter=IceStorm\/stress --rfilter=IceUtil\/stacktrace --rfilter=Glacier2\/staticFiltering|' \
cpp/Makefile || die
# mainly broken .ice files # fails even on unicode locale
# sed -i \ sed -i \
# -e 's|allTests.py|allTests.py --rfilter=operations --rfilter=slicing\/objects|' \ -e 's|allTests.py|allTests.py --rfilter=Slice\/unicodePaths|' \
# python/Makefile || die "sed failed" ruby/Makefile || die
# fix for x86 IceBox test
sed -i \
-e 's|"32"|""|' \
scripts/TestUtil.py || die
} }
src_configure() { src_configure() {
@ -88,13 +99,19 @@ src_configure() {
"prefix=\"${ED}/usr\"" "prefix=\"${ED}/usr\""
"install_docdir=\"${ED}/usr/share/doc/${PF}\"" "install_docdir=\"${ED}/usr/share/doc/${PF}\""
"install_configdir=\"${ED}/usr/share/${P}/config\"" "install_configdir=\"${ED}/usr/share/${P}/config\""
"install_mandir=\"${ED}/usr/share/man\"" "install_mandir=\"${ED}/usr/share/man/man1\""
"embedded_runpath_prefix=\"${EPREFIX}/usr\"" "embedded_runpath_prefix=\"${EPREFIX}/usr\""
"new_dtags=yes" "new_dtags=yes"
"OPTIMIZE=$(usex !debug)" "OPTIMIZE=$(usex !debug)"
"V=1"
) )
sed -i \
-e "s|g++|$(tc-getCXX)|" \
-e "s|\(CFLAGS[[:space:]]*=\)|\1 ${CFLAGS}|" \
-e "s|\(CXXFLAGS[[:space:]]*=\)|\1 ${CXXFLAGS}|" \
-e "s|\(LDFLAGS[[:space:]]*=\)|\1 ${LDFLAGS}|" \
cpp/config/Make.rules{,.Linux} python/config/Make.rules || die
if use python; then if use python; then
local S="${S}/python" local S="${S}/python"
python_copy_sources python_copy_sources
@ -105,26 +122,31 @@ src_configure() {
SITERUBYARCH="$(ruby27 -r rbconfig -e 'print RbConfig::CONFIG["sitearchdir"]')" SITERUBYARCH="$(ruby27 -r rbconfig -e 'print RbConfig::CONFIG["sitearchdir"]')"
MAKE_RULES_RUBY=( MAKE_RULES_RUBY=(
"install_rubydir=\"${ED}/${SITERUBY}\"" "install_rubydir=\"${ED}/${SITERUBY}\""
"install_rubylibdir=\"${ED}/${SITERUBYARCH}\"" "install_libdir=\"${ED}/${SITERUBYARCH}\""
) )
# make it use ruby27 only # make it use ruby27 only
sed -i \ sed -i \
-e 's|RUBY = ruby|\027|' \ -e 's|RUBY = ruby|\027|' \
ruby/config/Make.rules || die "sed failed" ruby/config/Make.rules || die
sed -i \ sed -i \
-e 's|env ruby|\027|' \ -e 's|env ruby|\027|' \
ruby/config/s2rb.rb || die "sed failed" ruby/config/s2rb.rb || die
sed -i \ sed -i \
-e 's|env ruby|\027|' \ -e 's|env ruby|\027|' \
ruby/scripts/slice2rb || die "sed failed" ruby/scripts/slice2rb || die
sed -i \
-e 's|output.write("ruby|\027|' \
scripts/TestUtil.py || die
fi fi
use test && python_setup use test && python_setup
} }
src_compile() { src_compile() {
local -x LD_LIBRARY_PATH="${S}/cpp/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}" # Do not remove this export or build will break!
tc-export CXX
emake -C cpp "${MAKE_RULES[@]}" emake -C cpp "${MAKE_RULES[@]}"
if use php; then if use php; then
@ -157,37 +179,32 @@ src_compile() {
fi fi
} }
run_tests() {
pushd "${1}" >/dev/null || die
./allTests.py
ret=${?}
popd >/dev/null || die
return ${ret}
}
src_test() { src_test() {
local -x LD_LIBRARY_PATH="${S}/cpp/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}" local -x LD_LIBRARY_PATH="${S}/cpp/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
run_tests cpp || die "emake cpp test failed" emake -C cpp "${MAKE_RULES[@]}" test
# php tests require the extension loaded and are therefore skipped # php tests require the extension loaded and are therefore skipped
if use python ; then if use python; then
testing() { testing() {
run_tests "${BUILD_DIR}" || die "emake ${BUILD_DIR} test failed" PYTHONPATH="${BUILD_DIR}"/python emake -C "${BUILD_DIR}" \
"${MAKE_RULES[@]}" \
PYTHON="${EPYTHON}" \
install_pythondir="\"${D}/$(python_get_sitedir)\"" \
install_libdir="\"${D}/$(python_get_sitedir)\"" test
} }
local S="${S}/python" local S="${S}/python"
python_foreach_impl testing python_foreach_impl testing
fi fi
if use ruby ; then if use ruby; then
run_tests ruby || die "emake ruby test failed" emake -C ruby "${MAKE_RULES[@]}" "${MAKE_RULES_RUBY[@]}" test
fi fi
} }
src_install() { src_install() {
export LD_LIBRARY_PATH="${S}/cpp/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
local DOCS=( CHANGELOG*.md README.md ) local DOCS=( CHANGELOG*.md README.md )
use doc && DOCS+=( "${DISTDIR}/${PN}-3.6.4.pdf" )
einstalldocs einstalldocs
insinto /usr/share/${P} insinto /usr/share/${P}
@ -237,6 +254,7 @@ src_install() {
emake -C "${BUILD_DIR}" \ emake -C "${BUILD_DIR}" \
"${MAKE_RULES[@]}" \ "${MAKE_RULES[@]}" \
install_pythondir="\"${D}/$(python_get_sitedir)\"" \ install_pythondir="\"${D}/$(python_get_sitedir)\"" \
install_libdir="\"${D}/$(python_get_sitedir)\"" \
install install
python_optimize python_optimize
} }