diff options
author | Carl Smedstad | 2023-09-11 22:44:40 +0200 |
---|---|---|
committer | Carl Smedstad | 2023-09-11 22:44:40 +0200 |
commit | 76725659766af0a0570419029ba4a3f0025bad38 (patch) | |
tree | 7ba19f8df912ff6ec67777837ff616c921a95edc | |
parent | e4b06bc9d157e094a994a88f937eea14b4eb15b4 (diff) | |
download | aur-76725659766af0a0570419029ba4a3f0025bad38.tar.gz |
Publish version 0.2.2-5
-rw-r--r-- | .SRCINFO | 21 | ||||
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | PKGBUILD | 132 | ||||
-rw-r--r-- | remove-failing-tests.patch | 99 |
4 files changed, 231 insertions, 26 deletions
@@ -1,19 +1,24 @@ pkgbase = ruby-prawn-table - pkgdesc = Provides tables for PrawnPDF + pkgdesc = Provides support for tables in Prawn pkgver = 0.2.2 - pkgrel = 4 + pkgrel = 5 url = https://github.com/prawnpdf/prawn-table arch = any - license = RUBY license = GPL2 license = GPL3 - makedepends = ruby-rdoc + license = custom:RUBY + checkdepends = ruby-mocha + checkdepends = ruby-pdf-inspector + checkdepends = ruby-rspec + checkdepends = ruby-simplecov + makedepends = ruby-yard + makedepends = rubygems depends = ruby depends = ruby-prawn - noextract = prawn-table-0.2.2.gem options = !emptydirs - source = https://rubygems.org/downloads/prawn-table-0.2.2.gem - sha1sums = 0db902ddbb158fda2a7c2e44ef35b3505f4de4ba + source = https://github.com/prawnpdf/prawn-table/archive/refs/tags/0.2.2.tar.gz + source = remove-failing-tests.patch + sha256sums = 25f0bcdc6ffbb0ff3746f96d02e083cbbaf1c71cd928176a23b2bd5e77ccc377 + sha256sums = 68873f4ea2242f16d1bc25c026c83739935133b907f272f9e3ddc4632037d492 pkgname = ruby-prawn-table - diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..c8b56c2430a0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +* +!.gitignore +!PKGBUILD +!.SRCINFO +!remove-failing-tests.patch @@ -1,25 +1,121 @@ -# Generated by gem2arch (https://github.com/anatol/gem2arch) -# Maintainer: Anatoly Bashmakov <anatoly at posteo dot net> +# Maintainer: Carl Smedstad <carl.smedstad at protonmail dot com> +# Contributor: Anatoly Bashmakov <anatoly at posteo dot net> -_gemname=prawn-table -pkgname=ruby-$_gemname +pkgname=ruby-prawn-table +_name=${pkgname#ruby-} pkgver=0.2.2 -pkgrel=4 -pkgdesc='Provides tables for PrawnPDF' +pkgrel=5 +pkgdesc="Provides support for tables in Prawn" arch=(any) -url='https://github.com/prawnpdf/prawn-table' -license=(RUBY GPL2 GPL3) -depends=(ruby ruby-prawn) -makedepends=(ruby-rdoc) +url="https://github.com/prawnpdf/prawn-table" +license=( + GPL2 + GPL3 + custom:RUBY +) +depends=( + ruby + ruby-prawn +) +makedepends=( + ruby-yard + rubygems +) +checkdepends=( + ruby-mocha + ruby-pdf-inspector + ruby-rspec + ruby-simplecov +) options=(!emptydirs) -source=(https://rubygems.org/downloads/$_gemname-$pkgver.gem) -sha1sums=('0db902ddbb158fda2a7c2e44ef35b3505f4de4ba') -noextract=($_gemname-$pkgver.gem) +source=( + "$url/archive/refs/tags/$pkgver.tar.gz" + "remove-failing-tests.patch" +) +sha256sums=( + '25f0bcdc6ffbb0ff3746f96d02e083cbbaf1c71cd928176a23b2bd5e77ccc377' + '68873f4ea2242f16d1bc25c026c83739935133b907f272f9e3ddc4632037d492' +) + +_archive="$_name-$pkgver" + +prepare() { + cd "$_archive" + + # Update gemspec/Gemfile to allow newer version of the dependencies + sed --in-place --regexp-extended 's|~>|>=|g' "$_name.gemspec" + + # sed --in-place '/rspec/d' "$_name.gemspec" + sed --in-place '/prawn-manual_builder/d' "$_name.gemspec" + sed --in-place 's/2.14.1/>= 2.15.1/' "$_name.gemspec" + + # Remove 5 failint tests - 4 of them due to depending on image not packaged + # with Prawn, 1 due incompatible with recent rspec. + patch --strip=1 --input="$srcdir/remove-failing-tests.patch" +} + +build() { + cd "$_archive" + + local _gemdir + _gemdir="$(gem env gemdir)" + + gem build "$_name.gemspec" + + gem install \ + --local \ + --verbose \ + --ignore-dependencies \ + --no-user-install \ + --install-dir "tmp_install/$_gemdir" \ + --bindir "tmp_install/usr/bin" \ + "$_name-$pkgver.gem" + + # Remove unrepreducible files + rm --force --recursive --verbose \ + "tmp_install/$_gemdir/cache/" \ + "tmp_install/$_gemdir/gems/$_name-$pkgver/vendor/" \ + "tmp_install/$_gemdir/doc/$_name-$pkgver/ri/ext/" + + find "tmp_install/$_gemdir/gems/" \ + -type f \ + \( \ + -iname "*.o" -o \ + -iname "*.c" -o \ + -iname "*.so" -o \ + -iname "*.time" -o \ + -iname "gem.build_complete" -o \ + -iname "Makefile" \ + \) \ + -delete + + find "tmp_install/$_gemdir/extensions/" \ + -type f \ + \( \ + -iname "mkmf.log" -o \ + -iname "gem_make.out" \ + \) \ + -delete +} + +check() { + cd "$_archive" + + # Avoid depending on rubocop + # sed --in-place '/rubocop/d' Rakefile "$_name.gemspec" + + local _gemdir + _gemdir="$(gem env gemdir)" + + GEM_HOME="tmp_install/$_gemdir" rspec +} package() { - local _gemdir="$(ruby -e 'puts Gem.default_dir')" - gem install --ignore-dependencies --no-user-install -i "$pkgdir/$_gemdir" -n "$pkgdir/usr/bin" $_gemname-$pkgver.gem - rm "$pkgdir/$_gemdir/cache/$_gemname-$pkgver.gem" - install -D -m644 "$pkgdir/$_gemdir/gems/$_gemname-$pkgver/COPYING" "$pkgdir/usr/share/licenses/$pkgname/COPYING" - install -D -m644 "$pkgdir/$_gemdir/gems/$_gemname-$pkgver/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" + cd "$_archive" + + cp --archive --verbose tmp_install/* "$pkgdir" + + install --verbose -D --mode=0644 COPYING --target-directory "$pkgdir/usr/share/licenses/$pkgname" + install --verbose -D --mode=0644 LICENSE --target-directory "$pkgdir/usr/share/licenses/$pkgname" + install --verbose -D --mode=0644 ./*.md --target-directory "$pkgdir/usr/share/doc/$pkgname" } diff --git a/remove-failing-tests.patch b/remove-failing-tests.patch new file mode 100644 index 000000000000..9e1326e6f1eb --- /dev/null +++ b/remove-failing-tests.patch @@ -0,0 +1,99 @@ +diff --unified --recursive --text prawn-table-0.2.2.orig/spec/cell_spec.rb prawn-table-0.2.2/spec/cell_spec.rb +--- prawn-table-0.2.2.orig/spec/cell_spec.rb 2023-09-11 22:29:42.905157197 +0200 ++++ prawn-table-0.2.2/spec/cell_spec.rb 2023-09-11 22:30:17.041870878 +0200 +@@ -561,59 +561,3 @@ + end + end + end +- +-describe "Image cells" do +- before(:each) do +- create_pdf +- end +- +- describe "with default options" do +- before(:each) do +- @cell = Prawn::Table::Cell.make(@pdf, +- :image => "#{Prawn::DATADIR}/images/prawn.png") +- end +- +- it "should create a Cell::Image" do +- @cell.should be_a_kind_of(Prawn::Table::Cell::Image) +- end +- +- it "should pull the natural width and height from the image" do +- @cell.natural_content_width.should == 141 +- @cell.natural_content_height.should == 142 +- end +- end +- +- describe "hash syntax" do +- before(:each) do +- @table = @pdf.make_table([[{ +- :image => "#{Prawn::DATADIR}/images/prawn.png", +- :scale => 2, +- :fit => [100, 200], +- :image_width => 123, +- :image_height => 456, +- :position => :center, +- :vposition => :center +- }]]) +- @cell = @table.cells[0, 0] +- end +- +- +- it "should create a Cell::Image" do +- @cell.should be_a_kind_of(Prawn::Table::Cell::Image) +- end +- +- it "should pass through image options" do +- @pdf.expects(:embed_image).checking do |_, _, options| +- options[:scale].should == 2 +- options[:fit].should == [100, 200] +- options[:width].should == 123 +- options[:height].should == 456 +- options[:position].should == :center +- options[:vposition].should == :center +- end +- +- @table.draw +- end +- end +- +-end +diff --unified --recursive --text prawn-table-0.2.2.orig/spec/table_spec.rb prawn-table-0.2.2/spec/table_spec.rb +--- prawn-table-0.2.2.orig/spec/table_spec.rb 2023-09-11 22:29:42.905157197 +0200 ++++ prawn-table-0.2.2/spec/table_spec.rb 2023-09-11 22:30:57.405262922 +0200 +@@ -1282,32 +1282,6 @@ + + end + +- it "Prints table on one page when using subtable with colspan > 1", :unresolved, issue: 10 do +- pdf = Prawn::Document.new(margin: [ 30, 71, 55, 71]) +- +- lines = "one\ntwo\nthree\nfour" +- +- sub_table_lines = lines.split("\n").map do |line| +- if line == "one" +- [ { content: "#{line}", colspan: 2, size: 11} ] +- else +- [ { content: "\u2022"}, { content: "#{line}"} ] +- end +- end +- +- sub_table = pdf.make_table(sub_table_lines, +- cell_style: { border_color: '00ff00'}) +- +- #outer table +- pdf.table [[ +- { content: "Placeholder text", width: 200 }, +- { content: sub_table } +- ]], width: 515, cell_style: { border_width: 1, border_color: 'ff0000' } +- +- pdf.render +- pdf.page_count.should == 1 +- end +- + describe "An invalid table" do + + before(:each) do |