This is a hacky little repo used to build Windows binaries for
ebookmaker using
pyinstaller. It uses an
in-development version of pyinstaller to work around issues in v3.6 (problems
with setuptools==45 and the lack of an installer hook for jaraco.text
).
These instructions use bash-isms and thus assume you are running the following commands in a git bash shell on Windows (presumably after having installed Git for Windows).
To use:
-
Clone this repository
-
Install the ebookmaker build dependencies
- Install Python 3.8 from python.org.
- Install Microsoft Visual Studio Build Tools.
- Go to Microsoft Visual Studio Downloads.
- Scroll down and expand Tools for Visual Studio 2019.
- Download Build Tools for Visual Studio 2019. This will download and start the Visual Studio Installer.
- In the installer, select the C++ build tools workload. You really will need all of the things this wants to install. All 4GB of it.
- Start the install.
-
Install
pipenv
pip install --user pipenv
-
Within the repository clone, install the pipenv virtual environment
pipenv install
-
Enter into a pipenv shell
pipenv shell
-
Build ebookmaker
pyinstaller -F \ --hidden-import ebookmaker.parsers.AuxParser \ --hidden-import ebookmaker.parsers.CSSParser \ --hidden-import ebookmaker.parsers.GutenbergTextParser \ --hidden-import ebookmaker.parsers.HTMLParser \ --hidden-import ebookmaker.parsers.ImageParser \ --hidden-import ebookmaker.parsers.RSTParser \ --hidden-import ebookmaker.parsers.WrapperParser \ --hidden-import ebookmaker.writers.EpubWriter \ --hidden-import ebookmaker.writers.HTMLWriter \ --hidden-import ebookmaker.writers.KindleWriter \ --hidden-import ebookmaker.writers.PDFWriter \ --hidden-import ebookmaker.writers.PicsDirWriter \ --hidden-import ebookmaker.writers.RSTWriter \ --hidden-import ebookmaker.writers.TxtWriter \ --hidden-import ebookmaker.packagers.GzipPackager \ --hidden-import ebookmaker.packagers.HTMLPackager \ --hidden-import ebookmaker.packagers.PDFPackager \ --hidden-import ebookmaker.packagers.PushPackager \ --hidden-import ebookmaker.packagers.RSTPackager \ --hidden-import ebookmaker.packagers.TxtPackager \ "$(which ebookmaker)"
This will create the Windows binary dist/ebookmaker.exe
.
To release a new binary:
- Ensure you are working with a fresh checkout of the
master
branch. - Tag the repo with the same version of EBookMaker installed in the
Pipfile
:git tag v0.9.1 master
- Push the tag to the upstream repo:
git push --tags upstream
- Create the
ebookmaker.exe
file. - Create a zip of the
ebookmaker.exe
file named with the version of EBookMaker that it was built from. For example:ebookmaker-0.9.1.zip
. - Create an ebm_builder release
with the tag using the following template:
- Release title:
- Description: updated with the appropriate versions
This is a Windows binary of the <tagname> [ebookmaker](https://github.com/gutenbergtools/ebookmaker) tool built on Windows 10 with pyinstaller and Python 3.8.
- Attach the zip file
To update the version of ebookmaker this tool builds you will need to
pipenv install
the newer ebookmaker package version. You may (or may not)
need to also adjust the version of pyinstaller or any of the other magical
package dependencies specified inside the Pipfile.
For example:
pipenv install "ebookmaker==0.9.2"