-
Notifications
You must be signed in to change notification settings - Fork 235
Package Manuskript for Linux with PyInstaller
This guide describes the steps for packaging Manuskript for Linux. The resulting package runs on x86-64 bit Linux computers only.
Before embarking on this procedure consider creating a clean 64-bit Virtual Machine for the purpose of creating Manuskript PyInstaller packages. The reasons are three-fold:
- Need to use oldest version of Linux you plan to support. See Making Linux Apps Forward-Compatible.
- Ensure no QT4 installed on system. Otherwise pyinstaller attempts to include unneeded QT4 in the package if QT4 is found on the system. See PyQt5.QtCore and PyQt4.QtCore modules both wrap the QObject class.
- Binary package wheels are provided for Python v3.5 and later for 64-bit Linux, OS X and 32-bit and 64-bit Windows.
Users with 32-bit Linux will need to run Manuskript from source code. See Run Manuskript from Source Code on Linux.
Note: I chose to create a Debian 8 Jessie 64-bit VM in order to support manuskript on a large number of currently supported GNU/Linux distros. At time of writing, Debian Jessie was the current oldStable release.
A working version of Manuskipt is required. If creating an official release, then download and extract an official source code release zip or tarball file.
unzip manuskript-#.#.#.zip
Be sure to include optional software such as Markdown and PyEnchant so that these are included in the package.
sudo apt install python3-markdown python3-pyenchant
See Run Manuskript from Source Code on Linux.
Note that pyenchant
is only listed as being supported with PyInstaller on Windows. See PyInstaller - Supported Packages and search for pyenchant
. The results on Linux may be unpredictable. For example I have seen a PyInstall packager with pyenchant work on one distro, but cause a segmentation fault on another.
Install all the necessary software required for creating the manuskript package.
-
Install zip
sudo apt install zip
-
Install pip and PyInstaller
sudo apt install python3-pip sudo pip3 install pyinstaller
Create a zip file package that can be installed and run on x86-64 computers.
-
Create the Manuskript package.
cd manuskript python3 /usr/local/bin/pyinstaller manuskript.spec
This should create a self-contained directory called
dist
under the current working directory. -
Remove
dist/manuskript/libdrm.so.2
file to avoid import errors on various graphics cards.rm dist/manuskript/libdrm.so.2
-
Create a zip file using the manuskript files under the
dist
directory.cd dist zip -r manuskript-#.#.#{-#}-linux64.zip ./manuskript
Note that the
-#
within the curly braces is optional. It is used to indicate updated packages of the same manuskript#-#-#
version. The curly braces are not included in the file name.For example:
First packaging of manuskript v0.4.0 would be named:
manuskript-0.4.0-linux64.zip
Or:
manuskript-0.4.0-1-linux64.zip
Second repackaging of manuskript v0.4.0 would be named:
manuskript-0.4.0-2-linux64.zip
And so on until the version of manuskript changed.
Use the following steps on a different computer or Virtual Machine to test that the manuskript package works.
-
Copy the manuksript-#.#.#{-#}-linux64.zip file and extract.
unzip manuskript-#.#.#{-#}-linux64.zip
-
Install a different language dictionary (e.g. French).
sudo apt install aspell-fr
-
Install pandoc for more export format options.
sudo apt install pandoc
-
Run manuskript and open/create a project.
./manuskript/manuskript # Open/create a project
-
Check for extra language dictionaries (e.g., French).
# Check *Tools -> Dictionary* for French "fr" dictionaries.
-
Check for additional pandoc export options.
# Select *File -> Compile* # Check *Export to:* drop down for pandoc export options.
-
Exit manuskript.