1 |
Excerpts from Hans de Graaff's message of Sat Jun 18 08:16:25 +0200 2011: |
2 |
> Stanislav asked me to review. I'm also including the list since other |
3 |
> people may also be interested how to handle ruby ebuilds. |
4 |
> |
5 |
> On Wed, 2011-06-15 at 22:04 +0000, Stanislav Ochotnicky (sochotnicky) |
6 |
> wrote: |
7 |
> > sochotnicky 11/06/15 22:04:56 |
8 |
> > |
9 |
> > Added: metadata.xml ChangeLog fromcvs-0_pre132.ebuild |
10 |
> > Log: |
11 |
> > New ebuild for fromcvs added to the tree. Fixes #173341 |
12 |
> > |
13 |
> |
14 |
> > EAPI=2 |
15 |
> > |
16 |
> > USE_RUBY="ruby18 ree18" |
17 |
> > |
18 |
> > #mercurial after ruby! |
19 |
> > inherit ruby-ng mercurial |
20 |
> > |
21 |
> > MY_PV="${PV#0_pre}" |
22 |
> > |
23 |
> > DESCRIPTION="fromcvs converts cvs to git and hg" |
24 |
> > HOMEPAGE="http://ww2.fs.ei.tum.de/~corecode/hg/fromcvs" |
25 |
> > SRC_URI="" |
26 |
> > EHG_REPO_URI="http://ww2.fs.ei.tum.de/~corecode/hg/fromcvs" |
27 |
> > EHG_REVISION="${MY_PV}" |
28 |
> > |
29 |
> > LICENSE="BSD-4" |
30 |
> > SLOT="0" |
31 |
> > KEYWORDS="~amd64" |
32 |
> > IUSE="test" |
33 |
> > |
34 |
> > RUBY_S="${PN}-${PV}" |
35 |
> |
36 |
> RUBY_S is only supported in EAPI=4. You are getting away with this |
37 |
> because you are using a custom unpack method. |
38 |
> |
39 |
|
40 |
Good to know. Moved to EAPI4, with it few "|| die" things went away. |
41 |
|
42 |
> > RDEPEND="dev-ruby/rcsparse >=dev-ruby/rbtree-0.3.0-r2 dev-vcs/git" |
43 |
> |
44 |
> The ruby-ng eclasses frob RDEPEND, so you should always add to it, e.g. |
45 |
> |
46 |
> RDEPEND="${RDEPEND} dev-vcs/git" |
47 |
> |
48 |
> Also, all ruby dependencies should be handled via ruby_add_rdepend to |
49 |
> ensure that your list in USE_RUBY is properly passed down to the |
50 |
> dependencies: |
51 |
> |
52 |
> ruby_add_rdepend "dev-ruby/rcsparse >=dev-ruby/rb-tree-0.3.0-r2" |
53 |
|
54 |
Fixed |
55 |
|
56 |
> > # this is a workaround because combination of ruby-ng and mercurial is |
57 |
> > # not working correctly for unpacking |
58 |
> > src_prepare() { |
59 |
> > for rubyv in ${USE_RUBY};do |
60 |
> |
61 |
> Missing "all" target. |
62 |
> |
63 |
|
64 |
Fixed. |
65 |
|
66 |
> > mkdir "${WORKDIR}/${rubyv}" |
67 |
> |
68 |
> || die |
69 |
> |
70 |
> > cp -prl "${S}" "${WORKDIR}/${rubyv}/${RUBY_S}" |
71 |
> |
72 |
> || die |
73 |
> |
74 |
|
75 |
Fixed on second iteration :-) |
76 |
|
77 |
> > done |
78 |
> > } |
79 |
> > |
80 |
> > each_ruby_install() { |
81 |
> > siteruby=$(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitedir"]') |
82 |
> > insinto ${siteruby} |
83 |
> |
84 |
> insinto ruby_rbconfig("sitedir") |
85 |
This didn't really work so I used |
86 |
insinto $(ruby_rbconfig_value 'sitedir') |
87 |
|
88 |
> > doins *.rb || die "Installation of rb files failes" |
89 |
> |
90 |
> Typo. |
91 |
|
92 |
Fixed |
93 |
|
94 |
> |
95 |
> > |
96 |
> > make_script togit |
97 |
> > make_script tohg |
98 |
> > } |
99 |
> > |
100 |
> > make_script() { |
101 |
> > echo "ruby /usr/$(get_libdir)/ruby/site_ruby/$1.rb \$@" > $1 |
102 |
> |
103 |
> I'm not sure how this should work? Perhaps you mean something like: |
104 |
> |
105 |
> echo "#!/usr/bin/ruby ..." |
106 |
> |
107 |
|
108 |
In the end I fixed up upstream scripts because they had no shebangs and |
109 |
isntalled them directly without any wrappers. They still use |
110 |
/usr/bin/ruby where it would be nicer to have specific script for each |
111 |
ruby version. |
112 |
|
113 |
> > dobin $1 |
114 |
> |
115 |
> || die, (or use EAPI=4) |
116 |
|
117 |
EAPI4 it is |
118 |
|
119 |
-- |
120 |
Stanislav Ochotnicky |
121 |
|
122 |
PGP: 7B087241 |
123 |
jabber: stanislav@××××××××××.com |