New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dev-ruby/facter: ebuild cleanup #9339
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,18 +17,16 @@ if [[ ${PV} == 9999 ]] ; then | |
inherit git-r3 | ||
EGIT_REPO_URI="https://github.com/puppetlabs/facter.git" | ||
EGIT_BRANCH="master" | ||
S="${S}/${P}" | ||
else | ||
[[ "${PV}" = *_rc* ]] || \ | ||
KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~sparc ~x86" | ||
SRC_URI="https://github.com/puppetlabs/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" | ||
S="${S}/all/${P}" | ||
fi | ||
|
||
BDEPEND=" | ||
>=sys-devel/gcc-4.8:* | ||
dev-cpp/cpp-hocon" | ||
CDEPEND=" | ||
COMMON_DEPEND=" | ||
>=dev-libs/leatherman-1.0.0:= | ||
dev-libs/openssl:* | ||
sys-apps/util-linux | ||
|
@@ -40,23 +38,29 @@ CDEPEND=" | |
|
||
ruby_add_bdepend "test? ( dev-ruby/rake dev-ruby/rspec:2 dev-ruby/mocha:0.14 )" | ||
|
||
RDEPEND="${CDEPEND}" | ||
RDEPEND="${COMMON_DEPEND}" | ||
DEPEND="${BDEPEND} | ||
${CDEPEND}" | ||
${COMMON_DEPEND}" | ||
|
||
# restore ${S} and override all phases exported by ruby-ng.eclass | ||
S="${WORKDIR}/${P}" | ||
|
||
pkg_setup() { | ||
ruby-ng_pkg_setup | ||
} | ||
|
||
src_unpack() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isn't this section the default already? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is to avoid ruby-ng_src_unpack() |
||
default | ||
|
||
if [[ ${PV} == 9999 ]] ; then | ||
git-r3_src_unpack | ||
fi | ||
} | ||
|
||
src_prepare() { | ||
# Remove the code that installs facter.rb to the wrong directory. | ||
sed -i '/install(.*facter\.rb/d' lib/CMakeLists.txt || die | ||
sed -i '/install(.*facter\.jar/d' lib/CMakeLists.txt || die | ||
# make it support multilib | ||
sed -i "s/\ lib)/\ $(get_libdir))/g" lib/CMakeLists.txt || die | ||
sed -i "s/lib\")/$(get_libdir)\")/g" CMakeLists.txt || die | ||
# make the require work | ||
sed -i 's/\${LIBFACTER_INSTALL_DESTINATION}\///g' lib/facter.rb.in || die | ||
# be explicit about the version of rspec we test with and use the | ||
# correct lib directory for tests | ||
# be explicit about the version of rspec we test with | ||
sed -i -e '/libfacter.*specs/ s/rspec/rspec-2/' \ | ||
-e '/libfacter.*specs/ s/lib64/lib/' CMakeLists.txt || die | ||
CMakeLists.txt || die | ||
# be more lenient for software versions for tests | ||
sed -i -e '/rake/ s/~> 10.1.0/>= 10/' \ | ||
-e '/rspec/ s/2.11.0/2.11/' \ | ||
|
@@ -66,12 +70,18 @@ src_prepare() { | |
cmake-utils_src_prepare | ||
} | ||
|
||
each_ruby_configure() { | ||
# hack for correct calculation of relative path from facter.rb to | ||
# libfacter.so | ||
my_ruby_sitelibdir=$(ruby_rbconfig_value 'sitelibdir') | ||
} | ||
|
||
src_configure() { | ||
ruby-ng_src_configure | ||
|
||
local mycmakeargs=( | ||
-DCMAKE_VERBOSE_MAKEFILE=ON | ||
-DCMAKE_BUILD_TYPE=None | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why'd you get rid of the build type? and install prefix? and blkid location? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CMAKE_BUILD_TYPE and CMAKE_INSTALL_PREFIX are passed by cmake-utils.eclass. Do we really need to override them? BLKID_LIBRARY is not used by build system for a long time: |
||
-DCMAKE_INSTALL_PREFIX=/usr | ||
-DBLKID_LIBRARY=/$(get_libdir)/libblkid.so.1 | ||
-DRUBY_LIB_INSTALL=${my_ruby_sitelibdir} | ||
) | ||
if use debug; then | ||
mycmakeargs+=( | ||
|
@@ -85,21 +95,15 @@ src_compile() { | |
cmake-utils_src_compile | ||
} | ||
|
||
each_ruby_install() { | ||
doruby "${BUILD_DIR}"/lib/facter.rb | ||
} | ||
|
||
src_test() { | ||
cmake-utils_src_test | ||
} | ||
|
||
each_ruby_install() { | ||
doruby "${BUILD_DIR}"/lib/facter.rb | ||
} | ||
|
||
src_install() { | ||
cmake-utils_src_install | ||
ruby-ng_src_install | ||
|
||
# need a variable file in env.d :( | ||
diropts -m0755 | ||
dodir /etc/env.d | ||
echo -n "FACTERDIR=/usr/$(get_libdir)" > "${D}/etc/env.d/00facterdir" | ||
fperms 0644 /etc/env.d/00facterdir | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ruby isn't actually needed for this package to work, so no need to run it's pkg_setup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This package already depends on ruby via ruby-ng.eclass (RUBY_OPTIONAL != yes). It can be made optional, but this should be done via use flag. Otherwise we can't properly install facter.rb for all ruby targets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ya, should probably be made optional then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't expect me to do that in this PR as it probably require changes in reverse deps (app-admin/puppet). :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, but you can do multiple commits in a PR, but that's up to you :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, build system does not allow to disable ruby support. So this needs either additional hacks in the ebuild or patches for build system.