@ -7,40 +7,35 @@ Scripts to build a distribution of Emacs from sources, using MSYS2 and Mingw64(3
I wanted a script to build Emacs from sources, package it and install it on
different computers, with the following conditions
- I should be able to build any branch or release from Emacs. This includes
the last release branch (right now emacs-27), as well as the master branch
for development. Always using pristine sources from Savannah.
- I want to build emacs with different options from the default, which is to
use all features available. For instance, I do not care for SVG support.
- The script needs to track all packages that are required by the Emacs build
even if I change the build options.
- The installation should take as little space as possible, removing useless
directories or files that come from the dependencies. For instance, headers
from libraries used by emacs, spurious documentation files, etc.
- The script should be able to build other components I regularly use, such as
mu, mu4e or pdf-tools, in a way that is not affected by updates to the mingw
or msys environments.
- I should be able to build any branch or release from Emacs. This includes the last release branch (right now emacs-27), as well as the master branch for development. Always using pristine sources from Savannah.
- I want to build emacs with different options from the default, which is to use all features available. For instance, I do not care for SVG support.
- The script needs to track all packages that are required by the Emacs build even if I change the build options.
- The installation should take as little space as possible, removing useless directories or files that come from the dependencies. For instance, headers from libraries used by emacs, spurious documentation files, etc.
- The script should be able to build other components I regularly use, such as mu, mu4e or pdf-tools, in a way that is not affected by updates to the mingw or msys environments.
## Usage
### Before running
The script supports two way of being invoked:
1. Install MSYS/Mingw64 as explained [here](https://www.msys2.org/).
2. Open a Mingw64 terminal.
3. Install Git using `pacman -S git`.
4. Upgrade your system if this is not a fresh install.
5. Clone this repository somewhere in your home directory.
6. Enter the repository and use the command line tool as explained below.
- The `emacs-build.cmd` assumes nothing about your system, except for an existing installation of PowerShell. It will download and install a minimal MSYS/MINGW64 environment and build Emacs and all other requested components. This allows for a more deterministic build, without perturbing your computer.
- The `emacs-build.sh` is meant to be ran from an existing MSYS/MINGW64 environment, which will be modified to allow building Emacs and all tools. Use this version at your own risk.
### General instructions
### Steps
1. Download or clone the script from GitHub
2. Open a Windows terminal and move to the folder for this script
3. Issue whatever commands you need, such as `.\emacs-build.cmd --clone --deps --build --pack-emacs`
4. Inspect the `zips` folder for the products of the script
1. Clone the latest emacs repository on the branch emacs-27
2. Ensure that all required packages Mingw64 are installed, or install them.
3. Configure and build Emacs using those packages
4. Pack all the dependencies into a ZIP file.
5. Download and build pdf-tools, hunspell, mu and isync (plus xapian and gmime3). In the process, ensure that the required packages are also installed.
6. Create a ZIP file with Emacs, all the dependencies and all the extensions.
1. Download the latest release of MSYS
2. Download a minimal set of MSYS and MINGW programs needed to build Emacs and the extensions
3. Clone the latest emacs repository on the branch emacs-27
4. Ensure that all required packages Mingw64 are installed, or install them.
5. Configure and build Emacs using those packages
6. Pack all the dependencies into a ZIP file.
7. Download and build pdf-tools, hunspell, mu and isync (plus xapian and gmime3). In the process, ensure that the required packages are also installed.
8. Create a ZIP file with Emacs, all the dependencies and all the extensions.
The script, just like its creator, is a bit opinionated. It performs takes some extra steps to reduce the size of the distribution
@ -101,12 +98,6 @@ The script, just like its creator, is a bit opinionated. It performs takes some
### Considerations
Regarding versions:
- Upgrade your MSYS/Mingw installation with `pacman -Su` before running this script.
- After every upgrade, it is recommended to do a full clean (`--clean-all`) and
rebuild. Otherwise different packages may be in an inconsistent state.
There are implicit dependencies in the various actions:
- `--clone` is required to get the sources
@ -114,26 +105,16 @@ There are implicit dependencies in the various actions:
The tool produces zip files that are stored in `./zips` and can be uncompressed wherever you want:
- `emacs-xx-xxxx-deps.zips` is the file with optional libraries (png, jpeg,
etc) used by Emacs.
- `emacs-xx-xxxx-nodeps.zip` is a bare Emacs installation. It runs even if the
'deps' file is not used
- `emacs-xx-xxxx-full.zip` is a complete Emacs installation, with the optional
libraries and all extensions (pdf-tools, mu, etc) you mentioned in the
command line.
- `pdf-tools-xxxx.zip` and others are the Zip files for the extensions. They
can be unpacked inside an Emacs installation, but may assume that 'deps' have
also been unpacked.
- `emacs-xx-xxxx-deps.zips` is the file with optional libraries (png, jpeg, etc) used by Emacs.
- `emacs-xx-xxxx-nodeps.zip` is a bare Emacs installation. It runs even if the 'deps' file is not used
- `emacs-xx-xxxx-full.zip` is a complete Emacs installation, with the optional libraries and all extensions (pdf-tools, mu, etc) you mentioned in the command line.
- `pdf-tools-xxxx.zip` and others are the Zip files for the extensions. They can be unpacked inside an Emacs installation, but may assume that 'deps' have also been unpacked.
Regarding the extensions to Emacs and third-party utilities:
- They can be built separately from Emacs.
- If `c:\emacs` is where you unpacked the full installation, some extensions
will reside in `c:\emacs\bin` (e.g. pdftools) and some others in
`c:\emacs\usr\bin` (e.g. mu and mbsync).
- Even though elisp files are provided, it is highly recommended that you
install pdf-tools and mu4e from Melpa or other repositories, to properly take
care of dependencies from other elisp libraries.
- If `c:\emacs` is where you unpacked the full installation, some extensions will reside in `c:\emacs\bin` (e.g. pdftools) and some others in `c:\emacs\usr\bin` (e.g. mu and mbsync).
- Even though elisp files are provided, it is highly recommended that you install pdf-tools and mu4e from Melpa or other repositories, to properly take care of dependencies from other elisp libraries.
## TO-DO
@ -143,4 +124,4 @@ Regarding the extensions to Emacs and third-party utilities:
- Setting up an MSYS/MINGW system https://github.com/marketplace/actions/setup-msys2