Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add package.el builder & packages #664

Closed
wants to merge 47 commits into from

Conversation

the-kenny
Copy link
Contributor

Nixpkgs already had some Emacs packages included. As of today, many new (and existing) packages are distributed via package.el, either on GNU ELPA or Marmalade.

This pull requests implement a new builder (buildEmacsPackage) for package.el packages which integrates nicely with Nix. In order to correctly set the package-directory-list variable in Emacs, it adds some code to the site-start.el file (9db63bf) which checks the environment variable EMACS_PACKAGE_EL_PACKAGES for directories. This variable is set by the setup-hook of Emacs.

The other addition is a script to generate package expressions from generic package.el repositories. This enables us to automatically import all available packages from the popular repositories and distribute them with Nix. Included in this pull request is the generated file for GNU ELPA and Marmalade, which are the most popular repositories for stable releases.

The whole result also plays nicely with the existing emacs packages in Nix: They can even depend on each other.

My intention for all this was to get more familar with nix and the way packages are built, used, and integrated. Another reason was the ability to automatically test package.el packages via Hydra, which might be useful for some personal projects for me.

I don't know what you guys think about all this, and I'm happy for any feedback. Positive or negative.

Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>

Conflicts:
	pkgs/top-level/all-packages.nix
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
For example: bbdb-ext depends on bbdb which is provided without
package.el.

Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
@peti
Copy link
Member

peti commented Jun 22, 2013

I'm not very familiar with packag.el, but from what little I can tell your improvements look really nice.

Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
…ook.

Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
@the-kenny
Copy link
Contributor Author

Started running tests on my own hydra instance on http://hydra.tarn-vedra.de. There are some (smaller) issues where the code to build the packages isn't robust enough to handle errors. I'll probably have to do a bit more testing before this is clear to merge.

Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
- Don't display the -${system} prefix
- Map lowPrio over all legacy emacs packages

Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Will default to emacs${majorVersion}-${package}.

Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
This fixes a bug where the env-vars file was copied, generating
collisions.

Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
@the-kenny
Copy link
Contributor Author

Any comments on this? If you guys are ok with adding ~990 packages to Nix I think this should be ready to merge. If it's too much spam, we could remove the recurseIntoAttrs so the packages won't be listed in nix-env -qa.

I want to do a single more commit before a merge (updating all packages), so please don't click merge already.

@mornfall
Copy link

Count me in. :-) Just saying.

@peti
Copy link
Member

peti commented Jul 14, 2013

I think your changes should be merged as soon as you think they're ready. If there is some unexpected issue, then it's cheap to revert (or fix) the commit anyway, so there's very little risk associated with this update.

Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
This set of Emacs packages corresponds to evaluation NixOS#134 of next on
http://hydra.tarn-vedra.de. It contains 914 successfully build
packages and 102 failures (mostly invalid package declarations).

Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
@the-kenny
Copy link
Contributor Author

I just pushed a final update to the automatically generated package list.

This should be ready for merge now. Sorry for the long (10 days) delay from my last communication. I just lost some focus...

One thing to mention is that I added a recurseIntoAttrs to the emacs24Packages stuff, so they appear in nix-env -qa '*'. I'm not sure if this causes other side effects (will hydra try to build the packages?). If it does, I'm totally fine with removing that call and forcing the user to use nix-env -iA pkgs.emacs24Packages.${bla}

Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>

Conflicts:
	pkgs/top-level/all-packages.nix

    There was a conflict while merging because there was a change in
    the `emacsPackages' attribute. A new packages (ess) was added in
    38d22b4. I backported this change to my branch in 2fa8d9f.
@the-kenny
Copy link
Contributor Author

Merged master and fixed a small conflict with the recently added `ess' package. Should be a clean merge with master now.

Current state is building at http://hydra.tarn-vedra.de/eval/137

@peti
Copy link
Member

peti commented Jul 25, 2013

The package ess is at version 13.05 at http://ess.r-project.org/, but the package you've generated claims to be version 5.14. How is it possible that these two versions differ so significantly?

@the-kenny
Copy link
Contributor Author

That's because someone uploaded a very old version to Marmalade:
http://marmalade-repo.org/packages/ess

This is kind of problemaic - I hoped that packages people upload there are
pretty recent.

On Thu, Jul 25, 2013 at 10:25 AM, Peter Simons notifications@github.comwrote:

The package ess is at version 13.05 at http://ess.r-project.org/, but the
package you've generated claims to be version 5.14. How is it possible that
these two versions differ so significantly?


Reply to this email directly or view it on GitHubhttps://github.com//pull/664#issuecomment-21539679
.

Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
@the-kenny
Copy link
Contributor Author

@peti Above commits contains some logic to automatically use the more recent version (as determined by versionOlder) of emacs packages. Thanks for uncovering this bug for me.

Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
…e, etc.)."

The grouping of packages by their respective repository causes too
much complexity when resolving duplicate packages by their version.

This patch reverts commit a5bfcb0 and
introduces meta.repository which contains the name of the repository.

Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>

Conflicts:
	pkgs/applications/editors/emacs-24/default.nix
	pkgs/top-level/all-packages.nix
This commit updates some Emacs packages to texinfo5.

Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Package.el's convention is haskell-mode, not haskellMode. Rename the
'manually' managed packages in Nix so we don't have duplicates in case
a package is in package.el and in `otherPackages' (in which case the
newer version will be picked automatically).

Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
I'll use this to provide a mirror for old Emacs packages which.

Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
@the-kenny
Copy link
Contributor Author

Closing this for now, I'll come up with a new PR as soon as I resolve the outstanding issues (e.g. mirroring old versions not available in repo anymore)

@the-kenny the-kenny closed this Sep 30, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants