aboutsummaryrefslogtreecommitdiffstats
path: root/devel
diff options
context:
space:
mode:
authorgarga <garga@FreeBSD.org>2011-12-28 23:21:51 +0800
committergarga <garga@FreeBSD.org>2011-12-28 23:21:51 +0800
commitd5ed3a2815b5e24436311e417ead4faf8fa60701 (patch)
tree34844f5b6fa4d6fed91b1d2c9d2a017a639c21ee /devel
parentb52e33183b3ade89c4c5d58861f68be6fdf41151 (diff)
downloadfreebsd-ports-gnome-d5ed3a2815b5e24436311e417ead4faf8fa60701.tar.gz
freebsd-ports-gnome-d5ed3a2815b5e24436311e417ead4faf8fa60701.tar.zst
freebsd-ports-gnome-d5ed3a2815b5e24436311e417ead4faf8fa60701.zip
Fix build on 9.x
PR: ports/163073 Submitted by: Kan Sasaki <sasaki@fcc.ad.jp>
Diffstat (limited to 'devel')
-rw-r--r--devel/lua-sysctl/Makefile2
-rw-r--r--devel/lua-sysctl/files/extra-patch-src__lua_sysctl.c45
2 files changed, 46 insertions, 1 deletions
diff --git a/devel/lua-sysctl/Makefile b/devel/lua-sysctl/Makefile
index 975759acae69..bed00e05b67f 100644
--- a/devel/lua-sysctl/Makefile
+++ b/devel/lua-sysctl/Makefile
@@ -21,7 +21,7 @@ PLIST_DIRS= %%LUA_MODLIBDIR%%/sysctl
.include <bsd.port.pre.mk>
.if ${OSVERSION} >= 900030
-BROKEN= Does not build
+EXTRA_PATCHES+= ${FILESDIR}/extra-patch-src__lua_sysctl.c
.endif
do-install:
diff --git a/devel/lua-sysctl/files/extra-patch-src__lua_sysctl.c b/devel/lua-sysctl/files/extra-patch-src__lua_sysctl.c
new file mode 100644
index 000000000000..de570dbf2c3a
--- /dev/null
+++ b/devel/lua-sysctl/files/extra-patch-src__lua_sysctl.c
@@ -0,0 +1,45 @@
+--- src/lua_sysctl.c.orig 2011-12-05 09:47:49.000000000 +0900
++++ src/lua_sysctl.c 2011-12-05 09:57:48.000000000 +0900
+@@ -257,6 +257,7 @@
+ long longval;
+ unsigned long ulongval;
+ quad_t quadval;
++ u_quad_t uquadval;
+ size_t s, newsize = 0;
+ u_int kind;
+ char fmt[BUFSIZ], key[BUFSIZ], nvalbuf[BUFSIZ];
+@@ -293,7 +294,8 @@
+ (kind & CTLTYPE) == CTLTYPE_UINT ||
+ (kind & CTLTYPE) == CTLTYPE_LONG ||
+ (kind & CTLTYPE) == CTLTYPE_ULONG ||
+- (kind & CTLTYPE) == CTLTYPE_QUAD) {
++ (kind & CTLTYPE) == CTLTYPE_S64 ||
++ (kind & CTLTYPE) == CTLTYPE_U64) {
+ if (strlen(newval) == 0)
+ return (luaL_error(L, "empty numeric value"));
+ }
+@@ -343,7 +345,7 @@
+ break;
+ case CTLTYPE_STRING:
+ break;
+- case CTLTYPE_QUAD:
++ case CTLTYPE_S64:
+ quadval = (quad_t)strtonum(newval, LLONG_MIN, LLONG_MAX, &errmsg);
+ if (errmsg) {
+ return (luaL_error(L, "bad quad_t integer: %s (%s)",
+@@ -352,6 +354,15 @@
+ newval = &quadval;
+ newsize = sizeof(quadval);
+ break;
++ case CTLTYPE_U64:
++ uquadval = (u_quad_t)strtonum(newval, 0, ULLONG_MAX, &errmsg);
++ if (errmsg) {
++ return (luaL_error(L, "bad unsigned quad_t integer: %s (%s)",
++ (char *)newval, errmsg));
++ }
++ newval = &uquadval;
++ newsize = sizeof(uquadval);
++ break;
+ case CTLTYPE_OPAQUE:
+ if (strcmp(fmt, "T,dev_t") == 0) {
+ set_T_dev_t(L, newval, &newval, &newsize);