2011-10-05 05:53:09 +00:00
|
|
|
# MELPA
|
2011-10-05 05:49:38 +00:00
|
|
|
|
2012-04-11 14:24:31 +00:00
|
|
|
MELPA is a growing collection of `package.el`-compatible Emacs Lisp
|
2012-04-08 14:11:55 +00:00
|
|
|
packages built automatically on our server from the upstream source
|
|
|
|
code using simple recipes. (Think of it as a server-side version of
|
|
|
|
[el-get](https://github.com/dimitri/el-get), or even
|
|
|
|
[homebrew](https://github.com/mxcl/homebrew).)
|
2011-10-05 05:49:38 +00:00
|
|
|
|
2012-04-08 14:11:55 +00:00
|
|
|
Packages are updated when changes are made to the MELPA repository,
|
|
|
|
or at least daily.
|
2012-03-24 17:47:05 +00:00
|
|
|
|
2012-04-08 14:11:55 +00:00
|
|
|
If you just want to browse and install packages, check out the
|
|
|
|
[archive index page](http://melpa.milkbox.net/) for instructions.
|
|
|
|
|
|
|
|
Adding packages is as simple as submitting a pull request; read on for
|
|
|
|
details.
|
|
|
|
|
|
|
|
### About the name
|
|
|
|
|
|
|
|
*MELPA* is *Milkypostman's ELPA* or *Milkypostman's Experimental Lisp
|
|
|
|
Package Archive* if you're not into the whole brevity thing.
|
2012-03-24 17:47:05 +00:00
|
|
|
|
2011-12-14 03:04:08 +00:00
|
|
|
## Scripts
|
|
|
|
|
|
|
|
* `buildpkg` -- Create an archive of the package(s) passed as
|
|
|
|
arguments to the script. Built packages are put in the `packages/`
|
|
|
|
folder with version corresponding to the newest HEAD revision
|
|
|
|
available; given according to the `%Y%m%d` format.
|
|
|
|
|
2012-04-07 07:17:22 +00:00
|
|
|
* `melpa` -- All the logic for generating everything in the repository
|
2012-04-09 19:41:58 +00:00
|
|
|
based on the recipe files. By default this will clean the `packages/` directory,
|
2012-04-07 17:58:11 +00:00
|
|
|
build all packages
|
|
|
|
listed under `recipes/`, and compile the `index.html` file for the [melpa]
|
|
|
|
website front page.
|
2011-12-14 03:04:08 +00:00
|
|
|
|
2012-04-11 14:24:31 +00:00
|
|
|
The following arguments are accepted:
|
2011-12-14 03:04:08 +00:00
|
|
|
|
2012-04-11 14:24:31 +00:00
|
|
|
clear
|
|
|
|
: clean out the `packages/` directory
|
2011-12-14 03:04:08 +00:00
|
|
|
|
2012-04-11 14:24:31 +00:00
|
|
|
build
|
|
|
|
: build all packages in `pkglist`
|
2011-12-14 03:04:08 +00:00
|
|
|
|
2012-04-11 14:24:31 +00:00
|
|
|
index
|
|
|
|
: build the `index.html` file
|
2011-12-14 03:04:08 +00:00
|
|
|
|
2012-04-11 14:24:31 +00:00
|
|
|
validate
|
|
|
|
: naively validate that the correct number of packages were built.
|
2011-12-14 03:04:08 +00:00
|
|
|
|
2012-04-06 18:54:31 +00:00
|
|
|
Note that these scripts require an Emacs with `package.el` installed,
|
|
|
|
such as Emacs 24. If you have an older version of Emacs, you can get a
|
|
|
|
suitable `package.el` [here](http://bit.ly/pkg-el23).
|
|
|
|
|
2011-12-14 03:04:08 +00:00
|
|
|
[melpa]: http://melpa.milkbox.net
|
|
|
|
|
|
|
|
## Code
|
|
|
|
|
|
|
|
The `package-build.el` file contains all the heavy lifting. The
|
|
|
|
scripts above call the `package-build-archive` function from the
|
|
|
|
command-line to actually build the package(s).
|
|
|
|
|
2012-03-17 15:06:39 +00:00
|
|
|
Use `(package-build-all)` to build all melpa packages.
|
|
|
|
|
|
|
|
Alternatively you can
|
2011-12-14 03:04:08 +00:00
|
|
|
load this file from within Emacs and issues commands from there.
|
|
|
|
|
2012-03-24 17:47:05 +00:00
|
|
|
The `package-build.el` automatically generates any required
|
|
|
|
information for the package. For multi-file packages this include
|
|
|
|
generating the file `<NAME>-pkg.el` which contains *description*,
|
|
|
|
*version*, and *requires* information determined by searching
|
|
|
|
`<NAME>-pkg.el`, `<NAME>.el`, and `<NAME>-pkg.el.in` if they exist in
|
|
|
|
the repository.
|
|
|
|
|
|
|
|
## Contributing New Packages
|
2012-01-22 20:28:20 +00:00
|
|
|
|
2012-04-11 14:24:31 +00:00
|
|
|
Packages are specified by files in the `recipes` directory. You can
|
|
|
|
contribute a new package by adding a new file under `recipes` using
|
|
|
|
the following form,
|
2012-01-22 20:28:20 +00:00
|
|
|
|
2012-04-11 14:26:10 +00:00
|
|
|
```elisp
|
|
|
|
(name
|
|
|
|
:fetcher [git|github|bzr|hg|darcs|svn|wiki]
|
|
|
|
[:url "<repo url>"]
|
|
|
|
[:repo "github-user/repo-name"]
|
|
|
|
[:files ("<file1>", ...)])
|
|
|
|
```
|
2012-04-09 19:41:58 +00:00
|
|
|
|
2012-03-24 17:47:05 +00:00
|
|
|
`name`
|
2012-04-11 14:54:07 +00:00
|
|
|
: a lisp symbol that has the same name as the package being specified.
|
2012-03-24 17:47:05 +00:00
|
|
|
|
|
|
|
`:url`
|
2012-04-11 14:54:07 +00:00
|
|
|
: specifies the URL of the version control repository. *required for
|
2012-04-11 14:24:31 +00:00
|
|
|
the `git`, `bzr`, `hg`, `darcs` and `svn` fetchers*
|
2012-03-24 17:47:05 +00:00
|
|
|
|
|
|
|
`:fetcher`
|
2012-04-11 14:54:07 +00:00
|
|
|
: specifies the type of repository that `:url` points to. Right now
|
2012-04-11 14:24:31 +00:00
|
|
|
package-build supports [git][git], [github][github],
|
|
|
|
[bazaar (bzr)][bzr], [mercurial (hg)][hg],
|
|
|
|
[subversion (svn)][svn], [darcs][darcs], and
|
|
|
|
[Emacs Wiki (wiki)][emacswiki] as possible mechanisms for checking out
|
|
|
|
the repository. With the exception of the Emacs Wiki fetcher,
|
|
|
|
package-build uses the corresponding application to update files
|
|
|
|
before building the package. The Emacs Wiki fetcher gets the latest
|
|
|
|
version of the package from
|
|
|
|
`http://www.emacswiki.org/emacs/download/<NAME>.el` where `NAME` is
|
|
|
|
the package name. Note that the `:url` property is not needed for the
|
|
|
|
`wiki` engine unless the name of the package file on the EmacsWiki
|
|
|
|
differs from the package name being built. In the case of the `github`
|
|
|
|
fetcher, use `:repo` instead of `:url`; the git URL will then be
|
|
|
|
deduced.
|
2012-03-24 17:47:05 +00:00
|
|
|
|
|
|
|
`:files`
|
2012-04-11 14:54:07 +00:00
|
|
|
: optional property specifying the explicit files used to build the
|
2012-04-11 14:24:31 +00:00
|
|
|
package. Automatically populated by matching all `.el` files in the
|
|
|
|
root of the repository. This is necessary when there are multiple
|
|
|
|
`.el` files in the repository but the package should only be built
|
|
|
|
from a subset.
|
2012-03-24 17:47:05 +00:00
|
|
|
|
|
|
|
[git]: http://git-scm.com/
|
2012-04-09 19:37:45 +00:00
|
|
|
[github]: https://github.com/
|
2012-04-11 14:24:31 +00:00
|
|
|
[bzr]: http://bazaar.canonical.com/en/
|
|
|
|
[hg]: http://mercurial.selenic.com/
|
2012-03-24 17:47:05 +00:00
|
|
|
[svn]: http://subversion.apache.org/
|
|
|
|
[darcs]: http://darcs.net/
|
|
|
|
[emacswiki]: http://www.emacswiki.org/
|
|
|
|
|
|
|
|
|
|
|
|
### Single File Repository
|
|
|
|
|
|
|
|
[ido-ubiquitous](https://github.com/DarwinAwardWinner/ido-ubiquitous) is a repository that contains two files:
|
2012-04-07 18:00:59 +00:00
|
|
|
|
2012-04-07 18:01:38 +00:00
|
|
|
* `README.md`
|
|
|
|
* `ido-ubiquitous.el`
|
2012-04-09 19:41:58 +00:00
|
|
|
|
2012-03-24 17:47:05 +00:00
|
|
|
Since there is only one `.el` file, this package only needs the `:url` and `:fetcher` specified,
|
|
|
|
|
2012-04-11 14:24:31 +00:00
|
|
|
```elisp
|
|
|
|
(ido-ubiquitous
|
|
|
|
:url "https://github.com/DarwinAwardWinner/ido-ubiquitous.git"
|
|
|
|
:fetcher git)
|
|
|
|
```
|
2012-03-24 17:47:05 +00:00
|
|
|
|
|
|
|
### Multiple Packages in one Repository
|
2012-04-09 19:41:58 +00:00
|
|
|
|
2012-03-24 17:47:05 +00:00
|
|
|
The
|
2012-01-22 20:28:20 +00:00
|
|
|
[emacs-starter-kit](https://github.com/technomancy/emacs-starter-kit)
|
|
|
|
contains the *starter-kit* package along with extra packages in the
|
|
|
|
`modules` directory; *starter-kit-bindings*, *starter-kit-lisp*, etc.
|
|
|
|
|
2012-04-11 14:24:31 +00:00
|
|
|
```elisp
|
|
|
|
(starter-kit
|
|
|
|
:url "https://github.com/technomancy/emacs-starter-kit.git"
|
|
|
|
:fetcher git)
|
|
|
|
(starter-kit-bindings
|
|
|
|
:url "https://github.com/technomancy/emacs-starter-kit.git"
|
|
|
|
:fetcher git
|
|
|
|
:files ("modules/starter-kit-bindings.el"))
|
|
|
|
```
|
|
|
|
|
|
|
|
Notice that `:files` is not specified for `starter-kit` since
|
|
|
|
package-build will automatically add all `.el` files in the root
|
|
|
|
directory of the repository. The `starter-kit-bindings` repository is
|
|
|
|
contained in the `modules/` subdirectory and thus needs the packages
|
|
|
|
files specified explicitly.
|
2011-12-14 03:04:08 +00:00
|
|
|
|
2012-03-24 17:47:05 +00:00
|
|
|
### Submitting the Package
|
2011-12-14 03:04:08 +00:00
|
|
|
|
2012-04-11 14:24:31 +00:00
|
|
|
You should first fork the MELPA repository, add your new file under
|
|
|
|
`recipes`, and confirm your new package builds properly by running
|
|
|
|
`buildpkg <NAME>`. You can install the package that you built by
|
|
|
|
running the interactive command `package-install-file` in Emacs, and
|
|
|
|
specifying the newly built package which should be in the `packages/`
|
|
|
|
subdirectory under the melpa directory.
|
2012-01-22 20:28:20 +00:00
|
|
|
|
2012-03-24 17:47:05 +00:00
|
|
|
After verifying the entry works properly please open a pull request on Github.
|
2011-12-14 03:04:08 +00:00
|
|
|
|
2012-03-24 17:47:05 +00:00
|
|
|
## Configuration
|
2012-03-17 15:06:39 +00:00
|
|
|
|
2011-12-14 03:04:08 +00:00
|
|
|
Packages end up in the `packages/` directory by default.
|
|
|
|
This can be configured using the `package-build-archive-dir` variable.
|
|
|
|
|
|
|
|
Repositories are checked out to the `working/` directory by default.
|
|
|
|
This can be configured using the `package-build-working-dir` variable.
|