Skip to content

Commit 915f2c1

Browse files
committed
FreeBSD fixes
1 parent ed39ab8 commit 915f2c1

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

docs/changelog.rst

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Changelog
88

99
- Slightly faster reading of events.
1010

11+
- Fix build on FreeBSD.
12+
1113

1214
1.8.0 (Jan 25, 2025)
1315
====================

setup.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import sys
33
import shutil
44
import textwrap
5+
import platform
56
from pathlib import Path
67
from 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)]

src/evdev/genecodes_c.py

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
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>

0 commit comments

Comments
 (0)