Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 914749 | Differences between
and this patch

Collapse All | Expand All

(-)a/dev-libs/libpeas/files/2.0.0-lua.patch (+68 lines)
Line 0 Link Here
1
diff --git a/meson.build b/meson.build
2
index 0744ba1..95c09c3 100644
3
--- a/meson.build
4
+++ b/meson.build
5
@@ -138,18 +138,12 @@ if host_machine.system() == 'windows' and not python3_dep.found()
6
 endif
7
 
8
 pygobject_dep = dependency('pygobject-3.0', version: pygobject_req, required: false)
9
-lua51_dep = dependency('lua51', version: lua_req, required: false)
10
-if not lua51_dep.found()
11
-  lua51_dep = dependency('lua-5.1', version: lua_req, required: false)
12
-endif
13
-luajit_dep = dependency('luajit', version: luajit_req, required: false)
14
+lua51_dep = dependency('lua', version: lua_req, required: get_option('lua51'))
15
+luajit_dep = dependency('luajit', version: luajit_req, required: get_option('luajit'))
16
 lua_lgi_found = false
17
 lua_lgi_ver = 'not found'
18
-lua51_prg = find_program('lua5.1', required: false)
19
-if not lua51_prg.found()
20
-  lua51_prg = find_program('lua51', required: false)
21
-endif
22
-luajit_prg = find_program('luajit', required: false)
23
+lua51_prg = find_program('lua', required: get_option('lua51'))
24
+luajit_prg = find_program('luajit', required: get_option('luajit'))
25
 xmllint_prg = find_program('xmllint', required: false)
26
 generate_vapi = get_option('vapi')
27
 vapigen_prg = find_program('vapigen', required: generate_vapi)
28
@@ -211,6 +205,8 @@ if lua_found
29
             lua51_lgi_dep = declare_dependency(version: lua_lgi_ver)
30
             lua_lgi_found = true
31
         endif
32
+    else
33
+        error('lua support requested but lua-lgi not found')
34
     endif
35
     message('lua-lgi version: ' + lua_lgi_ver)
36
 endif
37
@@ -394,11 +390,7 @@ endif
38
 
39
 build_gjs_loader = get_option('gjs')
40
 
41
-build_lua51_loader = get_option('lua51')
42
-lua51_found = (luajit_dep.found() or lua51_dep.found()) and lua_lgi_found
43
-if build_lua51_loader and not lua51_found
44
-  error('Lua51 requested but failed to locate suitable Lua51 and LGI support')
45
-endif
46
+build_lua51_loader = (luajit_dep.found() or lua51_dep.found()) and lua_lgi_found
47
 
48
 build_python3_loader = get_option('python3')
49
 python3_found = python3_dep.found() and pygobject_dep.found()
50
diff --git a/meson_options.txt b/meson_options.txt
51
index 48a7e8d..891bf2a 100644
52
--- a/meson_options.txt
53
+++ b/meson_options.txt
54
@@ -3,9 +3,13 @@ option('gjs',
55
        description: 'Enable GJS support (requires gjs-1.0)')
56
 
57
 option('lua51',
58
-       type: 'boolean', value: true,
59
+       type: 'feature', value: 'enabled',
60
        description: 'Enable Lua 5.1 support (requires lua-lgi)')
61
 
62
+option('luajit',
63
+       type: 'feature', value: 'disabled',
64
+       description: 'Use LuaJIT for Lua 5.1 support (requires lua-lgi)')
65
+
66
 option('python3',
67
        type: 'boolean', value: true,
68
        description: 'Enable Python 3 support (requires pygobject)')
(-)a/dev-libs/libpeas/libpeas-2.0.0.ebuild (-1 / +94 lines)
Line 0 Link Here
0
- 
1
# Copyright 1999-2023 Gentoo Authors
2
# Distributed under the terms of the GNU General Public License v2
3
4
EAPI=8
5
6
LUA_COMPAT=( lua5-1 luajit )
7
PYTHON_COMPAT=( python3_{10..12} )
8
9
inherit gnome.org lua-single meson python-single-r1 vala virtualx xdg
10
11
DESCRIPTION="A GObject plugins library"
12
HOMEPAGE="https://wiki.gnome.org/Projects/Libpeas https://gitlab.gnome.org/GNOME/libpeas"
13
14
LICENSE="LGPL-2.1+"
15
SLOT="2"
16
KEYWORDS="~alpha amd64 ~arm arm64 ~ia64 ~loong ~ppc ~ppc64 ~riscv ~sparc x86 ~amd64-linux ~x86-linux"
17
18
IUSE="gtk-doc lua +python vala"
19
REQUIRED_USE="lua? ( ${LUA_REQUIRED_USE} )
20
	python? ( ${PYTHON_REQUIRED_USE} )"
21
22
RDEPEND="
23
	>=dev-libs/glib-2.44:2
24
	>=dev-libs/gjs-1.77.1
25
	>=dev-libs/gobject-introspection-1.39:=
26
	lua? (
27
		${LUA_DEPS}
28
		$(lua_gen_cond_dep '
29
			>=dev-lua/lgi-0.9.0[${LUA_USEDEP}]
30
		')
31
	)
32
	python? (
33
		${PYTHON_DEPS}
34
		$(python_gen_cond_dep '
35
			>=dev-python/pygobject-3.2:3[${PYTHON_USEDEP}]
36
		')
37
	)
38
"
39
DEPEND="${RDEPEND}"
40
BDEPEND="
41
	dev-util/glib-utils
42
	gtk-doc? (
43
		>=dev-util/gtk-doc-1.11
44
		>=dev-util/gi-docgen-2021.7
45
		app-text/docbook-xml-dtd:4.3
46
	)
47
	>=sys-devel/gettext-0.19.8
48
	virtual/pkgconfig
49
"
50
51
PATCHES=(
52
	# Gentoo-specific lua tweak hack
53
	"${FILESDIR}"/2.0.0-lua.patch
54
)
55
56
pkg_setup() {
57
	use lua && lua-single_pkg_setup
58
	use python && python-single-r1_pkg_setup
59
}
60
61
src_prepare() {
62
	default
63
	use vala && vala_setup
64
}
65
66
src_configure() {
67
	local emesonargs=(
68
		$(meson_feature $(usex lua '!lua_single_target_luajit' 'lua') lua51)
69
		$(meson_feature $(usex lua 'lua_single_target_luajit' 'lua') luajit)
70
		$(meson_use python python3)
71
		# introspection was always enabled in autotools; would need readiness by consumers
72
		# to USE flag it, but most need it for python plugins anyways
73
		-Dintrospection=true
74
		$(meson_use vala vapi)
75
		$(meson_use gtk-doc gtk_doc)
76
	)
77
	meson_src_configure
78
}
79
80
src_test() {
81
	virtx meson_src_test
82
}
83
84
src_install() {
85
	meson_src_install
86
87
	if use gtk-doc; then
88
		mkdir -p "${ED}"/usr/share/gtk-doc/html/ || die
89
		mv "${ED}"/usr/share/doc/libpeas-1.0 "${ED}"/usr/share/gtk-doc/html/ || die
90
		if use gtk; then
91
			mv "${ED}"/usr/share/doc/libpeas-gtk-1.0 "${ED}"/usr/share/gtk-doc/html/ || die
92
		fi
93
	fi
94
}

Return to bug 914749