Skip to content

Commit

Permalink
Drop use of ronn, switch to raw roff instead
Browse files Browse the repository at this point in the history
Drop the ronn source files, check in the generated files instead. This gets rid
of the ruby+gem+ronn toolchain requirement at the cost of having to edit raw man
pages.

ronn files are as-generated but with the preamble and generation date removed.
The latter isn't important enough to keep, it'll just go stale for manually
maintained files and it's not worth setting up a configure_file() just for that
date.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
  • Loading branch information
whot committed Jul 23, 2020
1 parent 7176b03 commit 41ec5b1
Show file tree
Hide file tree
Showing 17 changed files with 334 additions and 336 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/main.yml
Expand Up @@ -23,7 +23,7 @@ jobs:
sudo apt update -y
sudo env DEBIAN_FRONTEND=noninteractive apt install -y \
doxygen libxcb-xkb-dev valgrind ninja-build \
libwayland-dev wayland-protocols bison graphviz ruby-ronn
libwayland-dev wayland-protocols bison graphviz
- name: Setup
run: |
meson setup build
Expand All @@ -40,14 +40,12 @@ jobs:
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1
- uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: Install dependencies
run: |
python -m pip install --upgrade pip meson
gem install ronn
brew install doxygen bison ninja
brew link bison --force
env:
Expand All @@ -67,7 +65,6 @@ jobs:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1
- uses: actions/setup-python@v1
with:
python-version: '3.7'
Expand All @@ -81,7 +78,6 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip meson
gem install ronn
choco install ninja winflexbison3 -y --no-progress --stop-on-first-failure
- name: Setup
shell: cmd
Expand Down
31 changes: 7 additions & 24 deletions meson.build
Expand Up @@ -13,7 +13,6 @@ pkgconfig = import('pkgconfig')
cc = meson.get_compiler('c')

dir_libexec = join_paths(get_option('prefix'), get_option('libexecdir'), 'xkbcommon')
dir_man = join_paths(get_option('prefix'), get_option('mandir'))

# Compiler flags.
foreach cflag: [
Expand Down Expand Up @@ -528,21 +527,21 @@ if build_tools

executable('xkbcli', 'tools/xkbcli.c',
dependencies: tools_dep, install: true)
man_pages += 'tools/xkbcli.1.ronn'
install_man('tools/xkbcli.1')

executable('xkbcli-compile-keymap',
'tools/compile-keymap.c',
dependencies: tools_dep,
install: true,
install_dir: dir_libexec)
man_pages += 'tools/xkbcli-compile-keymap.1.ronn'
install_man('tools/xkbcli-compile-keymap.1')
configh_data.set10('HAVE_XKBCLI_COMPILE_KEYMAP', true)
executable('xkbcli-how-to-type',
'tools/how-to-type.c',
dependencies: tools_dep,
install: true,
install_dir: dir_libexec)
man_pages += 'tools/xkbcli-how-to-type.1.ronn'
install_man('tools/xkbcli-how-to-type.1')
configh_data.set10('HAVE_XKBCLI_HOW_TO_TYPE', true)
if cc.has_header('linux/input.h')
executable('xkbcli-interactive-evdev',
Expand All @@ -551,7 +550,7 @@ if build_tools
install: true,
install_dir: dir_libexec)
configh_data.set10('HAVE_XKBCLI_INTERACTIVE_EVDEV', true)
man_pages += 'tools/xkbcli-interactive-evdev.1.ronn'
install_man('tools/xkbcli-interactive-evdev.1')
endif
if get_option('enable-x11')
x11_tools_dep = declare_dependency(
Expand All @@ -567,7 +566,7 @@ if build_tools
dependencies: x11_tools_dep,
install: true,
install_dir: dir_libexec)
man_pages += 'tools/xkbcli-interactive-x11.1.ronn'
install_man('tools/xkbcli-interactive-x11.1')
configh_data.set10('HAVE_XKBCLI_INTERACTIVE_X11', true)
endif
if get_option('enable-wayland')
Expand Down Expand Up @@ -602,7 +601,7 @@ if build_tools
dependencies: [tools_dep, wayland_client_dep],
install: true,
install_dir: dir_libexec)
man_pages += 'tools/xkbcli-interactive-wayland.1.ronn'
install_man('tools/xkbcli-interactive-wayland.1')
configh_data.set10('HAVE_XKBCLI_INTERACTIVE_WAYLAND', true)
endif

Expand All @@ -613,7 +612,7 @@ if build_tools
dependencies: dep_libxkbregistry,
install: true,
install_dir: dir_libexec)
man_pages += 'tools/xkbcli-list.1.ronn'
install_man('tools/xkbcli-list.1')
endif

# pytest finds files named test_foo_bar.py but not
Expand All @@ -629,22 +628,6 @@ if build_tools
args: [tool_option_test, '-n', 'auto'])
endif

if get_option('enable-manpages')
prog_ronn = find_program('ronn', required: true)
foreach manpage : man_pages
# man page filenames adhere to directory/topic.section.ronn
topic = manpage.split('/')[-1].split('.')[-3]
section = manpage.split('.')[-2]
output = '@0@.@1@'.format(topic, section)
custom_target(output,
input: manpage,
output: output,
command: [prog_ronn, '--manual=libxkbcommon manual', '--pipe', '--roff', files(manpage)],
capture: true,
install: true,
install_dir: join_paths(dir_man, section))
endforeach
endif

# xkeyboard-config "verifier"
xkct_config = configuration_data()
Expand Down
8 changes: 1 addition & 7 deletions tools/tools-common.c
Expand Up @@ -219,15 +219,9 @@ tools_exec_command(const char *prefix, int real_argc, char **real_argv)
}

command = real_argv[0];
#ifdef _MSC_VER
#define PATH_SEP '\\'
#else
#define PATH_SEP '/'
#endif

if (!snprintf_safe(executable, sizeof(executable),
"%s%c%s-%s", LIBXKBCOMMON_TOOL_PATH, PATH_SEP,
prefix, command)) {
"%s/%s-%s", LIBXKBCOMMON_TOOL_PATH, prefix, command)) {
fprintf(stderr, "Failed to assemble command\n");
return EXIT_FAILURE;
}
Expand Down
70 changes: 70 additions & 0 deletions tools/xkbcli-compile-keymap.1
@@ -0,0 +1,70 @@
.TH "XKBCLI\-COMPILE\-KEYMAP" "1" "" "" "libxkbcommon manual"
.
.SH "NAME"
\fBxkbcli\-compile\-keymap\fR \- compile an XKB keymap
.
.SH "SYNOPSIS"
\fBxkbcli\fR compile\-keymap [\-\-help] [OPTIONS]
.
.SH "DESCRIPTION"
\fBxkbcli compile\-keymap\fR compiles and prints a keymap based on the given options\.
.
.SH "OPTIONS"
.
.TP
\fB\-\-help\fR
Print help and exit
.
.TP
\fB\-\-verbose\fR
Enable verbose debugging output
.
.TP
\fB\-\-kccgst\fR
Print a keymap which only includes the KcCGST component names instead of the full keymap
.
.TP
\fB\-\-rmlvo\fR
Print the full RMLVO with the defaults filled in for missing elements
.
.TP
\fB\-\-from\-xkb\fR
Load the XKB file from stdin, ignore RMLVO options\. This option must not be used with \fB\-\-kccgst\fR\.
.
.TP
\fB\-\-include\fR
Add the given path to the include path list\. This option is order\-dependent, include paths given first are searched first\. If an include path is given, the default include path list is not used\. Use \fB\-\-include\-defaults\fR to add the default include paths
.
.TP
\fB\-\-include\-defaults\fR
Add the default set of include directories\. This option is order\-dependent, include paths given first are searched first\.
.
.TP
\fB\-\-rules <rules>\fR
The XKB ruleset
.
.TP
\fB\-\-model <model>\fR
The XKB model
.
.TP
\fB\-\-layout <layout>\fR:
.
.IP
The XKB layout
.
.TP
\fB\-\-variant <variant>\fR:
.
.IP
The XKB layout variant
.
.TP
\fB\-\-options <options>\fR
The XKB options
.
.SH "SEE ALSO"
\fBxkbcli\fR(1)
.
.P
The libxkbcommon online documentation at \fIhttps://xkbcommon\.org\fR
63 changes: 0 additions & 63 deletions tools/xkbcli-compile-keymap.1.ronn

This file was deleted.

41 changes: 41 additions & 0 deletions tools/xkbcli-how-to-type.1
@@ -0,0 +1,41 @@
.TH "XKBCLI\-HOW\-TO\-TYPE" "1" "" "" "libxkbcommon manual"
.
.SH "NAME"
\fBxkbcli\-how\-to\-type\fR \- query how to type a given Unicode codepoint
.
.SH "SYNOPSIS"
\fBxkbcli\fR how\-to\-type [OPTIONS] <codepoint>
.
.SH "DESCRIPTION"
\fBxkbcli how\-to\-type\fR prints key sequences to type the given Unicode codepoint\.
.
.P
Pipe into \fBcolumn \-ts $\'\e\et\'\fR for nicely aligned output\.
.
.SH "OPTIONS"
.
.TP
\fB\-\-rules <rules>\fR
The XKB ruleset
.
.TP
\fB\-\-model <model>\fR
The XKB model
.
.TP
\fB\-\-layout <layout>\fR
The XKB layout
.
.TP
\fB\-\-variant <variant>\fR
The XKB layout variant
.
.TP
\fB\-\-options <options>\fR
The XKB options
.
.SH "SEE ALSO"
\fBxkbcli\fR(1)
.
.P
The libxkbcommon online documentation at \fIhttps://xkbcommon\.org\fR
36 changes: 0 additions & 36 deletions tools/xkbcli-how-to-type.1.ronn

This file was deleted.

0 comments on commit 41ec5b1

Please sign in to comment.