pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/56809: Pkgsrc patches to make mail/cyrus-imapd24 compile on SmartOS



>Number:         56809
>Category:       pkg
>Synopsis:       Pkgsrc patches to make mail/cyrus-imapd24 compile on SmartOS
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 28 06:35:00 +0000 2022
>Originator:     Geoff Adams
>Release:        HEAD
>Organization:
>Environment:
SunOS mule.avernus.com 5.11 joyent_20220407T001427Z i86pc i386 i86pc illumos
>Description:
The most recent version of cyrus-imapd in pkgsrc doesn't build on Solaris/Illumos/SmartOS. This patch fixes it.

There are a couple problems:
- A couple functions use the parameter name "sun", which is unfortunately defined to 1 by compilers on Solaris-based operating systems. That makes it a poor choice for a parameter name. I've renamed it via a patch.
- There is a list of OSes on which the need for -fPIC compilation for the libcyrus.a library when used by perl code. This is needed in Solaris, but Solaris isn't in the list. I've added it via a patch.
>How-To-Repeat:
- Notice that the package mail/cyrus-imapd24 is oddly missing from the SmartOS packages list, but present in pkgsrc.
- Try to build the package on a SmartOS build machine (a joyent-branded VM in SmartOS). See the failures

idlemsg.c:71:50: error: expected ';', ',' or ')' before numeric constant

and

ld: fatal: relocations remain against allocatable but non-writable sections

>Fix:
diff --git a/mail/cyrus-imapd24/distinfo b/mail/cyrus-imapd24/distinfo
index 61ca75764527..b026c9826732 100644
--- a/mail/cyrus-imapd24/distinfo
+++ b/mail/cyrus-imapd24/distinfo
@@ -9,4 +9,6 @@ SHA1 (patch-ai) = 9167678988f411479d187b232eb10ad8622b4151
 SHA1 (patch-am) = e100e13d5137116f5bd7674e954031b2615e5ab1
 SHA1 (patch-ao) = c01c9d32b4d73cbc32d2ad8bfca8b8b021ca2474
 SHA1 (patch-aq) = 101f5d253dae303f187e15eca28aa687f846ba6b
+SHA1 (patch-configure) = 0b759390fae5e47fec0e212993df99ca733450a2
+SHA1 (patch-idlemsg.c) = b571a427f5bcc68ba9ffeb2ad4732bf75d2e29f7
 SHA1 (patch-imap_mailbox.c) = 9a000763a153863f6c40f8939fe19eab41973cea
diff --git a/mail/cyrus-imapd24/patches/patch-configure b/mail/cyrus-imapd24/patches/patch-configure
new file mode 100644
index 000000000000..9afb06fd1f1b
--- /dev/null
+++ b/mail/cyrus-imapd24/patches/patch-configure
@@ -0,0 +1,11 @@
+--- configure,orig	2022-04-27 20:39:59.524837033 +0000
++++ configure	2022-04-27 20:40:15.698845407 +0000
+@@ -10608,7 +10608,7 @@
+     PERL_SUBDIRS="imap"
+     PERL="${with_perl}"
+     case "${target_os}" in
+-        linux*|netbsd*|freebsd*|dragonfly*)
++        linux*|netbsd*|freebsd*|dragonfly*|solaris2*)
+             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl cccdlflags needed on \"${target_os}\"" >&5
+ $as_echo_n "checking for perl cccdlflags needed on \"${target_os}\"... " >&6; }
+             eval `${PERL} -V:cccdlflags`
diff --git a/mail/cyrus-imapd24/patches/patch-idlemsg.c b/mail/cyrus-imapd24/patches/patch-idlemsg.c
new file mode 100644
index 000000000000..55c30462b5d2
--- /dev/null
+++ b/mail/cyrus-imapd24/patches/patch-idlemsg.c
@@ -0,0 +1,59 @@
+$NetBSD: $
+
+* The word "sun" is a macro defined to 1 on Solaris, so it makes a bad parameter name.
+
+--- imap/idlemsg.c	2017-08-17 17:29:14.000000000 +0000
++++ imap/idlemsg.c	2022-04-27 18:18:25.117000719 +0000
+@@ -68,30 +68,30 @@
+ static int idle_sock = -1;
+ static struct sockaddr_un idle_local;
+ 
+-int idle_make_server_address(struct sockaddr_un *sun)
++int idle_make_server_address(struct sockaddr_un *s_un)
+ {
+     const char *idle_sock;
+ 
+-    memset(sun, 0, sizeof(*sun));
+-    sun->sun_family = AF_UNIX;
++    memset(s_un, 0, sizeof(*s_un));
++    s_un->sun_family = AF_UNIX;
+     idle_sock = config_getstring(IMAPOPT_IDLESOCKET);
+     if (idle_sock) {
+-	strlcpy(sun->sun_path, idle_sock, sizeof(sun->sun_path));
++	strlcpy(s_un->sun_path, idle_sock, sizeof(s_un->sun_path));
+     }
+     else {
+ 	/* TODO: detect overflow and fail */
+-	strlcpy(sun->sun_path, config_dir, sizeof(sun->sun_path));
+-	strlcat(sun->sun_path, FNAME_IDLE_SOCK, sizeof(sun->sun_path));
++	strlcpy(s_un->sun_path, config_dir, sizeof(s_un->sun_path));
++	strlcat(s_un->sun_path, FNAME_IDLE_SOCK, sizeof(s_un->sun_path));
+     }
+     return 1;
+ }
+ 
+-int idle_make_client_address(struct sockaddr_un *sun)
++int idle_make_client_address(struct sockaddr_un *s_un)
+ {
+-    memset(sun, 0, sizeof(*sun));
+-    sun->sun_family = AF_UNIX;
++    memset(s_un, 0, sizeof(*s_un));
++    s_un->sun_family = AF_UNIX;
+     /* TODO: detect overflow and fail */
+-    snprintf(sun->sun_path, sizeof(sun->sun_path), "%s%s/idle.%d",
++    snprintf(s_un->sun_path, sizeof(s_un->sun_path), "%s%s/idle.%d",
+ 	     config_dir, FNAME_IDLE_SOCK_DIR, (int)getpid());
+     return 1;
+ }
+@@ -99,9 +99,9 @@
+ /* Extract an identifying string from the remote AF_UNIX address,
+  * suitable for logging debug messages.  Returns a string into an
+  * internal buffer */
+-const char *idle_id_from_addr(const struct sockaddr_un *sun)
++const char *idle_id_from_addr(const struct sockaddr_un *s_un)
+ {
+-    const char *tail = strrchr(sun->sun_path, '/');
++    const char *tail = strrchr(s_un->sun_path, '/');
+     const char *p;
+     /* Has to be an absolute path, so there must be at least 1 / */
+     assert(tail);


Home | Main Index | Thread Index | Old Index