File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ Changelog
88
99- Slightly faster reading of events.
1010
11+ - Fix build on FreeBSD.
12+
1113
12141.8.0 (Jan 25, 2025)
1315====================
Original file line number Diff line number Diff line change 22import sys
33import shutil
44import textwrap
5+ import platform
56from pathlib import Path
67from subprocess import run
78
@@ -25,7 +26,11 @@ def create_ecodes(headers=None):
2526 include_paths .update (c_inc_path .split (":" ))
2627
2728 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+
2934 headers = [os .path .join (path , file ) for path in include_paths for file in files ]
3035
3136 headers = [header for header in headers if os .path .isfile (header )]
Original file line number Diff line number Diff line change 2525
2626
2727# -----------------------------------------------------------------------------
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+)"
2929macro_regex = re .compile (macro_regex )
3030
3131# Uname without hostname.
3838#include <Python.h>
3939#ifdef __FreeBSD__
4040#include <dev/evdev/input.h>
41+ #include <dev/evdev/uinput.h>
4142#else
4243#include <linux/input.h>
4344#include <linux/uinput.h>
You can’t perform that action at this time.
0 commit comments