Open thblt opened 6 years ago
I won't have time to do it myself, but I can be of some help with build systems and subshell-based dependency managers, like Nix. (where you don't just install the dependencies then build the program, but the package manager creates a shell into which the build sequence should run)
Thank you for the idea.
Description
Some Emacs package use native components, written in C, C++ or any other language, that require building on the user's computer. Such packages include irony-mode, mu4e, pdf-tools, intero and a lot more. The common approach is to use a shell script or ad-hoc elisp to install the dependencies using the adequate method for the running OS and try to produce a binary. This is horrible.
The envisioned library would provide a standard way for packages to expose their native component's dependencies and build system and would handle building and rebuilding
Things to Implement [0/5]
[ ] Some basic abstraction over common build systems, at the very least autotools and cmake.
[ ] Some basic abstraction over package management, supporting both the "old school method" (
apt-get install
) and the Nix/Guix "shell" approach (where the package manager creates a shell with the required packages available)[ ] Some basic abstraction over common dependencies. Eg, Debian's libexpat-dev = Arch's libexpat = nix's expat. Runtime dependencies must be distinguished from compilation deps. Having a stupid database of name equivalences is no big deal and makes things a lot easier for everyone. (the general rule that āx Debian = libX-dev, Arch=libX, Nix=X can be a good start)
[ ] Updates support: store the built version and compare with the library's version.
[ ] Support for generating binaries and Emacs native modules.
Interface for package writers
It could look like this:
From that, the library would create the build environment for the current OS and build the components. Options for installing the components should probably be provided, with reasonable defaults (= just take this binary and put it in your-package-name/bin or /lib
Support for including a simple test could help automate validation of the configuration in all supported OSs and build systems.
Prior art
Packages with a native component:
Package managers with support for building: