File: loadext.rst

package info (click to toggle)
beets 2.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 7,988 kB
  • sloc: python: 46,429; javascript: 8,018; xml: 334; sh: 261; makefile: 125
file content (54 lines) | stat: -rw-r--r-- 1,632 bytes parent folder | download | duplicates (2)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Load Extension Plugin
=====================

Beets uses an SQLite database to store and query library information, which has
support for extensions to extend its functionality. The ``loadext`` plugin lets
you enable these SQLite extensions within beets.

One of the primary uses of this within beets is with the `"ICU" extension`_,
which adds support for case insensitive querying of non-ASCII characters.

.. _"icu" extension: https://www.sqlite.org/src/dir?ci=7461d2e120f21493&name=ext/icu

Configuration
-------------

To configure the plugin, make a ``loadext`` section in your configuration file.
The section must consist of a list of paths to extensions to load, which looks
like this:

.. code-block:: yaml

    loadext:
      - libicu

If a relative path is specified, it is resolved relative to the beets
configuration directory.

If no file extension is specified, the default dynamic library extension for the
current platform will be used.

Building the ICU extension
--------------------------

This section is for **advanced** users only, and is not an in-depth guide on
building the extension.

To compile the ICU extension, you will need a few dependencies:

    - gcc
    - icu-devtools
    - libicu
    - libicu-dev
    - libsqlite3-dev

Here's roughly how to download, build and install the extension (although the
specifics may vary from system to system):

.. code-block:: shell

    $ wget https://sqlite.org/2019/sqlite-src-3280000.zip
    $ unzip sqlite-src-3280000.zip
    $ cd sqlite-src-3280000/ext/icu
    $ gcc -shared -fPIC icu.c $(icu-config --ldflags) -o libicu.so
    $ cp libicu.so ~/.config/beets