From d0df2704f923161ec97ca82ff8174fd06974120e Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 14 Jun 2020 15:58:44 +0200 Subject: [PATCH] lha: update to current git version. There has been no release archive on the old website since 2005, but development has moved on. Also use a better versionning scheme because all versions since lha got an autoconf script have been named 1.14i. --- ...14i.recipe => lha-1.14i.ac20191005.recipe} | 16 +-- .../lha/patches/lha-1.14i.ac20191005.patchset | 77 ++++++++++++ app-arch/lha/patches/lha-1.14i.patchset | 113 ------------------ 3 files changed, 86 insertions(+), 120 deletions(-) rename app-arch/lha/{lha-1.14i.recipe => lha-1.14i.ac20191005.recipe} (69%) create mode 100644 app-arch/lha/patches/lha-1.14i.ac20191005.patchset delete mode 100644 app-arch/lha/patches/lha-1.14i.patchset diff --git a/app-arch/lha/lha-1.14i.recipe b/app-arch/lha/lha-1.14i.ac20191005.recipe similarity index 69% rename from app-arch/lha/lha-1.14i.recipe rename to app-arch/lha/lha-1.14i.ac20191005.recipe index b43c7017c..fbee1ea3a 100644 --- a/app-arch/lha/lha-1.14i.recipe +++ b/app-arch/lha/lha-1.14i.ac20191005.recipe @@ -4,13 +4,14 @@ is rather effective and the unpacking is fast." HOMEPAGE="http://sourceforge.jp/projects/lha/" COPYRIGHT="1991 Masaru Oki 1993-1995 Nobutaka Watazaki - 2000 Tsugio Okamoto et al." + 2000 Tsugio Okamoto et al. + 2000-2020 Koji Arai" LICENSE="lha" -REVISION="3" -SOURCE_URI="http://jaist.dl.sourceforge.jp/lha/22231/lha-1.14i-ac20050924p1.tar.gz" -CHECKSUM_SHA256="b5261e9f98538816aa9e64791f23cb83f1632ecda61f02e54b6749e9ca5e9ee4" -SOURCE_DIR="lha-1.14i-ac20050924p1" -PATCHES="lha-1.14i.patchset" +REVISION="1" +SOURCE_URI="https://github.com/jca02266/lha/archive/7c3cd95fdf0d2f9198bb779561724cd314bc39a6.tar.gz" +CHECKSUM_SHA256="0f00ac5167dfa5754ad6e02d9cddce4dae997093515f5a906934b52426115efa" +SOURCE_DIR="lha-7c3cd95fdf0d2f9198bb779561724cd314bc39a6" +PATCHES="lha-$portVersion.patchset" ARCHITECTURES="x86 x86_gcc2 x86_64" @@ -41,7 +42,8 @@ BUILD_PREREQUIRES=" BUILD() { autoreconf -vfi - LDFLAGS=-liconv runConfigure ./configure + #LDFLAGS=-liconv runConfigure ./configure + runConfigure ./configure make $jobArgs } diff --git a/app-arch/lha/patches/lha-1.14i.ac20191005.patchset b/app-arch/lha/patches/lha-1.14i.ac20191005.patchset new file mode 100644 index 000000000..72eff1a5e --- /dev/null +++ b/app-arch/lha/patches/lha-1.14i.ac20191005.patchset @@ -0,0 +1,77 @@ +From 92fc0e864b51876c3ed08225266c58cf7003b4b6 Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Sun, 14 Jun 2020 15:31:28 +0200 +Subject: C89 fix + + +diff --git a/src/bitio.c b/src/bitio.c +index ac4e61b..1c3e1de 100644 +--- a/src/bitio.c ++++ b/src/bitio.c +@@ -19,8 +19,8 @@ fillbuf(n) /* Shift bitbuf n bits left, read n bits */ + n -= bitcount; + bitbuf = (bitbuf << bitcount) + (subbitbuf >> (CHAR_BIT - bitcount)); + if (compsize != 0) { +- compsize--; + int c = getc(infile); ++ compsize--; + if (c == EOF) { + fatal_error("cannot read stream"); + } +-- +2.26.0 + + +From b351c0c172434d1597d57853258a999c0c2b3610 Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Sun, 14 Jun 2020 15:57:59 +0200 +Subject: Fix detection of libiconv + + +diff --git a/configure.ac b/configure.ac +index eac9205..6558bd1 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -106,7 +106,7 @@ AC_CHECK_FUNCS(strchr strdup memcpy memset memmove strcasecmp) + AC_CHECK_FUNCS(mktime timelocal tzset ftime gettimeofday utime) + AC_CHECK_FUNCS(ftruncate chsize lchown mkstemp ftello) + AC_CHECK_FUNCS(getpwuid getgrgid getpwnam getgrnam) +-AC_CHECK_FUNCS(iconv basename) ++AC_CHECK_FUNCS(libiconv iconv basename) + AC_REPLACE_FUNCS(vsnprintf fnmatch) + + if test $ac_header_dirent = no; then +diff --git a/src/header.c b/src/header.c +index 523f2b5..3284000 100644 +--- a/src/header.c ++++ b/src/header.c +@@ -2000,7 +2000,7 @@ ConvertUTF8ToEncoding(const char* inUTF8Buf, + return cfResult; + } + +-#elif HAVE_ICONV ++#elif defined(HAVE_ICONV) || defined(HAVE_LIBICONV) + #include + + static int +@@ -2055,7 +2055,7 @@ sjis_to_utf8(char *dst, const char *src, size_t dstsize) + if (ConvertEncodingByIconv(src, dst, dstsize, "SJIS", "UTF-8-MAC") != -1) + return dst; + #endif +-#elif HAVE_ICONV ++#elif defined(HAVE_ICONV) || defined(HAVE_LIBICONV) + if (ConvertEncodingByIconv(src, dst, dstsize, "SJIS", "UTF-8") != -1) + return dst; + #else +@@ -2084,7 +2084,7 @@ utf8_to_sjis(char *dst, const char *src, size_t dstsize) + if (ConvertEncodingByIconv(src, dst, dstsize, "UTF-8-MAC", "SJIS") != -1) + return dst; + #endif +-#elif HAVE_ICONV ++#elif defined(HAVE_ICONV) || defined(HAVE_LIBICONV) + if (ConvertEncodingByIconv(src, dst, dstsize, "UTF-8", "SJIS") != -1) + return dst; + #else +-- +2.26.0 + diff --git a/app-arch/lha/patches/lha-1.14i.patchset b/app-arch/lha/patches/lha-1.14i.patchset deleted file mode 100644 index 87dc20f51..000000000 --- a/app-arch/lha/patches/lha-1.14i.patchset +++ /dev/null @@ -1,113 +0,0 @@ -From 4b488a3cdb9f40f91f81008b131e41b676a9937c Mon Sep 17 00:00:00 2001 -From: Chris Roberts -Date: Sun, 24 Nov 2013 19:28:57 -0700 -Subject: Updates for newer autotools and misc fixes - - -diff --git a/configure.ac b/configure.ac -index 5161979..cb0524a 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3,7 +3,7 @@ AC_INIT([LHa for UNIX], 1.14i-ac20050924p1, arai@users.sourceforge.jp, lha) - AC_CANONICAL_HOST - AC_CANONICAL_TARGET - AM_INIT_AUTOMAKE --AM_CONFIG_HEADER(config.h) -+AC_CONFIG_HEADERS([config.h]) - - AC_DEFINE_UNQUOTED(PLATFORM, "$ac_cv_host", - [the type of system on which the package will run.]) -@@ -14,7 +14,6 @@ AC_PROG_GCC_TRADITIONAL - AC_PROG_INSTALL - AC_PROG_MAKE_SET - AC_MINIX --AM_C_PROTOTYPES - AC_SYS_LARGEFILE - - # Checks for libraries. -diff --git a/src/prototypes.h b/src/prototypes.h -index 79e1330..cd456eb 100644 ---- a/src/prototypes.h -+++ b/src/prototypes.h -@@ -70,10 +70,10 @@ void temporary_to_new_archive_file P_((size_t new_archive_size)); - void cmd_add P_((void)); - void cmd_delete P_((void)); - /* lharc.c */ --void message P_((char *fmt, ...)); --void warning P_((char *fmt, ...)); --void error P_((char *fmt, ...)); --void fatal_error P_((char *fmt, ...)); -+//void message P_((char *fmt, ...)); -+//void warning P_((char *fmt, ...)); -+//void error P_((char *fmt, ...)); -+//void fatal_error P_((char *fmt, ...)); - void cleanup P_((void)); - RETSIGTYPE interrupt P_((int signo)); - void *xmalloc P_((size_t size)); -@@ -122,7 +122,7 @@ unsigned int decode P_((struct interfacing *interface)); - size_t copyfile P_((FILE *f1, FILE *f2, size_t size, int text_flg, unsigned int *crcp)); - int encode_stored_crc P_((FILE *ifp, FILE *ofp, size_t size, size_t *original_size_var, size_t *write_size_var)); - boolean archive_is_msdos_sfx1 P_((char *name)); --int xsnprintf P_((char *dest, size_t size, char *fmt, ...)); -+//int xsnprintf P_((char *dest, size_t size, char *fmt, ...)); - char *xstrchr P_((const char *s, int c)); - char *xstrrchr P_((const char *s, int c)); - char *xmemchr P_((const char *s, int c, size_t n)); --- -1.8.3.4 - - -From d8d031cbd5bdeceb1f75653ccd00483501964672 Mon Sep 17 00:00:00 2001 -From: Adrien Destugues -Date: Thu, 17 Jul 2014 09:00:08 +0200 -Subject: Detect and use Haiku's version of libiconv. - -* Makes it possible to extract archives with non-utf8 files inside. - -diff --git a/configure.ac b/configure.ac -index cb0524a..35763ac 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -62,7 +62,7 @@ AC_CHECK_FUNCS(strchr strdup memcpy memset memmove strcasecmp) - AC_CHECK_FUNCS(mktime timelocal tzset ftime gettimeofday utime) - AC_CHECK_FUNCS(ftruncate chsize lchown mkstemp ftello) - AC_CHECK_FUNCS(getpwuid getgrgid getpwnam getgrnam) --AC_CHECK_FUNCS(iconv basename) -+AC_CHECK_FUNCS(libiconv basename) - AC_REPLACE_FUNCS(vsnprintf fnmatch) - - if test $ac_header_dirent = no; then -diff --git a/src/header.c b/src/header.c -index e8d083d..c157727 100644 ---- a/src/header.c -+++ b/src/header.c -@@ -1736,7 +1736,7 @@ ConvertUTF8ToEncoding(const char* inUTF8Buf, - return cfResult; - } - --#elif HAVE_ICONV -+#elif HAVE_LIBICONV - #include - - static int -@@ -1786,7 +1786,7 @@ sjis_to_utf8(char *dst, const char *src, size_t dstsize) - kCFStringEncodingDOSJapanese, - kCFStringEncodingUseHFSPlusCanonical) == 0) - return dst; --#elif HAVE_ICONV -+#elif HAVE_LIBICONV - if (ConvertEncodingByIconv(src, dst, dstsize, "SJIS", "UTF-8") != -1) - return dst; - #else -@@ -1810,7 +1810,7 @@ utf8_to_sjis(char *dst, const char *src, size_t dstsize) - kCFStringEncodingDOSJapanese, - kCFStringEncodingUseHFSPlusCanonical) == 0) - return dst; --#elif HAVE_ICONV -+#elif HAVE_LIBICONV - if (ConvertEncodingByIconv(src, dst, dstsize, "UTF-8", "SJIS") != -1) - return dst; - #else --- -1.8.3.4 -