mirror of
https://github.com/termux-pacman/termux-packages.git
synced 2026-02-20 16:34:59 +00:00
libc-client: Fix build for Clang 16
This commit is contained in:
@@ -3,16 +3,15 @@ TERMUX_PKG_DESCRIPTION="UW IMAP c-client library"
|
||||
TERMUX_PKG_LICENSE="Apache-2.0"
|
||||
TERMUX_PKG_MAINTAINER="@termux"
|
||||
TERMUX_PKG_VERSION=2007f
|
||||
TERMUX_PKG_REVISION=2
|
||||
TERMUX_PKG_REVISION=3
|
||||
TERMUX_PKG_SRCURL=https://www.mirrorservice.org/sites/ftp.cac.washington.edu/imap/imap-${TERMUX_PKG_VERSION}.tar.gz
|
||||
TERMUX_PKG_SHA256=53e15a2b5c1bc80161d42e9f69792a3fa18332b7b771910131004eb520004a28
|
||||
TERMUX_PKG_DEPENDS="libcrypt, openssl"
|
||||
TERMUX_PKG_DEPENDS="openssl"
|
||||
TERMUX_PKG_BUILD_IN_SRC=true
|
||||
TERMUX_PKG_ENABLE_CLANG16_PORTING=false
|
||||
|
||||
termux_step_pre_configure() {
|
||||
CFLAGS+=" -fPIC $CPPFLAGS -DFNDELAY=O_NONBLOCK -DL_SET=SEEK_SET"
|
||||
LDFLAGS+=" -lcrypt -lssl -lcrypto"
|
||||
LDFLAGS+=" -lssl -lcrypto"
|
||||
}
|
||||
|
||||
termux_step_configure() {
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
https://github.com/termux/termux-packages/issues/15852
|
||||
Borrowed from https://github.com/gentoo/gentoo/blob/d8d6bf974cfa15d18d473b7de3a24558fa001669/net-libs/c-client/files/c-client-2007f-implicit-declaration-fix.patch
|
||||
|
||||
This patch solves build issues with -Werror=implicit-function-declaration
|
||||
enabled.
|
||||
|
||||
- safe_flock is a function from flocklnx.c but header file for consumers
|
||||
is missing, the simplest was to add function prototype to other
|
||||
header file.
|
||||
- utime.h is needed also in multiple places but os_slx.h header file is
|
||||
used in all of them
|
||||
|
||||
Bug: https://bugs.gentoo.org/870478
|
||||
|
||||
diff --git a/src/osdep/unix/os_slx.h b/src/osdep/unix/os_slx.h
|
||||
index b5f39ff..adad223 100644
|
||||
--- a/src/osdep/unix/os_slx.h
|
||||
+++ b/src/osdep/unix/os_slx.h
|
||||
@@ -46,6 +46,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
#include <time.h> /* for struct tm */
|
||||
+#include <utime.h>
|
||||
#include <fcntl.h>
|
||||
#include <syslog.h>
|
||||
#include <sys/file.h>
|
||||
@@ -57,6 +58,7 @@
|
||||
|
||||
#define direct dirent
|
||||
|
||||
+int safe_flock(int, int);
|
||||
#define flock safe_flock
|
||||
|
||||
|
||||
--
|
||||
2.35.1
|
||||
|
||||
170
packages/libc-client/c-client-2007f-scandir-callback-types.patch
Normal file
170
packages/libc-client/c-client-2007f-scandir-callback-types.patch
Normal file
@@ -0,0 +1,170 @@
|
||||
https://github.com/termux/termux-packages/issues/15852
|
||||
Borrowed from https://github.com/gentoo/gentoo/blob/d8d6bf974cfa15d18d473b7de3a24558fa001669/net-libs/c-client/files/c-client-2007f-scandir-callback-types.patch
|
||||
|
||||
clang-16 compiler complains with following error message in multiple
|
||||
places:
|
||||
|
||||
error: incompatible function pointer types passing 'int (struct dirent *)' to
|
||||
parameter of type 'int (*)(const struct dirent *)' [-Wincompatible-function-pointer-types]
|
||||
|
||||
error: incompatible function pointer types passing
|
||||
'int (const void *, const void *)' to parameter of type 'int (*)(const struct dirent **, const struct dirent **)' [-Wincompatible-function-pointer-types]
|
||||
|
||||
This patch fixes all those places by correcting function pointer types
|
||||
for scandir callbacks.
|
||||
|
||||
Bug: https://bugs.gentoo.org/870478
|
||||
|
||||
diff --git a/src/osdep/unix/mh.c b/src/osdep/unix/mh.c
|
||||
index 0226b7a..ace2b32 100644
|
||||
--- a/src/osdep/unix/mh.c
|
||||
+++ b/src/osdep/unix/mh.c
|
||||
@@ -103,8 +103,8 @@ long mh_copy (MAILSTREAM *stream,char *sequence,char *mailbox,
|
||||
long options);
|
||||
long mh_append (MAILSTREAM *stream,char *mailbox,append_t af,void *data);
|
||||
|
||||
-int mh_select (struct direct *name);
|
||||
-int mh_numsort (const void *d1,const void *d2);
|
||||
+int mh_select (const struct direct *name);
|
||||
+int mh_numsort (const struct direct **d1,const struct direct **d2);
|
||||
char *mh_file (char *dst,char *name);
|
||||
long mh_canonicalize (char *pattern,char *ref,char *pat);
|
||||
void mh_setdate (char *file,MESSAGECACHE *elt);
|
||||
@@ -1194,7 +1194,7 @@ long mh_append (MAILSTREAM *stream,char *mailbox,append_t af,void *data)
|
||||
* Returns: T to use file name, NIL to skip it
|
||||
*/
|
||||
|
||||
-int mh_select (struct direct *name)
|
||||
+int mh_select (const struct direct *name)
|
||||
{
|
||||
char c;
|
||||
char *s = name->d_name;
|
||||
@@ -1209,7 +1209,7 @@ int mh_select (struct direct *name)
|
||||
* Returns: negative if d1 < d2, 0 if d1 == d2, postive if d1 > d2
|
||||
*/
|
||||
|
||||
-int mh_numsort (const void *d1,const void *d2)
|
||||
+int mh_numsort (const struct direct **d1,const struct direct **d2)
|
||||
{
|
||||
return atoi ((*(struct direct **) d1)->d_name) -
|
||||
atoi ((*(struct direct **) d2)->d_name);
|
||||
diff --git a/src/osdep/unix/mix.c b/src/osdep/unix/mix.c
|
||||
index fbf4a02..0964842 100644
|
||||
--- a/src/osdep/unix/mix.c
|
||||
+++ b/src/osdep/unix/mix.c
|
||||
@@ -125,7 +125,7 @@ long mix_unsubscribe (MAILSTREAM *stream,char *mailbox);
|
||||
long mix_create (MAILSTREAM *stream,char *mailbox);
|
||||
long mix_delete (MAILSTREAM *stream,char *mailbox);
|
||||
long mix_rename (MAILSTREAM *stream,char *old,char *newname);
|
||||
-int mix_rselect (struct direct *name);
|
||||
+int mix_rselect (const struct direct *name);
|
||||
MAILSTREAM *mix_open (MAILSTREAM *stream);
|
||||
void mix_close (MAILSTREAM *stream,long options);
|
||||
void mix_abort (MAILSTREAM *stream);
|
||||
@@ -140,8 +140,8 @@ THREADNODE *mix_thread (MAILSTREAM *stream,char *type,char *charset,
|
||||
long mix_ping (MAILSTREAM *stream);
|
||||
void mix_check (MAILSTREAM *stream);
|
||||
long mix_expunge (MAILSTREAM *stream,char *sequence,long options);
|
||||
-int mix_select (struct direct *name);
|
||||
-int mix_msgfsort (const void *d1,const void *d2);
|
||||
+int mix_select (const struct direct *name);
|
||||
+int mix_msgfsort (const struct direct **d1,const struct direct **d2);
|
||||
long mix_addset (SEARCHSET **set,unsigned long start,unsigned long size);
|
||||
long mix_burp (MAILSTREAM *stream,MIXBURP *burp,unsigned long *reclaimed);
|
||||
long mix_burp_check (SEARCHSET *set,size_t size,char *file);
|
||||
@@ -587,7 +587,7 @@ long mix_rename (MAILSTREAM *stream,char *old,char *newname)
|
||||
* Returns: T if mix file name, NIL otherwise
|
||||
*/
|
||||
|
||||
-int mix_rselect (struct direct *name)
|
||||
+int mix_rselect (const struct direct *name)
|
||||
{
|
||||
return mix_dirfmttest (name->d_name);
|
||||
}
|
||||
@@ -1146,7 +1146,7 @@ long mix_expunge (MAILSTREAM *stream,char *sequence,long options)
|
||||
* ".mix" with no suffix was used by experimental versions
|
||||
*/
|
||||
|
||||
-int mix_select (struct direct *name)
|
||||
+int mix_select (const struct direct *name)
|
||||
{
|
||||
char c,*s;
|
||||
/* make sure name has prefix */
|
||||
@@ -1165,7 +1165,7 @@ int mix_select (struct direct *name)
|
||||
* Returns: -1 if d1 < d2, 0 if d1 == d2, 1 d1 > d2
|
||||
*/
|
||||
|
||||
-int mix_msgfsort (const void *d1,const void *d2)
|
||||
+int mix_msgfsort (const struct direct **d1,const struct direct **d2)
|
||||
{
|
||||
char *n1 = (*(struct direct **) d1)->d_name + sizeof (MIXNAME) - 1;
|
||||
char *n2 = (*(struct direct **) d2)->d_name + sizeof (MIXNAME) - 1;
|
||||
diff --git a/src/osdep/unix/mx.c b/src/osdep/unix/mx.c
|
||||
index 4549527..994f12c 100644
|
||||
--- a/src/osdep/unix/mx.c
|
||||
+++ b/src/osdep/unix/mx.c
|
||||
@@ -98,8 +98,8 @@ long mx_append (MAILSTREAM *stream,char *mailbox,append_t af,void *data);
|
||||
long mx_append_msg (MAILSTREAM *stream,char *flags,MESSAGECACHE *elt,
|
||||
STRING *st,SEARCHSET *set);
|
||||
|
||||
-int mx_select (struct direct *name);
|
||||
-int mx_numsort (const void *d1,const void *d2);
|
||||
+int mx_select (const struct direct *name);
|
||||
+int mx_numsort (const struct direct **d1,const struct direct **d2);
|
||||
char *mx_file (char *dst,char *name);
|
||||
long mx_lockindex (MAILSTREAM *stream);
|
||||
void mx_unlockindex (MAILSTREAM *stream);
|
||||
@@ -1110,7 +1110,7 @@ long mx_append_msg (MAILSTREAM *stream,char *flags,MESSAGECACHE *elt,
|
||||
* Returns: T to use file name, NIL to skip it
|
||||
*/
|
||||
|
||||
-int mx_select (struct direct *name)
|
||||
+int mx_select (const struct direct *name)
|
||||
{
|
||||
char c;
|
||||
char *s = name->d_name;
|
||||
@@ -1125,7 +1125,7 @@ int mx_select (struct direct *name)
|
||||
* Returns: negative if d1 < d2, 0 if d1 == d2, postive if d1 > d2
|
||||
*/
|
||||
|
||||
-int mx_numsort (const void *d1,const void *d2)
|
||||
+int mx_numsort (const struct direct **d1,const struct direct **d2)
|
||||
{
|
||||
return atoi ((*(struct direct **) d1)->d_name) -
|
||||
atoi ((*(struct direct **) d2)->d_name);
|
||||
diff --git a/src/osdep/unix/news.c b/src/osdep/unix/news.c
|
||||
index 4cf5bb7..caa6785 100644
|
||||
--- a/src/osdep/unix/news.c
|
||||
+++ b/src/osdep/unix/news.c
|
||||
@@ -76,8 +76,8 @@ long news_create (MAILSTREAM *stream,char *mailbox);
|
||||
long news_delete (MAILSTREAM *stream,char *mailbox);
|
||||
long news_rename (MAILSTREAM *stream,char *old,char *newname);
|
||||
MAILSTREAM *news_open (MAILSTREAM *stream);
|
||||
-int news_select (struct direct *name);
|
||||
-int news_numsort (const void *d1,const void *d2);
|
||||
+int news_select (const struct direct *name);
|
||||
+int news_numsort (const struct direct **d1,const struct direct **d2);
|
||||
void news_close (MAILSTREAM *stream,long options);
|
||||
void news_fast (MAILSTREAM *stream,char *sequence,long flags);
|
||||
void news_flags (MAILSTREAM *stream,char *sequence,long flags);
|
||||
@@ -402,7 +402,7 @@ MAILSTREAM *news_open (MAILSTREAM *stream)
|
||||
* Returns: T to use file name, NIL to skip it
|
||||
*/
|
||||
|
||||
-int news_select (struct direct *name)
|
||||
+int news_select (const struct direct *name)
|
||||
{
|
||||
char c;
|
||||
char *s = name->d_name;
|
||||
@@ -417,7 +417,7 @@ int news_select (struct direct *name)
|
||||
* Returns: negative if d1 < d2, 0 if d1 == d2, postive if d1 > d2
|
||||
*/
|
||||
|
||||
-int news_numsort (const void *d1,const void *d2)
|
||||
+int news_numsort (const struct direct **d1,const struct direct **d2)
|
||||
{
|
||||
return atoi ((*(struct direct **) d1)->d_name) -
|
||||
atoi ((*(struct direct **) d2)->d_name);
|
||||
--
|
||||
2.35.1
|
||||
|
||||
13
packages/libc-client/src-c-client-rfc822.c.patch
Normal file
13
packages/libc-client/src-c-client-rfc822.c.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
--- a/src/c-client/rfc822.c
|
||||
+++ b/src/c-client/rfc822.c
|
||||
@@ -37,6 +37,10 @@
|
||||
#include <time.h>
|
||||
#include "c-client.h"
|
||||
|
||||
+#ifdef __ANDROID__
|
||||
+#define gethostid() (0L)
|
||||
+#endif
|
||||
+
|
||||
|
||||
/* Support for deprecated features in earlier specifications. Note that this
|
||||
* module follows RFC 2822, and all use of "rfc822" in function names is
|
||||
Reference in New Issue
Block a user