aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2021-10-18 12:37:18 +0200
committerJakub Jirutka <jakub@jirutka.cz>2021-10-18 18:44:42 +0200
commit9c245821719151dfd0af9dbf4eea7f1bca97cc87 (patch)
treec5fdeccd79ca7d90a28e140d4c95945c121f6e5d
parent547ad57b56ec5e1a9482a0942c1f41c8ee7824ea (diff)
downloadaports-9c245821719151dfd0af9dbf4eea7f1bca97cc87.tar.gz
aports-9c245821719151dfd0af9dbf4eea7f1bca97cc87.tar.bz2
aports-9c245821719151dfd0af9dbf4eea7f1bca97cc87.tar.xz
main/ruby-minitest: new aport
This gem was bundled in main/ruby and it's 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). When the gem was bundled its pkgver was set to that of the ruby package, now its pkgver is set to its upstream version which is lower so users upgrading need to pass `--available` to the `apk upgrade` command.
-rw-r--r--main/ruby-minitest/APKBUILD66
-rw-r--r--main/ruby-minitest/gemspec.patch15
2 files changed, 81 insertions, 0 deletions
diff --git a/main/ruby-minitest/APKBUILD b/main/ruby-minitest/APKBUILD
new file mode 100644
index 0000000000..9c669ea2ea
--- /dev/null
+++ b/main/ruby-minitest/APKBUILD
@@ -0,0 +1,66 @@
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
+# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
+pkgname=ruby-minitest
+_gemname=minitest
+# Keep version in sync with "Bundled gems" (https://stdgems.org) for the
+# packaged Ruby version.
+pkgver=5.14.2
+pkgrel=0
+pkgdesc="Suite of testing facilities supporting TDD, BDD, mocking, and benchmarking for Ruby"
+url="https://github.com/seattlerb/minitest"
+arch="noarch"
+license="MIT"
+depends="ruby"
+makedepends="ruby-rdoc"
+subpackages="$pkgname-doc"
+source="https://github.com/seattlerb/minitest/archive/v$pkgver/$_gemname-$pkgver.tar.gz
+ https://rubygems.org/downloads/$_gemname-$pkgver.gem
+ "
+builddir="$srcdir/$_gemname-$pkgver"
+
+prepare() {
+ default_prepare
+
+ # Generate gemspec (there's no gemspec in the source).
+ gem specification -l --ruby "$srcdir"/$_gemname-$pkgver.gem \
+ > "$builddir"/$_gemname.gemspec
+}
+
+build() {
+ gem build $_gemname.gemspec
+}
+
+check() {
+ ruby -Ilib -Itest -e "Dir.glob('./test/**/test_*.rb', &method(:require))"
+}
+
+package() {
+ local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"
+ local geminstdir="$gemdir/gems/$_gemname-$pkgver"
+
+ gem install \
+ --local \
+ --install-dir "$gemdir" \
+ --ignore-dependencies \
+ --document ri \
+ --verbose \
+ $_gemname
+
+ # Remove unnessecary files
+ cd "$gemdir"
+ rm -rf build_info cache extensions plugins
+
+ cd "$geminstdir"
+ rm -rf History.* Manifest.* README.* Rakefile test/
+}
+
+doc() {
+ pkgdesc="$pkgdesc (ri docs)"
+
+ amove "$(ruby -e 'puts Gem.default_dir')"/doc
+}
+
+sha512sums="
+7e59cc35abfbd161f688ce58a8194881f3aff00deca9fea47ca00f93ab972990ba08d801e98b2240e35d547ca9010ce39fa2a8fcbf0bca452b80315bf5db888b minitest-5.14.2.tar.gz
+c1cdb87824382233d4ae0570346a6888ecdf0dddbd5fbc9bc136e1c8ed9e1ce57d08d5994f57ba1eee99a38e48a04a10a32288d34ce10ca4ecdfa15587cf602e minitest-5.14.2.gem
+"
diff --git a/main/ruby-minitest/gemspec.patch b/main/ruby-minitest/gemspec.patch
new file mode 100644
index 0000000000..a21a0c5e6e
--- /dev/null
+++ b/main/ruby-minitest/gemspec.patch
@@ -0,0 +1,15 @@
+--- a/webrick.gemspec
++++ b/webrick.gemspec
+@@ -14,12 +14,6 @@
+
+ s.require_path = %w{lib}
+ s.files = [
+- "Gemfile",
+- "LICENSE.txt",
+- "README.md",
+- "Rakefile",
+- "bin/console",
+- "bin/setup",
+ "lib/webrick.rb",
+ "lib/webrick/accesslog.rb",
+ "lib/webrick/cgi.rb",