Lines 14-19
Link Here
|
14 |
# gems_src_install() - installs a gem into ${D} |
14 |
# gems_src_install() - installs a gem into ${D} |
15 |
# gems_src_unpack() - Does nothing. |
15 |
# gems_src_unpack() - Does nothing. |
16 |
# gems_src_compile() - Does nothing. |
16 |
# gems_src_compile() - Does nothing. |
|
|
17 |
# gems_unpack() - Unpack gem package into current directory, save |
18 |
# save metadata.yaml to ${T}/metadata.yaml |
19 |
# gems_repack() - Use ${T}/metadata.yaml and unpacked directory from |
20 |
# gems_unpack() to construct a new gem, set GEM_SRC to the |
21 |
# new gem so that gems_src_install() works correctly |
17 |
# |
22 |
# |
18 |
# NOTE: |
23 |
# NOTE: |
19 |
# See http://dev.gentoo.org/~pythonhead/ruby/gems.html for notes on using gems with portage |
24 |
# See http://dev.gentoo.org/~pythonhead/ruby/gems.html for notes on using gems with portage |
Lines 43-52
Link Here
|
43 |
gems_src_install() { |
48 |
gems_src_install() { |
44 |
gems_location |
49 |
gems_location |
45 |
|
50 |
|
46 |
if [ -z "${MY_P}" ]; then |
51 |
if [ -z "${GEM_SRC}" ]; then |
47 |
GEM_SRC=${DISTDIR}/${P} |
52 |
if [ -z "${MY_P}" ]; then |
48 |
else |
53 |
GEM_SRC=${DISTDIR}/${P} |
49 |
GEM_SRC=${DISTDIR}/${MY_P} |
54 |
else |
|
|
55 |
GEM_SRC=${DISTDIR}/${MY_P} |
56 |
fi |
50 |
fi |
57 |
fi |
51 |
|
58 |
|
52 |
if use doc; then |
59 |
if use doc; then |
Lines 70-73
Link Here
|
70 |
true |
77 |
true |
71 |
} |
78 |
} |
72 |
|
79 |
|
|
|
80 |
gems_unpack() { |
81 |
local PP |
82 |
if [ -z "${MY_P}" ]; then |
83 |
PP=${P} |
84 |
else |
85 |
PP=${MY_P} |
86 |
fi |
87 |
gem unpack "${DISTDIR}"/${PP}.gem |
88 |
tar -xOf "${DISTDIR}"/${PP}.gem metadata.gz |gzip -d > "${T}"/metadata.yaml |
89 |
} |
90 |
|
91 |
gems_repack() { |
92 |
local PP |
93 |
if [ -z "${MY_P}" ]; then |
94 |
PP=${P} |
95 |
else |
96 |
PP=${MY_P} |
97 |
fi |
98 |
cd ${PP} |
99 |
gem build "${T}"/metadata.yaml |
100 |
[ -f ${PP}.gem ] || die "gems_repack failed to build new gem" |
101 |
mv ${PP}.gem "${T}" |
102 |
# Note: GEM_SRC is global |
103 |
GEM_SRC="${T}"/${PP} |
104 |
einfo "GEM_SRC=${GEM_SRC}" |
105 |
} |
106 |
|
73 |
EXPORT_FUNCTIONS src_unpack src_compile src_install |
107 |
EXPORT_FUNCTIONS src_unpack src_compile src_install |