aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--graphics/ophoto/Makefile8
-rw-r--r--graphics/ophoto/files/patch-utils.c21
-rw-r--r--graphics/ophoto/files/patch-utils.h21
3 files changed, 43 insertions, 7 deletions
diff --git a/graphics/ophoto/Makefile b/graphics/ophoto/Makefile
index 3bf9c40b209b..e88c30f149e8 100644
--- a/graphics/ophoto/Makefile
+++ b/graphics/ophoto/Makefile
@@ -20,10 +20,4 @@ PLIST_FILES= bin/ophoto
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/ophoto ${PREFIX}/bin
-.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 --git a/graphics/ophoto/files/patch-utils.c b/graphics/ophoto/files/patch-utils.c
new file mode 100644
index 000000000000..582066114c99
--- /dev/null
+++ b/graphics/ophoto/files/patch-utils.c
@@ -0,0 +1,21 @@
+--- utils.c.orig 2009-02-24 14:08:54.000000000 +0100
++++ utils.c 2009-02-24 14:07:20.000000000 +0100
+@@ -54,6 +54,9 @@
+ return (mem);
+ }
+
++#if defined(__FreeBSD__)
++#include <osreldate.h>
++#if __FreeBSD_version <= 800057 && __FreeBSD_version > 800000 || __FreeBSD_version <= 701100
+ char *strndup (const char *src, int num)
+ {
+ char *dst;
+@@ -63,6 +66,8 @@
+ dst[num] = '\0';
+ return (strncpy(dst, src, num));
+ }
++#endif
++#endif
+
+ char *justify (char *str)
+ {
diff --git a/graphics/ophoto/files/patch-utils.h b/graphics/ophoto/files/patch-utils.h
new file mode 100644
index 000000000000..4f7892203084
--- /dev/null
+++ b/graphics/ophoto/files/patch-utils.h
@@ -0,0 +1,21 @@
+--- utils.h.orig 2009-02-24 14:08:58.000000000 +0100
++++ utils.h 2009-02-24 14:07:43.000000000 +0100
+@@ -65,6 +65,9 @@
+ * allocated.
+ */
+
++#if defined(__FreeBSD__)
++#include <osreldate.h>
++#if __FreeBSD_version <= 800057 && __FreeBSD_version > 800000 || __FreeBSD_version <= 701100
+ char *strndup (const char *src, int num);
+ /*
+ * Like strdup(), but limits the string length to at most
+@@ -73,6 +76,8 @@
+ * Always allocates <num>+1 bytes, even if less space would
+ * be sufficient to store <src>.
+ */
++#endif
++#endif
+
+ char *justify (char *str);
+ /*