libedit, bump to 20210419-3.1

This commit is contained in:
begasus
2021-05-01 11:10:17 +00:00
committed by Adrien Destugues
parent 954a0e3c34
commit 4cb93cf0c9
2 changed files with 222 additions and 0 deletions

View File

@@ -0,0 +1,90 @@
SUMMARY="A BSD licensed replacement for the GNU readline library"
DESCRIPTION="This is an autotool- and libtoolized port of the NetBSD Editline library \
(libedit). This Berkeley-style licensed command line editor library provides \
generic line editing, history, and tokenization functions, similar to those \
found in GNU Readline."
HOMEPAGE="http://thrysoee.dk/editline/"
COPYRIGHT="1992-2021 The NetBSD Foundation, Inc."
LICENSE="BSD (3-clause)"
REVISION="1"
SOURCE_URI="http://thrysoee.dk/editline/libedit-${portVersion/_/-}.tar.gz"
CHECKSUM_SHA256="571ebe44b74860823e24a08cf04086ff104fd7dfa1020abf26c52543134f5602"
SOURCE_DIR="libedit-${portVersion/_/-}"
PATCHES="libedit-${portVersion/_/-}.patchset"
ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
libVersion="0.0.65"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
PROVIDES="
libedit$secondaryArchSuffix = $portVersion
lib:libedit$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libncurses$secondaryArchSuffix
"
PROVIDES_devel="
libedit${secondaryArchSuffix}_devel = $portVersion
devel:libedit$secondaryArchSuffix = $libVersionCompat
"
REQUIRES_devel="
libedit$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libncurses$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:aclocal
cmd:autoreconf
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:libtoolize$secondaryArchSuffix
cmd:m4
cmd:make
cmd:sed
"
defineDebugInfoPackage libedit$secondaryArchSuffix \
"$libDir"/libedit.so.$libVersion
BUILD()
{
autoreconf --force --install
runConfigure ./configure --enable-examples=no \
--enable-widec
make $jobArgs
}
INSTALL()
{
make install
# remove libtool file
rm -f "$libDir"/libedit.la
if [ -n "$secondaryArchSuffix" ]; then
rm -rf "$documentationDir"
maybe_manDir_man3=
else
maybe_manDir_man3="$manDir"/man3
fi
prepareInstalledDevelLib libedit
fixPkgconfig
# devel package
packageEntries devel \
"$developDir" \
${maybe_manDir_man3:+"$maybe_manDir_man3"}
}
TEST()
{
make check
}

View File

@@ -0,0 +1,132 @@
From a68cec6b9b23f1632f14e74e86778ff248ecc8cd Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Wed, 26 Nov 2014 16:48:13 +0000
Subject: Haiku patch
diff --git a/configure.ac b/configure.ac
index 013fb62..5180019 100644
--- a/configure.ac
+++ b/configure.ac
@@ -72,7 +72,7 @@ AM_CONDITIONAL(ENABLE_EXAMPLES, [test "$enable_examples" = "yes"])
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS([fcntl.h limits.h malloc.h stdlib.h string.h sys/ioctl.h sys/param.h unistd.h curses.h ncurses.h sys/cdefs.h termcap.h])
+AC_CHECK_HEADERS([fcntl.h limits.h malloc.h stdint.h stdlib.h string.h sys/errno.h errno.h sys/ioctl.h sys/param.h unistd.h curses.h ncurses.h sys/cdefs.h langinfo.h])
AC_CHECK_HEADER([ncurses.h], [],
[AC_CHECK_HEADER([curses.h], [],
diff --git a/src/editline/readline.h b/src/editline/readline.h
index 7e53f41..64a5fb3 100644
--- a/src/editline/readline.h
+++ b/src/editline/readline.h
@@ -76,7 +76,7 @@ typedef KEYMAP_ENTRY *Keymap;
#ifndef CTRL
#include <sys/ioctl.h>
-#if !defined(__sun) && !defined(__hpux) && !defined(_AIX)
+#if !defined(__sun) && !defined(__hpux) && !defined(_AIX) && !defined(__HAIKU__)
#include <sys/ttydefaults.h>
#endif
#ifndef CTRL
diff --git a/src/vis.c b/src/vis.c
index ce66205..283cf38 100644
--- a/src/vis.c
+++ b/src/vis.c
@@ -75,6 +75,10 @@ __FBSDID("$FreeBSD$");
#include <wchar.h>
#include <wctype.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#ifdef __weak_alias
__weak_alias(strvisx,_strvisx)
#endif
--
2.30.2
From 95fc6ef00932e10efe45dbc379249d64cfc31d14 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Wed, 26 Nov 2014 16:55:47 +0000
Subject: define NBBY
diff --git a/src/sys.h b/src/sys.h
index d2bcf11..44dca9d 100644
--- a/src/sys.h
+++ b/src/sys.h
@@ -125,4 +125,8 @@ extern char* tgoto(const char*, int, int);
extern char* tgetstr(char*, char**);
#endif
+#ifdef __HAIKU__
+#define NBBY 8
+#endif
+
#endif /* _h_sys */
--
2.30.2
From 70f3f89ddea86c9b0307ec7f717d6cde4c8fc16d Mon Sep 17 00:00:00 2001
From: fbrosson <fbrosson@localhost>
Date: Thu, 1 Feb 2018 11:05:59 +0000
Subject: gcc2 support.
diff --git a/src/hist.c b/src/hist.c
index 19ce1c1..2c88b28 100644
--- a/src/hist.c
+++ b/src/hist.c
@@ -188,12 +188,14 @@ hist_command(EditLine *el, int argc, const wchar_t **argv)
len = len * 4 + 1;
if (len >= maxlen) {
maxlen = len + 1024;
+ {
char *nbuf = el_realloc(buf, maxlen);
if (nbuf == NULL) {
el_free(buf);
return -1;
}
buf = nbuf;
+ }
}
strvis(buf, ptr, VIS_NL);
(void) fprintf(el->el_outfile, "%d\t%s\n",
--
2.30.2
From eaa32eed8c5a2f5709a3c71d2e6baf346775e46e Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Sat, 1 May 2021 09:40:38 +0000
Subject: Another gcc2 patch
diff --git a/src/filecomplete.c b/src/filecomplete.c
index baca190..a49ad41 100644
--- a/src/filecomplete.c
+++ b/src/filecomplete.c
@@ -707,6 +707,7 @@ fn_complete2(EditLine *el,
if (matches == NULL) {
goto out;
}
+ {
int i;
size_t matches_num, maxlen, match_len, match_display=1;
int single_match = matches[2] == NULL &&
@@ -813,6 +814,7 @@ fn_complete2(EditLine *el,
out:
el_free(temp);
return retval;
+ }
}
int
--
2.30.2