tech-pkg archive

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

making pkgsrc/devel/openrcs build on Mac OS X (patch, review wanted)




Hi,

currently pkgsrc/devel/openrcs fails to build on Mac OS X 10.13.3 as there is no memrchr(). Below is a patch that makes things working for me. I'd appreciate if someone could have a look before committing - my pkgsrc-fu is a bit rusty :)


 - Hubert


? patches
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/devel/openrcs/distinfo,v
retrieving revision 1.4
diff -u -r1.4 distinfo
--- distinfo	3 Nov 2015 03:27:53 -0000	1.4
+++ distinfo	5 Apr 2018 19:46:43 -0000
@@ -4,3 +4,6 @@
 RMD160 (openrcs-20110824192219.tar.gz) = 266fd50d49da2fbacd2a7c05e2f545a3a19331ad
 SHA512 (openrcs-20110824192219.tar.gz) = 7dcc009f1c8ee0da37bc1d59ecbbf06c1338a136864358164125fa43be69ede73d47501745092266f98346cfcbb4e3d2bce6f27fe1a74b02f765872afbb85e74
 Size (openrcs-20110824192219.tar.gz) = 106878 bytes
+SHA1 (patch-aa) = bf80bdce4af14245255556434e94a420fcb39218
+SHA1 (patch-ab) = 24f52eb05159318261ebfdb8b703da909633c6f2
+SHA1 (patch-ac) = f231553fb4f4fd8f6ee17cdd7c2422125869a161
$NetBSD$

--- patches/openbsd-compat/NOTES.orig	2010-08-24 22:08:11.000000000 +0000
+++ patches/openbsd-compat/NOTES
@@ -11,3 +11,4 @@ strtonum.c    portable openssh
 sys-queue.h   portable openssh
 utimes.c      http://www.sudo.ws/cgi-bin/cvsweb/~checkout~/sudo/utimes.c?rev=1.9
 utime.h       http://www.sudo.ws/cgi-bin/cvsweb/~checkout~/sudo/emul/utime.h?rev=1.25
+memrchr.c     https://github.com/aosm/sudo/blob/master/src/memrchr.c
$NetBSD$

--- patches/openbsd-compat/memrchr.c.orig	2018-04-05 19:37:00.000000000 +0000
+++ patches/openbsd-compat/memrchr.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2007 Todd C. Miller <Todd.Miller%courtesan.com@localhost>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <config.h>
+
+#include <sys/types.h>
+
+/*
+ * Reverse memchr()
+ * Find the last occurrence of 'c' in the buffer 's' of size 'n'.
+ */
+void *
+memrchr(s, c, n)
+    const void *s;
+    int c;
+    size_t n;
+{
+    const unsigned char *cp;
+
+    if (n != 0) {
+	cp = (unsigned char *)s + n;
+	do {
+	    if (*(--cp) == (unsigned char)c)
+		return (void *)cp;
+	} while (--n != 0);
+    }
+    return (void *)0;
+}
$NetBSD$

--- patches/openbsd-compat/Makefile.am.orig	2010-08-24 22:08:11.000000000 +0000
+++ patches/openbsd-compat/Makefile.am
@@ -1,6 +1,6 @@
 noinst_LIBRARIES = libopenbsd-compat.a

 libopenbsd_compat_a_SOURCES = \
-		  strlcat.c strlcpy.c strtonum.c fgetln.c getlogin.c
+		  strlcat.c strlcpy.c strtonum.c fgetln.c getlogin.c memrchr.c

 INCLUDES = -I$(top_srcdir)/src/


Home | Main Index | Thread Index | Old Index