aboutsummaryrefslogtreecommitdiffstats
path: root/community/ruby-charlock_holmes
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2018-03-02 17:40:29 +0100
committerJakub Jirutka <jakub@jirutka.cz>2018-03-02 17:40:29 +0100
commit0f20f3910b4dd65b090b99f4372bd5274ac7d86f (patch)
treec6a67b1465fb61b49ac51a3a23bccff36106558e /community/ruby-charlock_holmes
parenta1540bbfb837e6a8690f747e0bd5f2edfc6d57a4 (diff)
downloadaports-0f20f3910b4dd65b090b99f4372bd5274ac7d86f.tar.bz2
aports-0f20f3910b4dd65b090b99f4372bd5274ac7d86f.tar.xz
community/ruby-charlock_holmes: move from testing
Diffstat (limited to 'community/ruby-charlock_holmes')
-rw-r--r--community/ruby-charlock_holmes/APKBUILD58
-rw-r--r--community/ruby-charlock_holmes/gemspec.patch11
-rw-r--r--community/ruby-charlock_holmes/rakefile.patch16
-rw-r--r--community/ruby-charlock_holmes/tests-fix-icu59.1.patch60
-rw-r--r--community/ruby-charlock_holmes/tests-no-bundler.patch10
5 files changed, 155 insertions, 0 deletions
diff --git a/community/ruby-charlock_holmes/APKBUILD b/community/ruby-charlock_holmes/APKBUILD
new file mode 100644
index 0000000000..379eb75d13
--- /dev/null
+++ b/community/ruby-charlock_holmes/APKBUILD
@@ -0,0 +1,58 @@
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
+# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
+pkgname=ruby-charlock_holmes
+_gemname=charlock_holmes
+pkgver=0.7.5
+pkgrel=1
+pkgdesc="Character encoding detection, brought to you by ICU"
+url="https://github.com/brianmario/charlock_holmes"
+arch="all"
+license="MIT"
+checkdepends="ruby-minitest ruby-rake"
+makedepends="icu-dev ruby ruby-dev zlib-dev"
+source="$pkgname-$pkgver.tar.gz::https://github.com/brianmario/$_gemname/archive/$pkgver.tar.gz
+ gemspec.patch
+ rakefile.patch
+ tests-no-bundler.patch
+ tests-fix-icu59.1.patch"
+builddir="$srcdir/$_gemname-$pkgver"
+
+build() {
+ cd "$builddir"
+
+ gem build $_gemname.gemspec
+
+ gem install --local \
+ --install-dir dist \
+ --ignore-dependencies \
+ --no-document \
+ --verbose \
+ $_gemname
+
+ # Needed for tests.
+ cp -l dist/extensions/*/*/$_gemname-*/$_gemname/*.so lib/$_gemname/
+}
+
+check() {
+ cd "$builddir"
+ rake test
+}
+
+package() {
+ local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"
+ cd "$builddir"/dist
+
+ mkdir -p "$gemdir"
+ cp -r extensions gems specifications "$gemdir"/
+
+ # Remove unnecessary and duplicated files.
+ rm -f "$gemdir"/extensions/*/*/$_gemname-*/mkmf.log
+ cd "$gemdir"/gems/$_gemname-$pkgver
+ rm -rf ext/ lib/$_gemname/*.so
+}
+
+sha512sums="a5ee9d47d8c8386e7be9ad10e93e7bd7663713df285b33e5d8afd865570e463a9f785e568675363f9b949a8207bbcc144a7378dfb206645824e9f0abc33ec668 ruby-charlock_holmes-0.7.5.tar.gz
+c30ca2b7ac859bae553f633ed1df1947ad735c804f0edacd20c50d2d38d277d4a5a883459134a8caf832230754f272ec2a55e42e1cdf24eea1954aad9ead2679 gemspec.patch
+ac59baaa1f17281f9b07c035b367e697e08943f4e0cf2b5a718e7a957c1c156bbea0c240646cdea94575e7729e60415ee6293edbaa7b86aad3285282b9385181 rakefile.patch
+6fcdc90539154a007109a4958d7fc7451b0d5a69840866af928ce7233823b32a0f5a8d7d3d9b249978807ff8dced1a1f85d14187c99b7fff1f2497e26b11a120 tests-no-bundler.patch
+231c0563a1bee92aafa0a20d3db8c28ecc9a5e85530825852ec6457edfd6db068f866b52310621c0be97e0e209835b12714f77ded47c0188e4c8180d8429cf64 tests-fix-icu59.1.patch"
diff --git a/community/ruby-charlock_holmes/gemspec.patch b/community/ruby-charlock_holmes/gemspec.patch
new file mode 100644
index 0000000000..67f97da65f
--- /dev/null
+++ b/community/ruby-charlock_holmes/gemspec.patch
@@ -0,0 +1,11 @@
+--- a/charlock_holmes.gemspec
++++ b/charlock_holmes.gemspec
+@@ -5,7 +5,7 @@
+ s.authors = ["Brian Lopez", "Vicent Martí"]
+ s.email = "seniorlopez@gmail.com"
+ s.extensions = ["ext/charlock_holmes/extconf.rb"]
+- s.files = `git ls-files ext lib`.split("\n")
++ s.files = Dir["lib/**/*", "ext/**/*"]
+ s.homepage = "https://github.com/brianmario/charlock_holmes"
+ s.rdoc_options = ["--charset=UTF-8"]
+ s.summary = "Character encoding detection, brought to you by ICU"
diff --git a/community/ruby-charlock_holmes/rakefile.patch b/community/ruby-charlock_holmes/rakefile.patch
new file mode 100644
index 0000000000..5957a67f23
--- /dev/null
+++ b/community/ruby-charlock_holmes/rakefile.patch
@@ -0,0 +1,16 @@
+--- a/Rakefile
++++ b/Rakefile
+@@ -5,12 +5,3 @@
+ end
+
+ task :default => :test
+-
+-gem 'rake-compiler', '>= 0.7.5'
+-require "rake/extensiontask"
+-
+-Rake::ExtensionTask.new 'charlock_holmes' do |ext|
+- ext.lib_dir = File.join 'lib', 'charlock_holmes'
+-end
+-
+-Rake::Task[:test].prerequisites << :compile
+\ No newline at end of file
diff --git a/community/ruby-charlock_holmes/tests-fix-icu59.1.patch b/community/ruby-charlock_holmes/tests-fix-icu59.1.patch
new file mode 100644
index 0000000000..3de390f333
--- /dev/null
+++ b/community/ruby-charlock_holmes/tests-fix-icu59.1.patch
@@ -0,0 +1,60 @@
+See https://github.com/brianmario/charlock_holmes/issues/115
+
+--- a/test/encoding_detector_test.rb
++++ b/test/encoding_detector_test.rb
+@@ -24,7 +24,7 @@
+ assert detected_list.is_a? Array
+
+ encoding_list = detected_list.map {|d| d[:encoding]}.sort
+- assert_equal ['ISO-8859-1', 'ISO-8859-2', 'UTF-8'], encoding_list
++ assert_equal ['ISO-8859-1', 'ISO-8859-2', 'UTF-16BE', 'UTF-16LE', 'UTF-8'], encoding_list
+ end
+
+ def test_class_level_detect_all_method_accepts_encoding_hint
+@@ -33,7 +33,7 @@
+ assert detected_list.is_a? Array
+
+ encoding_list = detected_list.map {|d| d[:encoding]}.sort
+- assert_equal ['ISO-8859-1', 'ISO-8859-2', 'UTF-8'], encoding_list
++ assert_equal ['ISO-8859-1', 'ISO-8859-2', 'UTF-16BE', 'UTF-16LE', 'UTF-8'], encoding_list
+ end
+
+ def test_has_detect_method
+@@ -54,7 +54,7 @@
+ assert detected_list.is_a? Array
+
+ encoding_list = detected_list.map {|d| d[:encoding]}.sort
+- assert_equal ['ISO-8859-1', 'ISO-8859-2', 'UTF-8'], encoding_list
++ assert_equal ['ISO-8859-1', 'ISO-8859-2', 'UTF-16BE', 'UTF-16LE', 'UTF-8'], encoding_list
+ end
+
+ def test_detect_all_accepts_encoding_hint
+@@ -63,7 +63,7 @@
+ assert detected_list.is_a? Array
+
+ encoding_list = detected_list.map {|d| d[:encoding]}.sort
+- assert_equal ['ISO-8859-1', 'ISO-8859-2', 'UTF-8'], encoding_list
++ assert_equal ['ISO-8859-1', 'ISO-8859-2', 'UTF-16BE', 'UTF-16LE', 'UTF-8'], encoding_list
+ end
+
+ def test_strip_tags_flag
+--- a/test/string_methods_test.rb
++++ b/test/string_methods_test.rb
+@@ -26,7 +26,7 @@
+ assert detected_list.is_a? Array
+
+ encoding_list = detected_list.map {|d| d[:encoding]}.sort
+- assert_equal ['ISO-8859-1', 'ISO-8859-2', 'UTF-8'], encoding_list
++ assert_equal ['ISO-8859-1', 'ISO-8859-2', 'UTF-16BE', 'UTF-16LE', 'UTF-8'], encoding_list
+ end
+
+ def test_detect_encodings_accepts_encoding_hint_param
+@@ -37,7 +37,7 @@
+ assert detected_list.is_a? Array
+
+ encoding_list = detected_list.map {|d| d[:encoding]}.sort
+- assert_equal ['ISO-8859-1', 'ISO-8859-2', 'UTF-8'], encoding_list
++ assert_equal ['ISO-8859-1', 'ISO-8859-2', 'UTF-16BE', 'UTF-16LE', 'UTF-8'], encoding_list
+ end
+
+ def test_returns_a_ruby_compatible_encoding_name
diff --git a/community/ruby-charlock_holmes/tests-no-bundler.patch b/community/ruby-charlock_holmes/tests-no-bundler.patch
new file mode 100644
index 0000000000..24162fb0f5
--- /dev/null
+++ b/community/ruby-charlock_holmes/tests-no-bundler.patch
@@ -0,0 +1,10 @@
+--- a/test/helper.rb
++++ b/test/helper.rb
+@@ -2,7 +2,6 @@
+
+ # blah fuck this
+ require 'rubygems' if !defined?(Gem)
+-require 'bundler/setup'
+
+ require 'charlock_holmes'
+