To install a package by using a layer, you need to add the pacakge to the layer's packages list, write an init function for the package, and enable the layer. It appears that you did not write an init function. The init function is necessary for Spacemacs to install the package, but it can be empty if no configuration is needed for the package.
When trying to override a built-in package with a newer version, use the :min-version
keyword to specify a version that is higher than the built-in one and lower or equal to the desired version. :min-version
should be a version string, similar in format to emacs-version
.
Assuming your layer is called verilog, its packages.el
file should look like this:
(defconst verilog-packages
'((verilog-mode :location (recipe :fetcher github
:repo "veripool/verilog-mode"
:min-version "1"))))
(defun verilog/init-verilog-mode ()
;; ... verilog configuration goes here ...
)
And of course don't forget to enable the layer by adding it to dotspacemacs-configuration-layers
.
To make sure that :min-version
is newer than the built-in version, you can use this next small snippet. It is meant to be used interactively before installing the newer version:
(package-installed-p 'verilog-mode (version-to-list "1"))
Another approach is to install verilog-mode as an additional package. In this approach, you install the package by adding it to dotspacemacs-additional-packages
. The same entries that fit in a layer's packages list also fit in dotspacemacs-additional-packages
. In your case, you'd add this as an entry:
(verilog-mode :location (recipe :fetcher github :repo "veripool/verilog-mode" :min-version "1"))
And any configuration for verilog-mode goes in dotspacemacs/user-config
.