1 |
commit: a11d546c00d99701446ae27f25b57cce24fc2ea6 |
2 |
Author: Conrad Kostecki <conikost <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Mar 19 22:10:47 2023 +0000 |
4 |
Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Mar 19 22:12:41 2023 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a11d546c |
7 |
|
8 |
dev-lua/mpack: add 1.0.10 |
9 |
|
10 |
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org> |
11 |
|
12 |
dev-lua/mpack/Manifest | 1 + |
13 |
dev-lua/mpack/mpack-1.0.10.ebuild | 113 ++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 114 insertions(+) |
15 |
|
16 |
diff --git a/dev-lua/mpack/Manifest b/dev-lua/mpack/Manifest |
17 |
index 00e09b45279c..47c151b429a8 100644 |
18 |
--- a/dev-lua/mpack/Manifest |
19 |
+++ b/dev-lua/mpack/Manifest |
20 |
@@ -1 +1,2 @@ |
21 |
+DIST mpack-1.0.10.tar.gz 16256 BLAKE2B 56f279be5b84e89a18a6010320eff9f006cfba6df9621e7b4c338a866170a69589e9e50d0d7deb238ff40634f28aa4d0c43a135c6b7fa9a38ec41b8b669945cd SHA512 879e200d806a4aeb3dc31bf44781bb92b377ee86fe3050692179bff794a2748c175135e4ab5eb59f29202bd36ff27ecc26bab07d0c46c11414361f72abf3dc53 |
22 |
DIST mpack-1.0.9.tar.gz 16087 BLAKE2B 062f0deaa9ea359486933b5736591ea3ee78886e31259b721d88ef44762403185b881d076ca35fe6e8c16ab756d36698fec1ca893ab3667635e388456a8ad417 SHA512 c663a6cb29c1ae3f88baf25d36b076c35b35b96a16f9df472f8063009dc70886071cc27bf9224aceb86afb5c590ac072fd484435f40ecc4961eabfb5df08f395 |
23 |
|
24 |
diff --git a/dev-lua/mpack/mpack-1.0.10.ebuild b/dev-lua/mpack/mpack-1.0.10.ebuild |
25 |
new file mode 100644 |
26 |
index 000000000000..1c6415df4d35 |
27 |
--- /dev/null |
28 |
+++ b/dev-lua/mpack/mpack-1.0.10.ebuild |
29 |
@@ -0,0 +1,113 @@ |
30 |
+# Copyright 1999-2023 Gentoo Authors |
31 |
+# Distributed under the terms of the GNU General Public License v2 |
32 |
+ |
33 |
+EAPI=8 |
34 |
+ |
35 |
+LUA_COMPAT=( lua5-{1..4} luajit ) |
36 |
+ |
37 |
+inherit lua toolchain-funcs |
38 |
+ |
39 |
+MY_PN="lib${PN}-lua" |
40 |
+ |
41 |
+DESCRIPTION="Lua bindings for libmpack" |
42 |
+HOMEPAGE="https://github.com/libmpack/libmpack-lua/" |
43 |
+SRC_URI="https://github.com/${MY_PN/-lua/}/${MY_PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" |
44 |
+S="${WORKDIR}/${MY_PN}-${PV}" |
45 |
+ |
46 |
+LICENSE="MIT" |
47 |
+SLOT="0" |
48 |
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~x64-macos" |
49 |
+IUSE="test" |
50 |
+REQUIRED_USE="${LUA_REQUIRED_USE}" |
51 |
+RESTRICT="!test? ( test )" |
52 |
+ |
53 |
+RDEPEND=" |
54 |
+ dev-libs/libmpack |
55 |
+ ${LUA_DEPS} |
56 |
+" |
57 |
+DEPEND="${RDEPEND}" |
58 |
+BDEPEND=" |
59 |
+ virtual/pkgconfig |
60 |
+ test? ( |
61 |
+ dev-lua/busted[${LUA_USEDEP}] |
62 |
+ dev-lua/lua_cliargs[${LUA_USEDEP}] |
63 |
+ ${RDEPEND} |
64 |
+ ) |
65 |
+" |
66 |
+ |
67 |
+src_prepare() { |
68 |
+ default |
69 |
+ |
70 |
+ lua_copy_sources |
71 |
+} |
72 |
+ |
73 |
+lua_src_compile() { |
74 |
+ pushd "${BUILD_DIR}" || die |
75 |
+ |
76 |
+ local myemakeargs=( |
77 |
+ "CC=$(tc-getCC)" |
78 |
+ "LUA_INCLUDE=$(lua_get_CFLAGS)" |
79 |
+ "LUA_LIB=" |
80 |
+ "USE_SYSTEM_MPACK=yes" |
81 |
+ "USE_SYSTEM_LUA=yes" |
82 |
+ ) |
83 |
+ |
84 |
+ emake "${myemakeargs[@]}" |
85 |
+ |
86 |
+ popd |
87 |
+} |
88 |
+ |
89 |
+src_compile() { |
90 |
+ lua_foreach_impl lua_src_compile |
91 |
+} |
92 |
+ |
93 |
+lua_src_test() { |
94 |
+ pushd "${BUILD_DIR}" || die |
95 |
+ |
96 |
+ # "[ FAILED ] test.lua @ 279: mpack should not leak memory" |
97 |
+ # It doesn't seem upstream actually support LuaJIT so were this up to me |
98 |
+ # I would drop it from LUA_COMPAT, unfortunately there are packages in the |
99 |
+ # tree which currently expect it to be supported. |
100 |
+ if [[ ${ELUA} == "luajit" ]]; then |
101 |
+ ewarn "Not running tests under ${ELUA} because they are known to fail" |
102 |
+ return |
103 |
+ fi |
104 |
+ |
105 |
+ busted --lua="${ELUA}" test.lua || die |
106 |
+ |
107 |
+ popd |
108 |
+} |
109 |
+ |
110 |
+src_test() { |
111 |
+ lua_foreach_impl lua_src_test |
112 |
+} |
113 |
+ |
114 |
+lua_src_install() { |
115 |
+ pushd "${BUILD_DIR}" || die |
116 |
+ |
117 |
+ local installdir="$(lua_get_cmod_dir)" |
118 |
+ local myemakeargs=( |
119 |
+ "DESTDIR=${ED}" |
120 |
+ "LUA_CMOD_INSTALLDIR=${installdir#$EPREFIX}" |
121 |
+ "USE_SYSTEM_MPACK=yes" |
122 |
+ "USE_SYSTEM_LUA=yes" |
123 |
+ ) |
124 |
+ |
125 |
+ emake "${myemakeargs[@]}" install |
126 |
+ |
127 |
+ popd |
128 |
+ |
129 |
+ if [[ ${CHOST} == *-darwin* ]] ; then |
130 |
+ local luav=$(lua_get_version) |
131 |
+ # we only want the major version (e.g. 5.1) |
132 |
+ local luamv=${luav:0:3} |
133 |
+ local file="lua/${luamv}/mpack.so" |
134 |
+ install_name_tool -id "${EPREFIX}/usr/$(get_libdir)/${file}" "${ED}/usr/$(get_libdir)/${file}" || die "Failed to adjust install_name" |
135 |
+ fi |
136 |
+} |
137 |
+ |
138 |
+src_install() { |
139 |
+ lua_foreach_impl lua_src_install |
140 |
+ |
141 |
+ einstalldocs |
142 |
+} |