diff options
author | 2025-02-01 11:12:28 +0400 | |
---|---|---|
committer | 2025-02-10 09:41:10 +0000 | |
commit | f1c74fe44f995f117b055389b06999e353d1eeea (patch) | |
tree | af18ede9fc4cecce73abd18bc1b169751768d51a /app-i18n | |
parent | app-i18n/xvnkb: update SRC_URI (diff) | |
download | gentoo-f1c74fe44f995f117b055389b06999e353d1eeea.tar.gz gentoo-f1c74fe44f995f117b055389b06999e353d1eeea.tar.bz2 gentoo-f1c74fe44f995f117b055389b06999e353d1eeea.zip |
app-i18n/xvnkb: Add meson build manifest instead of bash
Package has two problems: It's doesn't compile with c23 and it's
build system is badly handwritten, and fails to configure due to
changes to bash and build environment.
It also makes Eli Schwartz scream (# 900398#c5 ).
Fix build by limiting C version to gnu17.
Fix configure by rewriting build in Meson.
New build artifacts are running, can't test if they are working
correctly - original build fails to configure on my system at all.
Bug: https://bugs.gentoo.org/879631
Bug: https://bugs.gentoo.org/926090
Bug: https://bugs.gentoo.org/900398
Signed-off-by: NHOrus <jy6x2b32pie9@yahoo.com>
Closes: https://github.com/gentoo/gentoo/pull/40404
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'app-i18n')
-rw-r--r-- | app-i18n/xvnkb/files/config.h.in | 5 | ||||
-rw-r--r-- | app-i18n/xvnkb/files/meson.build | 72 | ||||
-rw-r--r-- | app-i18n/xvnkb/files/meson.options | 20 | ||||
-rw-r--r-- | app-i18n/xvnkb/xvnkb-0.2.11-r1.ebuild | 59 |
4 files changed, 156 insertions, 0 deletions
diff --git a/app-i18n/xvnkb/files/config.h.in b/app-i18n/xvnkb/files/config.h.in new file mode 100644 index 000000000000..d7b351625533 --- /dev/null +++ b/app-i18n/xvnkb/files/config.h.in @@ -0,0 +1,5 @@ +#define VERSION "@version@" +#mesondefine VK_USE_ABCSTROKE +#mesondefine VK_USE_PROSTROKE +#mesondefine VK_USE_EXTSTROKE +#mesondefine VK_CHECK_SPELLING
\ No newline at end of file diff --git a/app-i18n/xvnkb/files/meson.build b/app-i18n/xvnkb/files/meson.build new file mode 100644 index 000000000000..502942233402 --- /dev/null +++ b/app-i18n/xvnkb/files/meson.build @@ -0,0 +1,72 @@ +project('xvnkb', 'c', version: '0.2.11', meson_version: '>=1.4.0') + +add_project_arguments('-DVK_NEED_UCHAR', language: 'c') + +conf_data = configuration_data() +conf_data.set('version', meson.project_version()) +conf_data.set('VK_USE_ABCSTROKE', get_option('abcstroke')) +conf_data.set('VK_USE_EXTSTROKE', get_option('extstroke')) +conf_data.set('VK_USE_PROSTROKE', get_option('prostroke')) +conf_data.set('VK_CHECK_SPELLING', get_option('spellcheck')) + +configure_file( + output: 'config.h', + input: 'config.h.in', + configuration: conf_data, +) + +dl_dep = dependency('dl') +xlib_dep = dependency('X11') + +xft_dep = dependency('xft', required: get_option('xft')) +if get_option('xft').enabled() + add_project_arguments('-DUSE_XFT', language: 'c') +endif + +deps = [dl_dep, xlib_dep, xft_dep] + +core_src = ['xvnkb.c', 'visckey.c'] +core = library( + 'xvnkb', + core_src, + name_prefix: '', + soversion: meson.project_version(), + dependencies: deps, + install: true, +) + +src = [ + 'data.c', + 'flash.c', + 'main.c', + 'event.c', + 'mainwin.c', + 'menu.c', + 'hotkey.c', + 'systray.c', + 'mode.c', + 'property.c', + 'session.c', + 'xconfig.c', + 'xresource.c', + 'label.c', + 'button.c', + 'msgbox.c', +] +executable('xvnkb', src, dependencies: deps, link_with: core, install: true) + +ctrl_src = [ + 'tools/xvnkb_ctrl.c', + 'tools/data.c', + 'tools/mode.c', + 'tools/property.c', + 'tools/xconfig.c', +] +executable( + 'xvnkb_ctlr', + ctrl_src, + dependencies: deps, + link_with: core, + install: true, +) + diff --git a/app-i18n/xvnkb/files/meson.options b/app-i18n/xvnkb/files/meson.options new file mode 100644 index 000000000000..b1517c1e6108 --- /dev/null +++ b/app-i18n/xvnkb/files/meson.options @@ -0,0 +1,20 @@ +option( + 'abcstroke', + type: 'boolean', + value: false, + description: 'Enable ABC liked Telex keystroke', +) +option( + 'extstroke', + type: 'boolean', + value: true, + description: 'Enable extended keystroke', +) +option( + 'prostroke', + type: 'boolean', + value: false, + description: 'Enable programmer keystroke', +) +option('spellcheck', type: 'boolean', value: true, description: 'Spelling check') +option('xft', type: 'feature', value: 'enabled', description: 'X freetype') diff --git a/app-i18n/xvnkb/xvnkb-0.2.11-r1.ebuild b/app-i18n/xvnkb/xvnkb-0.2.11-r1.ebuild new file mode 100644 index 000000000000..74c679988878 --- /dev/null +++ b/app-i18n/xvnkb/xvnkb-0.2.11-r1.ebuild @@ -0,0 +1,59 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="8" + +inherit flag-o-matic meson + +DESCRIPTION="Vietnamese input keyboard for X" +HOMEPAGE="https://xvnkb.sourceforge.net/" +SRC_URI="https://downloads.sourceforge.net/${PN}/${P}.tar.bz2" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" +IUSE="spell xft" + +RDEPEND="x11-libs/libX11:= + xft? ( x11-libs/libXft:= )" +DEPEND="${RDEPEND} + x11-base/xorg-proto" +BDEPEND="xft? ( virtual/pkgconfig )" + +src_prepare() { + default + cp "${FILESDIR}"/meson.build . ||die "Unable to move build system" + cp "${FILESDIR}"/meson.options . ||die "Unable to move build system" + cp "${FILESDIR}"/config.h.in . ||die "Unable to move build system" +} + +src_configure() { + append-cflags -std=gnu17 + + local emesonargs=( + $(meson_use spell spellcheck) + $(meson_feature xft) + -Dextstroke=true + ) + + meson_src_configure +} + +src_install() { + meson_src_install + + einstalldocs + dodoc -r doc/. scripts contrib +} + +pkg_postinst() { + elog "Remember to" + elog "$ export LANG=en_US.UTF-8" + elog "(or any other UTF-8 locale) and" + elog "$ export LD_PRELOAD=/usr/$(get_libdir)/${PN}.so" + elog "before starting X Window" + elog "More documents are in ${EROOT}/usr/share/doc/${PF}" + + ewarn "Programs with suid/sgid will have LD_PRELOAD cleared" + ewarn "You have to unset suid/sgid to use with ${PN}" +} |