Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ jobs:
key: 0_${{ steps.set_cache.outputs.cache_name }}_${{ hashFiles('reqs/constraints.txt', 'reqs/dist.txt', 'reqs/dist_extra_gui_qt.txt', 'reqs/test.txt') }}

- name: Install system dependencies
run: apt_get_install cmake libdbus-1-dev libdbus-glib-1-dev libudev-dev libusb-1.0-0-dev libegl-dev libxkbcommon-x11-0
run: apt_get_install libdbus-1-dev libdbus-glib-1-dev libudev-dev libegl-dev libxkbcommon-x11-0

- name: Setup Python environment
run: setup_python_env -c reqs/constraints.txt -r reqs/dist.txt -r reqs/dist_extra_gui_qt.txt -r reqs/test.txt
Expand Down Expand Up @@ -862,7 +862,7 @@ jobs:
key: 0_${{ steps.set_cache.outputs.cache_name }}_${{ hashFiles('reqs/constraints.txt', 'reqs/build.txt', 'reqs/setup.txt', 'reqs/dist_*.txt', 'linux/appimage/deps.sh') }}

- name: Install system dependencies
run: apt_get_install cmake libdbus-1-dev libdbus-glib-1-dev libudev-dev libusb-1.0-0-dev libegl-dev libxkbcommon-x11-0
run: apt_get_install libdbus-1-dev libdbus-glib-1-dev libudev-dev libegl-dev libxkbcommon-x11-0

- name: Setup Python environment
run: setup_python_env -c reqs/constraints.txt -r reqs/build.txt -r reqs/setup.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci/workflow_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ jobs:
<% endif %>
<% if j.type in ['build', 'test_gui_qt'] and j.os == 'Linux' %>
- name: Install system dependencies
run: apt_get_install cmake libdbus-1-dev libdbus-glib-1-dev libudev-dev libusb-1.0-0-dev libegl-dev libxkbcommon-x11-0
run: apt_get_install libdbus-1-dev libdbus-glib-1-dev libudev-dev libegl-dev libxkbcommon-x11-0

<% endif %>
<% if j.type != 'notarize' %>
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ include test/*.py
include test/gui_qt/*.py
include tox.ini
include windows/*
exclude dev/*
exclude .pre-commit-config.yaml
# without first including it, exluding .readthedocs.yml results in a warning when running locally
include .readthedocs.yml
Expand Down
158 changes: 0 additions & 158 deletions dev/build_hidapi.sh

This file was deleted.

52 changes: 0 additions & 52 deletions dev/write_hidapi_pth.py

This file was deleted.

2 changes: 0 additions & 2 deletions linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
To be able to setup a complete development environment, you'll need to manually
install some system libraries (including the development version of your
distribution corresponding packages):
- Treal support: `libusb` (1.0) and `libudev` are needed by
the [`hidapi` package](https://pypi.org/project/hidapi/).
- log / notifications support: `libdbus` is needed.

For the rest of the steps, follow the [developer guide](../doc/developer_guide.md).
32 changes: 4 additions & 28 deletions linux/appimage/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

set -e

. ./plover_build_utils/deps.sh
. ./plover_build_utils/functions.sh

topdir="$PWD"
Expand Down Expand Up @@ -197,33 +196,10 @@ run "$linuxdeploy" \
# Install Plover and dependencies.
bootstrap_dist "$wheel"

# ------- Start: Build & bundle hidapi from source -------
hidapi_src="$builddir/hidapi-src"
hidapi_bld="$builddir/hidapi-build"

. ./linux/build_hidapi.sh

echo "Downloading and unpacking hidapi ${hidapi_version}"
fetch_hidapi "$hidapi_src" "$builddir"

echo "Building hidapi…"
cmake_build_linux "$hidapi_src" "$hidapi_bld" "Release"

# Locate the produced .so
hidapi_so="$(find "$hidapi_bld" -name 'libhidapi-hidraw.so*' -type f -print -quit)"
if [ -z "$hidapi_so" ] || [ ! -f "$hidapi_so" ]; then
echo "Error: built libhidapi-hidraw.so not found." >&2
exit 3
fi

# Bundle into the AppDir's lib directory
run cp -v "$hidapi_so" "$appdir/usr/lib/"
base="$(basename "$hidapi_so")"
# Add symlink for unversioned .so if needed
if [ ! -e "$appdir/usr/lib/libhidapi-hidraw.so" ]; then
ln -s "$base" "$appdir/usr/lib/libhidapi-hidraw.so"
fi
# ------- End: Build & bundle hidapi from source -------
# Reinstall hidapi with the hidraw backend; libusb reports usage/usage_page as 0,
# which results in HID keyboards not being detected by Plover.
run "$python" -m pip uninstall -y hidapi || true
run_eval "HIDAPI_WITH_HIDRAW=1 HIDAPI_WITH_LIBUSB=0 $python -m pip install --no-binary :all: --no-cache-dir hidapi"

# Trim the fat, second pass.
run "$python" -m plover_build_utils.trim "$appdir" "$builddir/blacklist.txt"
Expand Down
8 changes: 0 additions & 8 deletions linux/build_hidapi.sh

This file was deleted.

1 change: 1 addition & 0 deletions news.d/api/1812.core.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Migrate HID library to cython-hidapi.
9 changes: 0 additions & 9 deletions osx/build_hidapi.sh

This file was deleted.

32 changes: 0 additions & 32 deletions osx/make_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

set -e

. ./plover_build_utils/deps.sh
. ./plover_build_utils/functions.sh

topdir="$PWD"
Expand Down Expand Up @@ -66,37 +65,6 @@ python='appdir_python'
# Install Plover and dependencies.
bootstrap_dist "$plover_wheel"

# ------- Start: Build & bundle hidapi from source -------
. ./osx/build_hidapi.sh

hidapi_src="$builddir/hidapi-src"
hidapi_bld="$builddir/hidapi-build"

echo "Downloading and unpacking hidapi ${hidapi_version}"
fetch_hidapi "$hidapi_src" "$builddir"

echo "Building hidapi…"
cmake_build_macos "$hidapi_src" "$hidapi_bld" "x86_64;arm64" "Release"

# Locate the produced dylib
hidapi_dylib="$(/usr/bin/find "$hidapi_bld" -name 'libhidapi*.dylib' -type f -print -quit)"
if [ -z "$hidapi_dylib" ] || [ ! -f "$hidapi_dylib" ]; then
echo "Error: built libhidapi*.dylib not found." >&2
exit 3
fi

# Bundle into the app's Frameworks directory
run cp "$hidapi_dylib" "$frameworks_dir/"
base="$(basename "$hidapi_dylib")"

# Add alias to Frameworks dir
ln -sfn "$base" "$frameworks_dir/libhidapi.dylib"

# Add RPATH to the Python binary itself and re-sign it
run install_name_tool -add_rpath "@executable_path/../../../../../Frameworks" "$py_binary"
run /usr/bin/codesign -f -s - "$py_binary"
# ------- End: Build & bundle hidapi from source -------

# Create launcher.
run gcc -Wall -O2 -arch x86_64 -arch arm64 'osx/app_resources/plover_launcher.c' -o "$macos_dir/Plover"

Expand Down
Loading