# Upstream hard-codes library(lsp_server) and the lsp() alias, so the pack dir # must stay "lsp_server" even though the RPM is named swipl-lsp-server. %global pack_name lsp_server %global packdir %{_datadir}/swi-prolog/pack/%{pack_name} # Pure-Prolog data package — no compiled output, so no debuginfo. %global debug_package %{nil} Name: swipl-lsp-server Version: 3.17.0 Release: 1%{?dist} Summary: Language Server Protocol server for SWI-Prolog License: BSD-2-Clause URL: https://github.com/jamesnvc/lsp_server Source0: %{url}/archive/v%{version}/%{pack_name}-%{version}.tar.gz BuildArch: noarch # pldoc, sgml and uri come from swi-prolog-core-packages; the rest of the loaded # libraries from swi-prolog-core. Needed at build time so %%check loads offline. BuildRequires: swi-prolog-core BuildRequires: swi-prolog-core-packages Requires: swi-prolog-core Requires: swi-prolog-core-packages %description A Language Server Protocol implementation for SWI-Prolog. It provides diagnostics, go-to-definition and find-references, hover documentation, predicate completion, code formatting, symbol highlighting and variable renaming, driven by SWI-Prolog's own cross-referencing and introspection. Installed as a SWI-Prolog pack, it is auto-attached at interpreter startup so editors can start it over stdio or a socket. %prep %autosetup -n %{pack_name}-%{version} %build %install mkdir -p %{buildroot}%{packdir} # Runtime pack only; tests and the VS Code client are not shipped. cp -pr pack.pl prolog app %{buildroot}%{packdir}/ # The upstream .plt suite is coupled to this SWI build's built-in help wording # (succ/2 hover text) and to cross-project xref, so it is not build-reproducible; # smoke-test that the pack attaches, every module loads, and the formatter runs. %check XDG_DATA_DIRS=%{buildroot}%{_datadir} swipl -q \ -g "use_module(library(lsp_server))" -g halt printf ':- module(t, []).\nfoo:-bar,baz.\n' > smoke.pl XDG_DATA_DIRS=%{buildroot}%{_datadir} swipl formatter --no-inplace smoke.pl | grep -q foo %files %license LICENSE %doc README.org %dir %{_datadir}/swi-prolog %dir %{_datadir}/swi-prolog/pack %{packdir} %changelog * Wed Jul 01 2026 Bahtiar `kalkin-` Gadimov - 3.17.0-1 - Initial package of the SWI-Prolog LSP server (lsp_server) 3.17.0