Permalink
Browse files

Add charlock_holmes

  • Loading branch information...
1 parent 578cc9b commit a7675059cc13c50e1c361da9023a1601e32caa40 @a3li committed May 27, 2012
View
@@ -7,6 +7,7 @@ About the ebuilds
-----------------
* **app-backup/tartarus**: A flexible yet simple backup script using bash to wrap standard UNIX commands.
+* **dev-ruby/charlock_holmes**: Character encoding detection library for ruby.
* **games-misc/xpenguins**: XPenguins with KDE4 support
* **kde-misc/plasma-icontasks**: Modified version of KDE 4.7 taskbar applet and taskmanager library
* **net-fs/afpfs-ng** ([bug 182046](https://bugs.gentoo.org/show_bug.cgi?id=182046)): An Apple Filing Protocol (AFP) client, also providing a FUSE filesystem.
@@ -0,0 +1,3 @@
+AUX extconf.patch 1340 RMD160 18f5571ae9fd2c8daf8481943968f774e49dafba SHA1 dae6101fb2e402401477919ec171e32c21845cf7 SHA256 138eff2646dd79464fa91d2f2654af16d771bc79b9e078c241911c25c41a8f08
+DIST charlock_holmes-0.6.8.gem 648192 RMD160 2ec16cddd5c89ce14df37b5349b4ed6c9709b14d SHA1 9f288be63c9dfca6f6ff9dcc9228314a494613fa SHA256 1f3af070aa98fe464413cbc29741b6e4cd986f50e3e4e895771ca91e74428361
+EBUILD charlock_holmes-0.6.8.ebuild 1118 RMD160 763e84e0063bdf7fb188673e9dc1960830275a28 SHA1 47f2b2fbcd43f8e4b9ef8b35ffd6dfb737dd758d SHA256 264a7a64c0d4d5eaa3ba8848d173d066761659ca3acea64fee08aa2137ad0148
@@ -0,0 +1,50 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-ruby/bundler/bundler-1.0.22.ebuild,v 1.3 2012/05/01 18:24:03 armin76 Exp $
+
+EAPI=2
+
+USE_RUBY="ruby18 ruby19"
+
+RUBY_FAKEGEM_TASK_TEST="spec"
+
+# No documentation task
+#RUBY_FAKEGEM_TASK_DOC=""
+RUBY_FAKEGEM_EXTRADOC="README.md"
+
+inherit ruby-fakegem
+
+DESCRIPTION="Character encoding detection, brought to you by ICU"
+HOMEPAGE="https://github.com/brianmario/charlock_holmes"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+# Tests fail with obscure file not founds
+RESTRICT="test"
+
+ruby_add_rdepend "dev-ruby/rake-compiler"
+
+ruby_add_bdepend "test? ( dev-ruby/rspec:2 )"
+
+RDEPEND="${RDEPEND}
+ dev-vcs/git
+ sys-apps/file"
+DEPEND="${DEPEND}
+ test? ( dev-vcs/git )"
+
+each_ruby_prepare() {
+ cd ext/charlock_holmes || die
+ epatch "${FILESDIR}/extconf.patch" || die
+}
+
+each_ruby_configure() {
+ ${RUBY} -Cext/charlock_holmes extconf.rb || die
+}
+
+each_ruby_compile() {
+ emake -Cext/charlock_holmes || die
+ mv ext/charlock_holmes/charlock_holmes$(get_modname) lib/charlock_holmes/ || die
+}
@@ -0,0 +1,43 @@
+Fixes two issues:
+ - Don't bundle file/libmagic
+ - Avoid underlinking by linking against libz, libicuuc, and libicudata
+
+--- extconf.rb.old 2012-05-27 11:17:30.798768657 +0200
++++ extconf.rb 2012-05-27 11:38:49.561899729 +0200
+@@ -45,31 +45,12 @@
+ exit(1)
+ end
+
+-##
+-# libmagic dependency
+-#
++# Fix underlinking
++have_library 'z' or abort 'libz missing'
++have_library 'icuuc' or abort 'libicuuc missing'
++have_library 'icudata' or abort 'libicudata missing'
+
+-src = File.basename('file-5.08.tar.gz')
+-dir = File.basename(src, '.tar.gz')
+-
+-Dir.chdir("#{CWD}/src") do
+- FileUtils.rm_rf(dir) if File.exists?(dir)
+-
+- sys("tar zxvf #{src}")
+- Dir.chdir(dir) do
+- sys("./configure --prefix=#{CWD}/dst/ --disable-shared --enable-static --with-pic")
+- sys("make -C src install")
+- sys("make -C magic install")
+- end
+-end
+-
+-FileUtils.cp "#{CWD}/dst/lib/libmagic.a", "#{CWD}/libmagic_ext.a"
+-
+-$INCFLAGS[0,0] = " -I#{CWD}/dst/include "
+-$LDFLAGS << " -L#{CWD} "
+-
+-dir_config 'magic'
+-unless have_library 'magic_ext' and have_header 'magic.h'
++unless have_library 'magic' and have_header 'magic.h'
+ STDERR.puts "\n\n"
+ STDERR.puts "***************************************************************************************"
+ STDERR.puts "********* error compiling and linking libmagic. please report issue on github *********"

0 comments on commit a767505

Please sign in to comment.