blob: d2a5b02779692ac5e7be6769643603668f557f67 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
USE_RUBY="ruby32 ruby33 ruby34 ruby40"
RUBY_FAKEGEM_EXTRADOC="README.md"
RUBY_FAKEGEM_BINWRAP=""
RUBY_FAKEGEM_GEMSPEC="brotli.gemspec"
RUBY_FAKEGEM_EXTENSIONS=(ext/brotli/extconf.rb)
RUBY_FAKEGEM_EXTENSION_LIBDIR="lib/brotli"
inherit ruby-fakegem
# upstream brotli aggressively strips files from generated git archives. So you need to fetch the test files one by one.
BROTLI_COMMIT="028fb5a23661f123017c060daa546b55cf4bde29"
DESCRIPTION="Brotli compressor/decompressor"
HOMEPAGE="https://github.com/miyucy/brotli"
SRC_URI="
https://github.com/miyucy/brotli/archive/v${PV}.tar.gz -> ruby-${P}.tar.gz
test? (
https://github.com/google/brotli/raw/${BROTLI_COMMIT}/tests/testdata/alice29.txt
-> brotli-${BROTLI_COMMIT:0:8}-alice29.txt
https://github.com/google/brotli/raw/${BROTLI_COMMIT}/tests/testdata/alice29.txt.compressed
-> brotli-${BROTLI_COMMIT:0:8}-alice29.txt.compressed
https://github.com/google/brotli/raw/${BROTLI_COMMIT}/tests/testdata/zerosukkanooa
-> brotli-${BROTLI_COMMIT:0:8}-zerosukkanooa
https://github.com/google/brotli/raw/${BROTLI_COMMIT}/tests/testdata/zerosukkanooa.compressed
-> brotli-${BROTLI_COMMIT:0:8}-zerosukkanooa.compressed
)
"
LICENSE="MIT"
SLOT="$(ver_cut 1)"
KEYWORDS="~amd64"
DEPEND=">=app-arch/brotli-1.1.0:="
RDEPEND="${DEPEND}"
ruby_add_bdepend "
test? (
dev-ruby/bundler
dev-ruby/rantly:*
>=dev-ruby/test-unit-3.0
dev-ruby/test-unit-rr
)
"
all_ruby_prepare() {
sed -e 's/__dir__/"."/' \
-e 's/git ls-files -z/find * -print0/' \
-e 's:require_relative ":require "./:' \
-i ${RUBY_FAKEGEM_GEMSPEC} || die
# Avoid rake-compiler, we handle it via the eclass
sed -e '/rake-compiler/ s:^:#:' \
-i Gemfile || die
sed -e '/require "rake\/extensiontask"/ s:^:#:' \
-e '/Rake::ExtensionTask/,/^end/ s:^:#:' \
-e '/task build: :compile/ s:^:#:' \
-e '/task test: :compile/ s:^:#:' \
-i Rakefile || die
if use test; then
mkdir -p vendor/brotli/tests/testdata || die
cp {"${DISTDIR}"/brotli-${BROTLI_COMMIT:0:8}-,vendor/brotli/tests/testdata/}alice29.txt || die
cp {"${DISTDIR}"/brotli-${BROTLI_COMMIT:0:8}-,vendor/brotli/tests/testdata/}alice29.txt.compressed || die
cp {"${DISTDIR}"/brotli-${BROTLI_COMMIT:0:8}-,vendor/brotli/tests/testdata/}zerosukkanooa || die
cp {"${DISTDIR}"/brotli-${BROTLI_COMMIT:0:8}-,vendor/brotli/tests/testdata/}zerosukkanooa.compressed || die
fi
}
|