blob: 005f93b4fb673c6e0fa152f3d7ff8ddc7d564ddf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
VIRTUALX_REQUIRED="manual"
LUA_COMPAT=( lua5-{1,3,4} luajit )
inherit lua meson virtualx
DESCRIPTION="Lua bindings using gobject-introspection"
HOMEPAGE="https://github.com/lgi-devs/lgi"
if [[ ${PV} == *_p* ]]; then
HASH_COMMIT="dfa82978d0f0f1ed1e817c9f0c5ea46824069e34"
SRC_URI="https://github.com/lgi-devs/lgi/archive/${HASH_COMMIT}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/${PN}-${HASH_COMMIT}"
else
SRC_URI="https://github.com/lgi-devs/lgi/archive/${PV}.tar.gz -> ${P}.tar.gz"
fi
LICENSE="MIT"
SLOT="0"
KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv x86"
IUSE="test"
RESTRICT="!test? ( test )"
REQUIRED_USE="${LUA_REQUIRED_USE}"
BDEPEND="
${LUA_DEPS}
virtual/pkgconfig
test? (
${VIRTUALX_DEPEND}
sys-apps/dbus
x11-misc/xvfb-run
)
"
RDEPEND="
${LUA_DEPS}
>=dev-libs/gobject-introspection-1.82.0-r2
dev-libs/glib:2
dev-libs/libffi:0=
"
DEPEND="
${RDEPEND}
test? (
x11-libs/cairo[glib,X]
|| (
x11-libs/gtk+:3[introspection,X]
gui-libs/gtk:4[introspection,X]
)
)
"
PATCHES=(
"${FILESDIR}"/${PN}-0.9.2-multi_lua_impl.patch
"${FILESDIR}"/${PN}-0.9.2-fix_tests.patch
"${FILESDIR}"/${PN}-0.9.2-fix_glib287.patch
"${FILESDIR}"/${PN}-0.9.2-skip_tests_5-1.patch
)
lua_src_prepare() {
pushd "${BUILD_DIR}" || die
# lgi/meson.build & several source files use the LUA version as part of the
# direct filename, dynamically created, and we respect that.
# replace @GENTOO_LUA_VERSION@ with lua version in patched files:
# lgi/core.c:luaopen_lgi_corelgilua51 (lua_State* L)
# lgi/core.lua:local core = require 'lgi.corelgilua51'
# lgi/meson.build: liblgi = shared_module('corelgilua51'
sed -i \
-e "s/@GENTOO_LUA_VERSION@/${ELUA/.}/" \
lgi/core.c \
lgi/core.lua \
lgi/meson.build \
|| die "sed failed"
popd
}
src_prepare() {
default
lua_copy_sources
lua_foreach_impl lua_src_prepare
}
lua_src_configure() {
local emesonargs=(
-Dlua-pc="${ELUA}"
-Dlua-bin="${LUA}"
$(meson_use test tests)
)
EMESON_SOURCE="${BUILD_DIR}" \
BUILD_DIR="${BUILD_DIR}-meson" \
meson_src_configure
}
src_configure() {
lua_foreach_impl lua_src_configure
}
lua_src_compile() {
EMESON_SOURCE="${BUILD_DIR}" \
BUILD_DIR="${BUILD_DIR}-meson" \
meson_src_compile
}
src_compile() {
lua_foreach_impl lua_src_compile
}
lua_src_test() {
if [[ ${ELUA} == luajit ]]; then
einfo "Tests are currently not supported on LuaJIT"
else
BUILD_DIR="${BUILD_DIR}-meson" \
virtx meson_src_test
fi
}
src_test() {
lua_foreach_impl lua_src_test
}
lua_src_install() {
BUILD_DIR="${BUILD_DIR}-meson" \
meson_install
}
src_install() {
lua_foreach_impl lua_src_install
local DOCS=( README.md docs/. samples )
docompress -x /usr/share/doc/${PF}/samples
einstalldocs
}
|