2009-12-29 02:50:51 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Recode < Formula
|
2012-04-17 02:02:20 +00:00
|
|
|
homepage 'http://recode.progiciels-bpi.ca/index.html'
|
|
|
|
url 'https://github.com/pinard/Recode/tarball/v3.6'
|
|
|
|
md5 'f82e9a6ede9119268c13493c9add2809'
|
2009-12-29 02:50:51 +00:00
|
|
|
|
|
|
|
depends_on "gettext"
|
2012-05-15 21:17:32 +00:00
|
|
|
depends_on "libtool" => :build if MacOS.xcode_version.to_f >= 4.3
|
2009-12-29 02:50:51 +00:00
|
|
|
|
2012-04-17 02:02:20 +00:00
|
|
|
# Patches from MacPorts
|
|
|
|
# No reason for patch given, no link to patches given. Someone shoot that guy :P
|
2009-12-29 02:50:51 +00:00
|
|
|
def patches
|
|
|
|
{ :p0 => DATA }
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
2012-02-27 20:18:12 +00:00
|
|
|
ENV.append 'LDFLAGS', '-liconv'
|
|
|
|
|
2012-02-27 12:56:35 +00:00
|
|
|
if MacOS.xcode_version >= "4.3"
|
|
|
|
d = "#{HOMEBREW_PREFIX}/share/libtool/config"
|
|
|
|
cp ["#{d}/config.guess", "#{d}/config.sub"], "."
|
|
|
|
elsif MacOS.leopard?
|
2010-11-14 23:16:27 +00:00
|
|
|
cp Dir["#{MacOS.xcode_prefix}/usr/share/libtool/config.*"], "."
|
2011-04-08 18:16:37 +00:00
|
|
|
else
|
|
|
|
cp Dir["#{MacOS.xcode_prefix}/usr/share/libtool/config/config.*"], "."
|
2010-11-09 05:35:10 +00:00
|
|
|
end
|
2010-11-09 15:45:09 +00:00
|
|
|
|
2010-07-15 16:37:11 +00:00
|
|
|
system "./configure", "--disable-debug", "--disable-dependency-tracking",
|
|
|
|
"--without-included-gettext",
|
2011-02-18 02:16:25 +00:00
|
|
|
"--infodir=#{info}",
|
2010-07-15 16:37:11 +00:00
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"--mandir=#{man}"
|
2009-12-29 02:50:51 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
__END__
|
|
|
|
--- lib/Makefile.in.orig 2007-10-20 01:45:40.000000000 +0200
|
|
|
|
+++ lib/Makefile.in 2007-10-20 01:46:19.000000000 +0200
|
|
|
|
@@ -107,8 +107,8 @@
|
|
|
|
AUTOMAKE_OPTIONS = gnits
|
|
|
|
|
|
|
|
noinst_LIBRARIES = libreco.a
|
|
|
|
-noinst_HEADERS = error.h getopt.h gettext.h pathmax.h xstring.h
|
|
|
|
-libreco_a_SOURCES = error.c getopt.c getopt1.c xstrdup.c
|
|
|
|
+noinst_HEADERS = error.h gettext.h pathmax.h xstring.h
|
|
|
|
+libreco_a_SOURCES = error.c xstrdup.c
|
|
|
|
|
|
|
|
EXTRA_DIST = alloca.c gettext.c malloc.c realloc.c strtol.c strtoul.c
|
|
|
|
|
|
|
|
@@ -128,7 +128,7 @@
|
|
|
|
LDFLAGS = @LDFLAGS@
|
|
|
|
LIBS = @LIBS@
|
|
|
|
libreco_a_DEPENDENCIES = @ALLOCA@ @LIBOBJS@
|
|
|
|
-libreco_a_OBJECTS = error.o getopt.o getopt1.o xstrdup.o
|
|
|
|
+libreco_a_OBJECTS = error.o xstrdup.o
|
|
|
|
AR = ar
|
|
|
|
CFLAGS = @CFLAGS@
|
|
|
|
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
|
|
|
--- src/libiconv.c.orig 2000-07-01 11:13:25.000000000 -0600
|
|
|
|
+++ src/libiconv.c 2008-10-21 01:24:40.000000000 -0600
|
|
|
|
@@ -195,12 +195,17 @@
|
|
|
|
memcpy() doesn't do here, because the regions might overlap.
|
|
|
|
memmove() isn't worth it, because we rarely have to move more
|
|
|
|
than 12 bytes. */
|
|
|
|
- if (input > input_buffer && input_left > 0)
|
|
|
|
+ cursor = input_buffer;
|
|
|
|
+ if (input_left > 0)
|
|
|
|
{
|
|
|
|
- cursor = input_buffer;
|
|
|
|
- do
|
|
|
|
- *cursor++ = *input++;
|
|
|
|
- while (--input_left > 0);
|
|
|
|
+ if (input > input_buffer)
|
|
|
|
+ {
|
|
|
|
+ do
|
|
|
|
+ *cursor++ = *input++;
|
|
|
|
+ while (--input_left > 0);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ cursor += input_left;
|
|
|
|
}
|
|
|
|
}
|