ruby-ng-gnome2.eclass 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. # @ECLASS: ruby-ng-gnome2.eclass
  4. # @MAINTAINER:
  5. # Ruby herd <ruby@gentoo.org>
  6. # @AUTHOR:
  7. # Author: Hans de Graaff <graaff@gentoo.org>
  8. # @BLURB: An eclass to simplify handling of various ruby-gnome2 parts.
  9. # @DESCRIPTION:
  10. # This eclass simplifies installation of the various pieces of
  11. # ruby-gnome2 since they share a very common installation procedure.
  12. RUBY_FAKEGEM_NAME="${RUBY_FAKEGEM_NAME:-${PN#ruby-}}"
  13. RUBY_FAKEGEM_TASK_TEST=""
  14. RUBY_FAKEGEM_TASK_DOC=""
  15. inherit ruby-fakegem multilib versionator
  16. IUSE=""
  17. # Define EPREFIX if needed
  18. has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
  19. subbinding=${PN#ruby-}
  20. if [ $(get_version_component_range "1-2") == "0.19" ]; then
  21. subbinding=${subbinding/%2}
  22. else
  23. subbinding=${subbinding/-/_}
  24. DEPEND="virtual/pkgconfig"
  25. ruby_add_bdepend "dev-ruby/pkg-config"
  26. fi
  27. if has "${EAPI:-0}" 0 1 2 3 ; then
  28. S=${WORKDIR}/ruby-gnome2-all-${PV}/${subbinding}
  29. else
  30. RUBY_S=ruby-gnome2-all-${PV}/${subbinding}
  31. fi
  32. SRC_URI="mirror://sourceforge/ruby-gnome2/ruby-gnome2-all-${PV}.tar.gz"
  33. HOMEPAGE="http://ruby-gnome2.sourceforge.jp/"
  34. LICENSE="Ruby"
  35. SLOT="0"
  36. # @FUNCTION: each_ruby_configure
  37. # @DESCRIPTION:
  38. # Run the configure script in the subbinding for each specific ruby target.
  39. each_ruby_configure() {
  40. ${RUBY} extconf.rb || die "extconf.rb failed"
  41. }
  42. # @FUNCTION: each_ruby_compile
  43. # @DESCRIPTION:
  44. # Compile the C bindings in the subbinding for each specific ruby target.
  45. each_ruby_compile() {
  46. # We have injected --no-undefined in Ruby as a safety precaution
  47. # against broken ebuilds, but the Ruby-Gnome bindings
  48. # unfortunately rely on the lazy load of other extensions; see bug
  49. # #320545.
  50. find . -name Makefile -print0 | xargs -0 \
  51. sed -i -e 's:-Wl,--no-undefined ::' \
  52. -e "s/^ldflags = /ldflags = $\(LDFLAGS\) /" \
  53. || die "--no-undefined removal failed"
  54. emake V=1 || die "emake failed"
  55. }
  56. # @FUNCTION: each_ruby_install
  57. # @DESCRIPTION:
  58. # Install the files in the subbinding for each specific ruby target.
  59. each_ruby_install() {
  60. # Create the directories, or the package will create them as files.
  61. local archdir=$(ruby_rbconfig_value "sitearchdir")
  62. dodir ${archdir#${EPREFIX}} /usr/$(get_libdir)/pkgconfig
  63. emake DESTDIR="${D}" install || die "make install failed"
  64. each_fakegem_install
  65. }
  66. # @FUNCTION: all_ruby_install
  67. # @DESCRIPTION:
  68. # Install the files common to all ruby targets.
  69. all_ruby_install() {
  70. for doc in ../AUTHORS ../NEWS ChangeLog README; do
  71. [ -s "$doc" ] && dodoc $doc
  72. done
  73. if [[ -d sample ]]; then
  74. insinto /usr/share/doc/${PF}
  75. doins -r sample || die "sample install failed"
  76. fi
  77. all_fakegem_install
  78. }