Compare commits

...

24 Commits
v0.6 ... v0.7

Author SHA1 Message Date
Benjamin Tissoires
5443083b1d meson.build: libratbag 0.7
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-04-20 11:59:48 +02:00
Benjamin Tissoires
cc19496699 Fix release.sh for meson
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-04-20 11:59:48 +02:00
Peter Hutterer
b595691c5e meson: break up the two long error messages
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-20 11:28:05 +02:00
Peter Hutterer
7d784a1a91 doc: use USE_MDFILE_AS_MAINPAGE to include the README.md as mainpage
Supported as of doxygen 1.8.3 (Dec 2012), see
http://www.stack.nl/~dimitri/doxygen/manual/changelog.html#log_1_8_3

Fixes #145

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-20 11:28:05 +02:00
Peter Hutterer
a664042f64 meson: add doxygen input files to source list
To rebuild the documentation when either changes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-20 11:28:05 +02:00
Benjamin Tissoires
5bc4470a8c Fix warning: ‘x’ may be used uninitialized in this function
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-04-20 11:20:07 +02:00
Peter Hutterer
b8ed1ea3a4 Remove autotools build system
And thus drop the code to parse the top_srcdir from the arguments to the
symbols-leak-test, not the env.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-19 14:40:57 +02:00
Peter Hutterer
f2ad49cf20 Add meson build file
For a builddir called 'builddir', the following commands are sufficient now:

    meson builddir
    ninja -C builddir
    sudo ninja -C builddir install

Meson only needs to be run once after checkout or after the removal of the
builddir.

Fixes https://github.com/libratbag/libratbag/issues/142

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-19 14:40:57 +02:00
Peter Hutterer
fd6a9e73ed test: always run the symbols-leak-test
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-19 14:40:57 +02:00
Peter Hutterer
db57a8e7b6 test: pass TOP_SRCDIR via the env or as $1
Prep work for meson, even though we'll eventuall drop the env bit. This just
removes the extra symbols-leak-test.in step.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-19 14:40:57 +02:00
Peter Hutterer
2a35bf009f configure.ac: drop "auto" detection of test dependencies
Always build the tests, if someone doesn't want it disable it with a configure
flag but at least be explicit about it.

Justification: any developer should build the full stack as intended by
default. Distributions may disable bits and pieces, but they shouldn't rely on
auto-detection to figure it out, they should explicity disable those bits they
don't want.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-04 10:00:38 +02:00
Peter Hutterer
42d49d74ab configure.ac: drop "auto" detection of doxygen dependencies
Always build the documentation, if someone doesn't want it disable it with a
configure flag but at least be explicit about it.

Justification: any developer should build the full stack as intended by
default. Distributions may disable bits and pieces, but they shouldn't rely on
auto-detection to figure it out, they should explicity disable those bits they
don't want.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-04 10:00:38 +02:00
Peter Hutterer
a9f34249fc configure.ac: remove an erroneous quotation mark
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-04 10:00:38 +02:00
Peter Hutterer
1ce59bcc1f doc: drop the custom INPUT to doxygen
Not necessary, we have it in the doxygen.in
2017-04-03 09:55:53 +02:00
Peter Hutterer
bb35821c45 tools: fix signed vs unsigned comparison warnings
And use this to start using C99 variable style, for pure loop variables it's
better to have them declared in the loop itself.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-03 09:55:53 +02:00
Peter Hutterer
bbec42c426 tools: include config.h for ratbag-command
And that then pulls in _GNU_SOURCE for us

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-03 09:55:53 +02:00
Peter Hutterer
cb487a6d1a tools: fix compiler warning 'no previous prototype'
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-03 09:55:53 +02:00
Peter Hutterer
7fdcf62bf2 tools: fix compiler warning
../tools/shared.c:132:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-03 09:55:53 +02:00
Peter Hutterer
f82c1119bf tools: fix Makefile, it's SOURCES, not SOURCeS
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-03 09:55:53 +02:00
Peter Hutterer
f60f8a12ab tools: fix string parsing for LED colors 2017-03-31 15:07:01 +10:00
Peter Hutterer
fd348d456d tools: add missing LED_OFF switch case
And add the missing break
2017-03-31 15:07:01 +10:00
Peter Hutterer
0f73a97bc8 tools: move variable declaration up
We do C99, but not this :)
2017-03-31 15:07:01 +10:00
Peter Hutterer
7783f50110 tools: fix unused variable warnings 2017-03-31 15:07:01 +10:00
Benjamin Tissoires
b85fcd0cee hwdb: add missing G900 over USB entry
Allows to have the nice picture

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-03-22 11:49:19 +01:00
23 changed files with 487 additions and 483 deletions

1
.gitignore vendored
View File

@@ -36,7 +36,6 @@ tags
test-driver
compile
m4
symbols-leak-test
symbols-leak-test.log
test-build-cxx
test-build-linker

View File

@@ -1,6 +0,0 @@
SUBDIRS = src doc test tools hwdb data
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
valgrind:
(cd test; $(MAKE) valgrind)

View File

@@ -1,5 +1,3 @@
/*!@mainpage
libratbag
=========
@@ -67,6 +65,28 @@ Source
git clone https://github.com/libratbag/libratbag.git
Building
--------
libratbag uses the meson build system, see http://mesonbuild.com which in
turn uses ninja to invoke the compiler (`ninja` may be `ninja-build` on your
distribution). From a fresh git checkout, run the
following commands to init the repository:
meson builddir --prefix=/usr/
And to build or re-build after code-changes, run:
ninja -C builddir
sudo ninja -C builddir install
Note: 'builddir' is the build output directory and can be changed to any
other directory name. To set configure-time options, use e.g.
mesonconf builddir -Denable-documentation=no
Run 'mesonconf builddir' to list the options.
Bugs
----
@@ -100,5 +120,3 @@ libratbag is licensed under the MIT license.
See the COPYING file for the full license information.
[![Build Status](https://semaphoreci.com/api/v1/projects/7905244a-c0b5-468b-9071-d846de3ce9f1/545192/badge.svg)](https://semaphoreci.com/libratbag/libratbag)
*/

View File

@@ -1,164 +0,0 @@
AC_PREREQ([2.64])
m4_define([libratbag_major_version], [0])
m4_define([libratbag_minor_version], [6])
m4_define([libratbag_micro_version], [0])
m4_define([libratbag_version],
[libratbag_major_version.libratbag_minor_version.libratbag_micro_version])
AC_INIT([libratbag],
[libratbag_version],
[],
[libratbag],
[])
AC_SUBST([LIBRATBAG_VERSION_MAJOR], [libratbag_major_version])
AC_SUBST([LIBRATBAG_VERSION_MINOR], [libratbag_minor_version])
AC_SUBST([LIBRATBAG_VERSION_MICRO], [libratbag_micro_version])
AC_SUBST([LIBRATBAG_VERSION], [libratbag_version])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz])
# Before making a release, the LIBRATBAG_LT_VERSION and LIBLUR_LT_VERSION
# strings should be modified.
# The strings are of the form C:R:A.
# a) If binary compatibility has been broken (eg removed or changed interfaces)
# change to C+1:0:0.
# b) If interfaces have been changed or added, but binary compatibility has
# been preserved, change to C+1:0:A+1
# c) If the interface is the same as the previous version, change to C:R+1:A
LIBRATBAG_LT_VERSION=4:0:0
LIBLUR_LT_VERSION=3:2:0
AC_SUBST(LIBRATBAG_LT_VERSION)
AC_SUBST(LIBLUR_LT_VERSION)
AM_SILENT_RULES([yes])
AC_USE_SYSTEM_EXTENSIONS
# Check for programs
AC_PROG_CC_C99
AC_PROG_CXX # Only used by build C++ test
AC_PROG_GREP
# Initialize libtool
LT_PREREQ([2.2])
LT_INIT
PKG_PROG_PKG_CONFIG()
PKG_CHECK_MODULES(LIBUDEV, [libudev])
PKG_CHECK_MODULES(LIBEVDEV, [libevdev])
if test "x$GCC" = "xyes"; then
GCC_CXXFLAGS="-Wall -Wextra -Wno-unused-parameter -g -fvisibility=hidden"
GCC_CFLAGS="$GCC_CXXFLAGS -Wmissing-prototypes -Wstrict-prototypes"
fi
AC_SUBST(GCC_CFLAGS)
AC_SUBST(GCC_CXXFLAGS)
AC_ARG_WITH(udev-base-dir, AS_HELP_STRING([--with-udev-base-dir=DIR], [where udev base directory is]))
if test -n "$with_udev_base_dir" ; then
UDEV_BASE_DIR="$with_udev_base_dir"
else
UDEV_BASE_DIR="$prefix/lib/udev"
fi
AC_SUBST(UDEV_BASE_DIR)
AC_ARG_ENABLE([documentation],
[AC_HELP_STRING([--enable-documentation],
[Enable building the documentation (default=auto)])],
[build_documentation="$enableval"],
[build_documentation="auto"])
if test "x$build_documentation" = "xyes" -o "x$build_documentation" = "xauto"; then
AC_PATH_PROG(DOXYGEN, doxygen)
if test "x$DOXYGEN" = "x"; then
if test "x$build_documentation" = "xyes"; then
AC_MSG_ERROR([Documentation build requested but doxygen not found. Install doxygen or disable the documentation using --disable-documentation])
fi
else
AC_MSG_CHECKING([for compatible doxygen version])
doxygen_version=`$DOXYGEN --version`
AS_VERSION_COMPARE([$doxygen_version], [1.6.0],
[AC_MSG_RESULT([no])
DOXYGEN=""],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([yes])])
if test "x$DOXYGEN" = "x" -a "x$build_documentation" = "xyes"; then
AC_MSG_ERROR([Doxygen $doxygen_version too old. Doxygen 1.6+ required for documentation build. Install required doxygen version or disable the documentation using --disable-documentation])
fi
fi
AC_PATH_PROG(DOT, dot)
if test "x$DOT" = "x"; then
if test "x$build_documentation" = "xyes"; then
AC_MSG_ERROR([Documentation build requested but graphviz's dot not found. Install graphviz or disable the documentation using --disable-documentation])
fi
else
AC_MSG_CHECKING([for compatible dot version])
dot_version=`$DOT -V 2>&1|$GREP -oP '(?<=version\W)@<:@0-9.@:>@*(?=\W(.*))'`
AS_VERSION_COMPARE([$dot_version], [2.26.0],
[AC_MSG_RESULT([no])
DOT=""],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([yes])])
if test "x$DOT" = "x" -a "x$build_documentation" = "xyes"; then
AC_MSG_ERROR([Graphviz dot $dot_version too old. Graphviz 2.26+ required for documentation build. Install required graphviz version or disable the documentation using --disable-documentation])
fi
fi
if test "x$DOXYGEN" != "x" -a "x$DOT" != "x"; then
build_documentation="yes"
else
build_documentation="no"
fi
fi
AC_ARG_ENABLE(tests,
AS_HELP_STRING([--enable-tests], [Build the tests (default=auto)]),
[build_tests="$enableval"],
[build_tests="auto"])
PKG_CHECK_MODULES(CHECK, [check >= 0.9.10], [HAVE_CHECK="yes"], [HAVE_CHECK="no"])
if test "x$build_tests" = "xauto"; then
build_tests="$HAVE_CHECK"
fi
if test "x$build_tests" = "xyes"; then
if test "x$HAVE_CHECK" = "xno"; then
AC_MSG_ERROR([Cannot build tests, check is missing])
fi
AC_PATH_PROG(VALGRIND, [valgrind])
fi
AC_DEFINE(BUILD_TESTS, [1], ["Build the test suite])
AM_CONDITIONAL(HAVE_VALGRIND, [test "x$VALGRIND" != "x"])
AM_CONDITIONAL(BUILD_TESTS, [test "x$build_tests" = "xyes"])
AM_CONDITIONAL(BUILD_DOCS, [test "x$build_documentation" = "xyes"])
AC_CONFIG_FILES([Makefile
data/Makefile
doc/Makefile
doc/libratbag.doxygen
hwdb/Makefile
src/Makefile
src/libratbag.pc
src/libratbag-version.h
src/liblur.pc
test/Makefile
tools/Makefile])
AC_CONFIG_FILES([test/symbols-leak-test],
[chmod +x test/symbols-leak-test])
AC_OUTPUT
AC_MSG_RESULT([
Prefix ${prefix}
udev base directory: ${UDEV_BASE_DIR}
Build documentation ${build_documentation}
Build tests ${build_tests}
Tests use valgrind ${VALGRIND}
])

View File

@@ -1,2 +0,0 @@
libratbagdatadir = $(datadir)/libratbag
dist_libratbagdata_DATA = $(shell find $(top_srcdir)/data -name "*.svg" -printf "%P\n")

View File

@@ -1,38 +0,0 @@
if BUILD_DOCS
noinst_DATA = html/index.html
header_files = \
$(top_srcdir)/src/libratbag.h \
$(top_srcdir)/README.md
style_files = \
style/header.html \
style/footer.html \
style/customdoxygen.css \
style/bootstrap.css
html/index.html: libratbag.doxygen $(header_files) $(diagram_files) $(style_files)
$(AM_V_GEN)(cat $<; \
echo "INPUT = $(header_files)"; \
) | $(DOXYGEN) -
clean-local:
$(AM_V_at)rm -rf html
doc_src= $(shell find html -type f -printf "html/%P\n" 2>/dev/null)
EXTRA_DIST = $(builddir)/html/index.html \
$(doc_src) \
$(diagram_files) \
$(header_files) \
$(style_files)
endif
# make sure doc was built before running dist
dist-hook:
@test -f $(distdir)/html/index.html || (\
echo "******************************************************" && \
echo "Couldn't find documentation files, refusing make dist." && \
echo "Install doxygen to build documentation for tarball." && \
echo "******************************************************" && \
test )

View File

@@ -8,8 +8,9 @@ EXTRACT_ALL = YES
EXTRACT_STATIC = YES
MAX_INITIALIZER_LINES = 0
QUIET = YES
# Keep this list in sync with meson.build
INPUT = @top_srcdir@/src/libratbag.h \
@top_srcdir@/README.txt
@top_srcdir@/README.md
GENERATE_HTML = YES
HTML_TIMESTAMP = YES
USE_MATHJAX = YES
@@ -24,3 +25,4 @@ HTML_HEADER = @top_srcdir@/doc/style/header.html
HTML_FOOTER = @top_srcdir@/doc/style/footer.html
HTML_EXTRA_STYLESHEET = @top_srcdir@/doc/style/customdoxygen.css \
@top_srcdir@/doc/style/bootstrap.css
USE_MDFILE_AS_MAINPAGE = README.md

View File

@@ -180,6 +180,10 @@ mouse:usb:v046dp4011:name:*:
mouse:usb:v046dpc537:name:*:
RATBAG_HIDPP20_INDEX=1
# G900 over USB
mouse:usb:v046dpc081:name:*:
RATBAG_SVG=logitech-g900.svg
# G900 over wireless USB
mouse:usb:v046dpc539:name:*:
RATBAG_DRIVER=hidpp20

View File

@@ -1,9 +0,0 @@
udevrulesdir = $(UDEV_BASE_DIR)/rules.d
udevrules_DATA = 70-libratbag-mouse.rules
hwdbdir = $(UDEV_BASE_DIR)/hwdb.d
hwdb_DATA = 70-libratbag-mouse.hwdb
EXTRA_DIST = \
$(udevrules_DATA) \
$(hwdb_DATA)

390
meson.build Normal file
View File

@@ -0,0 +1,390 @@
project('libratbag', 'c', 'cpp',
version : '0.7.0',
license : 'MIT/Expat',
default_options : [ 'c_std=gnu99' ])
libratbag_version = meson.project_version().split('.')
# We use libtool-version numbers because it's easier to understand.
# Before making a release, the libratbag_so_* and liblur_so_*
# numbers should be modified. The components are of the form C:R:A.
# a) If binary compatibility has been broken (eg removed or changed interfaces)
# change to C+1:0:0.
# b) If interfaces have been changed or added, but binary compatibility has
# been preserved, change to C+1:0:A+1
# c) If the interface is the same as the previous version, change to C:R+1:A
libratbag_so_c=4
libratbag_so_r=1
libratbag_so_a=0
liblur_so_c=3
liblur_so_r=1
liblur_so_a=0
# convert to sonames
libratbag_so_version = '@0@.@1@.@2@'.format((libratbag_so_c - libratbag_so_a),
libratbag_so_a, libratbag_so_r)
liblur_so_version = '@0@.@1@.@2@'.format((liblur_so_c-liblur_so_a),
liblur_so_a, liblur_so_r)
# Compiler setup
cc = meson.get_compiler('c')
cpp = meson.get_compiler('cpp')
cppflags = ['-Wall', '-Wextra', '-Wno-unused-parameter', '-g', '-fvisibility=hidden']
cflags = cppflags + ['-Wmissing-prototypes', '-Wstrict-prototypes']
add_project_arguments(cflags, language: 'c')
add_project_arguments(cppflags, language: 'cpp')
# Initialize config.h, to be added to in the various options below, config.h
# is generated at the end of this file
config_h = configuration_data()
config_h.set('_GNU_SOURCE', '1')
# dependencies
pkgconfig = import('pkgconfig')
dep_udev = dependency('libudev')
dep_libevdev = dependency('libevdev')
dep_lm = cc.find_library('m')
#### libutil.a ####
src_libutil = [
'src/libratbag-util.c',
'src/libratbag-util.h'
]
deps_libutil = [
dep_udev,
]
lib_libutil = static_library('util',
src_libutil,
dependencies : deps_libutil
)
dep_libutil = declare_dependency(link_with: lib_libutil)
### libhidpp.a ####
src_libhidpp = [
'src/hidpp-generic.h',
'src/hidpp-generic.c',
'src/hidpp10.h',
'src/hidpp10.c',
'src/hidpp20.h',
'src/hidpp20.c',
'src/usb-ids.h'
]
deps_libhidpp = [ dep_lm ]
lib_libhidpp = static_library('hidpp',
src_libhidpp,
dependencies : deps_libhidpp)
dep_libhidpp = declare_dependency(link_with: lib_libhidpp)
### liblur.a ####
install_headers('src/liblur.h')
src_liblur = [
'src/liblur.c',
'src/liblur.h'
]
deps_liblur = [
dep_libutil,
dep_libhidpp,
]
lur_mapfile = 'src/liblur.sym'
lur_version_flag = '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), lur_mapfile)
lib_liblur = shared_library('lur',
src_liblur,
include_directories : include_directories('.'),
dependencies : deps_liblur,
version : liblur_so_version,
link_args : lur_version_flag,
link_depends : lur_mapfile,
install : true,
)
dep_liblur = declare_dependency(link_with: lib_liblur)
pkgconfig.generate (
filebase: 'liblur',
name: 'Liblur',
description: 'Logitech Unifying Receiver configuration library',
version: meson.project_version(),
libraries: lib_liblur
)
#### libratbag.so ####
install_headers('src/libratbag.h')
src_libratbag = [
'src/driver-etekcity.c',
'src/driver-hidpp20.c',
'src/driver-hidpp10.c',
'src/driver-logitech-g300.c',
'src/driver-roccat.c',
'src/driver-gskill.c',
'src/driver-test.c',
'src/libratbag.c',
'src/libratbag.h',
'src/libratbag-hidraw.c',
'src/libratbag-hidraw.h',
'src/libratbag-private.h',
'src/libratbag-test.c',
'src/libratbag-test.h',
'src/usb-ids.h'
]
deps_libratbag = [
dep_udev,
dep_libevdev,
dep_libutil,
dep_libhidpp,
]
libratbag_version_h_config = configuration_data()
libratbag_version_h_config.set('LIBRATBAG_VERSION_MAJOR', libratbag_version[0])
libratbag_version_h_config.set('LIBRATBAG_VERSION_MINOR', libratbag_version[1])
libratbag_version_h_config.set('LIBRATBAG_VERSION_MICRO', libratbag_version[2])
libratbag_version_h_config.set('LIBRATBAG_VERSION', meson.project_version())
libratbag_version_h = configure_file(
ratbag : 'src/libratbag-version.h.in',
output : 'libratbag-version.h',
configuration : libratbag_version_h_config,
install: false,
)
mapfile = 'src/libratbag.sym'
version_flag = '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), mapfile)
lib_libratbag = shared_library('ratbag',
src_libratbag,
include_directories : include_directories('.'),
dependencies : deps_libratbag,
version : libratbag_so_version,
link_args : version_flag,
link_depends : mapfile,
install : true,
)
dep_libratbag = declare_dependency(
link_with : lib_libratbag,
dependencies : deps_libratbag
)
pkgconfig.generate(
filebase: 'libratbag',
name: 'Libratbag',
description: 'Mouse configuration library',
version: meson.project_version(),
libraries: lib_libratbag
)
#### libshared.a ####
src_libshared = [
'tools/shared.c',
'tools/shared.h'
]
deps_libshared = [
dep_udev,
dep_libevdev,
]
lib_libshared = static_library('shared',
src_libshared,
dependencies : deps_libshared,
include_directories : include_directories('src')
)
dep_libshared = declare_dependency(link_with: lib_libshared)
#### ratbag-command ####
src_ratbag_command = [ 'tools/ratbag-command.c' ]
deps_ratbag_command = [
dep_libshared,
dep_libratbag,
dep_libevdev
]
executable('ratbag-command',
src_ratbag_command,
dependencies : deps_ratbag_command,
include_directories : include_directories('src'),
install : true,
)
man_config = configuration_data()
man_config.set('version', meson.project_version())
man_ratbag_command = configure_file (
input: 'tools/ratbag-command.man',
output: 'ratbag-command.1',
configuration: man_config,
install : true,
install_dir : join_paths(get_option('mandir'), 'man1')
)
#### hidpp10-dump-page ####
src_hidpp10_dump_page = [ 'tools/hidpp10-dump-page.c' ]
executable('hidpp10-dump-page',
src_hidpp10_dump_page,
dependencies : [ dep_libhidpp ],
include_directories : include_directories('src'),
install : false,
)
#### hidpp20-dump-page ####
src_hidpp20_dump_page = [ 'tools/hidpp20-dump-page.c' ]
executable('hidpp20-dump-page',
src_hidpp20_dump_page,
dependencies : [ dep_libhidpp ],
include_directories : include_directories('src'),
install : false,
)
#### lur-command ####
src_lur_command = [ 'tools/lur-command.c' ]
executable('lur-command',
src_lur_command,
dependencies : [ dep_libshared, dep_liblur ],
include_directories : include_directories('src'),
install : true,
)
#### hwdb ####
udev_dir = get_option('udev-dir')
if udev_dir == ''
udev_dir = '@0@/lib/udev'.format(get_option('prefix'))
endif
udev_rules_dir = '@0@/rules.d'.format(udev_dir)
udev_hwdb_dir = '@0@/hwdb.d'.format(udev_dir)
install_data('hwdb/70-libratbag-mouse.rules',
install_dir : udev_rules_dir)
install_data('hwdb/70-libratbag-mouse.hwdb',
install_dir : udev_hwdb_dir)
#### svg files ####
svg_files = [
'data/etekcity.svg',
'data/logitech-g300.svg',
'data/logitech-g303.svg',
'data/logitech-g500s.svg',
'data/logitech-g502.svg',
'data/logitech-g700.svg',
'data/logitech-g900.svg',
'data/logitech-mx_master.svg',
'data/roccat-kone-xtd.svg'
]
install_data(svg_files,
install_dir : '@0@/libratbag'.format(get_option('datadir')))
#### tests ####
enable_tests = get_option('enable-tests')
if enable_tests
dep_check = dependency('check', version: '>= 0.9.10')
config_h.set('BUILD_TESTS', '1')
env_test = ['RATBAG_TEST=1']
valgrind_args = [ '--leak-check=full',
'--quiet',
'--error-exitcode=3',
'--suppressions=@0@/test/valgrind.suppressions'.format(meson.current_source_dir()) ]
test_context = executable('test-context',
['test/test-context.c'],
dependencies : [ dep_libratbag, dep_check ],
include_directories : include_directories('src'),
install : false)
test_device = executable('test-device',
['test/test-device.c'],
dependencies : [ dep_libratbag, dep_check ],
include_directories : include_directories('src'),
install : false)
test_iconv_helper = executable('test-iconv-helper',
['test/test-iconv-helper.c'],
dependencies : [ dep_libratbag,
dep_check,
dep_libutil],
include_directories : include_directories('src'),
install : false)
test('test-context', test_context, env : env_test, valgrind_args : valgrind_args)
test('test-device', test_device, env : env_test, valgrind_args : valgrind_args)
test('test-iconv-helper', test_iconv_helper, env : env_test, valgrind_args : valgrind_args)
executable('test-build-cxx',
['test/build-cxx.cc'],
dependencies : [ dep_libratbag ],
include_directories : include_directories('src'),
cpp_args : ['-Wall', '-Wextra', '-Wno-unused-parameter'],
install : false)
executable('test-build-linker',
['test/build-pedantic.c'],
dependencies : [ dep_libratbag ],
include_directories : include_directories('src'),
install : false)
executable('test-build-gnuc90',
['test/build-pedantic.c'],
dependencies : [ dep_libratbag ],
include_directories : include_directories('src'),
c_args : ['-std=gnu90', '-Werror'],
install : false)
executable('test-build-pedantic',
['test/build-pedantic.c'],
dependencies : [ dep_libratbag ],
include_directories : include_directories('src'),
c_args : ['-std=c99', '-pedantic', '-Werror'],
install : false)
endif
test_symbols_leak = find_program('test/symbols-leak-test')
test('symbols-leak-test',
test_symbols_leak,
args : [ meson.current_source_dir() ])
#### documentation ####
enable_doc = get_option('enable-documentation')
if enable_doc
cmd_doxygen = find_program('doxygen')
cmd_dot = find_program('dot')
v = run_command(cmd_doxygen, ['--version']).stdout()
if not v.version_compare('>=1.8.3')
error('Doxygen $doxygen_version too old. ' +
'Doxygen 1.8.3+ required for documentation build. ' +
'Install required doxygen version or ' +
'disable the documentation using --disable-documentation')
endif
v = run_command(cmd_dot, ['-V']).stderr()
v = v.split(' ')[4]
if v.version_compare('<2.26.0')
error('Graphviz dot $dot_version too old. ' +
'Graphviz 2.26+ required for documentation build. ' +
'Install required graphviz version or ' +
'disable the documentation using --disable-documentation')
endif
doc_config = configuration_data()
doc_config.set('PACKAGE_NAME', meson.project_name())
doc_config.set('PACKAGE_VERSION', meson.project_version())
doc_config.set('top_srcdir', meson.source_root())
doxyfile = configure_file(input : 'doc/libratbag.doxygen.in',
output : 'libratbag.doxygen',
configuration : doc_config,
install : false)
src_doxygen = [ doxyfile,
'src/libratbag.h',
'README.md']
custom_target('doxygen',
input : src_doxygen,
output : [ 'html' ],
command : [ cmd_doxygen, doxyfile ],
install : false,
build_by_default : true)
endif
#### output files ####
configure_file(output: 'config.h', install: false, configuration: config_h)

14
meson_options.txt Normal file
View File

@@ -0,0 +1,14 @@
option('udev-dir',
type: 'string',
default: '',
description: 'udev base directory [default=$prefix/lib/udev]')
option('enable-tests',
type: 'boolean',
value: true,
description: 'Build the tests (default=yes)')
option('enable-documentation',
type: 'boolean',
value: true,
description: 'Build the documentation (default=yes)')

View File

@@ -342,19 +342,9 @@ process_module() {
return 1
fi
# Run 'make dist/distcheck' to ensure the tarball matches the git module content
# Important to run make dist/distcheck before looking in Makefile, may need to reconfigure
echo "Info: running \"make $MAKE_DIST_CMD\" to create tarballs:"
${MAKE} $MAKEFLAGS $MAKE_DIST_CMD > /dev/null
if [ $? -ne 0 ]; then
echo "Error: \"$MAKE $MAKEFLAGS $MAKE_DIST_CMD\" failed."
cd $top_src
return 1
fi
# Find out the tarname from the makefile
pkg_name=`$GREP '^PACKAGE = ' Makefile | sed 's|PACKAGE = ||'`
pkg_version=`$GREP '^VERSION = ' Makefile | sed 's|VERSION = ||'`
# Find out the tarname from meson.build
pkg_name=$($GREP '^project(' meson.build | sed 's|project(\([^\s,]*\).*|\1|' | sed "s/'//g")
pkg_version=$($GREP -m 1 '^ version : ' meson.build | sed 's| version : \([^\s,]*\).*|\1|' | sed "s/'//g")
tar_name="$pkg_name-$pkg_version"
targz=$tar_name.tar.gz
tag_name=$(echo "v$pkg_version" | sed 's|.0$||')
@@ -497,17 +487,11 @@ Usage: $basename [options] path...
Where "path" is a relative path to a git module, including '.'.
Options:
--dist make 'dist' instead of 'distcheck'; use with caution
--distcheck Default, ignored for compatibility
--dry-run Does everything except tagging and uploading tarballs
--force Force overwriting an existing release
--help Display this help and exit successfully
--no-quit Do not quit after error; just print error message
Environment variables defined by the "make" program and used by release.sh:
MAKE The name of the make command [make]
MAKEFLAGS: Options to pass to all \$(MAKE) invocations
HELP
}
@@ -516,9 +500,6 @@ HELP
#------------------------------------------------------------------------------
#
# Choose which make program to use (could be gmake)
MAKE=${MAKE:="make"}
# Choose which grep program to use (on Solaris, must be gnu grep)
if [ "x$GREP" = "x" ] ; then
if [ -x /usr/gnu/bin/grep ] ; then
@@ -528,23 +509,10 @@ if [ "x$GREP" = "x" ] ; then
fi
fi
# Set the default make tarball creation command
MAKE_DIST_CMD=distcheck
# Process command line args
while [ $# != 0 ]
do
case $1 in
# Use 'dist' rather than 'distcheck' to create tarballs
# You really only want to do this if you're releasing a module you can't
# possibly build-test. Please consider carefully the wisdom of doing so.
--dist)
MAKE_DIST_CMD=dist
;;
# Use 'distcheck' to create tarballs
--distcheck)
MAKE_DIST_CMD=distcheck
;;
# Does everything except uploading tarball
--dry-run)
DRY_RUN=yes

View File

@@ -8,6 +8,18 @@
sudo apt-get update
sudo apt-get install -y valgrind check libevdev-dev libudev-dev doxygen graphviz
autoreconf -ivf
./configure --prefix=$PWD/_build --with-udev-base-dir=$PWD/_build
DISTCHECK_CONFIGURE_FLAGS="--with-udev-base-dir=$PWD/_build" make distcheck
# no meson on 14.04
sudo apt-get install -y python3-pip
sudo pip3 install meson
# ninja on 14.04 is too old
git clone git://github.com/ninja-build/ninja.git
cd ninja
git checkout release
./configure.py --bootstrap
sudo cp ninja /usr/bin/ninja
cd ..
meson builddir
ninja -C builddir test

View File

@@ -1,78 +0,0 @@
lib_LTLIBRARIES = libratbag.la \
liblur.la
noinst_LTLIBRARIES = libhidpp.la \
libutil.la
include_HEADERS = \
libratbag.h \
liblur.h
libratbag_la_SOURCES = \
driver-etekcity.c \
driver-hidpp20.c \
driver-hidpp10.c \
driver-logitech-g300.c \
driver-roccat.c \
driver-gskill.c \
driver-test.c \
libratbag.c \
libratbag.h \
libratbag-hidraw.c \
libratbag-hidraw.h \
libratbag-private.h \
libratbag-test.c \
libratbag-test.h \
usb-ids.h
libratbag_la_LIBADD = \
libhidpp.la \
libutil.la \
$(LIBUDEV_LIBS) $(LIBEVDEV_LIBS)
libratbag_la_CFLAGS = -I$(top_srcdir)/include \
$(LIBUDEV_CFLAGS) \
$(LIBEVDEV_CFLAGS) \
$(GCC_CFLAGS)
EXTRA_libratbag_la_DEPENDENCIES = $(srcdir)/libratbag.sym
libratbag_la_LDFLAGS = -version-info $(LIBRATBAG_LT_VERSION) -shared \
-Wl,--version-script=$(srcdir)/libratbag.sym
liblur_la_SOURCES = \
liblur.c \
liblur.h
liblur_la_LIBADD = \
libhidpp.la \
libutil.la
liblur_la_CFLAGS = \
-I$(top_srcdir)/include \
$(GCC_CFLAGS)
EXTRA_liblur_la_DEPENDENCIES = $(srcdir)/liblur.sym
liblur_la_LDFLAGS = -version-info $(LIBLUR_LT_VERSION) -shared \
-Wl,--version-script=$(srcdir)/liblur.sym
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libratbag.pc \
liblur.pc
AM_CFLAGS = $(GCC_CFLAGS)
DISTCLEANFILES = libratbag-version.h
EXTRA_DIST = libratbag-version.h.in libratbag.sym liblur.sym
# The hidpp libraries are static libraries only for in-tree tools. No API
# stability is guaranteed here.
libhidpp_la_SOURCES = \
hidpp-generic.h \
hidpp-generic.c \
hidpp10.h \
hidpp10.c \
hidpp20.h \
hidpp20.c \
usb-ids.h
libhidpp_la_LDFLAGS = -lm
libutil_la_SOURCES = \
libratbag-util.c \
libratbag-util.h
libutil_la_LIBADD = $(LIBUDEV_LIBS)

View File

@@ -1405,7 +1405,7 @@ ratbag_find_hidraw_node(struct ratbag_device *device,
udev_enumerate_add_match_parent(e, parent_udev);
udev_enumerate_scan_devices(e);
udev_list_entry_foreach(entry, udev_enumerate_get_list_entry(e)) {
_cleanup_udev_device_unref_ struct udev_device *udev_device;
_cleanup_udev_device_unref_ struct udev_device *udev_device = NULL;
path = udev_list_entry_get_name(entry);
udev_device = udev_device_new_from_syspath(udev, path);

View File

@@ -1,70 +0,0 @@
if BUILD_TESTS
AM_CPPFLAGS = -I$(top_srcdir)/include \
-I$(top_srcdir)/src \
$(CHECK_CFLAGS) \
$(LIBEVDEV_CFLAGS)
AM_CFLAGS = $(GCC_CFLAGS)
AM_CXXFLAGS = $(GCC_CXXFLAGS)
TEST_LIBS = $(CHECK_LIBS) $(LIBEVDEV_LIBS) $(top_builddir)/src/libratbag.la
run_tests = \
test-context \
test-device \
test-iconv-helper
build_tests = \
test-build-cxx \
test-build-linker \
test-build-pedantic-c99 \
test-build-std-gnuc90
noinst_PROGRAMS = $(build_tests) $(run_tests)
noinst_SCRIPTS = symbols-leak-test
TESTS = $(run_tests) symbols-leak-test
test_context_SOURCES = test-context.c
test_context_LDADD = $(TEST_LIBS)
test_context_LDFLAGS = -no-install
test_device_SOURCES = test-device.c
test_device_LDADD = $(TEST_LIBS)
test_device_LDFLAGS = -no-install
test_iconv_helper_SOURCES = test-iconv-helper.c
test_iconv_helper_LDADD = $(TEST_LIBS) $(top_builddir)/src/libutil.la
test_iconv_helper_LDFLAGS = -no-install
# build-test only
test_build_pedantic_c99_SOURCES = build-pedantic.c
test_build_pedantic_c99_CFLAGS = -std=c99 -pedantic -Werror
test_build_std_gnuc90_SOURCES = build-pedantic.c
test_build_std_gnuc90_CFLAGS = -std=gnu90 -Werror
# test for linking with the minimal linker flags
test_build_linker_SOURCES = build-pedantic.c
test_build_linker_CFLAGS = -I$(top_srcdir)/src
test_build_linker_LDADD = $(top_builddir)/src/libratbag.la
# test including from C++
test_build_cxx_SOURCES = build-cxx.cc
test_build_cxx_CXXFLAGS = -Wall -Wextra -Wno-unused-parameter $(AM_CXXFLAGS)
AM_TESTS_ENVIRONMENT=RATBAG_TEST=1; export RATBAG_TEST;
if HAVE_VALGRIND
VALGRIND_FLAGS=--leak-check=full \
--quiet \
--error-exitcode=3 \
--suppressions=$(srcdir)/valgrind.suppressions
valgrind:
$(MAKE) check-TESTS LOG_COMPILER="$(VALGRIND)" LOG_FLAGS="$(VALGRIND_FLAGS)" CK_FORK=no USING_VALGRIND=yes
check: valgrind
endif
endif
EXTRA_DIST=valgrind.suppressions

13
test/symbols-leak-test.in → test/symbols-leak-test Normal file → Executable file
View File

@@ -2,16 +2,21 @@
### simple check for exported symbols
TOP_SRCDIR="$1"
if [ -z "$TOP_SRCDIR" ]; then
echo "usage: $0 path/to/top_srcdir"
exit 1
fi
# make bash exit if any command will exit with non-0 return value
set -e
# make sure the paths are alright
cd `dirname $0`
diff -a -u \
<(cat @top_srcdir@/src/libratbag.sym | \
<(cat "$TOP_SRCDIR"/src/libratbag.sym | \
grep '^\s\+ratbag_.*' | \
sed -e 's/^\s\+\(.*\);/\1/' | sort) \
<(cat @top_srcdir@/src/*.c | \
<(cat "$TOP_SRCDIR"/src/*.c | \
grep LIBRATBAG_EXPORT -A 1 | grep '^ratbag_.*' | \
sed -e 's/(.*//' | sort)

View File

@@ -1,32 +0,0 @@
noinst_PROGRAMS = hidpp10-dump-page hidpp20-dump-page
bin_PROGRAMS = ratbag-command lur-command
noinst_LTLIBRARIES = libshared.la
AM_CPPFLAGS = -I$(top_srcdir)/include \
-I$(top_srcdir)/src \
-I$(top_builddir)/src # for libratbag-version.h
libshared_la_SOURCES = \
shared.c \
shared.h
libshared_la_CFLAGS = $(LIBUDEV_LIBS) $(LIBEVDEV_CFLAGS)
libshared_la_LIBADD = $(LIBUDEV_CFLAGS) $(LIBEVDEV_LIBS)
ratbag_command_SOURCES = ratbag-command.c
ratbag_command_LDADD = ../src/libratbag.la libshared.la $(LIBUDEV_LIBS) $(LIBEVDEV_LIBS)
ratbag_command_CFLAGS = $(LIBUDEV_CFLAGS) $(LIBEVDEV_CFLAGS)
dist_man1_MANS = ratbag-command.man
hidpp10_dump_page_SOURCES = hidpp10-dump-page.c
hidpp10_dump_page_LDADD = ../src/libhidpp.la
hidpp10_dump_page_LDFLAGS = -no-install
hidpp10_dump_page_CFLAGS = -I$(top_srcdir)/src
hidpp20_dump_page_SOURCES = hidpp20-dump-page.c
hidpp20_dump_page_LDADD = ../src/libhidpp.la
hidpp20_dump_page_LDFLAGS = -no-install
hidpp20_dump_page_CFLAGS = -I$(top_srcdir)/src
lur_command_SOURCeS = lur-command.c
lur_command_LDADD = ../src/liblur.la
lur_command_CFLAGS = -I$(top_srcdir)/src

View File

@@ -71,7 +71,7 @@ dump_all_pages(struct hidpp10_device *dev)
return rc;
}
void
static void
usage(void)
{
printf("Usage: %s [page] [offset] /dev/hidraw0\n", program_invocation_short_name);
@@ -80,7 +80,7 @@ usage(void)
int
main(int argc, char **argv)
{
_cleanup_close_ int fd;
_cleanup_close_ int fd = 0;
const char *path;
size_t page = 0, offset = 0;
struct hidpp10_device *dev = NULL;

View File

@@ -83,7 +83,7 @@ dump_everything(struct hidpp20_device *dev)
return dump_all_pages(dev, 1);
}
void
static void
usage(void)
{
printf("Usage: %s [page] [offset] /dev/hidraw0\n", program_invocation_short_name);
@@ -92,7 +92,7 @@ usage(void)
int
main(int argc, char **argv)
{
_cleanup_close_ int fd;
_cleanup_close_ int fd = 0;
const char *path;
size_t page = 0, offset = 0;
struct hidpp20_device *dev = NULL;

View File

@@ -21,7 +21,8 @@
* DEALINGS IN THE SOFTWARE.
*/
#define _GNU_SOURCE
#include "config.h"
#include <errno.h>
#include <dirent.h>
#include <fcntl.h>
@@ -216,9 +217,8 @@ static inline struct ratbag_profile *
ratbag_cmd_get_active_profile(struct ratbag_device *device)
{
struct ratbag_profile *profile = NULL;
int i;
for (i = 0; i < ratbag_device_get_num_profiles(device); i++) {
for (unsigned int i = 0; i < ratbag_device_get_num_profiles(device); i++) {
profile = ratbag_device_get_profile(device, i);
if (ratbag_profile_is_active(profile))
return profile;
@@ -237,9 +237,8 @@ static inline struct ratbag_resolution *
ratbag_cmd_get_active_resolution(struct ratbag_profile *profile)
{
struct ratbag_resolution *resolution = NULL;
int i;
for (i = 0; i < ratbag_profile_get_num_resolutions(profile); i++) {
for (unsigned int i = 0; i < ratbag_profile_get_num_resolutions(profile); i++) {
resolution = ratbag_profile_get_resolution(profile, i);
if (ratbag_resolution_is_active(resolution))
return resolution;
@@ -341,7 +340,7 @@ ratbag_cmd_info(const struct ratbag_cmd *cmd,
struct ratbag_led *led;
char *action;
int num_profiles, num_buttons, num_leds;
int i, j, b, l;
int b, l;
struct ratbag_color color;
device = options->device;
@@ -375,7 +374,7 @@ ratbag_cmd_info(const struct ratbag_cmd *cmd,
num_profiles = ratbag_device_get_num_profiles(device);
printf("Profiles supported: %d\n", num_profiles);
for (i = 0; i < num_profiles; i++) {
for (int i = 0; i < num_profiles; i++) {
int dpi, rate;
profile = ratbag_device_get_profile(device, i);
if (!profile)
@@ -385,7 +384,7 @@ ratbag_cmd_info(const struct ratbag_cmd *cmd,
ratbag_profile_is_enabled(profile) ? "enabled" : "disabled",
ratbag_profile_is_active(profile) ? " (active)" : "");
printf(" Resolutions:\n");
for (j = 0; j < ratbag_profile_get_num_resolutions(profile); j++) {
for (unsigned int j = 0; j < ratbag_profile_get_num_resolutions(profile); j++) {
struct ratbag_resolution *res;
res = ratbag_profile_get_resolution(profile, j);
@@ -518,7 +517,7 @@ str_to_macro(const char *action_arg, struct macro *m)
char *str, *s;
enum ratbag_macro_event_type type;
int code;
int idx = 0;
unsigned int idx = 0;
int rc = ERR_USAGE;
/* FIXME: handle per-device maximum lengths of macros */
@@ -606,10 +605,9 @@ ratbag_cmd_change_button(const struct ratbag_cmd *cmd,
int button_index;
enum ratbag_button_action_type action_type;
int rc = ERR_DEVICE;
unsigned int btnkey;
unsigned int btnkey = 0;
enum ratbag_button_action_special special;
struct macro macro = {0};
int i;
if (argc != 3)
return ERR_USAGE;
@@ -678,7 +676,7 @@ ratbag_cmd_change_button(const struct ratbag_cmd *cmd,
break;
case RATBAG_BUTTON_ACTION_TYPE_MACRO:
m = ratbag_button_macro_new(macro.name);
for (i = 0; i < ARRAY_LENGTH(macro.events); i++) {
for (size_t i = 0; i < ARRAY_LENGTH(macro.events); i++) {
if (macro.events[i].type == RATBAG_MACRO_EVENT_NONE)
break;
@@ -1316,13 +1314,12 @@ ratbag_cmd_button_set_macro(const struct ratbag_cmd *cmd,
struct ratbag_button_macro *m;
struct macro macro = {0};
int rc;
int i;
char macro_str[PATH_MAX] = {0};
if (argc < 1)
return ERR_USAGE;
for (i = 0; i < argc; i++) {
for (int i = 0; i < argc; i++) {
strncat(macro_str, argv[i], sizeof(macro_str) - strlen(macro_str) - 1);
strcat(macro_str, " ");
}
@@ -1339,7 +1336,7 @@ ratbag_cmd_button_set_macro(const struct ratbag_cmd *cmd,
button = options->button;
m = ratbag_button_macro_new(macro.name);
for (i = 0; i < ARRAY_LENGTH(macro.events); i++) {
for (size_t i = 0; i < ARRAY_LENGTH(macro.events); i++) {
if (macro.events[i].type == RATBAG_MACRO_EVENT_NONE)
break;
@@ -1483,10 +1480,8 @@ ratbag_cmd_led_set_brightness(const struct ratbag_cmd *cmd,
struct ratbag_cmd_options *options,
int argc, char **argv)
{
struct ratbag_device *device;
struct ratbag_led *led;
char *str, *endptr;
int brightness, b;
int brightness;
int rc;
if (argc < 1)
@@ -1495,8 +1490,6 @@ ratbag_cmd_led_set_brightness(const struct ratbag_cmd *cmd,
led = options->led;
brightness = atoi(argv[0]);
device = options->device;
rc = ratbag_led_set_brightness(led, brightness);
if (rc != 0)
return ERR_DEVICE;
@@ -1520,10 +1513,9 @@ ratbag_cmd_led_set_effect_rate(const struct ratbag_cmd *cmd,
int argc, char **argv)
{
struct ratbag_device *device;
struct ratbag_led *led;
char *str, *endptr;
int hz, b;
int hz;
int rc;
if (argc < 1)
@@ -1557,10 +1549,8 @@ ratbag_cmd_led_set_color(const struct ratbag_cmd *cmd,
struct ratbag_cmd_options *options,
int argc, char **argv)
{
struct ratbag_device *device;
struct ratbag_led *led;
struct ratbag_color color;
char *str, *endptr;
int rc;
char red[2], green[2], blue[2];
char *p;
@@ -1570,7 +1560,7 @@ ratbag_cmd_led_set_color(const struct ratbag_cmd *cmd,
led = options->led;
sscanf(argv[0], "%2s%2s%2s", &red, &green, &blue);
sscanf(argv[0], "%2s%2s%2s", red, green, blue);
color.red = strtoul(red, &p, 16);
color.green = strtoul(green, &p, 16);
@@ -1598,10 +1588,10 @@ ratbag_cmd_led_set_mode(const struct ratbag_cmd *cmd,
struct ratbag_cmd_options *options,
int argc, char **argv)
{
struct ratbag_device *device;
struct ratbag_led *led;
struct ratbag_color color;
char *str, *endptr;
enum ratbag_led_mode mode;
char *str;
int rc;
if (argc < 1)
@@ -1610,8 +1600,6 @@ ratbag_cmd_led_set_mode(const struct ratbag_cmd *cmd,
led = options->led;
str = argv[0];
enum ratbag_led_mode mode;
if (streq(str, "off"))
mode = RATBAG_LED_OFF;
else if (streq(str, "on"))
@@ -1637,6 +1625,9 @@ ratbag_cmd_led_set_mode(const struct ratbag_cmd *cmd,
case RATBAG_LED_BREATHING:
ratbag_led_set_effect_rate(led, 20);
ratbag_led_set_brightness(led, 100);
break;
case RATBAG_LED_OFF:
break;
}
rc = ratbag_led_set_mode(led, mode);

View File

@@ -1,4 +1,4 @@
.TH RATBAG_COMMAND "1"
.TH RATBAG_COMMAND "1" "@version@"
.SH NAME
ratbag-command \- Query or change a device's settings
.SH SYNOPSIS

View File

@@ -129,7 +129,7 @@ button_type_to_str(enum ratbag_button_type type)
return str;
}
const static struct map {
static const struct map {
enum ratbag_button_action_special special;
const char *str;
} special_map[] = {