1 |
Stanislav asked me to review. I'm also including the list since other |
2 |
people may also be interested how to handle ruby ebuilds. |
3 |
|
4 |
On Wed, 2011-06-15 at 22:04 +0000, Stanislav Ochotnicky (sochotnicky) |
5 |
wrote: |
6 |
> sochotnicky 11/06/15 22:04:56 |
7 |
> |
8 |
> Added: metadata.xml ChangeLog fromcvs-0_pre132.ebuild |
9 |
> Log: |
10 |
> New ebuild for fromcvs added to the tree. Fixes #173341 |
11 |
> |
12 |
|
13 |
> EAPI=2 |
14 |
> |
15 |
> USE_RUBY="ruby18 ree18" |
16 |
> |
17 |
> #mercurial after ruby! |
18 |
> inherit ruby-ng mercurial |
19 |
> |
20 |
> MY_PV="${PV#0_pre}" |
21 |
> |
22 |
> DESCRIPTION="fromcvs converts cvs to git and hg" |
23 |
> HOMEPAGE="http://ww2.fs.ei.tum.de/~corecode/hg/fromcvs" |
24 |
> SRC_URI="" |
25 |
> EHG_REPO_URI="http://ww2.fs.ei.tum.de/~corecode/hg/fromcvs" |
26 |
> EHG_REVISION="${MY_PV}" |
27 |
> |
28 |
> LICENSE="BSD-4" |
29 |
> SLOT="0" |
30 |
> KEYWORDS="~amd64" |
31 |
> IUSE="test" |
32 |
> |
33 |
> RUBY_S="${PN}-${PV}" |
34 |
|
35 |
RUBY_S is only supported in EAPI=4. You are getting away with this |
36 |
because you are using a custom unpack method. |
37 |
|
38 |
> RDEPEND="dev-ruby/rcsparse >=dev-ruby/rbtree-0.3.0-r2 dev-vcs/git" |
39 |
|
40 |
The ruby-ng eclasses frob RDEPEND, so you should always add to it, e.g. |
41 |
|
42 |
RDEPEND="${RDEPEND} dev-vcs/git" |
43 |
|
44 |
Also, all ruby dependencies should be handled via ruby_add_rdepend to |
45 |
ensure that your list in USE_RUBY is properly passed down to the |
46 |
dependencies: |
47 |
|
48 |
ruby_add_rdepend "dev-ruby/rcsparse >=dev-ruby/rb-tree-0.3.0-r2" |
49 |
|
50 |
> # this is a workaround because combination of ruby-ng and mercurial is |
51 |
> # not working correctly for unpacking |
52 |
> src_prepare() { |
53 |
> for rubyv in ${USE_RUBY};do |
54 |
|
55 |
Missing "all" target. |
56 |
|
57 |
> mkdir "${WORKDIR}/${rubyv}" |
58 |
|
59 |
|| die |
60 |
|
61 |
> cp -prl "${S}" "${WORKDIR}/${rubyv}/${RUBY_S}" |
62 |
|
63 |
|| die |
64 |
|
65 |
> done |
66 |
> } |
67 |
> |
68 |
> each_ruby_install() { |
69 |
> siteruby=$(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitedir"]') |
70 |
> insinto ${siteruby} |
71 |
|
72 |
insinto ruby_rbconfig("sitedir") |
73 |
|
74 |
> doins *.rb || die "Installation of rb files failes" |
75 |
|
76 |
Typo. |
77 |
|
78 |
> |
79 |
> make_script togit |
80 |
> make_script tohg |
81 |
> } |
82 |
> |
83 |
> make_script() { |
84 |
> echo "ruby /usr/$(get_libdir)/ruby/site_ruby/$1.rb \$@" > $1 |
85 |
|
86 |
I'm not sure how this should work? Perhaps you mean something like: |
87 |
|
88 |
echo "#!/usr/bin/ruby ..." |
89 |
|
90 |
> dobin $1 |
91 |
|
92 |
|| die, (or use EAPI=4) |