1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-23 11:15:13 +03:00
aports/community/ruby-mathematical/APKBUILD
Jakub Jirutka d8a3193eb5 community/ruby-mathematical: add ruby-base64 to depends
base64 is not part of the default gems starting from Ruby 3.4.0
2025-04-22 23:19:28 +02:00

96 lines
2.7 KiB
Text

# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ruby-mathematical
_gemname=${pkgname#ruby-}
pkgver=1.6.20
pkgrel=1
pkgdesc="Convert mathematical equations to SVGs, PNGs, or MathML"
url="https://www.gjtorikian.com/mathematical/"
arch="all"
license="MIT"
depends="
ruby
ruby-base64
ruby-enum
"
makedepends="
cmake
lasem-dev
mtex2mml-dev
ruby-dev
"
checkdepends="
font-bakoma-ttf
mtex2mml-fixtures
ruby-minitest
ruby-nokogiri
ruby-rake
"
source="https://github.com/gjtorikian/$_gemname/archive/v$pkgver/$pkgname-$pkgver.tar.gz
use-system-mtex2mml-fixtures.patch
rakefile.patch
"
builddir="$srcdir/$_gemname-$pkgver"
prepare() {
default_prepare
# Don't load bundler, it messes with GEM_PATH.
sed -i "/^require\s*[\"']bundler/d" Rakefile test/test_helper.rb
# Some tests in this file are unstable (randomly fails).
# https://github.com/gjtorikian/mathematical/issues/73
rm test/mathematical/delimiters_test.rb
}
build() {
gem build $_gemname.gemspec
gem install --local \
--install-dir dist \
--ignore-dependencies \
--no-document \
--verbose \
$_gemname -- \
--use-system-lasem \
--use-system-mtex2MML
}
check() {
local dev_deps
# Install missing development dependencies needed and used only for running
# tests. We can't install them easily with bundler, because there's
# no way how to force it to NOT update already satisifed dependencies.
# We can't install them directly with gem either, because there's no
# way how to force it to instally only dependencies, not the gem itself.
dev_deps=$(gem install --explain --development --minimal-deps $_gemname-$pkgver.gem \
| head -n -1 | sed -En 's/-([^-]+)$/:\1/p')
gem install --instal-dir=.gem --conservative --no-document $dev_deps
local rc=0
GEM_PATH='dist:.gem' ruby -S rake test || rc=$?
case "$CARCH" in
armhf | armv7) return 0;; # FIXME: 3 tests fail, ignore it for now
*) return $rc;;
esac
}
package() {
local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"
cd "$builddir"/dist
mkdir -p "$gemdir"
cp -r extensions gems specifications "$gemdir"/
# Remove unnecessary files and rubbish...
find "$gemdir"/extensions/ -name mkmf.log -delete
cd "$gemdir"/gems/$_gemname-$pkgver
rm -rf -- ext/ test/ Rakefile *.md *.txt
}
sha512sums="
748e7d71e34da95ae71ec619d12a7510a25d9bdddabf07c06129e9d1d84a7d863e1c5002e48feff10c5f2abca40a68a9ec8f234d3881caacd055ba41ffe588be ruby-mathematical-1.6.20.tar.gz
74ec74e161040a14e255562a0568aa961c86d16601d9e2f88484c8f828e90d3bd9153ec80b569471d88367be8f4dc708696f7b4645cf05b01d0c9c8bb9e248ee use-system-mtex2mml-fixtures.patch
2c8685403c30c97e6718704fd782d95a5777e177d94383bafdc730c15ee2c5125f60dd63d361eec826297bb12e1c6841af33368d7f04d2cbb40b96ae7143d03a rakefile.patch
"