How to build your own ELPA with Eask?

ELPA stands for Emacs Lisp Package Archive. It’s used for Emacs users to download packages from, and it’s also the place where Emacs Lisp developers will host their packages. Here is a list of famous ELPA; see their site for more information!
- GNU Elpa (official)
- NonGNU Elpa (official)
- MELPA
❓ Why?
So why do we want to host our own ELPA? Aren’t those ELPAs enough?
Yes, in general, you don’t need to host ELPA yourself since most packages you need will be available in one of those ELPA (packages can co-exist between ELPA). Here are several reasons why you might want to build your own ELPA:
- The package you like isn’t (yet) on any ELPA
- ELPA’s package review takes a couple of days or months to review (MELPA is probably the fastest)
- For packages that are no longer maintained, you can link to the newly maintained fork
- Similar to Pt. 3, if there are bugs in the package you like, you can create a new fork to replace it!
- For elisp package development purposes. Sometimes, more than the build tools are needed.
📝 Prerequisite
- Some knowledge about Emacs Lisp
- Install Eask CLI
🔍 Step 1. Create ELPA project
It’s easy to build your own ELPA with Eask. You only need a few commands, and it will run.
First, we need to create the ELPA project:
|
|
In the example, I’m going to use my-elpa
as my project name:
|
|
Then you will be prompted to create the Eask file; enter the required information like this:
|
|
And here is the output:
|
|
Now, you will see the project my-elpa
has been created! Use the ls
command to see
what’s in the project folder:
|
|
🔍 Step 2. Add recipes!
Now, you can add recipes to the recipes
folder.
If you don’t know what’s the recipe, see melpa#recipe-format for more information!
In this example, I’m going to add the jcs-modeline to this ELPA. But you can add whatever package you like!
This is the recipe file, and place it as my-elpa/recipes/jcs-modeline
(no file extension).
|
|
🔍 Step 3. Build it!
Nice! Now, we have one package in our ELPA.
Next, build our ELPA to host it with GitHub pages (or your own server).
First, we need to install dependencies for our project.
|
|
The output:
|
|
Once all dependencies have been installed, we can build our ELPA with the following command:
|
|
The output:
|
|
Congratulations! 🎉 Now you have your own ELPA!
Next, you would just need to push to a GitHub repo and enable GitHub Pages for that repo. See github-elpa#3-change-repository-setting for more information!