From a92ad274cbfec76b661e833c14216545f35a1bae Mon Sep 17 00:00:00 2001
From: Jakub Jirutka <jakub@jirutka.cz>
Date: Tue, 26 Dec 2023 22:13:51 +0100
Subject: [PATCH] community/ruby-mathematical: upgrade to 1.6.18

---
 community/ruby-mathematical/APKBUILD          | 12 ++++----
 .../gemspec-update-pry-byebug.patch           |  9 ------
 community/ruby-mathematical/rakefile.patch    | 30 +++++++++++++++++++
 .../use-system-mtex2mml-fixtures.patch        | 14 ++++-----
 4 files changed, 43 insertions(+), 22 deletions(-)
 delete mode 100644 community/ruby-mathematical/gemspec-update-pry-byebug.patch
 create mode 100644 community/ruby-mathematical/rakefile.patch

diff --git a/community/ruby-mathematical/APKBUILD b/community/ruby-mathematical/APKBUILD
index dfa32143725e..15be5e2e016f 100644
--- a/community/ruby-mathematical/APKBUILD
+++ b/community/ruby-mathematical/APKBUILD
@@ -2,8 +2,8 @@
 # Maintainer: Jakub Jirutka <jakub@jirutka.cz>
 pkgname=ruby-mathematical
 _gemname=${pkgname#ruby-}
-pkgver=1.6.14
-pkgrel=5
+pkgver=1.6.18
+pkgrel=0
 pkgdesc="Convert mathematical equations to SVGs, PNGs, or MathML"
 url="https://www.gjtorikian.com/mathematical/"
 arch="all"
@@ -24,7 +24,7 @@ checkdepends="
 	"
 source="https://github.com/gjtorikian/$_gemname/archive/v$pkgver/$pkgname-$pkgver.tar.gz
 	use-system-mtex2mml-fixtures.patch
-	gemspec-update-pry-byebug.patch
+	rakefile.patch
 	"
 builddir="$srcdir/$_gemname-$pkgver"
 
@@ -86,7 +86,7 @@ package() {
 }
 
 sha512sums="
-05201ee54795a410635affbe7bf84fd4d332a64a8e476ce27672ecdc4b8ebac58036b1f7fcf7a47ffd13d5210706c2679a0bed5c8138cd91a92e8473334003c7  ruby-mathematical-1.6.14.tar.gz
-35c691b2006e6c0bac26ebb0adac5ffa99fbc37100c94d5978508b91b3df84544e4fc8fa38b5de01ae0fcc644c1eeb97b6129f59b4488b467c1ded468277c400  use-system-mtex2mml-fixtures.patch
-aaa1ee99ec2d546badc2c15d85ed31c4df072497133fa0208a91d0da7a7f85e57dec70093718705e0f861474508d7904fa353e81a0ff11f1a3ddda47cd481d05  gemspec-update-pry-byebug.patch
+2a0b08362346221b4e2bfa26d2283c75a9c0997932d27771ccfbde12ce4c3848e32bd7cb526107d72ed9837383a1e8643fc28c40e10daecbed9782f47367e6c0  ruby-mathematical-1.6.18.tar.gz
+74ec74e161040a14e255562a0568aa961c86d16601d9e2f88484c8f828e90d3bd9153ec80b569471d88367be8f4dc708696f7b4645cf05b01d0c9c8bb9e248ee  use-system-mtex2mml-fixtures.patch
+2c8685403c30c97e6718704fd782d95a5777e177d94383bafdc730c15ee2c5125f60dd63d361eec826297bb12e1c6841af33368d7f04d2cbb40b96ae7143d03a  rakefile.patch
 "
diff --git a/community/ruby-mathematical/gemspec-update-pry-byebug.patch b/community/ruby-mathematical/gemspec-update-pry-byebug.patch
deleted file mode 100644
index a0b6d27f1e67..000000000000
--- a/community/ruby-mathematical/gemspec-update-pry-byebug.patch
+++ /dev/null
@@ -1,9 +0,0 @@
-Fix the following error in tests:
-
-    .gem/gems/pry-0.13.1/lib/pry/code.rb:342:in `<class:Code>': undefined method `=~' for class `Pry::Code' (NameError)
-
---- a/mathematical.gemspec
-+++ b/mathematical.gemspec
-@@ -30 +30 @@
--  spec.add_development_dependency 'pry-byebug', '~> 3.9.0'
-+  spec.add_development_dependency 'pry-byebug', '~> 3.10.1'
diff --git a/community/ruby-mathematical/rakefile.patch b/community/ruby-mathematical/rakefile.patch
new file mode 100644
index 000000000000..9cbaf28f103e
--- /dev/null
+++ b/community/ruby-mathematical/rakefile.patch
@@ -0,0 +1,30 @@
+--- a/Rakefile
++++ b/Rakefile
+@@ -1,7 +1,6 @@
+ #!/usr/bin/env rake
+ # frozen_string_literal: true
+ 
+-require "bundler/gem_tasks"
+ require "rake/testtask"
+ require "fileutils"
+ require "tmpdir"
+@@ -43,10 +42,6 @@
+   end
+ end
+ 
+-require "rubocop/rake_task"
+-
+-RuboCop::RakeTask.new
+-
+ desc "Pretty format C code"
+ task :format do
+   puts %x(astyle --indent=spaces=2 --style=1tbs --keep-one-line-blocks \
+@@ -58,8 +53,3 @@
+   $LOAD_PATH.unshift("lib")
+   load "script/benchmark.rb"
+ end
+-
+-GEMSPEC = Bundler.load_gemspec("mathematical.gemspec")
+-gem_path = Gem::PackageTask.new(GEMSPEC).define
+-desc "Package the ruby gem"
+-task "package" => [gem_path]
diff --git a/community/ruby-mathematical/use-system-mtex2mml-fixtures.patch b/community/ruby-mathematical/use-system-mtex2mml-fixtures.patch
index 76621f1f8e55..1630113c5b1d 100644
--- a/community/ruby-mathematical/use-system-mtex2mml-fixtures.patch
+++ b/community/ruby-mathematical/use-system-mtex2mml-fixtures.patch
@@ -1,11 +1,11 @@
 --- a/test/test_helper.rb
 +++ b/test/test_helper.rb
-@@ -6,7 +6,7 @@
- require 'pp'
- require 'pry-byebug'
+@@ -7,7 +7,7 @@
+ require "math-to-itex"
+ require "pp"
  
--MTEX2MML_FIXTURES_DIR = File.join('ext', 'mathematical', 'mtex2MML', 'tests', 'fixtures')
+-MTEX2MML_FIXTURES_DIR = File.join("ext", "mathematical", "mtex2MML", "tests", "fixtures")
 +MTEX2MML_FIXTURES_DIR = '/usr/share/mtex2MML/fixtures'
- MATHJAX_TEST_DIR = File.join(MTEX2MML_FIXTURES_DIR, 'MathJax')
- MATHJAX_TEX_DIR = File.join(MATHJAX_TEST_DIR, 'LaTeXToMathML-tex')
- TRAVIS_OSX = ENV['TRAVIS'] && ENV['TRAVIS_OS_NAME'] == 'osx'
+ MATHJAX_TEST_DIR = File.join(MTEX2MML_FIXTURES_DIR, "MathJax")
+ MATHJAX_TEX_DIR = File.join(MATHJAX_TEST_DIR, "LaTeXToMathML-tex")
+ 
-- 
GitLab