Commit Graph

66 Commits (v0.2.3)

Author SHA1 Message Date
nirenjan a5a25c307c Update version in configure.ac 2021-09-19 16:41:35 -07:00
nirenjan 8874a282aa Add configure check for libevdev
This change is the first in a series of commits to support a virtual
mouse controlled by means of the thumbstick on the throttle unit.
2021-09-14 09:34:11 -07:00
nirenjan a39945f461 Import inih library into source tree
Prior to this change, the user needed to install inih as a dependency,
either from the distribution repositories, or from source. On some
platforms (notably macOS), inih is not available prepackaged, and must
be installed by the user. This tends to cause needless friction.

This change imports the ini.c and ini.h files from the upstream inih
repository into the X52 source tree. This will allow us to build the
repository on any system with the original set of dependencies, and not
have to force the user to install packages themselves.
2021-08-26 22:16:38 -07:00
nirenjan ff10525028 Make inih a mandatory package.
AC_CHECK_HEADERS and AC_SEARCH_LIBS do not abort when the header or
library respectively are not found. Since inih is a hard requirement,
make sure that the action-if-not-found fields call AC_MSG_ERROR.

Fixes #32
2021-08-11 22:22:50 -07:00
nirenjan 86960e7e20 Create the log and run directories for daemon to store files 2021-08-05 10:25:45 -07:00
nirenjan 0cf6f247be Add systemd unit file to start X52 daemon 2021-08-05 10:21:28 -07:00
nirenjan e968656672 Fix Cflags and add libx52util.pc 2021-08-03 12:53:26 -07:00
nirenjan 446fec3b9f Add libx52io pkgconfig file 2021-08-03 12:50:09 -07:00
nirenjan f6cfc59cb6 Fix libx52 pkgconfig file 2021-08-03 12:42:15 -07:00
nirenjan ac68ee07e5 Use non-recursive Automake 2021-07-29 23:53:21 -07:00
nirenjan 23fa0daf4f Move evtest to top level 2021-07-29 22:26:15 -07:00
nirenjan a94b079cf5 Move x52test to top level 2021-07-29 22:14:48 -07:00
nirenjan 711e4385c1 Move x52cli to top level 2021-07-29 22:11:19 -07:00
nirenjan 3b2378a54b Move libusbx52 to top level 2021-07-29 21:57:19 -07:00
nirenjan 7f30863e5d Move libx52io to top level 2021-07-29 21:51:11 -07:00
nirenjan 34adeaec45 Move libx52util to top level 2021-07-29 21:47:07 -07:00
nirenjan e3bccd3ac3 Move libx52 to top level 2021-07-29 21:41:07 -07:00
nirenjan 386174d2a4 Update package version 2021-07-27 02:18:35 -07:00
nirenjan 3bca8da541 Add check for typeof support in compiler 2021-07-22 15:12:37 -07:00
nirenjan c9cb89f833 Fix syntax of PKG_CHECK_MODULES
Commit 2ce9ff22 replaced the calls to AX_PKG_CHECK_MODULES with
PKG_CHECK_MODULES, but it was done blindly, since PKG_CHECK_MODULES
takes a different number of arguments. As a result, even if the checks
for cmocka and udev succeed, they are still disabled because the
corresponding have_ variable is not set to 'yes'.
2021-07-20 01:38:19 -07:00
nirenjan 1b598c2d78 Fix pkg-config check for inih and enable Ubuntu 18.04 builds 2021-07-19 11:09:41 -07:00
nirenjan 82c778c7de Update configure.ac to handle the new pinelog method 2021-07-16 16:25:43 -07:00
nirenjan 2ce9ff2280 Disable AX_PKG_CHECK_MODULES on optional modules 2021-07-15 22:00:14 -07:00
nirenjan fc9bebbe5a Add noreturn attribute to fix compiler warnings 2021-07-15 17:57:51 -07:00
nirenjan fa298455aa Use PKG_CHECK_MODULES instead of AX_PKG_CHECK_MODULES 2021-07-15 17:43:51 -07:00
nirenjan cbe7f00a5a Add daemon framework
This change adds the daemon configuration parser and command line
argument parser. This also adds the associated strings to the
translation files, and integrates the daemon into the existing autotools
build framework.
2021-07-15 15:53:56 -07:00
nirenjan f82c31a6eb Add support for including inih configuration parser library 2021-07-15 13:52:46 -07:00
nirenjan 4b1d524d39 Integrate pinelog into autotools build framework 2021-07-15 10:33:52 -07:00
nirenjan abb366d89c Allow udev rules to be configured at build time [#25]
Prior to this change, the udev rules were fixed to allow read-write
access only to the `plugdev` group. However, while this is the default
group for USB input devices on Debian and its derivatives, this is not
true for some systems such as openSUSE, which use `input` as the group.

This change adds a `--with-input-group` argument to `configure`, which
defaults to `plugdev`. This change also updates the install
documentation to reflect the new options.
2020-12-25 15:17:52 -08:00
nirenjan 46bd78bdd9 Add event test utility
This change is a wrapper around libx52io to print the raw events coming
from the X52 device.
2020-07-11 00:15:14 -07:00
nirenjan 329274e6c9 Add initial version of libx52io 2020-07-08 00:33:03 -07:00
nirenjan bcc90ac24e Add HIDAPI to build dependencies 2020-07-05 16:19:04 -07:00
nirenjan 681a8e8aa1 Change libx52 mock tests to use preprocessor overrides
Prior to this change, libx52 tests needed a linker that supported the
--wrap argument. This is not available on OSX, and therefore, we had to
disable the unit tests on non-Linux systems.

Since we needed to rebuild the libx52 library anyway for the test, it is
simpler to just define libusb_control_transfer to point to our mock
function. This allows us to verify libx52 on all supported platforms.
2020-06-27 22:04:56 -07:00
nirenjan 8388f3308e Reword configure warning on non-Linux hosts 2020-06-21 08:48:44 -07:00
nirenjan 34b023b1fa Add cmocka to Travis CI builds on Ubuntu 2020-06-17 16:18:06 -07:00
nirenjan e9167b4c20 Disable cmocka tests on non-Linux hosts 2020-06-17 16:00:25 -07:00
nirenjan bf9b1bdfbd Remove manual tests in favor of cmocka
Prior to this change, we needed to add a manual override function to
mock the vendor command. Given that cmocka has built-in support for
mocking functions, it's better to use that instead.

This change simply removes the manual override and any tests that rely
on it.
2020-06-16 17:33:15 -07:00
nirenjan f0ed2f39e3 Set minimum version of Python to 3.5
On Xenial, the version of Python 3 is 3.5. Restricting the version to
3.6 or newer causes the Travis CI build to break on Xenial.
2020-06-16 15:39:31 -07:00
nirenjan c4acd0ce49 Update makefiles to use Python 3
Prior to this change, generation of the character lookup table could use
Python 2 or Python 3, depending on what the first instance of python in
the PATH pointed to.  On most systems, python is a symbolic link to
python2.7. However, given that Python 2 is EOL, it makes sense to switch
the code to use Python 3 now, rather than later.

This change updates the requirements to use Python 3.6 or later, and
updates the Makefile to invoke the script with the detected python
binary, rather than relying on the shebang to use the system Python.
2020-06-16 15:17:53 -07:00
nirenjan 8b49b91267 Enable -Werror in compiler flags 2020-06-11 23:39:28 -07:00
nirenjan 37162510ac Enable additional compiler warnings
This change adds additional compiler warnings as detected by the
autoconf archive. Because the code is susceptible to these additional
warnings, disable treating warnings as errors for now, until we can fix
the warnings.
2020-06-11 23:38:44 -07:00
nirenjan af49ce6500 Fix daylight savings offset calculation bug
This commit changes the local timezone calculation to use tm.tm_gmtoff,
and falling back to calculating it manually from the output of strftime
when tm_gmtoff is not a member of struct tm.

This also fixes the tests so that they are no longer expected to fail.

Fixes #20.
2020-06-06 17:48:17 -07:00
nirenjan 4f22983739 Revert "Enable compiling libx52 with weak symbol binding"
The hope was that I could compile some tests that would override
libx52_vendor_command, and run those on OSX to bypass the skipped tests
that used x52cli. However, a Travis-CI run indicated that the compiler
on OSX doesn't support weak symbols, which renders the point moot.
2020-06-06 17:05:17 -07:00
nirenjan 95bc71859b Enable compiling libx52 with weak symbol binding
This change allows exporting libx52_vendor_command as a weak symbol,
thereby allowing it to be overridden by a test runner to validate that
the library is indeed behaving as per the spec.

Because this is something that may not be necessarily desirable on a
production environment, add a configure time flag to disable building
with weak symbols. This will also disable any tests that may rely on
libx52_vendor_command being a weak function.
2020-06-06 16:24:31 -07:00
nirenjan 1188bea444 Use TAP for tests
Prior to this change, the tests were using the automake simple test
harness. The limitation was that for each set of test cases (e.g.
timezone tests), even if one test failed, it would report every test in
that set as failed. Migrating to TAP allows fine-grained reporting on
every single test case, and allows better investigation into checking
which individual tests failed.

This change also updates the timezone tests to explicitly mark the ones
that check when the timezone is Pacific Daylight Time as expected to
fail. It also updates the clock tests to improve the formatting of the
test case identifier.
2020-06-06 08:33:30 -07:00
nirenjan 543aec85b1 Add config header to all C files 2020-06-05 15:19:56 -07:00
nirenjan 2db24e8759 Add udev rules to distribution
Prior to this change, a user had to manually install their own udev
rules on Linux if they wanted to access the joystick without having to
run as root. The most common usecase was on systems based on Debian,
where the user would be a member of the plugdev group, and they would
create their own rule to allow members of the group to write to the
joystick.

This change adds a validated udev rule to the distribution, so if the
user compiles from source and does a make install, the rule to allow
plugdev group members to access the joystick is installed.
2020-05-30 16:38:58 -07:00
nirenjan ec9443dcdd Add gettext support to libx52
This change adds gettext support to libx52 using the Autotools
framework. This should allow translators to translate the error messages
provided by libx52_strerror into their corresponding localized versions.
2020-05-19 08:07:10 -07:00
nirenjan 0204103ccd Add Doxygen support
This change adds Doxygen support in the configure/make step. Doxygen is
optional, and the absence of Doxygen should not break the build.
2020-04-18 01:35:57 -07:00
nirenjan 116f7b3a57 Install libx52.pc during make install 2020-04-17 00:04:09 -07:00