Skip to content

armgit / Filee

Public Imported from GitHub
0

Free, open-source file converter. Convert 263 formats offline by drag & drop — images, PDF, Word, Excel, PowerPoint, HWP/HWPX, video, audio, e-books and archives. No upload, no Office needed.

SharpHook 8.0.1 runs on glibc 2.34: stop building libuiohook

KnifeLemon3aa26379b43d
diff --git a/.github/workflows/portable.yml b/.github/workflows/portable.yml
index e82dbe85..4a28ad67 100644
--- a/.github/workflows/portable.yml
+++ b/.github/workflows/portable.yml
@@ -1,9 +1,10 @@
name: Linux and macOS packages
-# Linux packages are built on Ubuntu 24.04 but must run on Ubuntu 22.04 (glibc 2.35). The two upstream binaries that
-# need a newer glibc (SharpHook's X11 libuiohook back ends and the rhwp CLI) are built from pinned source on Ubuntu
-# 22.04 first (linux-native, build/build-linux-native.py) and replace the downloaded ones in the package. Every ELF
-# file in a Linux package is then checked against glibc 2.35, and the x64 and arm64 packages are tried on Ubuntu 22.04.
+# Linux packages are built on Ubuntu 24.04 but must run on Ubuntu 22.04 (glibc 2.35). The rhwp CLI release needs a
+# newer glibc, so it is built from pinned source on Ubuntu 22.04 first (linux-native, build/build-linux-native.py) and
+# replaces the download in the package. SharpHook (>= 8.0.1) ships libuiohook builds for glibc 2.34 and is packaged as
+# is. Every ELF file in a Linux package is then checked against glibc 2.35, and the x64 and arm64 packages are tried on
+# Ubuntu 22.04, which also catches a SharpHook or engine update that raises the requirement again.
on:
workflow_call:
@@ -43,8 +44,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- # Fails when Directory.Packages.props or engines.json moved to another SharpHook or rhwp version while
- # build/build-linux-native.py still builds the old sources (also when the build below comes from the cache).
+ # Fails when engines.json moved to another rhwp version while build/build-linux-native.py still builds the old
+ # source (also when the build below comes from the cache).
- name: Check pinned sources
run: python3 build/build-linux-native.py check
@@ -55,17 +56,13 @@ jobs:
path: build/.cache/linux-native/${{ matrix.rid }}
key: linux-native-${{ matrix.rid }}-ubuntu-22.04-${{ hashFiles('build/build-linux-native.py') }}
- # The packages SharpHook's build.yml installs, plus CMake >= 4.2 (libuiohook's minimum) from PyPI, pinned.
+ # rhwp's default features are pure Rust: a C toolchain for the linker and build scripts is enough.
- name: Build dependencies
if: steps.native-cache.outputs.cache-hit != 'true'
run: |
set -euo pipefail
sudo apt-get update
- sudo apt-get install -y build-essential pkg-config git python3-pip extra-cmake-modules \
- libx11-dev libxtst-dev libxt-dev libxrandr-dev libx11-xcb-dev libxkbcommon-dev libxkbcommon-x11-dev \
- libxkbfile-dev libinput-dev libudev-dev libwayland-dev wayland-protocols
- python3 -m pip install --user cmake==4.2.3
- echo "$HOME/.local/bin" >> "$GITHUB_PATH"
+ sudo apt-get install -y build-essential pkg-config git
if ! command -v rustup >/dev/null; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain none
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
@@ -82,10 +79,6 @@ jobs:
key: cargo-registry-${{ matrix.rid }}-${{ hashFiles('build/build-linux-native.py') }}
restore-keys: cargo-registry-${{ matrix.rid }}-
- - name: Build libuiohook back ends
- if: steps.native-cache.outputs.cache-hit != 'true'
- run: python3 build/build-linux-native.py uiohook --output "$NATIVE_OUT/uiohook" --work "$RUNNER_TEMP/uiohook"
-
- name: Build rhwp
if: steps.native-cache.outputs.cache-hit != 'true'
run: python3 build/build-linux-native.py rhwp --output "$NATIVE_OUT/rhwp" --work "$RUNNER_TEMP/rhwp"
@@ -170,17 +163,14 @@ jobs:
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
}
- # Linux: rhwp and SharpHook's X11 back ends from linux-native instead of the downloads (see the top).
+ # Linux: rhwp from linux-native instead of the download (see the top).
- name: Build portable package
env:
PACKAGE_VERSION: ${{ inputs.version }}
run: |
$native = @{}
if ($IsLinux) {
- $native = @{
- RhwpOverride = Join-Path $env:RUNNER_TEMP 'linux-native/rhwp'
- UiohookOverride = Join-Path $env:RUNNER_TEMP 'linux-native/uiohook'
- }
+ $native = @{ RhwpOverride = Join-Path $env:RUNNER_TEMP 'linux-native/rhwp' }
}
./build/build-portable.ps1 -Runtime '${{ matrix.rid }}' -Version $env:PACKAGE_VERSION -SkipFonts @native
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 963fdfb8..59faee05 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -35,9 +35,9 @@ install/uninstall scripts. `Filee-<version>-<rid>-SHA256SUMS.txt` verifies the a
`com.filee.app` and a development ad-hoc signature by default; public distribution still needs Developer ID signing
and notarization. `-SigningIdentity` can supply a signing identity, but does not perform notarization.
-Linux release packages must run on Ubuntu 22.04 (glibc 2.35). CI builds rhwp and SharpHook's X11 input hook back ends
-from source on Ubuntu 22.04 (`build/build-linux-native.py`) and passes them with `-RhwpOverride` and
-`-UiohookOverride`; a local package without them needs the glibc of the machine that built it. Check a package with
+Linux release packages must run on Ubuntu 22.04 (glibc 2.35). CI builds rhwp from source on Ubuntu 22.04
+(`build/build-linux-native.py`) and passes it with `-RhwpOverride`; a local package without it needs the glibc of the
+machine that built it. Check a package with
`python3 build/check-elf-glibc.py --max 2.35 <unpacked package>`. See [docs/ENGINES.md](docs/ENGINES.md#linux-builds-for-older-glibc).
- **Linux:** drag gestures require X11. Install the Avalonia desktop dependencies (fontconfig, FreeType, X11,
diff --git a/Directory.Packages.props b/Directory.Packages.props
index d0901cef..18aba06c 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -22,7 +22,7 @@
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.12" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="10.0.12" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.12" />
- <PackageVersion Include="SharpHook" Version="8.0.0" />
+ <PackageVersion Include="SharpHook" Version="8.0.1" />
</ItemGroup>
<ItemGroup Label="Conversion engines">
diff --git a/THIRD-PARTY-NOTICES.md b/THIRD-PARTY-NOTICES.md
index c999ef6e..6ca4408c 100644
--- a/THIRD-PARTY-NOTICES.md
+++ b/THIRD-PARTY-NOTICES.md
@@ -40,11 +40,8 @@ Each component remains under its own license.
| cu2qu (fontTools): the cubic-to-quadratic approach followed by `Filee.Engines/Fonts/Cff/CubicToQuadratic.cs` | Apache-2.0, Copyright 2016 Google Inc. | https://github.com/fonttools/fonttools |
libuiohook (the native input hook inside SharpHook) is the fork https://github.com/TolikPylypchuk/libuiohook, licensed
-under the GNU LGPL-3.0 (`COPYING.LESSER.md` in its repository). Filee loads it dynamically. In the Linux packages,
-`libuiohook-xrecord.so` and `libuiohook-x11.so` are built by Filee's CI from the unmodified source SharpHook 8.0.0 uses
-(commit `a41658fb2bef7503a3bcb305ab8bf849755fe906`) with SharpHook's build flags on Ubuntu 22.04, so they run on older
-Linux systems; the other libuiohook files are SharpHook's. The build steps are in `build/build-linux-native.py`. You
-may replace these libraries with your own build of libuiohook.
+under the GNU LGPL-3.0 (`COPYING.LESSER.md` in its repository). Filee loads SharpHook's unmodified build of it
+dynamically; you may replace those libraries with your own build of libuiohook.
Used by the tests only (not redistributed): DocumentFormat.OpenXml (Open XML SDK, MIT, https://github.com/dotnet/Open-XML-SDK) validates the DOCX files Filee writes.
diff --git a/build/build-linux-native.py b/build/build-linux-native.py
index 1a6ba1e6..123b55a6 100644
--- a/build/build-linux-native.py
+++ b/build/build-linux-native.py
@@ -1,48 +1,29 @@
#!/usr/bin/env python3
"""Builds the Linux native pieces of the portable package that upstream builds on a newer glibc than Filee supports.
-Filee's Linux packages must start on Ubuntu 22.04 (glibc 2.35). Two upstream binaries need a newer glibc, so CI builds
-them from their pinned source on Ubuntu 22.04 and build/build-portable.ps1 puts them into the package:
-
-- uiohook: SharpHook's libuiohook-xrecord.so and libuiohook-x11.so (the X11 global input hook back ends). SharpHook
- builds them on Ubuntu 26.04 in C23 mode, where glibc 2.38+ headers turn sscanf into __isoc23_sscanf (GLIBC_2.38).
- The loader libuiohook.so and the Wayland back end stay SharpHook's own: they already run on glibc 2.34.
-- rhwp: the rhwp CLI (HWP/HWPX -> PDF). Its release binary is linked on Ubuntu 24.04 (GLIBC_2.39).
+Filee's Linux packages must start on Ubuntu 22.04 (glibc 2.35). The rhwp CLI (HWP/HWPX -> PDF) release binary is linked
+on Ubuntu 24.04 (GLIBC_2.39), so CI builds it from its pinned source on Ubuntu 22.04 and build/build-portable.ps1 puts it
+into the package. SharpHook's native libraries (libuiohook) come from its NuGet package: from 8.0.1 on they need glibc
+2.34 at most.
Subcommands:
- check verify the pins below still match Directory.Packages.props and engines.json
- uiohook --output DIR build libuiohook-xrecord.so and libuiohook-x11.so into DIR
+ check verify the rhwp pin below still matches engines.json
rhwp --output DIR build the rhwp CLI into DIR (rhwp, LICENSE, README files, like its release archive)
-Needs git, and for uiohook CMake >= 4.2, a C compiler and the X11/Wayland development packages (see
-.github/workflows/portable.yml); for rhwp rustup. Standard library only.
+Needs git, a C toolchain and rustup. Standard library only.
"""
import argparse
import json
import os
import platform
-import re
import shutil
import subprocess
import sys
import tempfile
-import xml.etree.ElementTree as ElementTree
ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
-# SharpHook's NuGet package carries a libuiohook build; ours must come from the same source. LIBUIOHOOK_COMMIT is the
-# commit of SharpHook's `libuiohook` submodule at tag v{SHARPHOOK_VERSION} (TolikPylypchuk/libuiohook, LGPL-3.0). When
-# Directory.Packages.props moves SharpHook to another version, `check` fails until both lines are updated: look up the
-# submodule commit of the new tag (`git ls-tree v<version> libuiohook` in SharpHook) and copy its CMake flags from
-# SharpHook's .github/workflows/build.yml.
-SHARPHOOK_VERSION = "8.0.0"
-LIBUIOHOOK_REPOSITORY = "https://github.com/TolikPylypchuk/libuiohook"
-LIBUIOHOOK_COMMIT = "a41658fb2bef7503a3bcb305ab8bf849755fe906"
-SHARPHOOK_REPOSITORY = "https://github.com/TolikPylypchuk/SharpHook"
-# Only the back ends that need the newer glibc are replaced; the names are what the loader dlopens from its folder.
-UIOHOOK_LIBRARIES = ["libuiohook-xrecord.so", "libuiohook-x11.so"]
-
# The rhwp release pinned in engines.json for Linux (`check` compares the versions). RUST_TOOLCHAIN is the one in the
# tag's rust-toolchain.toml. Cargo.lock in the tag pins every dependency (--locked).
RHWP_VERSION = "0.8.7"
@@ -50,22 +31,6 @@ RHWP_REPOSITORY = "https://github.com/edwardkim/rhwp"
RHWP_COMMIT = "1a76570e833917d15817415a53c09ad61ab3203f"
RUST_TOOLCHAIN = "1.93.1"
-# SharpHook's CI flags for each architecture (build.yml, jobs libuiohook-linux-x64 / libuiohook-linux-arm64).
-UIOHOOK_FLAGS = {
- "x86_64": {
- "CC": "x86_64-linux-gnu-gcc",
- "CFLAGS": "-O2 -march=x86-64 -mtune=generic -g -fomit-frame-pointer -flto -fno-stack-protector -pipe",
- "PKG_CONFIG_PATH": "/usr/lib/x86_64-linux-gnu/pkgconfig",
- },
- "aarch64": {
- "CC": "aarch64-linux-gnu-gcc",
- "CFLAGS": "-Os -march=armv8-a+crc -mtune=cortex-a53 -g -flto -fomit-frame-pointer -fno-stack-protector -pipe",
- "PKG_CONFIG_PATH": "/usr/lib/aarch64-linux-gnu/pkgconfig",
- },
-}
-UIOHOOK_LDFLAGS = "-Wl,-O1 -Wl,--as-needed"
-MINIMUM_CMAKE = (4, 2)
-
class BuildError(Exception):
pass
@@ -80,14 +45,6 @@ def run(command, cwd=None, env=None, capture=False):
return result.stdout if capture else None
-def sharphook_version():
- path = os.path.join(ROOT, "Directory.Packages.props")
- for element in ElementTree.parse(path).getroot().iter("PackageVersion"):
- if element.get("Include") == "SharpHook":
- return element.get("Version")
- raise BuildError("Directory.Packages.props has no SharpHook PackageVersion.")
-
-
def linux_rhwp_versions():
path = os.path.join(ROOT, "src", "Filee.Engines", "Infrastructure", "engines.json")
with open(path, encoding="utf-8") as stream:
@@ -97,12 +54,6 @@ def linux_rhwp_versions():
def check():
problems = []
- version = sharphook_version()
- if version != SHARPHOOK_VERSION:
- problems.append(
- f"Directory.Packages.props uses SharpHook {version}, but build/build-linux-native.py builds the libuiohook "
- f"of SharpHook {SHARPHOOK_VERSION} (commit {LIBUIOHOOK_COMMIT}). Update SHARPHOOK_VERSION, "
- "LIBUIOHOOK_COMMIT and UIOHOOK_FLAGS to the new SharpHook tag.")
for rid, rhwp in linux_rhwp_versions().items():
if rhwp != RHWP_VERSION:
problems.append(
@@ -110,8 +61,7 @@ def check():
"Update RHWP_VERSION, RHWP_COMMIT and RUST_TOOLCHAIN (from the tag's rust-toolchain.toml).")
if problems:
raise BuildError("\n".join(problems))
- print(f"Pins match: SharpHook {SHARPHOOK_VERSION} -> libuiohook {LIBUIOHOOK_COMMIT}, "
- f"rhwp {RHWP_VERSION} -> {RHWP_COMMIT} (Rust {RUST_TOOLCHAIN}).")
+ print(f"Pins match: rhwp {RHWP_VERSION} -> {RHWP_COMMIT} (Rust {RUST_TOOLCHAIN}).")
def fetch(repository, commit, destination):
@@ -125,57 +75,6 @@ def fetch(repository, commit, destination):
raise BuildError(f"{repository}: expected commit {commit}, got {head}")
-def verify_sharphook_submodule(work):
- """The submodule pointer of SharpHook's release tag must be the commit we build."""
- sharphook = os.path.join(work, "sharphook")
- os.makedirs(sharphook)
- run(["git", "init", "-q", sharphook])
- run(["git", "-C", sharphook, "fetch", "-q", "--depth", "1", SHARPHOOK_REPOSITORY,
- f"refs/tags/v{SHARPHOOK_VERSION}"])
- entry = run(["git", "-C", sharphook, "ls-tree", "FETCH_HEAD", "libuiohook"], capture=True).split()
- if len(entry) < 3 or entry[1] != "commit":
- raise BuildError(f"SharpHook v{SHARPHOOK_VERSION} has no libuiohook submodule: {entry}")
- if entry[2] != LIBUIOHOOK_COMMIT:
- raise BuildError(f"SharpHook v{SHARPHOOK_VERSION} uses libuiohook {entry[2]}, not {LIBUIOHOOK_COMMIT}.")
- print(f"SharpHook v{SHARPHOOK_VERSION} uses libuiohook {LIBUIOHOOK_COMMIT}.")
-
-
-def cmake_version():
- output = run(["cmake", "--version"], capture=True)
- match = re.search(r"(\d+)\.(\d+)", output)
- return (int(match.group(1)), int(match.group(2))) if match else (0, 0)
-
-
-def build_uiohook(output, work):
- machine = platform.machine()
- if machine not in UIOHOOK_FLAGS:
- raise BuildError(f"No libuiohook build flags for {machine}.")
- if cmake_version() < MINIMUM_CMAKE:
- raise BuildError("libuiohook needs CMake 4.2 or newer (on Ubuntu 22.04: python3 -m pip install cmake).")
- verify_sharphook_submodule(work)
- source = os.path.join(work, "libuiohook")
- fetch(LIBUIOHOOK_REPOSITORY, LIBUIOHOOK_COMMIT, source)
- build = os.path.join(work, "uiohook-build")
- env = dict(os.environ, LDFLAGS=UIOHOOK_LDFLAGS, **UIOHOOK_FLAGS[machine])
- # CMAKE_POLICY_VERSION_MINIMUM lets CMake 4 read the older extra-cmake-modules of Ubuntu 22.04.
- run(["cmake", "-S", source, "-B", build, "-G", "Unix Makefiles", "-D", "CMAKE_VERBOSE_MAKEFILE=true",
- "-D", "BUILD_TEST=ON", "-D", "CMAKE_POLICY_VERSION_MINIMUM=3.5"], env=env)
- targets = [name[len("lib"):-len(".so")] for name in UIOHOOK_LIBRARIES] + ["uiohook_tests"]
- run(["cmake", "--build", build, "--parallel", str(os.cpu_count() or 2), "--target", *targets], env=env)
- # The same unit tests SharpHook's CI runs on its build (no display needed).
- run([os.path.join(build, "uiohook_tests"), "--headless"], cwd=build)
- os.makedirs(output, exist_ok=True)
- for name in UIOHOOK_LIBRARIES:
- built = os.path.join(build, name)
- if not os.path.isfile(built):
- raise BuildError(f"The libuiohook build did not produce {name}.")
- shutil.copy2(built, os.path.join(output, name))
- for name in ("COPYING.md", "COPYING.LESSER.md"):
- shutil.copy2(os.path.join(source, name), os.path.join(output, name))
- write_source_note(output, "libuiohook", LIBUIOHOOK_REPOSITORY, LIBUIOHOOK_COMMIT,
- f"SharpHook {SHARPHOOK_VERSION}; CMake flags of SharpHook's build.yml; {machine}")
-
-
def verify_rhwp_tag():
"""Warns when the tag no longer points at the pinned commit (the pinned commit is built either way)."""
lines = run(["git", "ls-remote", RHWP_REPOSITORY, f"refs/tags/v{RHWP_VERSION}", f"refs/tags/v{RHWP_VERSION}^{{}}"],
@@ -230,7 +129,7 @@ def distribution():
def main(argv=None):
parser = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])
- parser.add_argument("component", choices=["check", "uiohook", "rhwp"])
+ parser.add_argument("component", choices=["check", "rhwp"])
parser.add_argument("--output", help="folder for the built files (must not exist yet)")
parser.add_argument("--work", help="scratch folder (default: a new temporary folder)")
options = parser.parse_args(argv)
@@ -247,10 +146,7 @@ def main(argv=None):
raise BuildError(f"{output} already exists. Use a fresh output folder.")
work = os.path.abspath(options.work) if options.work else tempfile.mkdtemp(prefix=f"filee-{options.component}-")
os.makedirs(work, exist_ok=True)
- if options.component == "uiohook":
- build_uiohook(output, work)
- else:
- build_rhwp(output, work)
+ build_rhwp(output, work)
print(f"{options.component} ready in {output}: {', '.join(sorted(os.listdir(output)))}")
return 0
except BuildError as error:
diff --git a/build/build-portable.ps1 b/build/build-portable.ps1
index 6172c059..ec9c5107 100644
--- a/build/build-portable.ps1
+++ b/build/build-portable.ps1
@@ -1,11 +1,10 @@
# Builds the Linux or macOS portable package (tar.gz + SHA256SUMS) on its own operating system.
#
-# Linux packages must run on Ubuntu 22.04 (glibc 2.35). CI builds the two upstream binaries that need a newer glibc
-# from source on Ubuntu 22.04 (build/build-linux-native.py) and passes them in:
-# -RhwpOverride <dir> a folder with the rhwp program (rhwp's release archive layout) used instead of the
-# rhwp download pinned in engines.json
-# -UiohookOverride <dir> a folder with libuiohook-xrecord.so and libuiohook-x11.so that replace SharpHook's
-# Without them (local builds) the package uses the downloads and SharpHook's files, which need a newer glibc.
+# Linux packages must run on Ubuntu 22.04 (glibc 2.35). rhwp's Linux release needs a newer glibc, so CI builds it from
+# source on Ubuntu 22.04 (build/build-linux-native.py) and passes it in:
+# -RhwpOverride <dir> a folder with the rhwp program (rhwp's release archive layout) used instead of the rhwp
+# download pinned in engines.json
+# Without it (local builds) the package uses the download, which needs a newer glibc.
[CmdletBinding()]
param(
[ValidateSet('linux-x64', 'linux-arm64', 'osx-x64', 'osx-arm64')][string]$Runtime,
@@ -13,8 +12,7 @@ param(
[string]$OutputDir = (Join-Path $PSScriptRoot '../Releases'),
[string]$SigningIdentity = '-',
[switch]$SkipFonts,
- [string]$RhwpOverride,
- [string]$UiohookOverride
+ [string]$RhwpOverride
)
$ErrorActionPreference = 'Stop'
@@ -27,9 +25,8 @@ if (-not $Runtime) {
if (($Runtime.StartsWith('osx-') -and -not $IsMacOS) -or ($Runtime.StartsWith('linux-') -and -not $IsLinux)) {
throw "Build $Runtime on its native operating system."
}
-$uiohookLibraries = @('libuiohook-xrecord.so', 'libuiohook-x11.so')
-if (($RhwpOverride -or $UiohookOverride) -and -not $Runtime.StartsWith('linux-')) {
- throw '-RhwpOverride and -UiohookOverride are for Linux packages.'
+if ($RhwpOverride -and -not $Runtime.StartsWith('linux-')) {
+ throw '-RhwpOverride is for Linux packages.'
}
if ($RhwpOverride) {
$RhwpOverride = (Resolve-Path -LiteralPath $RhwpOverride).Path
@@ -37,14 +34,6 @@ if ($RhwpOverride) {
throw "-RhwpOverride: $RhwpOverride has no rhwp program."
}
}
-if ($UiohookOverride) {
- $UiohookOverride = (Resolve-Path -LiteralPath $UiohookOverride).Path
- foreach ($library in $uiohookLibraries) {
- if (-not (Test-Path -LiteralPath (Join-Path $UiohookOverride $library) -PathType Leaf)) {
- throw "-UiohookOverride: $UiohookOverride has no $library."
- }
- }
-}
if (-not $Version) {
$Version = ([xml](Get-Content -LiteralPath (Join-Path $root 'Directory.Build.props') -Raw)).Project.PropertyGroup.Version |
Where-Object { $_ } | Select-Object -First 1
@@ -90,17 +79,6 @@ if ($RhwpOverride) {
else {
& (Join-Path $PSScriptRoot 'fetch-portable-engines.ps1') -Runtime $Runtime -Destination $engines
}
-if ($UiohookOverride) {
- # SharpHook's loader (libuiohook.so) dlopens these back ends from its own folder, the publish root.
- foreach ($library in $uiohookLibraries) {
- $target = Join-Path $publish $library
- if (-not (Test-Path -LiteralPath $target -PathType Leaf)) {
- throw "Publish has no $library to replace: SharpHook's native layout changed."
- }
- Copy-Item -LiteralPath (Join-Path $UiohookOverride $library) -Destination $target -Force
- }
- Write-Host "libuiohook back ends from $UiohookOverride"
-}
foreach ($name in @('Filee', 'filee-cli')) {
$executable = Join-Path $publish $name
if (-not (Test-Path -LiteralPath $executable -PathType Leaf)) { throw "Publish did not produce $name" }
diff --git a/docs/ENGINES.md b/docs/ENGINES.md
index 5fe5d5a1..01b7e205 100644
--- a/docs/ENGINES.md
+++ b/docs/ENGINES.md
@@ -82,25 +82,23 @@ keep the pinned version current.
## Linux builds for older glibc
-Linux packages run on Ubuntu 22.04 (glibc 2.35). rhwp's Linux release is linked on Ubuntu 24.04 (needs glibc 2.39), and
-SharpHook's `libuiohook-xrecord.so` / `libuiohook-x11.so` are built in C23 mode on Ubuntu 26.04 (`__isoc23_sscanf`,
-glibc 2.38). The `linux-native` job of `.github/workflows/portable.yml` builds both from their pinned, unmodified
-source on Ubuntu 22.04 (x64 and arm64) with `build/build-linux-native.py`:
-
-- `uiohook`: libuiohook at the commit SharpHook's release tag uses as its submodule (the script checks the tag), with
- the CMake flags of SharpHook's `build.yml`, and its unit tests. Only those two back ends are replaced; the loader
- `libuiohook.so` and the Wayland back end already run on glibc 2.34.
+Linux packages run on Ubuntu 22.04 (glibc 2.35). rhwp's Linux release is linked on Ubuntu 24.04 (needs glibc 2.39).
+The `linux-native` job of `.github/workflows/portable.yml` builds it from its pinned, unmodified source on Ubuntu 22.04
+(x64 and arm64) with `build/build-linux-native.py`:
+
- `rhwp`: `cargo build --release --locked --bin rhwp` at the tag's commit with its pinned Rust toolchain, in the
layout of rhwp's release archive.
-- `check` (also run on its own): fails when `Directory.Packages.props` uses another SharpHook version or engines.json
- another rhwp version than the script builds. After bumping SharpHook, look up the new tag's libuiohook submodule
- commit (`git ls-tree v<version> libuiohook` in SharpHook) and its CMake flags.
-
-The Linux package jobs pass the results to `build/build-portable.ps1 -RhwpOverride <dir> -UiohookOverride <dir>`.
-Local builds without these options use the downloaded rhwp and SharpHook's libraries (fine on the machine that
-builds them). `build/check-elf-glibc.py` then lists the newest GLIBC version every ELF file in the package needs and
-fails above 2.35, and the packages are unpacked and started on Ubuntu 22.04 (`build/smoke-portable.ps1`: CLI, rhwp
-conversions, loading the X11 back end; `build/smoke-launch-app.py`: the app under Xvfb).
+- `check` (also run on its own): fails when engines.json pins another rhwp version than the script builds.
+
+The Linux package jobs pass the result to `build/build-portable.ps1 -RhwpOverride <dir>`. Local builds without it use
+the downloaded rhwp (fine on the machine that builds it). SharpHook's native libraries are packaged as they come
+from NuGet: SharpHook 8.0.0 built its X11 back ends against glibc 2.38, 8.0.1 needs glibc 2.34 at most again.
+
+`build/check-elf-glibc.py` lists the newest GLIBC version every ELF file in the package needs and fails above 2.35,
+and the packages are unpacked and started on Ubuntu 22.04 (`build/smoke-portable.ps1`: CLI, rhwp conversions, loading
+the X11 input hook back end; `build/smoke-launch-app.py`: the app under Xvfb). If a SharpHook or engine update fails
+these checks, keep the previous version until upstream builds for an older glibc again, or build the binary from its
+pinned source in `build/build-linux-native.py` like rhwp (PR #113 did this for SharpHook 8.0.0's libuiohook back ends).
## Images and vector graphics