1 |
|
# Copyright 1999-2022 Gentoo Authors
|
|
1 |
# Copyright 1999-2023 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
4 |
EAPI=8
|
5 |
|
USE_RUBY="ruby26 ruby27 ruby30 ruby31"
|
|
5 |
USE_RUBY="ruby27 ruby30 ruby31 ruby32"
|
6 |
6 |
|
7 |
7 |
RUBY_FAKEGEM_TASK_DOC="faq"
|
8 |
8 |
RUBY_FAKEGEM_DOCDIR="doc faq"
|
9 |
|
RUBY_FAKEGEM_EXTRADOC="API_CHANGES.rdoc README.rdoc ChangeLog.cvs CHANGELOG.rdoc"
|
|
9 |
RUBY_FAKEGEM_EXTRADOC="API_CHANGES.md README.md ChangeLog.cvs CHANGELOG.md"
|
10 |
10 |
|
11 |
11 |
RUBY_FAKEGEM_EXTENSIONS=(ext/sqlite3/extconf.rb)
|
12 |
12 |
RUBY_FAKEGEM_EXTENSION_LIBDIR=lib/sqlite3
|
... | ... | |
17 |
17 |
HOMEPAGE="https://github.com/sparklemotion/sqlite3-ruby"
|
18 |
18 |
LICENSE="BSD"
|
19 |
19 |
|
20 |
|
KEYWORDS="amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
|
|
20 |
KEYWORDS="amd64 ~arm ~arm64 ~hppa ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
|
21 |
21 |
SLOT="0"
|
22 |
22 |
IUSE=""
|
23 |
23 |
|
24 |
|
RDEPEND+=" >=dev-db/sqlite-3.6.16:3"
|
25 |
|
DEPEND+=" >=dev-db/sqlite-3.6.16:3"
|
|
24 |
RDEPEND+=" >=dev-db/sqlite-3.39.4:3"
|
|
25 |
DEPEND+=" >=dev-db/sqlite-3.39.4:3"
|
26 |
26 |
|
|
27 |
# TODO: drop the mini_portile2 dep after 1.6.1
|
27 |
28 |
ruby_add_bdepend "
|
28 |
|
dev-ruby/rake-compiler
|
|
29 |
dev-ruby/mini_portile2:2.8
|
29 |
30 |
doc? ( dev-ruby/rdoc dev-ruby/redcloth )
|
30 |
31 |
test? ( dev-ruby/minitest:5 )"
|
31 |
32 |
|
32 |
33 |
all_ruby_prepare() {
|
33 |
|
# We remove the vendor_sqlite3 rake task because it's used to
|
34 |
|
# bundle SQlite3 which we definitely don't want.
|
35 |
|
rm -f rakelib/vendor_sqlite3.rake || die
|
36 |
|
|
37 |
|
# Remove gem tasks since we don't need them and they require hoe.
|
38 |
|
rm -f rakelib/gem.rake || die
|
39 |
|
|
40 |
|
sed -i -e 's:, HOE.spec::' -e '/task :test/d' rakelib/native.rake || die
|
|
34 |
sed -i -e 's/enable_config("system-libraries")/true/' ext/sqlite3/extconf.rb || die
|
41 |
35 |
}
|
42 |
36 |
|
43 |
37 |
all_ruby_compile() {
|
44 |
38 |
all_fakegem_compile
|
45 |
39 |
|
46 |
40 |
if use doc; then
|
47 |
|
rdoc --title "${P} Dcoumentation" -o doc --main README.rdoc lib *.rdoc ext/*/*.c || die
|
|
41 |
rdoc --title "${P} Documentation" -o doc --main README.rdoc lib *.rdoc ext/*/*.c || die
|
48 |
42 |
rm -f doc/js/*.gz || die
|
49 |
43 |
fi
|
50 |
44 |
}
|
... | ... | |
52 |
46 |
each_ruby_test() {
|
53 |
47 |
${RUBY} -Ilib:test:. -e 'Dir["test/test_*.rb"].each{|f| require f}' || die
|
54 |
48 |
}
|
55 |
|
|
56 |
|
each_ruby_install() {
|
57 |
|
each_fakegem_install
|
58 |
|
|
59 |
|
# sqlite3 was called sqlite3-ruby before, so add a spec file that
|
60 |
|
# simply loads sqlite3 to make sure that old projects load correctly
|
61 |
|
# we don't even need to create a file to load this: the `require
|
62 |
|
# sqlite3` was already part of sqlite3-ruby requirements.
|
63 |
|
cat - <<EOF > "${T}/sqlite3-ruby.gemspec"
|
64 |
|
# generated by ebuild
|
65 |
|
# ${CATEGORY}/${PF}
|
66 |
|
Gem::Specification.new do |s|
|
67 |
|
s.name = "sqlite3-ruby"
|
68 |
|
s.version = "${RUBY_FAKEGEM_VERSION}"
|
69 |
|
s.summary = "Fake gem to load sqlite3"
|
70 |
|
s.homepage = "${HOMEPAGE}"
|
71 |
|
s.specification_version = 3
|
72 |
|
s.add_runtime_dependency("${RUBY_FAKEGEM_NAME}", ["= ${RUBY_FAKEGEM_VERSION}"])
|
73 |
|
end
|
74 |
|
EOF
|
75 |
|
RUBY_FAKEGEM_NAME=sqlite3-ruby \
|
76 |
|
RUBY_FAKEGEM_GEMSPEC="${T}/sqlite3-ruby.gemspec" \
|
77 |
|
ruby_fakegem_install_gemspec
|
78 |
|
}
|