| @@ -1,35 +1,38 @@ | | | @@ -1,35 +1,38 @@ |
1 | # $NetBSD: module.mk,v 1.13 2022/02/19 20:39:58 nia Exp $ | | 1 | # $NetBSD: module.mk,v 1.14 2022/03/06 09:13:44 nia Exp $ |
2 | # | | 2 | # |
3 | # This Makefile fragment is intended to be included by packages that | | 3 | # This Makefile fragment is intended to be included by packages that |
4 | # install Lua modules. | | 4 | # install Lua modules. |
5 | # | | 5 | # |
6 | # === Package-settable variables === | | 6 | # === Package-settable variables === |
7 | # | | 7 | # |
8 | # LUA_LINKER_MAGIC | | 8 | # LUA_LINKER_MAGIC |
9 | # This appends LDFLAGS to properly link Lua modules on non-ELF | | 9 | # This appends LDFLAGS to properly link Lua modules on non-ELF |
10 | # linkers. | | 10 | # linkers. |
11 | # | | 11 | # |
12 | # You probably want to set this to "no" if the package links | | 12 | # You probably want to set this to "no" if the package links |
13 | # binaries that are not Lua modules. | | 13 | # binaries that are not Lua modules. |
14 | # | | 14 | # |
15 | # Possible values: yes no | | 15 | # Possible values: yes no |
16 | # Default: yes | | 16 | # Default: yes |
17 | # | | 17 | # |
18 | # LUA_USE_BUSTED | | 18 | # LUA_USE_BUSTED |
19 | # Use busted to run tests and provide a do-test target. | | 19 | # Use busted to run tests and provide a do-test target. |
20 | # | | 20 | # |
21 | # Possible values: yes no | | 21 | # Possible values: yes no |
22 | # Default: yes | | 22 | # Default: no |
| | | 23 | # |
| | | 24 | # LUA_BUSTED_ARGS |
| | | 25 | # Arguments to pass to the busted command when LUA_USE_BUSTED. |
23 | # | | 26 | # |
24 | # === Defined variables === | | 27 | # === Defined variables === |
25 | # | | 28 | # |
26 | # LUA_LDIR | | 29 | # LUA_LDIR |
27 | # Path where Lua modules are installed. | | 30 | # Path where Lua modules are installed. |
28 | # | | 31 | # |
29 | # LUA_CDIR | | 32 | # LUA_CDIR |
30 | # Path where Lua C modules are installed. Not defined if | | 33 | # Path where Lua C modules are installed. Not defined if |
31 | # NO_BUILD variable is set to "yes". | | 34 | # NO_BUILD variable is set to "yes". |
32 | # | | 35 | # |
33 | # LUA_DOCDIR | | 36 | # LUA_DOCDIR |
34 | # Path where documentation files are installed. | | 37 | # Path where documentation files are installed. |
35 | # | | 38 | # |
| @@ -80,21 +83,25 @@ LUA_LINKER_MAGIC?= yes | | | @@ -80,21 +83,25 @@ LUA_LINKER_MAGIC?= yes |
80 | BUILDLINK_TRANSFORM.Darwin+= rm:-shared | | 83 | BUILDLINK_TRANSFORM.Darwin+= rm:-shared |
81 | LDFLAGS.Cygwin+= -llua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR} | | 84 | LDFLAGS.Cygwin+= -llua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR} |
82 | LDFLAGS.Darwin+= -bundle -undefined dynamic_lookup | | 85 | LDFLAGS.Darwin+= -bundle -undefined dynamic_lookup |
83 | .endif | | 86 | .endif |
84 | | | 87 | |
85 | .if ${_LUA_VERSION} != "51" && ${_LUA_VERSION} != "52" | | 88 | .if ${_LUA_VERSION} != "51" && ${_LUA_VERSION} != "52" |
86 | # Any Lua>=5.3 module using these flags is invalid, | | 89 | # Any Lua>=5.3 module using these flags is invalid, |
87 | # since Lua 5.3 and newer require "long long". | | 90 | # since Lua 5.3 and newer require "long long". |
88 | BUILDLINK_TRANSFORM+= rm:-ansi | | 91 | BUILDLINK_TRANSFORM+= rm:-ansi |
89 | BUILDLINK_TRANSFORM+= rm:-std=c89 | | 92 | BUILDLINK_TRANSFORM+= rm:-std=c89 |
90 | BUILDLINK_TRANSFORM+= rm:-std=c90 | | 93 | BUILDLINK_TRANSFORM+= rm:-std=c90 |
91 | .endif | | 94 | .endif |
92 | | | 95 | |
| | | 96 | LUA_USE_BUSTED?= no |
| | | 97 | |
93 | .if !empty(LUA_USE_BUSTED:M[yY][eE][sS]) | | 98 | .if !empty(LUA_USE_BUSTED:M[yY][eE][sS]) |
94 | TEST_DEPENDS+= ${LUA_PKGPREFIX}-busted-[0-9]*:../../devel/lua-busted | | 99 | TEST_DEPENDS+= ${LUA_PKGPREFIX}-busted-[0-9]*:../../devel/lua-busted |
95 | | | 100 | |
96 | do-test: | | 101 | do-test: |
97 | cd ${WRKSRC} && ${PREFIX}/bin/busted${_LUA_DOT_VERSION} | | 102 | cd ${WRKSRC} && ${TEST_ENV} \ |
| | | 103 | ${PREFIX}/bin/busted${_LUA_DOT_VERSION} \ |
| | | 104 | ${LUA_BUSTED_ARGS} |
98 | .endif # LUA_USE_BUSTED | | 105 | .endif # LUA_USE_BUSTED |
99 | | | 106 | |
100 | .endif # LUA_MODULE_MK | | 107 | .endif # LUA_MODULE_MK |