Next: , Up: Installation   [Contents][Index]


2.1 Use as secondary package manager

To use Borg as a secondary package manager alongside Package, begin by installing the former using the latter. Borg is only available from Melpa, so you have to add that first.

(add-to-list 'package-archives
             (cons "melpa" "https://melpa.org/packages/")
             t)

Then you have to M-x package-refresh-contents RET before you can M-x package-install RET borg RET. Doing that should add a verbose variant of this to your init file:

(custom-set-variables
 '(package-selected-packages '(borg)))

Then you have to make the two package managers aware of each other by replacing the call to package-initialize in your init file with this:

(if (require 'borg-elpa nil t)
    (borg-elpa-initialize)
  (package-initialize))

Just like Package (aka Elpa) defaults to installing packages in elpa/, Borg defaults to installing them in borg/. (When using both package managers, that is. If used by itself, then Borg defaults to using lib/.) If you want to use another directory, then you can do so by setting the Git variable borg.drones-directory.

You should also add a Makefile containing:

BORG_SECONDARY_P = true
include $(shell find -L elpa -maxdepth 1 -regex '.*/borg-[.0-9]*' |\
  sort | tail -n 1)/borg.mk

Despite its title, many things mentioned in the next section are relevant even when Borg was installed the way we just did. Just saying.