diff options
author | Hans de Graaff <hans@degraaff.org> | 2009-09-06 14:34:34 +0200 |
---|---|---|
committer | Hans de Graaff <hans@degraaff.org> | 2009-09-06 14:34:34 +0200 |
commit | e2bfcddb550bd6cf7963bc4a48383e67dbb5ad4a (patch) | |
tree | 97f0db2a3a95e85d5beafd66a2419ab0d47b40fd /gemtoo-testbed | |
parent | Initial version of gemtoo rubygems plugin. (diff) | |
download | ruby-scripts-e2bfcddb550bd6cf7963bc4a48383e67dbb5ad4a.tar.gz ruby-scripts-e2bfcddb550bd6cf7963bc4a48383e67dbb5ad4a.tar.bz2 ruby-scripts-e2bfcddb550bd6cf7963bc4a48383e67dbb5ad4a.zip |
Proof-of-concept overlay for testing Gemtoo.
Contains eclass and testing ebuilds. Also need the gemtoo
rubygems plugin installed.
Diffstat (limited to 'gemtoo-testbed')
-rw-r--r-- | gemtoo-testbed/dev-ruby/gruff/Manifest | 2 | ||||
-rw-r--r-- | gemtoo-testbed/dev-ruby/gruff/gruff-0.3.6-r1.ebuild | 20 | ||||
-rw-r--r-- | gemtoo-testbed/dev-ruby/json/Manifest | 2 | ||||
-rw-r--r-- | gemtoo-testbed/dev-ruby/json/json-1.1.7-r1.ebuild | 15 | ||||
-rw-r--r-- | gemtoo-testbed/eclass/gemtoo.eclass | 163 |
5 files changed, 202 insertions, 0 deletions
diff --git a/gemtoo-testbed/dev-ruby/gruff/Manifest b/gemtoo-testbed/dev-ruby/gruff/Manifest new file mode 100644 index 0000000..0f7c82c --- /dev/null +++ b/gemtoo-testbed/dev-ruby/gruff/Manifest @@ -0,0 +1,2 @@ +DIST gruff-0.3.6.gem 300032 RMD160 8c2a0bccda3da0f3af9bc8270fb2e19a1d316203 SHA1 4c2f4d05bd9878af639698e15f70dd3b5b797cc6 SHA256 162d81f661d7ec6f7bd6a389abd6ff82f2fd5b6c477427d6600808b998ba1f9f +EBUILD gruff-0.3.6-r1.ebuild 516 RMD160 1ff402a7c0064e63cd57d12ca0b488fcc62b5992 SHA1 fefc557bac090e2cdbd334bdb90a31fc581375d3 SHA256 ec28f870c7fbe9b151e99216284bd9d483c80912f005a505b9b3805c0b374c67 diff --git a/gemtoo-testbed/dev-ruby/gruff/gruff-0.3.6-r1.ebuild b/gemtoo-testbed/dev-ruby/gruff/gruff-0.3.6-r1.ebuild new file mode 100644 index 0000000..41286af --- /dev/null +++ b/gemtoo-testbed/dev-ruby/gruff/gruff-0.3.6-r1.ebuild @@ -0,0 +1,20 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/gruff/gruff-0.3.6.ebuild,v 1.1 2009/08/23 07:50:17 graaff Exp $ + +EAPI="2" + +inherit gemtoo + +DESCRIPTION="A ruby library for creating pretty graphs and charts" +HOMEPAGE="http://rubyforge.org/projects/gruff/" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~ia64 ~x86 ~amd64" +IUSE="" +USE_RUBY="ruby18" + +DEPEND="dev-ruby/rmagick + media-gfx/imagemagick[truetype]" +RDEPEND="${DEPEND}" diff --git a/gemtoo-testbed/dev-ruby/json/Manifest b/gemtoo-testbed/dev-ruby/json/Manifest new file mode 100644 index 0000000..c438a53 --- /dev/null +++ b/gemtoo-testbed/dev-ruby/json/Manifest @@ -0,0 +1,2 @@ +DIST json-1.1.7.gem 383488 RMD160 5b801d357566cdd85689384f27c0a0f372d4ca8a SHA1 3fca98e1bdc69d4616027b49c6211004525c418e SHA256 eb3b1d31d1e158fd12b1f5c01db66c3d44d45727f4941c5f12cb4704018e68fb +EBUILD json-1.1.7-r1.ebuild 406 RMD160 a749f2feaa5d78a8219e17f30b10288d021d0c82 SHA1 c270edebca975ed087a17b1f467dd9fbb2b0b5cb SHA256 448037efedce6c3194131a1fa27ec60fa819939b059bc7ccc33756b675c1ed53 diff --git a/gemtoo-testbed/dev-ruby/json/json-1.1.7-r1.ebuild b/gemtoo-testbed/dev-ruby/json/json-1.1.7-r1.ebuild new file mode 100644 index 0000000..f279eab --- /dev/null +++ b/gemtoo-testbed/dev-ruby/json/json-1.1.7-r1.ebuild @@ -0,0 +1,15 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/json/json-1.1.7.ebuild,v 1.1 2009/07/04 08:24:54 graaff Exp $ + +inherit gemtoo + +USE_RUBY="ruby18" + +DESCRIPTION="A JSON implementation as a Ruby extension." +HOMEPAGE="http://json.rubyforge.org/" +LICENSE="GPL-2" + +KEYWORDS="~amd64 ~ppc ~x86" +SLOT="0" +IUSE="" diff --git a/gemtoo-testbed/eclass/gemtoo.eclass b/gemtoo-testbed/eclass/gemtoo.eclass new file mode 100644 index 0000000..791509d --- /dev/null +++ b/gemtoo-testbed/eclass/gemtoo.eclass @@ -0,0 +1,163 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/eclass/gems.eclass,v 1.29 2009/08/20 08:55:01 graaff Exp $ + +# @ECLASS: gemtoo.eclass +# @MAINTAINER: +# ruby@gentoo.org +# +# @BLURB: Eclass helping with the installation of RubyGems in a Gentoo way +# @DESCRIPTION: + +# @ECLASS-VARIABLE: USE_RUBY +# @DESCRIPTION: +# Ruby versions the gem is compatible to. The eclass will install the +# gem for versions that are compatible and installed on the +# system. Format: rubyDD where DD is the two-digit version suffix +# (e.g.: USE_RUBY="ruby19" for Ruby 1.9.1) + +# inherit eutils ruby + +SRC_URI="mirror://rubyforge/gems/${P}.gem" + +# IUSE="doc" + +DEPEND="|| ( >=dev-ruby/rubygems-1.3.1 =dev-lang/ruby-1.9* )" +RDEPEND="${DEPEND}" + +# # @FUNCTION: gems_location +# # @USAGE: [Ruby binary] +# # @DESCRIPTION: +# # Exports GEMSDIR to the path Gems are installed to for the respective Ruby +# # version +# gems_location() { +# local ruby_version +# if [[ -z "$1" ]]; then +# ruby_version="gem" +# else +# ruby_version=${1/ruby/gem} +# fi +# export GEMSDIR=$(/usr/bin/${ruby_version} env gemdir) +# } + +# @FUNCTION: gemtoo_src_unpack +# @DESCRIPTION: +# Unpacks the gem contents into the work directory. +gemtoo_src_unpack() { + if [[ -z "${MY_P}" ]]; then + [[ -z "${GEM_SRC}" ]] && GEM_SRC="${DISTDIR}/${P}" + else + [[ -z "${GEM_SRC}" ]] && GEM_SRC="${DISTDIR}/${MY_P}" + fi + + gem src_unpack ${GEM_SRC}.gem --install-dir "${S}" +} + +# @FUNCTION: gemtoo_src_compile +# @DESCRIPTION: +# Compile gem code, if any +gemtoo_src_compile() { + if [[ -z "${MY_P}" ]]; then + [[ -z "${GEM_SRC}" ]] && GEM_SRC="${DISTDIR}/${P}" + else + [[ -z "${GEM_SRC}" ]] && GEM_SRC="${DISTDIR}/${MY_P}" + fi + + gem src_compile ${GEM_SRC}.gem --install-dir "${S}" +} + +# @FUNCTION: gemtoo_src_test +# @DESCRIPTION: +# Test the compile gem code, if possible +gemtoo_src_test() { + cd "${S}/gems/${P}" + echo "Running tests in $(pwd)" + rake test +} + + +# install should also cover the bin directory. + +# @FUNCTION: gemtoo_src_install +# @DESCRIPTION: +# Installs the gem +gemtoo_src_install() { + if [[ -z "${MY_P}" ]]; then + [[ -z "${GEM_SRC}" ]] && GEM_SRC="${DISTDIR}/${P}" + else + [[ -z "${GEM_SRC}" ]] && GEM_SRC="${DISTDIR}/${MY_P}" + fi + + # Install all the files in the correct place in the work directory. + mkdir "${S}/specifications" + gem src_install ${GEM_SRC}.gem --install-dir "${D}/" + + # Install them onto the image + +} + +# # @FUNCTION: gems_src_install +# # @DESCRIPTION: +# # Installs the gem +# gems_src_install() { +# local myconf +# if use doc; then +# myconf="--rdoc --ri" +# else +# myconf="--no-rdoc --no-ri" +# fi + +# # I'm not sure how many ebuilds have correctly set USE_RUBY - let's assume +# # ruby18 if they haven't, since even pure Ruby gems that have been written +# # against 1.8 can explode under 1.9. +# if [[ -z "${USE_RUBY}" ]]; then +# einfo "QA notice" +# einfo "The ebuild doesn't set USE_RUBY explicitly. Defaulting to ruby18." +# einfo "Please check compatibility and set USE_RUBY respectively." + +# USE_RUBY="ruby18" +# elif [[ "${USE_RUBY}" == "any" ]]; then +# eerror "USE_RUBY=\"any\" is no longer supported. Please use explicit versions instead." +# die "USE_RUBY=\"any\" is no longer supported." +# fi + +# local num_ruby_slots=$(echo "${USE_RUBY}" | wc -w) + +# for ruby_version in ${USE_RUBY} ; do +# # Check that we have the version installed +# [[ -e "/usr/bin/${ruby_version/ruby/gem}" ]] || continue + +# einfo "Installing for ${ruby_version}..." +# gems_location ${ruby_version} +# dodir ${GEMSDIR} || die + +# if [[ -z "${MY_P}" ]]; then +# [[ -z "${GEM_SRC}" ]] && GEM_SRC="${DISTDIR}/${P}" +# spec_path="${D}/${GEMSDIR}/specifications/${P}.gemspec" +# else +# [[ -z "${GEM_SRC}" ]] && GEM_SRC="${DISTDIR}/${MY_P}" +# spec_path="${D}/${GEMSDIR}/specifications/${MY_P}.gemspec" +# fi + +# # >=1.3.0 needs a path fix +# local gte13=$(/usr/bin/${ruby_version} -rubygems -e 'puts Gem::RubyGemsVersion >= "1.3.0"') + +# /usr/bin/${ruby_version} /usr/bin/gem install ${GEM_SRC} \ +# --version ${PV} ${myconf} --local --install-dir "${D}/${GEMSDIR}" \ +# --sandbox-fix --no-user-install || die "gem (>=1.3.0) install failed" + +# if [[ -d "${D}/${GEMSDIR}/bin" ]] ; then +# exeinto /usr/bin +# for exe in "${D}"/${GEMSDIR}/bin/* ; do +# if [ "$num_ruby_slots" -ge 2 ] ; then +# # Ensures that the exe file gets run using the currently +# # selected version of ruby. +# sed -i -e 's@^#!/usr/bin/ruby.*$@#!/usr/bin/ruby@' "${exe}" +# fi +# doexe "${exe}" || die +# done +# fi +# done +# } + +EXPORT_FUNCTIONS src_unpack src_compile src_test src_install |