lha, bump version (#9133)

This commit is contained in:
Schrijvers Luc
2023-08-02 13:50:31 +00:00
committed by GitHub
parent c2db237f6f
commit 0adf1d996f
3 changed files with 70 additions and 139 deletions

View File

@@ -1,62 +0,0 @@
SUMMARY="Tools to archive files using LZSS and Huffman compression (.lzh files)"
DESCRIPTION="LHA archives are often used on Amiga computers. The compression \
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-2020 Koji Arai"
LICENSE="lha"
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="all"
PROVIDES="
lha = $portVersion
cmd:lha = $portVersion
"
REQUIRES="
haiku
lib:libiconv
"
BUILD_REQUIRES="
haiku_devel
devel:libiconv
"
BUILD_PREREQUIRES="
cmd:aclocal
cmd:autoconf
cmd:autoheader
cmd:automake
cmd:autoreconf
cmd:gcc
cmd:libtoolize
cmd:make
"
BUILD()
{
autoreconf -vfi
#LDFLAGS=-liconv runConfigure ./configure
runConfigure ./configure
make $jobArgs
}
INSTALL()
{
make install
# Create expander rule
mkdir -p $dataDir/expander/rules
echo '"application/x-lharc" .lha "lha l --system-kanji-code=utf8 %s" "lha x --system-kanji-code=utf8 %s"' > $dataDir/expander/rules/lha
}
TEST()
{
make check
}

View File

@@ -0,0 +1,70 @@
SUMMARY="Tools to archive files using LZSS and Huffman compression (.lzh files)"
DESCRIPTION="LHA archives are often used on Amiga computers. The compression \
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-2020 Koji Arai"
LICENSE="lha"
REVISION="1"
SOURCE_URI="https://github.com/jca02266/lha/archive/refs/tags/release-20211125.tar.gz"
CHECKSUM_SHA256="8761edac9613cf1c06cbc341259fb2abd804f8f5bb8ba25970779062701e8a46"
SOURCE_DIR="lha-release-20211125"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
# On x86_gcc2 we don't want to install the commands in bin/<arch>/, but in bin/.
commandBinDir=$binDir
commandSuffix=$secondaryArchSuffix
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
PROVIDES="
lha$secondaryArchSuffix = $portVersion
cmd:lha$commandSuffix = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libiconv$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libiconv$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:aclocal
cmd:autoconf
cmd:autoheader
cmd:automake
cmd:autoreconf
cmd:gcc$secondaryArchSuffix
cmd:libtoolize$secondaryArchSuffix
cmd:make
"
BUILD()
{
autoreconf -vfi
runConfigure --omit-dirs binDir ./configure \
--bindir=$commandBinDir
make $jobArgs
}
INSTALL()
{
make install
# Create expander rule
mkdir -p $dataDir/expander/rules
echo '"application/x-lharc" .lha "lha l --system-kanji-code=utf8 %s" "lha x --system-kanji-code=utf8 %s"' > $dataDir/expander/rules/lha
}
TEST()
{
make check
}

View File

@@ -1,77 +0,0 @@
From 92fc0e864b51876c3ed08225266c58cf7003b4b6 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
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 <pulkomandy@pulkomandy.tk>
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 <iconv.h>
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