diff options
author | Matthew Schultz (mschultz) <mattsch@gmail.com> | 2011-06-28 16:12:57 +0000 |
---|---|---|
committer | Matthew Schultz (mschultz) <mattsch@gmail.com> | 2011-06-28 16:12:57 +0000 |
commit | 529e8668bdcb39f8d8a8062a7bd3582aaa4f6ab6 (patch) | |
tree | 8a44ba815c5292cefd0b69e77838f8d98104689e /dev-libs | |
parent | media-tv/otrdecoder-bin: Version bump, added support for amd64. Thanks to mgorny (diff) | |
download | sunrise-reviewed-529e8668bdcb39f8d8a8062a7bd3582aaa4f6ab6.tar.gz sunrise-reviewed-529e8668bdcb39f8d8a8062a7bd3582aaa4f6ab6.tar.bz2 sunrise-reviewed-529e8668bdcb39f8d8a8062a7bd3582aaa4f6ab6.zip |
dev-libs/librets: Added ruby slot implemention support. Updated python patch to upstream patch. Fixed bug that caused build to fail if more than one binding was enabled. Added disable threads for certain bindings dueo to segfaults. Stopped dotnet from attempting to build if mono was installed. Thanks to binki and mgorny for the reviews.
svn path=/sunrise/; revision=12171
Diffstat (limited to 'dev-libs')
-rw-r--r-- | dev-libs/librets/ChangeLog | 8 | ||||
-rw-r--r-- | dev-libs/librets/Manifest | 6 | ||||
-rw-r--r-- | dev-libs/librets/files/python.mk.patch | 20 | ||||
-rw-r--r-- | dev-libs/librets/librets-1.5.2.ebuild | 129 |
4 files changed, 119 insertions, 44 deletions
diff --git a/dev-libs/librets/ChangeLog b/dev-libs/librets/ChangeLog index 63ef9d0b2..2d8976f05 100644 --- a/dev-libs/librets/ChangeLog +++ b/dev-libs/librets/ChangeLog @@ -2,6 +2,14 @@ # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ + 28 Jun 2011; Matthew Schultz (mschultz) <mattsch@gmail.com> + librets-1.5.2.ebuild, files/python.mk.patch: + Added ruby slot implemention support. Updated python patch to upstream + patch. Fixed bug that caused build to fail if more than one binding was + enabled. Added disable threads for certain bindings dueo to segfaults. + Stopped dotnet from attempting to build if mono was installed. Thanks to + binki and mgorny for the reviews. + 25 Jun 2011; Matthew Schultz (mschultz) <mattsch@gmail.com> +librets-1.5.2.ebuild, +files/java.mk.patch, +files/perl.mk.patch, +files/python.mk.patch, +metadata.xml: diff --git a/dev-libs/librets/Manifest b/dev-libs/librets/Manifest index 0089650f8..7b21d0920 100644 --- a/dev-libs/librets/Manifest +++ b/dev-libs/librets/Manifest @@ -1,7 +1,7 @@ AUX java.mk.patch 783 RMD160 1ba38cbea393c1646f1517665c515402a3834135 SHA1 049e24d2240fe8b3c22325f4e476afa4f901b063 SHA256 9709b787b2c55c9c390a22677fbe15d821beb588e6ccedb48e1277fff47345de AUX perl.mk.patch 1088 RMD160 7054d8bb712814434e3978c69c36ff267c102a5a SHA1 660fa197034f316aa7523a17c2a0ea065876e975 SHA256 200c4fa5f034478b406892fbac17156655be49164f46dcaba094e13745993198 -AUX python.mk.patch 758 RMD160 d6e34e296eaefe7dad02a79312c2ee2925d1bb55 SHA1 07c1a325c05c938660df975fc3340de1c12dc8fd SHA256 0f51951aeacd3be302eac03af56011bb02b1b684a1ceb3ed366d054eec143ceb +AUX python.mk.patch 501 RMD160 611578ad08ee095d4364e538e6b69e4f5727d401 SHA1 803f4678b974d87008e772115d09034fb31bb8fe SHA256 8ba69a842499dcfeaaba25ac8fb9f4723d7243293b7fba7734510bca47eb89cb DIST librets-1.5.2.tar.gz 1157546 RMD160 154a4fff9bbf994b739a1d30b3bb5eed9ecdd5d3 SHA1 cc856a41bc8120865937d199c918542bf3d82a95 SHA256 5d9c32eefd1a20b90c58ef117010768d8161c56ee0138efa4dd8b1ab82a433ce -EBUILD librets-1.5.2.ebuild 5038 RMD160 424ab5b76bf4bf3a54baeb195f5450aaffc73f60 SHA1 b83fb3b3bdfb04e1188e8d7f4fe2d03ce99dbc9b SHA256 1766bb19cb1d332b1fad13aa63ec6e5bb093ed71e48bd56c5f53b3b7ea5ff720 -MISC ChangeLog 351 RMD160 4eebe269f9cdedf106e35080da93926b7770d118 SHA1 0cd2d53ae7b3866a25eb184d6ba0489e5b357354 SHA256 28d484abe4da95105c7e06b5fa87db80ac3cd351db8dd0e6251b601c61d8a093 +EBUILD librets-1.5.2.ebuild 7307 RMD160 fdc21115b81508e982ea18c312eb86d233ac64c3 SHA1 37a25f3a70a4dee7a41658a753389387f14bf13a SHA256 68b22f89498f2ab868dd05de6ff5b427b288afde939d8d18c10f2a3f9058ad59 +MISC ChangeLog 792 RMD160 ac8d112c8cd6325ec62e1f8a07896b8a640aa136 SHA1 7c3cfd48663fcceeb07fd8bc0402b2a9937fccec SHA256 adb9a8bc731590d880196cf1cac996639622f8a802b73c7c8789e9e3a5e5b1af MISC metadata.xml 800 RMD160 d48297095a211ab283113ba6e523e891c28ca103 SHA1 fa4d97550c3635d2c82c90b203c402afb974825e SHA256 b1e957b8e2cc90cbab17953978c297fb87c63cf4abbbaf861a299e4f447aa63e diff --git a/dev-libs/librets/files/python.mk.patch b/dev-libs/librets/files/python.mk.patch index 82fa76a87..3181c2785 100644 --- a/dev-libs/librets/files/python.mk.patch +++ b/dev-libs/librets/files/python.mk.patch @@ -1,21 +1,13 @@ ---- project/build/python.mk.old 2011-06-25 13:54:02.971786719 -0500 -+++ project/build/python.mk 2011-06-25 13:54:40.032087701 -0500 -@@ -16,10 +16,17 @@ - -outdir ${PYTHON_OBJ_DIR} ${SWIG_DIR}/librets.i - - ifneq (${SWIG_OSNAME}, MSWin32) -+ifeq (${SWIG_OSNAME}, linux) +Index: project/build/python.mk +=================================================================== +--- project/build/python.mk (revision 1522) ++++ project/build/python.mk (revision 1523) +@@ -19,7 +19,7 @@ ${PYTHON_DLL}: ${PYTHON_WRAP} ${LIBRETS_LIB} cd ${PYTHON_OBJ_DIR} ; \ CC="${CC}" CXX="${CXX}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" \ - ${PYTHON} setup.py build --build-lib=. -+ ${PYTHON} setup.py build -+else -+${PYTHON_DLL}: ${PYTHON_WRAP} ${LIBRETS_LIB} -+ cd ${PYTHON_OBJ_DIR} ; \ -+ CC="${CC}" CXX="${CXX}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" \ -+ ${PYTHON} setup.py build --build-lib=. -+endif ++ ${PYTHON} setup.py build else PYTHON_CXX_FLAGS = -mcygwin -mdll \ `${SWIG_LIBRETS_CONFIG} --cflags` diff --git a/dev-libs/librets/librets-1.5.2.ebuild b/dev-libs/librets/librets-1.5.2.ebuild index c5902f0f7..55aee6368 100644 --- a/dev-libs/librets/librets-1.5.2.ebuild +++ b/dev-libs/librets/librets-1.5.2.ebuild @@ -12,9 +12,12 @@ USE_PHP="php5-2 php5-3" PYTHON_DEPEND="python? 2" PYTHON_MODNAME="librets.py" +USE_RUBY="ree18 ruby18 ruby19" +RUBY_OPTIONAL="yes" + LIBOPTIONS="-m755" -inherit distutils eutils java-pkg-opt-2 perl-module php-ext-source-r2 +inherit distutils eutils java-pkg-opt-2 perl-module php-ext-source-r2 ruby-ng DESCRIPTION="A library that implements the RETS 1.7, RETS 1.5 and 1.0 standards" HOMEPAGE="http://www.crt.realtors.org/projects/rets/librets/" @@ -43,7 +46,11 @@ RDEPEND=" dev-util/boost-build java? ( >=virtual/jdk-1.6.0 ) net-misc/curl - ruby? ( dev-lang/ruby:1.8 ) + ruby? ( + ruby_targets_ree18? ( dev-lang/ruby-enterprise:1.8 ) + ruby_targets_ruby18? ( dev-lang/ruby:1.8 ) + ruby_targets_ruby19? ( dev-lang/ruby:1.9 ) + ) sql-compiler? ( dev-java/antlr:0[script] ) sys-libs/zlib ${SWIG_RDEPEND}" @@ -59,6 +66,26 @@ _php-move_swig_build_to_modules_dir() { mv build/swig/php5/* "${1}"/modules || die "Could not move php slot build" } +_php-replace_config_with_selected_config() { + php_init_slot_env ${1} + cd "${S}" || die "cannot change to source directory" + # Replace the reference to php-config with the current slotted one + sed -i -e "s|${2}|${PHPCONFIG}|g" project/build/php.mk || die "sed php-config change failed" +} + +_ruby-get_use_implementations() { + local i implementation + for implementation in ${USE_RUBY}; do + use ruby_targets_${implementation} && i+=" ${implementation}" + done + echo $i +} + +_ruby-move_swig_build_to_impl_dir() { + mkdir -p "${1}"/${P} || die "Could not create directory for ruby implementation" + mv build/swig/ruby/* "${1}"/${P} || die "Could not move ruby implementation build" +} + pkg_setup() { use java && java-pkg-opt-2_pkg_setup use perl && perl-module_pkg_setup @@ -66,16 +93,22 @@ pkg_setup() { python_set_active_version 2 python_pkg_setup fi + use ruby && ruby-ng_pkg_setup +} + +src_unpack() { + use php && php-ext-source-r2_src_unpack + default } src_prepare() { - use php && php-ext-source-r2_src_prepare - #Patch upstream patch to allow perl to be built in the compile stage - use perl && epatch "${FILESDIR}"/perl.mk.patch + #Upstream patch to allow perl to be built in the compile stage + epatch "${FILESDIR}"/perl.mk.patch #Patch to fix java errors and allow compilation - use java && epatch "${FILESDIR}"/java.mk.patch + epatch "${FILESDIR}"/java.mk.patch #Patch to stop python from building the extension again during install - use python && epatch "${FILESDIR}"/python.mk.patch + epatch "${FILESDIR}"/python.mk.patch + use php && php-ext-source-r2_src_prepare } src_configure() { @@ -91,42 +124,89 @@ src_configure() { myconf="${myconf} --disable-php" fi use python || myconf="${myconf} --disable-python" - use ruby || myconf="${myconf} --disable-ruby" if use doc; then myconf="${myconf} --enable-maintainer-documentation" fi + if use threads; then + if use perl || use php || use python || use ruby; then + ewarn "Enabling threads for perl, php, python or ruby causes segmentation faults." + ewarn "Disabling threads" + myconf="${myconf} --disable-thread-safe" + else + myconf="${myconf} --enable-thread-safe" + fi + fi + + if use ruby; then + MYRUBYIMPLS=($(_ruby-get_use_implementations)) + MYRUBYFIRSTIMPL=${MYRUBYIMPLS[0]} + #Set RUBY value in config to the first ruby implementation to build + RUBY=$(ruby_implementation_command ${MYRUBYFIRSTIMPL}) + MYRUBYIMPLS=(${MYRUBYIMPLS[@]:1}) + myconf="${myconf} RUBY=${RUBY}" + else + myconf="${myconf} --disable-ruby" + fi + econf \ --enable-shared_dependencies \ --enable-depends \ --enable-default-search-path="/usr /opt ${myphpprefix}" \ --disable-examples \ + --disable-dotnet \ $(use_enable debug) \ $(use_enable sql-compiler) \ - $(use_enable threads thread-safe) \ - ${myconf} || die + ${myconf} } src_compile() { + if use php; then + local slot myphpconfig="php-config" + # Shift off the first slot so it doesn't get built again + local myphpslots=($(php_get_slots)) myphpfirstslot="${myphpslots[@]:0:1}" myphpslots=(${myphpslots[@]:1}) + _php-replace_config_with_selected_config ${myphpfirstslot} ${myphpconfig} + myphpconfig="${PHPCONFIG}" + fi emake || die "emake failed" if use php; then - local slot myphpconfig="php-config" myphpselectedslot="php${PHP_CURRENTSLOT}" - #Move the current slotted build of php to another dir so other slots can be built - _php-move_swig_build_to_modules_dir "${WORKDIR}/${myphpselectedslot}" - for slot in $(php_get_slots); do - # Don't build the selected slot since the build system already built it - [[ "${slot}" != "${myphpselectedslot}" ]] || continue; - php_init_slot_env ${slot} - cd "${S}" || die "cannot change to source directory" - # Replace the reference to php-config with the current slotted one - sed -i -e "s|${myphpconfig}|${PHPCONFIG}|g" project/build/php.mk || die "sed php-config change failed" + # Move the current slotted build of php to another dir so other slots can be built + _php-move_swig_build_to_modules_dir "${WORKDIR}/${myphpfirstslot}" + # Build the remaining slots + for slot in ${myphpslots[@]}; do + _php-replace_config_with_selected_config ${slot} ${myphpconfig} myphpconfig="${PHPCONFIG}" - # Build the current slotted + # Build the current slot emake build/swig/php5/${PN}.so || die "Unable to make php${slot} extension" _php-move_swig_build_to_modules_dir ${PHP_EXT_S} done fi + if use ruby; then + # Move the current implementation build of ruby to another dir so other implementations can be built + _ruby-move_swig_build_to_impl_dir "${WORKDIR}/${MYRUBYFIRSTIMPL}" + unset MYFIRSTRUBYIMPL + unset RUBY + local impl + MYRUBYIMPL="\${RUBY}" + # Build the remaining implementations + for impl in ${MYRUBYIMPLS[@]}; do + cd "${S}" || die "cannot change to source directory" + # Replace the reference to ${RUBY} with the current implementation + sed -i -e "s|${MYRUBYIMPL}|$(ruby_implementation_command ${impl})|g" project/build/ruby.mk || die "sed ruby implementation change failed" + MYRUBYIMPL="$(ruby_implementation_command ${impl})" + # Build the current implementation + emake build/swig/ruby/${PN}_native.bundle || die "Unable to make ${impl} extension" + _ruby-move_swig_build_to_impl_dir "${WORKDIR}/${impl}" + done + unset MYRUBYIMPLS + fi +} + +each_ruby_install() { + exeinto "$(ruby_rbconfig_value archdir)" + doexe "${S}"/librets_native.so || die + doruby "${S}"/librets.rb || die } src_install() { @@ -157,12 +237,7 @@ src_install() { java-pkg_doso "${S}"/build/swig/java/${PN}.so || die fi - if use ruby; then - insinto /usr/lib64/ruby/site_ruby/1.8/x86_64-linux - doexe "${S}"/build/swig/ruby/librets_native.so || die - insinto /usr/lib64/ruby/site_ruby/1.8 - doins "${S}"/build/swig/ruby/librets.rb || die - fi + use ruby && ruby-ng_src_install if use python; then cd "${S}"/build/swig/python || die |