ports/132067: [PATCH] audio/tosha: fix after strndup addition/MFC, remove BROKEN tag
Florian Smeets
flo at kasimir.com
Tue Feb 24 14:30:05 UTC 2009
>Number: 132067
>Category: ports
>Synopsis: [PATCH] audio/tosha: fix after strndup addition/MFC, remove BROKEN tag
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Tue Feb 24 14:30:04 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator: Florian Smeets
>Release: FreeBSD 7.1-STABLE amd64
>Organization:
>Environment:
System: FreeBSD mail.solomo.de 7.1-STABLE FreeBSD 7.1-STABLE #4: Mon Jan 5 22:33:23 CET
>Description:
this port was broken by the addition/MFC of strndup. With this patch it builds again.
Added file(s):
- files/patch-utils.c
- files/patch-utils.h
Generated with FreeBSD Port Tools 0.77
>How-To-Repeat:
build on 7-STABLE >= 701101 or 8-CURRENT >= 800058 without this patch
>Fix:
use strndup function included in the port only in the cases where it's needed
--- tosha-0.6_1.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/audio/tosha.orig/Makefile /usr/ports/audio/tosha/Makefile
--- /usr/ports/audio/tosha.orig/Makefile 2009-02-24 14:43:40.000000000 +0100
+++ /usr/ports/audio/tosha/Makefile 2009-02-24 14:44:04.000000000 +0100
@@ -18,10 +18,4 @@
MAN1= pcmfade.1 pcmplay.1 tosha.1
MANCOMPRESSED= yes
-.include <bsd.port.pre.mk>
-
-.if ${OSVERSION} >= 800058 || (${OSVERSION} >= 701101 && ${OSVERSION} < 800000)
-BROKEN= does not build
-.endif
-
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff -ruN --exclude=CVS /usr/ports/audio/tosha.orig/files/patch-utils.c /usr/ports/audio/tosha/files/patch-utils.c
--- /usr/ports/audio/tosha.orig/files/patch-utils.c 1970-01-01 01:00:00.000000000 +0100
+++ /usr/ports/audio/tosha/files/patch-utils.c 2009-02-24 14:44:04.000000000 +0100
@@ -0,0 +1,21 @@
+--- utils.c.orig 2009-02-24 14:41:16.000000000 +0100
++++ utils.c 2009-02-24 14:41:55.000000000 +0100
+@@ -59,6 +59,9 @@
+ return (mem);
+ }
+
++#if defined(__FreeBSD__)
++#include <osreldate.h>
++#if __FreeBSD_version <= 800057 && __FreeBSD_version > 800000 || __FreeBSD_version <= 701100
+ char *strndup (char *src, int num)
+ {
+ char *dst;
+@@ -68,6 +71,8 @@
+ dst[num] = '\0';
+ return (strncpy(dst, src, num));
+ }
++#endif
++#endif
+
+ char *justify (char *str)
+ {
diff -ruN --exclude=CVS /usr/ports/audio/tosha.orig/files/patch-utils.h /usr/ports/audio/tosha/files/patch-utils.h
--- /usr/ports/audio/tosha.orig/files/patch-utils.h 1970-01-01 01:00:00.000000000 +0100
+++ /usr/ports/audio/tosha/files/patch-utils.h 2009-02-24 14:44:04.000000000 +0100
@@ -0,0 +1,21 @@
+--- utils.h.orig 2009-02-24 14:41:21.000000000 +0100
++++ utils.h 2009-02-24 14:42:08.000000000 +0100
+@@ -63,6 +63,9 @@
+ * allocated.
+ */
+
++#if defined(__FreeBSD__)
++#include <osreldate.h>
++#if __FreeBSD_version <= 800057 && __FreeBSD_version > 800000 || __FreeBSD_version <= 701100
+ char *strndup (char *src, int num);
+ /*
+ * Like strdup(), but limits the string length to at most
+@@ -71,6 +74,8 @@
+ * Always allocates <num>+1 bytes, even if less space would
+ * be sufficient to store <src>.
+ */
++#endif
++#endif
+
+ char *justify (char *str);
+ /*
--- tosha-0.6_1.patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list