diff options
author | ryoon <ryoon@pkgsrc.org> | 2012-12-24 12:53:17 +0000 |
---|---|---|
committer | ryoon <ryoon@pkgsrc.org> | 2012-12-24 12:53:17 +0000 |
commit | 32858b351c5ce612cfbd82e3575ba28510bf498d (patch) | |
tree | 37552f2ed6375e6875bddf69467645451ac1da45 | |
parent | 85357e39d79415741fa7cbdec29aba9d187fddc4 (diff) | |
download | pkgsrc-32858b351c5ce612cfbd82e3575ba28510bf498d.tar.gz |
Fix build on SmartOS.
If this is irrelevant, please revert them.
* Use OS_VARIANT to include db_185.h
* Include posix stat function in ifdef to avoid binary change
-rw-r--r-- | textproc/mdocml/Makefile | 8 | ||||
-rw-r--r-- | textproc/mdocml/distinfo | 4 | ||||
-rw-r--r-- | textproc/mdocml/patches/patch-apropos.c | 13 | ||||
-rw-r--r-- | textproc/mdocml/patches/patch-mandocdb.c | 50 |
4 files changed, 73 insertions, 2 deletions
diff --git a/textproc/mdocml/Makefile b/textproc/mdocml/Makefile index 6eee4659dd1..c7577c6b4ad 100644 --- a/textproc/mdocml/Makefile +++ b/textproc/mdocml/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.32 2012/10/25 06:56:07 asau Exp $ +# $NetBSD: Makefile,v 1.33 2012/12/24 12:53:17 ryoon Exp $ DISTNAME= mdocml-1.12.0 PKGREVISION= 2 @@ -14,5 +14,11 @@ MAKE_FLAGS+= PREFIX=${PREFIX} DBLIB=${BDB_LIBS:Q} CONFLICTS= man-pages-[0-9]* groff-[0-9]* +.include "../../mk/bsd.prefs.mk" + +.if ${OS_VARIANT} == "SmartOS" +CFLAGS+= -D__SmartOS__ +.endif + .include "../../mk/bdb.buildlink3.mk" .include "../../mk/bsd.pkg.mk" diff --git a/textproc/mdocml/distinfo b/textproc/mdocml/distinfo index 4f9afb2d759..40cfcf70ff5 100644 --- a/textproc/mdocml/distinfo +++ b/textproc/mdocml/distinfo @@ -1,5 +1,7 @@ -$NetBSD: distinfo,v 1.24 2011/10/10 12:31:56 wiz Exp $ +$NetBSD: distinfo,v 1.25 2012/12/24 12:53:17 ryoon Exp $ SHA1 (mdocml-1.12.0.tar.gz) = 7c2c1a23c0bba61d9fc4ee7dc5b47a0a07e0b981 RMD160 (mdocml-1.12.0.tar.gz) = 3ea04c4b4639ae63ae924db3645f1712f149ec5b Size (mdocml-1.12.0.tar.gz) = 236717 bytes +SHA1 (patch-apropos.c) = 8c219b5b1c61dc49d71f0a4207e8480f5aa79099 +SHA1 (patch-mandocdb.c) = 325d80259553fc223b8f8e4c1a3949f127c74cae diff --git a/textproc/mdocml/patches/patch-apropos.c b/textproc/mdocml/patches/patch-apropos.c new file mode 100644 index 00000000000..59159389545 --- /dev/null +++ b/textproc/mdocml/patches/patch-apropos.c @@ -0,0 +1,13 @@ +$NetBSD: patch-apropos.c,v 1.1 2012/12/24 12:53:17 ryoon Exp $ + +--- apropos.c.orig 2011-10-08 20:07:21.000000000 +0000 ++++ apropos.c +@@ -33,7 +33,7 @@ + #include <string.h> + #include <unistd.h> + +-#ifdef __linux__ ++#if defined(__linux__) || defined(__SmartOS__) + # include <db_185.h> + #else + # include <db.h> diff --git a/textproc/mdocml/patches/patch-mandocdb.c b/textproc/mdocml/patches/patch-mandocdb.c new file mode 100644 index 00000000000..4254ccf0a7c --- /dev/null +++ b/textproc/mdocml/patches/patch-mandocdb.c @@ -0,0 +1,50 @@ +$NetBSD: patch-mandocdb.c,v 1.1 2012/12/24 12:53:17 ryoon Exp $ + +--- mandocdb.c.orig 2011-10-08 20:07:22.000000000 +0000 ++++ mandocdb.c +@@ -29,12 +29,16 @@ + #include <stdlib.h> + #include <string.h> + +-#ifdef __linux__ ++#if defined(__linux__) || defined(__SmartOS__) + # include <db_185.h> + #else + # include <db.h> + #endif + ++#if defined(__sun) ++# include <sys/stat.h> ++#endif ++ + #include "man.h" + #include "mdoc.h" + #include "mandoc.h" +@@ -1223,7 +1227,15 @@ ofile_dirbuild(const char *dir, int verb + + while (NULL != (dp = readdir(d))) { + fn = dp->d_name; ++#if defined(__sun) ++ struct stat s; ++ stat(dp->d_name, &s); ++#endif ++#if !defined(__sun) + if (DT_DIR == dp->d_type) { ++#else ++ if (!(s.st_mode & S_IFDIR)) { ++#endif + if (0 == strcmp(".", fn)) + continue; + if (0 == strcmp("..", fn)) +@@ -1244,7 +1256,11 @@ ofile_dirbuild(const char *dir, int verb + fprintf(stderr, "%s: Path too long\n", dir); + return(0); + } ++#if !defined(__sun) + if (DT_REG != dp->d_type) ++#else ++ if (!(s.st_mode & S_IFREG)) ++#endif + continue; + + if (0 == strcmp(MANDOC_DB, fn) || |