Commit 39531286 authored by Cédric Krier's avatar Cédric Krier Committed by Germán Poo-Caamaño
Browse files

libdocument: get backends directory from environment

When bundling evince library, the directory of the backends is copied in
another directory than the installation directory.

For example, cx_freeze is a popular Python package for creating
standalone executables from Python scripts. For applications using
Evince as a library, cx_freeze copies the evince dlls in the main
directory with the executable and the backends are copied to this
directory. So the directory is relative to the directory where the
executable is installed and not from the package installation
directory of evince (because it is not really installed).

Therefore, to help the use case where Evince is bundled as a library,
and not installes, we need a way to specify dynamically the path of this
new directory.

See MR !327 for more discussion.
parent ced83b22
Pipeline #389028 passed with stages
in 6 minutes and 57 seconds
......@@ -233,6 +233,10 @@ _ev_document_factory_init (void)
if (ev_backends_list)
return TRUE;
if (g_getenv ("EV_BACKENDS_DIR") != NULL)
ev_backends_dir = g_strdup (g_getenv ("EV_BACKENDS_DIR"));
if (!ev_backends_dir) {
#ifdef G_OS_WIN32
{
gchar *dir;
......@@ -246,6 +250,7 @@ _ev_document_factory_init (void)
#else
ev_backends_dir = g_strdup (EV_BACKENDSDIR);
#endif
}
ev_backends_list = _ev_backend_info_load_from_dir (ev_backends_dir);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment