Merge pull request #3519 from lazka/libedit-update

libedit: sync with cygwin
This commit is contained in:
Christoph Reiter 2023-01-28 17:12:19 +01:00 committed by GitHub
commit 6ea9347171
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 50 additions and 48 deletions

View File

@ -3,9 +3,9 @@
pkgbase=libedit
pkgname=('libedit' 'libedit-devel')
_base_ver=3.1
_snap_date=20210910
_snap_date=20221030
pkgver=${_snap_date}_${_base_ver}
pkgrel=2
pkgrel=1
pkgdesc="Libedit is an autotool- and libtoolized port of the NetBSD Editline library."
groups=('libraries')
arch=('i686' 'x86_64')
@ -16,27 +16,28 @@ makedepends=('ncurses-devel' 'autotools' 'gcc')
options=('staticlibs')
source=(https://www.thrysoee.dk/editline/${pkgname}-${_snap_date}-${_base_ver}.tar.gz
libedit-20191231-3.1.patch
libedit-20130712-1.src.patch
libedit-3.0-20120311-msys2.patch)
sha256sums=('6792a6a992050762edcca28ff3318cdb7de37dccf7bc30db59fcd7017eed13c5'
cygwin-build.patch)
sha256sums=('f0925a5adf4b1bf116ee19766b7daa766917aec198747943b1c4edf67a4be2bb'
'858f123a0844bb16903014a9b3e7dd4668654931a07ca8a9a4d1a8a3572863b0'
'e973c43b6576fbafef69f05c3c95ee256bfb972d3622e8c87658e737415cc258'
'd7060b7449241d87612ce1a2fd1fdb91fa8ad5ff40f4e039b2d2cd7a64565d83')
'b04f81f22bd5601c3df54dcdc7f79c5a25a7a8563336238129ac7bba123ed2a3')
prepare() {
cd "${srcdir}/${pkgname}-${_snap_date}-${_base_ver}"
patch -p1 -i ${srcdir}/cygwin-build.patch
# https://github.com/msys2/MSYS2-packages/pull/2241
patch -p1 -i ${srcdir}/libedit-20191231-3.1.patch
patch -p2 -i ${srcdir}/libedit-20130712-1.src.patch
patch -p1 -i ${srcdir}/libedit-3.0-20120311-msys2.patch
autoreconf -fi
}
build() {
cd "${srcdir}/${pkgname}-${_snap_date}-${_base_ver}"
local CYGWIN_CHOST="${CHOST/-msys/-cygwin}"
./configure \
--build=${CHOST} \
--build=${CYGWIN_CHOST} \
--prefix=/usr \
--enable-widec \
CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw" \

View File

@ -0,0 +1,39 @@
diff -up a/src/chartype.h b/src/chartype.h
--- a/src/chartype.h 2022-06-11 09:57:59.000000000 +0200
+++ b/src/chartype.h 2023-01-20 21:42:39.530718100 +0100
@@ -51,7 +51,7 @@
/* Oh for a <uchar.h> with char32_t and __STDC_UTF_32__ in it...
* ref: ISO/IEC DTR 19769
*/
-#if WCHAR_MAX < INT32_MAX
+#if WCHAR_MAX < INT32_MAX && !defined(__CYGWIN__)
#warning Build environment does not support non-BMP characters
#endif
diff -up a/src/editline/readline.h b/src/editline/readline.h
--- a/src/editline/readline.h 2022-06-11 09:57:59.000000000 +0200
+++ b/src/editline/readline.h 2023-01-20 21:42:50.567947600 +0100
@@ -77,7 +77,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(__CYGWIN__)
#include <sys/ttydefaults.h>
#endif
#ifndef CTRL
diff -up a/src/sys.h b/src/sys.h
--- a/src/sys.h 2022-10-30 06:35:40.000000000 +0100
+++ b/src/sys.h 2023-01-20 21:43:19.440199500 +0100
@@ -63,7 +63,11 @@
#endif
/* If your compiler does not support this, define it to be empty. */
+#ifdef __CYGWIN__
+#define libedit_private
+#else
#define libedit_private __attribute__((__visibility__("hidden")))
+#endif
#ifndef __arraycount
# define __arraycount(a) (sizeof(a) / sizeof(*(a)))

View File

@ -1,25 +0,0 @@
--- origsrc/libedit-20130712-3.1/src/chartype.h 2012-03-11 10:54:58.000000000 +0100
+++ src/libedit-20130712-3.1/src/chartype.h 2013-10-20 13:54:52.166608497 +0200
@@ -56,9 +56,11 @@
/* Oh for a <uchar.h> with char32_t and __STDC_UTF_32__ in it...
* ref: ISO/IEC DTR 19769
*/
+#ifndef __CYGWIN__
#if WCHAR_MAX < INT32_MAX
#warning Build environment does not support non-BMP characters
#endif
+#endif
#ifndef HAVE_WCSDUP
wchar_t *wcsdup(const wchar_t *s);
--- origsrc/libedit-20130712-3.1/src/editline/readline.h 2013-06-01 17:46:07.000000000 +0200
+++ src/libedit-20130712-3.1/src/editline/readline.h 2013-10-20 13:54:52.202608341 +0200
@@ -75,7 +75,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(__CYGWIN__)
#include <sys/ttydefaults.h>
#endif
#ifndef CTRL

View File

@ -1,13 +0,0 @@
diff -Naur libedit-20120311-3.0-orig/config.guess libedit-20120311-3.0/config.guess
--- libedit-20120311-3.0-orig/config.guess 2012-03-11 22:01:33.000000000 +0000
+++ libedit-20120311-3.0/config.guess 2013-04-26 16:07:04.552734300 +0000
@@ -947,6 +947,9 @@
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
GUESS=x86_64-pc-cygwin
;;
+ amd64:MSYS*:*:* | x86_64:MSYS*:*:*)
+ GUESS=x86_64-unknown-msys
+ ;;
prep*:SunOS:5.*:*)
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
GUESS=powerpcle-unknown-solaris2$SUN_REL