Borg can now be installed as a secondary package manager alongside package.el. This is not documented in the manual yet. Please follow the below instructions instead. Beside adding such installation instructions to the manual, I also have to describe use-cases and restructure the manual. This is quite a bit of work and that is why I am making this feature available now with only limited documentation.
While it is possible (and in fact a major goal of this update) to install Borg in an existing configuration that relies on package.el I demonstrating how to install it Borg in a new configuration using package.el. If you want to use Borg and package.el at the same time, then I recommend you first go through this process to get a feel for how things work and only then do it in your existing configuration.
First create a new temporary repository in e.g. /tmp/.emacs.d/, clone the package database, and edit /tmp/.emacs.d/init.el:
git init /tmp/.emacs.d
git clone git@github.com:emacsmirror/epkgs.git
emacs /tmp/.emacs.d/init.el
Put this into the /tmp/.emacs.d/init.el:
(setq user-init-file (or load-file-name buffer-file-name))
(setq user-emacs-directory (file-name-directory user-init-file))
(require 'package)
(add-to-list 'package-archives (cons "melpa" "https://melpa.org/packages/") t)
(package-initialize)
(package-refresh-contents)
If you are modifying an existing configuration, then make sure you put that at the top of the file and that you remove all existing package.el configuration.
Then start a new Emacs instance using that configuration.
emacs -Q --load /tmp/.emacs.d/init.el
Install borg using package.el.
M-x package-install RET borg RET
You could start using borg to install other packages right now, but lets first finish the configuration. Replace the last two lines, that we added above, with these:
(package-initialize 'no-activate)
(package-activate 'borg)
(require 'borg-elpa)
(borg-elpa-initialize)
Quit Emacs and start a new instance.
Install a package using Borg. (After the first RET you will be told Compiling EmacSQL SQLite binary. Just wait for that to complete.)
M-x borg-assimilate RET hl-todo RET
That causes package.el to write custom-set-variables and custom-save-faces forms into the init file, so you might want to reload the buffer from the modified file at this point.
The hl-todo package has no dependency, but if it did, then you would have to first install those in separate steps because Borg does not handle dependencies for you. (In the future it might.) You can however use epkg-describe-package to get a tree of dependencies. You can install dependencies of package using package.el if you wish -- even if you are going to install the package itself using Borg.
Have a look at the load-path and note that all the lib directories come before all the elpa directories. Packages installed with Borg override those installed with Package.el.
Use list-packages to get a list of Elpa packages and note that that list includes the packages that you installed using Borg -- with correct version strings, summaries and all.
Once you have installed magit and use-package you should also add the following to your init file.
(use-package magit
:config
(magit-add-section-hook 'magit-status-sections-hook
'magit-insert-modules
'magit-insert-stashes
'append)
EDIT: Building a package using Borg currently fails if a dependency was installed using Package.el. I am working on a fix.
EDIT: When using Borg as the primary package manager, then something like this should work:
(progn ; `borg'
(setq epkg-repository "~/git/emacs/epkgs/")
;; (package-initialize)
(add-to-list 'load-path (expand-file-name "lib/borg" user-emacs-directory))
(require 'borg-elpa)
(borg-elpa-initialize))
Borg can now be installed as a secondary package manager alongside
package.el. This is not documented in the manual yet. Please follow the below instructions instead. Beside adding such installation instructions to the manual, I also have to describe use-cases and restructure the manual. This is quite a bit of work and that is why I am making this feature available now with only limited documentation.While it is possible (and in fact a major goal of this update) to install Borg in an existing configuration that relies on
package.elI demonstrating how to install it Borg in a new configuration usingpackage.el. If you want to use Borg andpackage.elat the same time, then I recommend you first go through this process to get a feel for how things work and only then do it in your existing configuration.First create a new temporary repository in e.g.
/tmp/.emacs.d/, clone the package database, and edit/tmp/.emacs.d/init.el:Put this into the
/tmp/.emacs.d/init.el:If you are modifying an existing configuration, then make sure you put that at the top of the file and that you remove all existing
package.elconfiguration.Then start a new Emacs instance using that configuration.
Install
borgusingpackage.el.You could start using
borgto install other packages right now, but lets first finish the configuration. Replace the last two lines, that we added above, with these:Quit Emacs and start a new instance.
Install a package using Borg. (After the first
RETyou will be toldCompiling EmacSQL SQLite binary. Just wait for that to complete.)That causes
package.elto writecustom-set-variablesandcustom-save-facesforms into the init file, so you might want to reload the buffer from the modified file at this point.The
hl-todopackage has no dependency, but if it did, then you would have to first install those in separate steps because Borg does not handle dependencies for you. (In the future it might.) You can however useepkg-describe-packageto get a tree of dependencies. You can install dependencies of package usingpackage.elif you wish -- even if you are going to install the package itself using Borg.Have a look at the
load-pathand note that all thelibdirectories come before all theelpadirectories. Packages installed with Borg override those installed with Package.el.Use
list-packagesto get a list of Elpa packages and note that that list includes the packages that you installed using Borg -- with correct version strings, summaries and all.Once you have installed
magitanduse-packageyou should also add the following to your init file.EDIT: Building a package using Borg currently fails if a dependency was installed using Package.el. I am working on a fix.
EDIT: When using Borg as the primary package manager, then something like this should work: