diff options
author | swills <swills@FreeBSD.org> | 2019-01-01 04:51:16 +0800 |
---|---|---|
committer | swills <swills@FreeBSD.org> | 2019-01-01 04:51:16 +0800 |
commit | 374feeaab32288f19aa5f5a8d0582bf9d1bb6c2b (patch) | |
tree | 2d9c4a5bc52a4a14975cd91c475e2fc98eac9ecf /mail | |
parent | b0c7d7e3bb67ca576b8299db5cd5bf956caf5ee8 (diff) | |
download | freebsd-ports-gnome-374feeaab32288f19aa5f5a8d0582bf9d1bb6c2b.tar.gz freebsd-ports-gnome-374feeaab32288f19aa5f5a8d0582bf9d1bb6c2b.tar.zst freebsd-ports-gnome-374feeaab32288f19aa5f5a8d0582bf9d1bb6c2b.zip |
mail/opendkim: fix build with lua52 and lua53
PR: 232953
Submitted by: Chad Jacob Milios <milios@ccsys.com> (with slight changes)
Reported by: pr@aoek.com
Approved by: maintainer timeout (freebsd-ports@dan.me.uk, >2 weeks)
Diffstat (limited to 'mail')
-rw-r--r-- | mail/opendkim/Makefile | 8 | ||||
-rw-r--r-- | mail/opendkim/distinfo | 1 | ||||
-rw-r--r-- | mail/opendkim/files/patch-miltertest_miltertest.c | 20 | ||||
-rw-r--r-- | mail/opendkim/files/patch-opendkim_opendkim-lua.c | 152 |
4 files changed, 174 insertions, 7 deletions
diff --git a/mail/opendkim/Makefile b/mail/opendkim/Makefile index 50da21652e3b..9abe740f48e0 100644 --- a/mail/opendkim/Makefile +++ b/mail/opendkim/Makefile @@ -154,12 +154,6 @@ USES+= bdb LDFLAGS+= -lpthread .endif -.include <bsd.port.pre.mk> - -.if ${PORT_OPTIONS:MLUA} && ${LUA_VER_STR} >= 53 -BROKEN= Does not build with Lua 5.3: miltertest.c:4171:54: error: too few arguments to function call, expected 5, have 4 -.endif - pre-configure: ${REINPLACE_CMD} -e '/PKG_CHECK_MODULES/s/lua5\.[0-9]/lua-${LUA_VER}/' \ -e '/PKG_CONFIG/s/cyrussasl/libsasl2/' \ @@ -175,4 +169,4 @@ post-install: ${INSTALL_DATA} ${WRKSRC}/opendkim/opendkim.conf.sample \ ${STAGEDIR}${PREFIX}/etc/mail/ -.include <bsd.port.post.mk> +.include <bsd.port.mk> diff --git a/mail/opendkim/distinfo b/mail/opendkim/distinfo index 885a4b01db17..fec3f058e8cb 100644 --- a/mail/opendkim/distinfo +++ b/mail/opendkim/distinfo @@ -1,2 +1,3 @@ +TIMESTAMP = 1544327198 SHA256 (opendkim-2.10.3.tar.gz) = 43a0ba57bf942095fe159d0748d8933c6b1dd1117caf0273fa9a0003215e681b SIZE (opendkim-2.10.3.tar.gz) = 1210224 diff --git a/mail/opendkim/files/patch-miltertest_miltertest.c b/mail/opendkim/files/patch-miltertest_miltertest.c new file mode 100644 index 000000000000..11c2ff7c7634 --- /dev/null +++ b/mail/opendkim/files/patch-miltertest_miltertest.c @@ -0,0 +1,20 @@ +--- miltertest/miltertest.c.orig 2014-03-20 04:36:13 UTC ++++ miltertest/miltertest.c +@@ -4009,7 +4009,7 @@ main(int argc, char **argv) + } + + /* register functions */ +-#if LUA_VERSION_NUM == 502 ++#if (LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503) + luaL_newlib(l, mt_library); + lua_setglobal(l, "mt"); + #else /* LUA_VERSION_NUM == 502 */ +@@ -4163,7 +4163,7 @@ main(int argc, char **argv) + lua_setglobal(l, "SMFIF_SETSYMLIST"); + #endif /* SMFIF_SETSYMLIST */ + +-#if LUA_VERSION_NUM == 502 ++#if (LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503) + switch (lua_load(l, mt_lua_reader, (void *) &io, + script == NULL ? "(stdin)" : script, NULL)) + #else /* LUA_VERSION_NUM == 502 */ diff --git a/mail/opendkim/files/patch-opendkim_opendkim-lua.c b/mail/opendkim/files/patch-opendkim_opendkim-lua.c new file mode 100644 index 000000000000..a11256458223 --- /dev/null +++ b/mail/opendkim/files/patch-opendkim_opendkim-lua.c @@ -0,0 +1,152 @@ +--- opendkim/opendkim-lua.c.orig 2015-02-04 00:31:11 UTC ++++ opendkim/opendkim-lua.c +@@ -282,7 +282,7 @@ dkimf_lua_alloc(void *ud, void *ptr, size_t osize, siz + free(ptr); + return NULL; + } +-# if LUA_VERSION_NUM == 502 ++# if (LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503) + else if (nsize != 0 && ptr == NULL) + # else /* LUA_VERSION_NUM == 502 */ + else if (nsize != 0 && osize == 0) +@@ -482,7 +482,7 @@ dkimf_lua_setup_hook(void *ctx, const char *script, si + ** Register functions. + */ + +-# if LUA_VERSION_NUM == 502 ++# if (LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503) + luaL_newlib(l, dkimf_lua_lib_setup); + lua_setglobal(l, "odkim"); + # else /* LUA_VERSION_NUM == 502 */ +@@ -529,7 +529,7 @@ dkimf_lua_setup_hook(void *ctx, const char *script, si + /* import other globals */ + dkimf_import_globals(ctx, l); + +-# if LUA_VERSION_NUM == 502 ++# if (LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503) + switch (lua_load(l, dkimf_lua_reader, (void *) &io, name, NULL)) + # else /* LUA_VERSION_NUM == 502 */ + switch (lua_load(l, dkimf_lua_reader, (void *) &io, name)) +@@ -561,7 +561,11 @@ dkimf_lua_setup_hook(void *ctx, const char *script, si + io.lua_io_len = 0; + io.lua_io_alloc = 0; + ++#if (LUA_VERSION_NUM == 503) ++ if (lua_dump(l, dkimf_lua_writer, &io, 0) == 0) ++#else + if (lua_dump(l, dkimf_lua_writer, &io) == 0) ++#endif + { + *keep = (void *) io.lua_io_script; + *funclen = io.lua_io_len; +@@ -637,7 +641,7 @@ dkimf_lua_screen_hook(void *ctx, const char *script, s + ** Register functions. + */ + +-# if LUA_VERSION_NUM == 502 ++# if (LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503) + luaL_newlib(l, dkimf_lua_lib_screen); + lua_setglobal(l, "odkim"); + # else /* LUA_VERSION_NUM == 502 */ +@@ -674,7 +678,7 @@ dkimf_lua_screen_hook(void *ctx, const char *script, s + /* import other globals */ + dkimf_import_globals(ctx, l); + +-# if LUA_VERSION_NUM == 502 ++# if (LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503) + switch (lua_load(l, dkimf_lua_reader, (void *) &io, name, NULL)) + # else /* LUA_VERSION_NUM == 502 */ + switch (lua_load(l, dkimf_lua_reader, (void *) &io, name)) +@@ -706,7 +710,11 @@ dkimf_lua_screen_hook(void *ctx, const char *script, s + io.lua_io_len = 0; + io.lua_io_alloc = 0; + ++#if (LUA_VERSION_NUM == 503) ++ if (lua_dump(l, dkimf_lua_writer, &io, 0) == 0) ++#else + if (lua_dump(l, dkimf_lua_writer, &io) == 0) ++#endif + { + *keep = (void *) io.lua_io_script; + *funclen = io.lua_io_len; +@@ -782,7 +790,7 @@ dkimf_lua_stats_hook(void *ctx, const char *script, si + ** Register functions. + */ + +-# if LUA_VERSION_NUM == 502 ++# if (LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503) + luaL_newlib(l, dkimf_lua_lib_stats); + lua_setglobal(l, "odkim"); + # else /* LUA_VERSION_NUM == 502 */ +@@ -911,7 +919,7 @@ dkimf_lua_stats_hook(void *ctx, const char *script, si + /* import other globals */ + dkimf_import_globals(ctx, l); + +-# if LUA_VERSION_NUM == 502 ++# if (LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503) + switch (lua_load(l, dkimf_lua_reader, (void *) &io, name, NULL)) + # else /* LUA_VERSION_NUM == 502 */ + switch (lua_load(l, dkimf_lua_reader, (void *) &io, name)) +@@ -943,7 +951,11 @@ dkimf_lua_stats_hook(void *ctx, const char *script, si + io.lua_io_len = 0; + io.lua_io_alloc = 0; + ++#if (LUA_VERSION_NUM == 503) ++ if (lua_dump(l, dkimf_lua_writer, &io, 0) == 0) ++#else + if (lua_dump(l, dkimf_lua_writer, &io) == 0) ++#endif + { + *keep = (void *) io.lua_io_script; + *funclen = io.lua_io_len; +@@ -1019,7 +1031,7 @@ dkimf_lua_final_hook(void *ctx, const char *script, si + ** Register functions. + */ + +-# if LUA_VERSION_NUM == 502 ++# if (LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503) + luaL_newlib(l, dkimf_lua_lib_final); + lua_setglobal(l, "odkim"); + # else /* LUA_VERSION_NUM == 502 */ +@@ -1148,7 +1160,7 @@ dkimf_lua_final_hook(void *ctx, const char *script, si + /* import other globals */ + dkimf_import_globals(ctx, l); + +-# if LUA_VERSION_NUM == 502 ++# if (LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503) + switch (lua_load(l, dkimf_lua_reader, (void *) &io, name, NULL)) + # else /* LUA_VERSION_NUM == 502 */ + switch (lua_load(l, dkimf_lua_reader, (void *) &io, name)) +@@ -1180,7 +1192,11 @@ dkimf_lua_final_hook(void *ctx, const char *script, si + io.lua_io_len = 0; + io.lua_io_alloc = 0; + ++#if (LUA_VERSION_NUM == 503) ++ if (lua_dump(l, dkimf_lua_writer, &io, 0) == 0) ++#else + if (lua_dump(l, dkimf_lua_writer, &io) == 0) ++#endif + { + *keep = (void *) io.lua_io_script; + *funclen = io.lua_io_len; +@@ -1249,7 +1265,7 @@ dkimf_lua_db_hook(const char *script, size_t scriptlen + lua_pushstring(l, query); + lua_setglobal(l, "query"); + +-# if LUA_VERSION_NUM == 502 ++# if (LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503) + switch (lua_load(l, dkimf_lua_reader, (void *) &io, script, NULL)) + # else /* LUA_VERSION_NUM == 502 */ + switch (lua_load(l, dkimf_lua_reader, (void *) &io, script)) +@@ -1281,7 +1297,11 @@ dkimf_lua_db_hook(const char *script, size_t scriptlen + io.lua_io_len = 0; + io.lua_io_alloc = 0; + ++#if (LUA_VERSION_NUM == 503) ++ if (lua_dump(l, dkimf_lua_writer, &io, 0) == 0) ++#else + if (lua_dump(l, dkimf_lua_writer, &io) == 0) ++#endif + { + *keep = (void *) io.lua_io_script; + *funclen = io.lua_io_len; |