Next: Python模块, Previous: Snippets versus Phases, Up: 打包指导 [Contents][Index]
Emacs packages should preferably use the Emacs build system
(see emacs-build-system), for uniformity and the benefits provided by
its build phases, such as the auto-generation of the autoloads file and the
byte compilation of the sources. Because there is no standardized way to
run a test suite for Emacs packages, tests are disabled by default. When a
test suite is available, it should be enabled by setting the #:tests?
argument to #true
. By default, the command to run the test is
make check
, but any command can be specified via the
#:test-command
argument. The #:test-command
argument expects
a list containing a command and its arguments, to be invoked during the
check
phase.
The Elisp dependencies of Emacs packages are typically provided as
propagated-inputs
when required at run time. As for other packages,
build or test dependencies should be specified as native-inputs
.
Emacs packages sometimes depend on resources directories that should be
installed along the Elisp files. The #:include
argument can be used
for that purpose, by specifying a list of regexps to match. The best
practice when using the #:include
argument is to extend rather than
override its default value (accessible via the %default-include
variable). As an example, a yasnippet extension package typically include a
snippets directory, which could be copied to the installation
directory using:
#:include (cons "^snippets/" %default-include)
When encountering problems, it is wise to check for the presence of the
Package-Requires
extension header in the package main source file,
and whether any dependencies and their versions listed therein are
satisfied.
Next: Python模块, Previous: Snippets versus Phases, Up: 打包指导 [Contents][Index]