From c339ed4def5854b8daa0cbf2733c00d54b672078 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Fri, 12 Jan 2024 19:46:57 +0300 Subject: minor FreeBSD compatibility fixes and documentation --- Makefile | 2 +- README.md | 11 ++++++++++- applause.c | 3 ++- evdev.c | 4 ++-- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index a2fbffa..62c82e9 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -CC = gcc +CC = cc CFLAGS = -std=c99 -Wall -O2 -g diff --git a/README.md b/README.md index 039b770..f1ac59b 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,15 @@ You have to manually build and install LuaJIT v2.1: make sudo make install -Furthermore, install the following dependencies: +Furthermore, install the following dependencies (Ubuntu): sudo apt-get install build-essential libreadline-dev libjack-jackd2-dev \ libsndfile1 libasound2 feedgnuplot +On FreeBSD, you will need the following packages/ports: + + pkg install gmake readline jackit evdev-proto libsndfile alsa-lib p5-feedgnuplot + To compile the project, type: make @@ -35,6 +39,11 @@ TODO: How to use jack-plumbing? This may require root rights for accessing HID devices. You may also add the current user to the `input` group. +On FreeBSD, you might need to add the current user to the `wheel` group and +give read acceess to evdev nodes by creating `/etc/devd.rules`: + + [localrules=10] + add path 'input/*' mode 0640 Example (one channel): diff --git a/applause.c b/applause.c index 5853e32..e9ffd66 100644 --- a/applause.c +++ b/applause.c @@ -1,5 +1,5 @@ #define _XOPEN_SOURCE -#define _POSIX_C_SOURCE 199506L +//#define _POSIX_C_SOURCE 200112 #define _GNU_SOURCE #include @@ -18,6 +18,7 @@ #include #include +#include #include diff --git a/evdev.c b/evdev.c index 2d179d2..8cc4aa4 100644 --- a/evdev.c +++ b/evdev.c @@ -19,11 +19,11 @@ #include "evdev.h" -typedef struct applause_evdev { +struct applause_evdev { int fd; jack_ringbuffer_t *buffer; pthread_t thread; -} applause_evdev; +}; char * applause_evdev_getname(const char *node) -- cgit v1.2.3