diff --git a/.github/workflows/fedora-tools-ci.yml b/.github/workflows/fedora-tools-ci.yml new file mode 100644 index 0000000..bcea147 --- /dev/null +++ b/.github/workflows/fedora-tools-ci.yml @@ -0,0 +1,25 @@ +name: Fedora tools CI + +on: + push: + branches: ["**"] + pull_request: + +jobs: + build-tools: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build and install Fedora tools + run: | + docker run --rm \ + -v "$GITHUB_WORKSPACE:/workspace:ro" \ + -w /workspace \ + fedora:45 \ + bash -euo pipefail -c ' + PREFIX=/tmp/hyde-tools ./fedora/install-tools.sh + test -x /tmp/hyde-tools/bin/hyq + test -x /tmp/hyde-tools/bin/awww + test -x /tmp/hyde-tools/bin/awww-daemon + ' diff --git a/.gitignore b/.gitignore index a620942..3e9e967 100644 --- a/.gitignore +++ b/.gitignore @@ -27,4 +27,9 @@ # editor/system .DS_Store .* -* \ No newline at end of file +* +!fedora/ +!fedora/** +!.github/ +!.github/workflows/ +!.github/workflows/fedora-tools-ci.yml diff --git a/README.md b/README.md index 855c1ca..cad5694 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,7 @@ # distro -Host Build Scripts for Distros. Yey + +Host build scripts and packaging for HyDE project binaries across distros. + +- `arch/` contains Arch package recipes. +- `fedora/` contains Fedora tooling to build and install upstream binaries + that are not available as Fedora packages. diff --git a/fedora/README.md b/fedora/README.md new file mode 100644 index 0000000..565dc2f --- /dev/null +++ b/fedora/README.md @@ -0,0 +1,14 @@ +# Fedora tools + +`install-tools.sh` builds and installs the Fedora tools HyDE currently +consumes from upstream source: `hyq` (from HyDE-Project/hyprquery), and +`awww` plus `awww-daemon` (from LGFae/awww). Source revisions are pinned in the +script so the same inputs are used by local installs and CI. + +Run it from a Fedora system with `dnf` and `sudo` available: + +```bash +./fedora/install-tools.sh +``` + +The default install prefix is `/usr/local`. Set `PREFIX` to override it. diff --git a/fedora/install-tools.sh b/fedora/install-tools.sh new file mode 100755 index 0000000..28e7b31 --- /dev/null +++ b/fedora/install-tools.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Build and install the Fedora-only tools used by HyDE. +# Override PREFIX to install somewhere other than /usr/local. + +readonly HYPRQUERY_REV="4e1405cc7d07f1b6d611d6d96322f009cd298f23" +readonly AWWW_REV="f66e12a76dbc4c669b2f1375f78bce49f5b19d66" +readonly PREFIX="${PREFIX:-/usr/local}" +readonly BUILD_ROOT="$(mktemp -d)" + +cleanup() { + rm -rf "${BUILD_ROOT}" +} +trap cleanup EXIT + +as_root() { + if [[ "$(id -u)" -eq 0 ]]; then + "$@" + else + sudo "$@" + fi +} + +if ! command -v dnf >/dev/null 2>&1; then + echo "This installer requires Fedora's dnf package manager." >&2 + exit 1 +fi + +as_root dnf install -y \ + git cargo cmake make gcc-c++ pkgconf-pkg-config \ + hyprlang-devel cli11-devel json-devel \ + hyprutils-devel lz4-devel libxkbcommon-devel wayland-devel \ + wayland-protocols-devel scdoc + +git clone https://github.com/HyDE-Project/hyprquery.git "${BUILD_ROOT}/hyprquery" +git -C "${BUILD_ROOT}/hyprquery" checkout --detach "${HYPRQUERY_REV}" +cmake -S "${BUILD_ROOT}/hyprquery" -B "${BUILD_ROOT}/hyprquery/build" \ + -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ + -DHYPRQUERY_DISTRO_BUILD=ON +cmake --build "${BUILD_ROOT}/hyprquery/build" --parallel +as_root cmake --install "${BUILD_ROOT}/hyprquery/build" + +git clone https://codeberg.org/LGFae/awww.git "${BUILD_ROOT}/awww" +git -C "${BUILD_ROOT}/awww" checkout --detach "${AWWW_REV}" +cargo build --manifest-path "${BUILD_ROOT}/awww/Cargo.toml" --release +as_root install -Dm755 "${BUILD_ROOT}/awww/target/release/awww" \ + "${PREFIX}/bin/awww" +as_root install -Dm755 "${BUILD_ROOT}/awww/target/release/awww-daemon" \ + "${PREFIX}/bin/awww-daemon" + +printf 'Installed hyq, awww and awww-daemon under %s/bin\n' "${PREFIX}"