Skip to content

Instantly share code, notes, and snippets.

@robbat2
Created March 4, 2024 05:55
Show Gist options
  • Save robbat2/f4a18ed76d1504fa2a43871978a2cd7f to your computer and use it in GitHub Desktop.
Save robbat2/f4a18ed76d1504fa2a43871978a2cd7f to your computer and use it in GitHub Desktop.
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
USE_RUBY="ruby30 ruby31 ruby32"
RUBY_FAKEGEM_TASK_DOC=""
RUBY_FAKEGEM_EXTRADOC="README.md CHANGELOG.md PLUGINS.md"
RUBY_FAKEGEM_GEMSPEC="${PN}.gemspec"
inherit ruby-fakegem
# This includes all the fixes needed for Ruby3.2 support
# upstream release is pending https://github.com/voxpupuli/hiera-eyaml/pull/362
# includes dev-util/cucumber-8 & >=dev-util/aruba-2.1.0
# Because the old versions didn't support Ruby 3.2
COMMIT_SHA="c63f4af0cb95121561c3b6f281469b8ef751db1a"
MY_P="hiera-eyaml-${COMMIT_SHA}"
DESCRIPTION="Encrypted YAML backend for hiera"
HOMEPAGE="https://github.com/voxpupuli/hiera-eyaml"
SRC_URI="https://github.com/voxpupuli/hiera-eyaml/archive/${COMMIT_SHA}.tar.gz -> ${MY_P}.tar.gz"
RUBY_S="${MY_P}"
LICENSE="MIT"
SLOT="3"
# KEYWORDS="~amd64 ~arm64 ~x86"
# Failing Scenarios:
# cucumber features/valid_encryption.feature:14 # Scenario: encrypt and decrypt multiline yaml
# cucumber features/valid_encryption.feature:19 # Scenario: encrypt and decrypt windows multiline yaml
KEYWORDS=""
IUSE="test"
ruby_add_rdepend "
>=dev-ruby/highline-1.6.19:*
dev-ruby/optimist
"
ruby_add_bdepend "test? (
>=dev-util/cucumber-8
>=dev-util/aruba-2.1.0
dev-ruby/hiera-eyaml-plaintext
)"
BDEPEND+=" test? ( || ( app-admin/puppet-agent app-admin/puppet ) dev-tcltk/expect )"
all_ruby_prepare() {
einfo all_ruby_prepare $(pwd)
sed -i -e '/highline/ s/~>/>=/' \
-e '/gem.files/d' ${RUBY_FAKEGEM_GEMSPEC} || die
sed -i -e "s:/tmp:${T}:" \
features/sandbox/puppet/environments/local/modules/test/manifests/run.pp \
features/sandbox/puppet-hiera-merge/environments/local/modules/test/manifests/run.pp \
features/sandbox/puppet-envvar/environments/local/modules/test/manifests/run.pp \
features/puppet.feature || die
}
each_ruby_prepare() {
einfo each_ruby_prepare $(pwd)
D1=$(pwd) # must be an absolute path
sed -i -e 's:I run `eyaml:I run `'${RUBY}' '"${D1}"'/bin/eyaml:' features/*.feature || die
}
each_ruby_test() {
einfo each_ruby_test $(pwd)
which ${RUBY}
CUCUMBER_PUBLISH_QUIET=true ${RUBY} -S /usr/bin/cucumber --format progress --verbose features || die
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment