summaryrefslogtreecommitdiff
path: root/gui-apps/wayfire-mcp/wayfire-mcp-0.1.3.ebuild
blob: 4f4c7de7afb27f0a779af22085ab17b416d79534 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Pyr dependency namespace.
# 0.1.3: first release cut from Git, tag v0.1.3 of https://git.hedronfire.com/wayfire-mcp (crucible distfiles); no patches.
EAPI=8
PYTHON_COMPAT=( python3_{13..14} )
inherit meson python-single-r1
DESCRIPTION="Optional local read-only MCP bridge for SrcUX Wayfire components"
HOMEPAGE="https://www.hedronfire.com/"
SRC_URI="https://www.hedronfire.com/distfiles/${P}.tar.gz https://www.hedronfire.com/distfiles/wayfire-mcp-wheels-0.1.2.tar.gz"
LICENSE="MIT Apache-2.0 BSD-2 BSD ISC MPL-2.0 PSF-2"
SLOT="0"
KEYWORDS="~amd64"
# The bundled wheels keep their recorded hashes, so their native modules are not stripped.
RESTRICT="mirror strip test"
QA_PREBUILT="usr/libexec/wayfire-mcp/python/*.so usr/libexec/wayfire-mcp/python/*/*.so usr/libexec/wayfire-mcp/python/*/*/*/*.so"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
RDEPEND="${PYTHON_DEPS} >=gui-apps/pyr-ctl-0.1.4 >=gui-apps/pyr-session-0.1.10"
BDEPEND="${PYTHON_DEPS} dev-python/uv"
src_install() {
    meson_src_install
    local bundle="${ED}/usr/libexec/wayfire-mcp/python"
    # The lock leaves out SDK extras the stdio bridge never imports.
    uv pip install --python "${PYTHON}" --target "${bundle}" \
        --offline --no-index --find-links "${WORKDIR}/wheels" --require-hashes --no-deps \
        --no-compile-bytecode -r data/requirements.lock || die "offline SDK bundle failed"
    rm -f "${bundle}/.lock" || die
    rm -rf "${bundle}/bin" || die
    # Bundled Python distributions retain dist-info licences and provenance.
    find "${bundle}" -type d -name __pycache__ -prune -exec rm -rf {} + || die
    # Byte-compile here so the package owns the bytecode; the launcher runs with -B.
    python_optimize "${ED}/usr/libexec/wayfire-mcp"
    # The build installs its documents to /usr/share/doc/${PN}; keep them under ${PF}.
    mkdir -p "${ED}/usr/share/doc/${PF}" || die
    mv "${ED}/usr/share/doc/${PN}"/* "${ED}/usr/share/doc/${PF}/" || die
    rmdir "${ED}/usr/share/doc/${PN}" || die
}
pkg_postinst() {
    elog "search_files is now opt-in: start the bridge with WAYFIRE_MCP_FILE_SEARCH=1 in its"
    elog "environment to enable filename search (at most 100 searches per bridge)."
}