aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2021-10-18 12:45:57 +0200
committerJakub Jirutka <jakub@jirutka.cz>2021-10-18 18:44:43 +0200
commit7f73ccb0087eff2ea3b16d3137e4f6f7e0f24b82 (patch)
tree006a6afc54ef57daaf0962ad4a88475468691a32
parent1d2da34c193df30d4dbe2a2fcb4b3e0c4b3be5cf (diff)
downloadaports-7f73ccb0087eff2ea3b16d3137e4f6f7e0f24b82.tar.gz
aports-7f73ccb0087eff2ea3b16d3137e4f6f7e0f24b82.tar.bz2
aports-7f73ccb0087eff2ea3b16d3137e4f6f7e0f24b82.tar.xz
main/ruby-rbs: new aport
This gem is on the list of the "Bundled gems" (https://stdgems.org/#bundled-gems-ruby-302) for Ruby 3.0.2. I'm moving it to a separate aport to provide a correct pkgver - to avoid confusion and future complications if the upstream decide to remove it from the "Bundled gems" (as they did for some other gems with 3.0.0 release).
-rw-r--r--main/ruby-rbs/APKBUILD62
-rw-r--r--main/ruby-rbs/gemspec.patch14
2 files changed, 76 insertions, 0 deletions
diff --git a/main/ruby-rbs/APKBUILD b/main/ruby-rbs/APKBUILD
new file mode 100644
index 0000000000..0e7888b27a
--- /dev/null
+++ b/main/ruby-rbs/APKBUILD
@@ -0,0 +1,62 @@
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
+# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
+pkgname=ruby-rbs
+_gemname=rbs
+# Keep version in sync with "Bundled gems" (https://stdgems.org) for the
+# packaged Ruby version.
+pkgver=1.0.4
+pkgrel=0
+pkgdesc="Type Signature for Ruby"
+url="https://github.com/ruby/rbs"
+arch="noarch"
+license="BSD-2-Clause AND Ruby"
+depends="ruby"
+checkdepends="ruby-rake ruby-test-unit"
+makedepends="ruby-rdoc"
+subpackages="$pkgname-doc"
+source="https://github.com/ruby/rbs/archive/v$pkgver/$_gemname-$pkgver.tar.gz
+ gemspec.patch
+ "
+builddir="$srcdir/$_gemname-$pkgver"
+options="!check" # FIXME: require ruby-pry that is not packaged yet
+
+prepare() {
+ default_prepare
+ sed -i '/require .bundler/d' Rakefile
+}
+
+build() {
+ gem build $_gemname.gemspec
+}
+
+check() {
+ rake test
+}
+
+package() {
+ local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"
+
+ gem install \
+ --local \
+ --install-dir "$gemdir" \
+ --bindir "$pkgdir/usr/bin" \
+ --ignore-dependencies \
+ --document ri \
+ --verbose \
+ $_gemname
+
+ # Remove unnessecary files
+ cd "$gemdir"
+ rm -rf build_info cache extensions plugins
+}
+
+doc() {
+ pkgdesc="$pkgdesc (ri docs)"
+
+ amove "$(ruby -e 'puts Gem.default_dir')"/doc
+}
+
+sha512sums="
+d998a1613b7653278460f5cee19f38bbdd13aa46d9deb8e4da8fd710a78c6ede2784580481cad43700f3d2c4c51d0d0b70eac23b156215ad3df2d227d1f6a3b6 rbs-1.0.4.tar.gz
+e31431de3e1b13d9ac11277457f7856349029be9b775f1bab87eecd53998737b793cd310ba772ff122424b4c2c79e90dc4ed00debcc26a6d4d496ed19ac28aff gemspec.patch
+"
diff --git a/main/ruby-rbs/gemspec.patch b/main/ruby-rbs/gemspec.patch
new file mode 100644
index 0000000000..30877555b0
--- /dev/null
+++ b/main/ruby-rbs/gemspec.patch
@@ -0,0 +1,14 @@
+--- a/rbs.gemspec
++++ b/rbs.gemspec
+@@ -26,10 +26,7 @@
+ end
+
+ # Specify which files should be added to the gem when it is released.
+- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
+- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
+- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
+- end
++ spec.files = Dir["core/**/*.rbs", "exe/*", "lib/**/*.rb", "schema/**/*.json", "sig/**/*.rbs", "stdlib/**/*.rbs"]
+ spec.files << "lib/rbs/parser.rb"
+ spec.bindir = "exe"
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }