pkgsrc-WIP-changes archive

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

munge: Hack to fix build on Darwin



Module Name:	pkgsrc-wip
Committed By:	Jason W. Bacon <bacon4000%gmail.com@localhost>
Pushed By:	outpaddling
Date:		Sat May 18 17:13:33 2024 -0500
Changeset:	35a97c7df36aaac3b08255e4cf07335a49fc240d

Modified Files:
	munge/distinfo
Added Files:
	munge/patches/patch-_src_munged_path.c
	munge/patches/patch-configure
	munge/patches/patch-src_libmissing_strlcpy.c
	munge/patches/patch-src_libmissing_strlcpy.h
	munge/patches/patch-src_munged_munged.c
	munge/patches/patch-src_munged_path.c

Log Message:
munge: Hack to fix build on Darwin

Bundled libmissing contains strlcpy() and other functions that
are part of libc on Darwin, so the library is empty.  macOS "ar"
requires at least one object file.  Renamed strlcpy() to
__munge_strlcpy() so libmissing would contain something.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=35a97c7df36aaac3b08255e4cf07335a49fc240d

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 munge/distinfo                               |  6 ++++++
 munge/patches/patch-_src_munged_path.c       |  2 ++
 munge/patches/patch-configure                | 15 +++++++++++++++
 munge/patches/patch-src_libmissing_strlcpy.c | 15 +++++++++++++++
 munge/patches/patch-src_libmissing_strlcpy.h | 15 +++++++++++++++
 munge/patches/patch-src_munged_munged.c      | 15 +++++++++++++++
 munge/patches/patch-src_munged_path.c        | 24 ++++++++++++++++++++++++
 7 files changed, 92 insertions(+)

diffs:
diff --git a/munge/distinfo b/munge/distinfo
index b41e7c269e..5be7087b27 100644
--- a/munge/distinfo
+++ b/munge/distinfo
@@ -3,4 +3,10 @@ $NetBSD$
 BLAKE2s (munge-0.5.16.tar.xz) = c1720fd24852ad31a8aa6d83a24c5935519d0d7a682abdf2fdb535673d6c5885
 SHA512 (munge-0.5.16.tar.xz) = b808deede8e71c96719526182c5fc16250dc09d2129dc9d5cbcb54c5827723e1dbbd47b8c912373328f5f3b8971c75200abb2def5d35ebc896bff1984ab8c305
 Size (munge-0.5.16.tar.xz) = 448120 bytes
+SHA1 (patch-_src_munged_path.c) = adc83b19e793491b1c6ea0fd8b46cd9f32e592fc
+SHA1 (patch-configure) = 435da9c3f3400cecd3a370d74c1d662233984a10
 SHA1 (patch-src_etc_Makefile.in) = fbf4e59810c97e4c70353ec435867bebf2bd39bd
+SHA1 (patch-src_libmissing_strlcpy.c) = 1eec6bd0c20d28f9bd3450d27fb76dd25e0c977d
+SHA1 (patch-src_libmissing_strlcpy.h) = a53d4994fb26722fd3cc6de553e522cf5bc96bb5
+SHA1 (patch-src_munged_munged.c) = aa0d4b09db38c1d160a9ecbc4826b4696e79882d
+SHA1 (patch-src_munged_path.c) = 00b020e1b8d53b832a5a6d9d85612c0a7aac5347
diff --git a/munge/patches/patch-_src_munged_path.c b/munge/patches/patch-_src_munged_path.c
new file mode 100644
index 0000000000..afc76512f4
--- /dev/null
+++ b/munge/patches/patch-_src_munged_path.c
@@ -0,0 +1,2 @@
+$NetBSD$
+
diff --git a/munge/patches/patch-configure b/munge/patches/patch-configure
new file mode 100644
index 0000000000..2dead698c4
--- /dev/null
+++ b/munge/patches/patch-configure
@@ -0,0 +1,15 @@
+$NetBSD$
+
+# Use local strlcpy() without collision
+
+--- configure.orig	2024-05-18 22:10:14.716509177 +0000
++++ configure
+@@ -16348,7 +16348,7 @@ else $as_nop
+ esac
+ 
+ fi
+-ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy"
++ac_fn_c_check_func "$LINENO" "__munge_strlcpy" "ac_cv_func_strlcpy"
+ if test "x$ac_cv_func_strlcpy" = xyes
+ then :
+   printf "%s\n" "#define HAVE_STRLCPY 1" >>confdefs.h
diff --git a/munge/patches/patch-src_libmissing_strlcpy.c b/munge/patches/patch-src_libmissing_strlcpy.c
new file mode 100644
index 0000000000..644f5a0330
--- /dev/null
+++ b/munge/patches/patch-src_libmissing_strlcpy.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+# Use local strlcpy() without collision
+
+--- src/libmissing/strlcpy.c.orig	2024-05-18 22:08:28.175772831 +0000
++++ src/libmissing/strlcpy.c
+@@ -29,7 +29,7 @@ static char *rcsid = "$OpenBSD: strlcpy.
+  * Returns strlen(src); if retval >= siz, truncation occurred.
+  */
+ size_t
+-strlcpy(char *dst, const char *src, size_t siz)
++__munge_strlcpy(char *dst, const char *src, size_t siz)
+ {
+ 	register char *d = dst;
+ 	register const char *s = src;
diff --git a/munge/patches/patch-src_libmissing_strlcpy.h b/munge/patches/patch-src_libmissing_strlcpy.h
new file mode 100644
index 0000000000..30e312ea55
--- /dev/null
+++ b/munge/patches/patch-src_libmissing_strlcpy.h
@@ -0,0 +1,15 @@
+$NetBSD$
+
+# Use local strlcpy() without collision
+
+--- src/libmissing/strlcpy.h.orig	2024-05-18 22:09:11.468056157 +0000
++++ src/libmissing/strlcpy.h
+@@ -3,7 +3,7 @@
+ #endif /* HAVE_CONFIG_H */
+ 
+ #if !HAVE_STRLCPY
+-size_t strlcpy(char *dst, const char *src, size_t siz);
++size_t __munge_strlcpy(char *dst, const char *src, size_t siz);
+ /*
+  *  Copy src to string dst of size siz.  At most siz-1 characters
+  *    will be copied.  Always NUL terminates (unless siz == 0).
diff --git a/munge/patches/patch-src_munged_munged.c b/munge/patches/patch-src_munged_munged.c
new file mode 100644
index 0000000000..1f0df60bd3
--- /dev/null
+++ b/munge/patches/patch-src_munged_munged.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+# Use local strlcpy() without collision
+
+--- src/munged/munged.c.orig	2024-05-18 22:06:54.452854855 +0000
++++ src/munged/munged.c
+@@ -653,7 +653,7 @@ sock_create (conf_t conf)
+     }
+     memset (&addr, 0, sizeof (addr));
+     addr.sun_family = AF_UNIX;
+-    n = strlcpy (addr.sun_path, conf->socket_name, sizeof (addr.sun_path));
++    n = __munge_strlcpy (addr.sun_path, conf->socket_name, sizeof (addr.sun_path));
+     if (n >= sizeof (addr.sun_path)) {
+         log_err (EMUNGE_SNAFU, LOG_ERR,
+             "Exceeded maximum length of %lu bytes for socket pathname",
diff --git a/munge/patches/patch-src_munged_path.c b/munge/patches/patch-src_munged_path.c
new file mode 100644
index 0000000000..8f2cabcb2c
--- /dev/null
+++ b/munge/patches/patch-src_munged_path.c
@@ -0,0 +1,24 @@
+$NetBSD$
+
+# Use local strlcpy() without collision
+
+--- src/munged/path.c.orig	2024-05-18 21:58:24.907978477 +0000
++++ src/munged/path.c
+@@ -81,7 +81,7 @@ path_canonicalize (const char *src, char
+         return (-1);
+     }
+     if ((dst != NULL) && (dstlen > 0)) {
+-        n = strlcpy (dst, buf, dstlen);
++        n = __munge_strlcpy (dst, buf, dstlen);
+     }
+     return (n);
+ }
+@@ -97,7 +97,7 @@ path_dirname (const char *src, char *dst
+         errno = EINVAL;
+         return (-1);
+     }
+-    if (strlcpy (dst, src, dstlen) >= dstlen) {
++    if (__munge_strlcpy (dst, src, dstlen) >= dstlen) {
+         errno = ENAMETOOLONG;
+         return (-1);
+     }


Home | Main Index | Thread Index | Old Index