File tree 3 files changed +10
-2
lines changed
3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ Changelog
8
8
9
9
- Slightly faster reading of events.
10
10
11
+ - Fix build on FreeBSD.
12
+
11
13
12
14
1.8.0 (Jan 25, 2025)
13
15
====================
Original file line number Diff line number Diff line change 2
2
import sys
3
3
import shutil
4
4
import textwrap
5
+ import platform
5
6
from pathlib import Path
6
7
from subprocess import run
7
8
@@ -25,7 +26,11 @@ def create_ecodes(headers=None):
25
26
include_paths .update (c_inc_path .split (":" ))
26
27
27
28
include_paths .add ("/usr/include" )
28
- files = ["linux/input.h" , "linux/input-event-codes.h" , "linux/uinput.h" ]
29
+ if platform .system ().lower () == "freebsd" :
30
+ files = ["dev/evdev/input.h" , "dev/evdev/input-event-codes.h" , "dev/evdev/uinput.h" ]
31
+ else :
32
+ files = ["linux/input.h" , "linux/input-event-codes.h" , "linux/uinput.h" ]
33
+
29
34
headers = [os .path .join (path , file ) for path in include_paths for file in files ]
30
35
31
36
headers = [header for header in headers if os .path .isfile (header )]
Original file line number Diff line number Diff line change 25
25
26
26
27
27
# -----------------------------------------------------------------------------
28
- macro_regex = r"#define +((?:KEY|ABS|REL|SW|MSC|LED|BTN|REP|SND|ID|EV|BUS|SYN|FF|UI_FF|INPUT_PROP)_\w+)"
28
+ macro_regex = r"#define\s +((?:KEY|ABS|REL|SW|MSC|LED|BTN|REP|SND|ID|EV|BUS|SYN|FF|UI_FF|INPUT_PROP)_\w+)"
29
29
macro_regex = re .compile (macro_regex )
30
30
31
31
# Uname without hostname.
38
38
#include <Python.h>
39
39
#ifdef __FreeBSD__
40
40
#include <dev/evdev/input.h>
41
+ #include <dev/evdev/uinput.h>
41
42
#else
42
43
#include <linux/input.h>
43
44
#include <linux/uinput.h>
You can’t perform that action at this time.
0 commit comments