The library(prolog_pack) provides the SWI-Prolog package manager. This library lets you inspect installed packages, install packages, remove packages, etc. It is complemented by the built-in attach_packs/0 that makes installed packages available as libraries.
To make changes to a package:
?- pack_install(.).
This builds the pack locally and creates a symlink to make it
available. It will also write a file buildenv.sh
that you can
source to get the environment for running a normal make
(this is
done only if there is a configure
step; i.e., if there is a
configure.in
or configure
file).?- pack_rebuild(package_name).
This runs `make distclean and
make` with the right environment.cmake
.
Once you have made the changes, you should edit the pack.pl
file
to change the version
item. After updating the git repo, issue
a pack_install(package_name, [upgrade(true), test(true), rebuild(make)])
to cause the repository to refresh. You can simulate the full
installation process by removing all the build files in the package
(including any in submodules), running pack_install/1, and then
running pack_install using a file://
URL.
?- pack_list('', [server(false)]).
Options processed:
installed(true)
.false
, do not contact the server. This implies
installed(true)
. Otherwise, use the given pack server.
Hint: ?- pack_list('').
lists all packages.
The predicates pack_list/1 and pack_search/1 are synonyms. Both contact the package server at https://www.swi-prolog.org to find available packages.
file://
URL'.'
, in which case a relative symlink is created to the
current directory (all other options for Spec make a copy
of the files).After resolving the type of package, pack_install/2 is used to do the actual installation.
true
, install in the XDG common application data path, making
the pack accessible to everyone. If false
, install in the XDG
user application data path, making the pack accessible for the
current user only. If the option is absent, use the first
existing and writable directory. If that doesn't exist find
locations where it can be created and prompt the user to do
so.true
(default false
), do not perform any checks on SSL
certificates when downloading using https
.true
(default false), suppress informational progress
messages.true
(default false
), upgrade package if it is already
installed.if_absent
(default, do nothing if the directory with foreign
resources exists), make
(run make
) or true
(run `make
distclean` followed by the default configure and build steps).true
(default), run the pack tests.true
(default false
unless URL ends with =.git=),
assume the URL is a GIT repository.
Non-interactive installation can be established using the option
interactive(false)
. It is adviced to install from a particular
trusted URL instead of the plain pack name for unattented
operation.
README
file (if present)TODO
file (if present)pack.pl
and a prolog
directory. Options processed:
last
, alternative is first
.The following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.
Options processed:
installed(true)
.false
, do not contact the server. This implies
installed(true)
. Otherwise, use the given pack server.
Hint: ?- pack_list('').
lists all packages.
The predicates pack_list/1 and pack_search/1 are synonyms. Both contact the package server at https://www.swi-prolog.org to find available packages.
Options processed:
installed(true)
.false
, do not contact the server. This implies
installed(true)
. Otherwise, use the given pack server.
Hint: ?- pack_list('').
lists all packages.
The predicates pack_list/1 and pack_search/1 are synonyms. Both contact the package server at https://www.swi-prolog.org to find available packages.