moment/INSTALL.md

306 lines
9.0 KiB
Markdown
Raw Normal View History

2020-03-20 10:13:08 +11:00
# Installation
Instructions and releases are currently only available for Linux,
but compiling on Windows and macOS should be possible with the right tools.
- [Packages](#packages)
2020-03-20 10:13:08 +11:00
- [Linux](#linux)
2020-03-27 22:06:38 +11:00
- [AppImage](#appimage)
- [Flatpak](#flatpak)
- [Arch Linux](#arch-linux)
2020-03-20 10:13:08 +11:00
- [Manual installation](#manual-installation)
- [Environment variables](#environment-variables)
- [Package manager dependencies](#package-manager-dependencies)
- [Alpine Linux 3.9+ / apk](#alpine-linux-39--apk)
- [Arch Linux / pacman & AUR](#arch-linux--pacman--aur)
- [Fedora 30+ / dnf](#fedora-30--dnf)
2020-03-21 05:11:47 +11:00
- [Gentoo / emerge](#gentoo--emerge)
2020-03-20 10:13:08 +11:00
- [Ubuntu 19.04 / apt](#ubuntu-1904--apt)
- [Ubuntu 19.10+, Debian bullseye / apt](#ubuntu-1910-debian-bullseye--apt)
- [Void Linux / xbps](#void-linux--xbps)
- [Installing PyOtherSide manually](#installing-pyotherside-manually)
- [Installing libolm manually](#installing-libolm-manually)
- [Installing Mirage](#installing-mirage)
2020-03-27 22:06:38 +11:00
- [Common issues](#common-issues)
- [cffi version mismatch](#cffi-version-mismatch)
- [Component is not ready](#component-is-not-ready)
2020-03-20 10:13:08 +11:00
## Packages
2020-03-20 10:13:08 +11:00
### Linux
For developement, or if none of the package options are satisfying,
2020-03-27 22:06:38 +11:00
see [manual installation](#manual-installation).
#### AppImage
For **x86 64bit glibc-based systems**, Mirage is available as an AppImage
on the [release page](https://github.com/mirukana/mirage/releases).
2020-03-20 10:13:08 +11:00
AppImages are single executable files that contain the app and all
its dependencies.
Mirage images are built in Ubuntu 16.04, and should therefore run on any distro
2020-03-27 22:06:38 +11:00
released in April 2016 or later.
[How to start AppImages](https://docs.appimage.org/introduction/quickstart.html#how-to-run-an-appimage)
(TL;DR: `chmod +x Mirage-*.AppImage && ./Mirage-*.AppImage`)
#### Flatpak
Mirage is also available as a Flatpak
on the [release page](https://github.com/mirukana/mirage/releases).
Follow [these instructions](https://flatpak.org/setup/) to install the flatpak
command on your system.
2020-03-20 10:13:08 +11:00
To then install and run the downloaded `.flatpak` file:
2020-03-20 10:13:08 +11:00
```sh
flatpak remote-add --user --if-not-exists \
flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install --user flathub org.kde.Platform//5.12
flatpak install --user mirage-*.flatpak
2020-03-27 22:06:38 +11:00
flatpak run io.github.mirukana.mirage
2020-03-20 10:13:08 +11:00
```
If downloading the dependencies fail due to e.g. connection error,
run `flatpak repair` before retrying.
2020-03-20 10:13:08 +11:00
If your architecture is not listed on the release page, clone the repository
and see [packaging/flatpak/README.md](packaging/flatpak/README.md) to build the
2020-03-27 22:06:38 +11:00
package on your machine.
2020-03-20 10:13:08 +11:00
#### Arch Linux
[Available on the AUR](https://aur.archlinux.org/packages/matrix-mirage-git/)
Using a AUR helper to install it,
in this example [yay](https://github.com/Jguer/yay):
yay -S matrix-mirage-git
2020-03-20 10:42:49 +11:00
## Manual Installation
2020-03-20 10:13:08 +11:00
2020-03-21 05:11:47 +11:00
**Qt 5.12+**, **Python 3.6+** (with **pip** to install packages from the
[requirements.txt](requirements.txt)), **PyOtherSide 1.5+** and
**libolm 3+** are required.
The equivalent `-dev` or `-devel` packages are needed, if your distro
splits development headers into their own packages.
For the Pillow Python package, these dependencies are recommended to support
all common image formats:
- **libjpeg-turbo**
- **zlib**
- **libtiff**
- **libwebp**
- **openjpeg2**
**libmediainfo** is also required for the pymediainfo package.
2020-03-20 10:13:08 +11:00
2020-03-20 10:42:49 +11:00
### Environment Variables
2020-03-20 10:13:08 +11:00
To ensure Qt **5** will be used by default, compile using all CPU cores and
optimize the build for your machine:
```sh
export QT_SELECT=5
export MAKEFLAGS="-j$(nproc)"
export CFLAGS="-march=native -O2 -pipe"
```
2020-03-20 10:42:49 +11:00
### Package Manager Dependencies
2020-03-20 10:13:08 +11:00
#### Alpine Linux 3.9+ / apk
[PyOtherSide](#installing-pyotherside-manually) and
[libolm](#installing-libolm-manually) must be manually installed.
```sh
sudo apk add qt5-qtquickcontrols2-dev qt5-qtsvg-dev qt5-qtimageformats \
python3-dev py3-setuptools \
build-base git cmake \
libjpeg-turbo-dev zlib-dev tiff-dev libwebp-dev openjpeg-dev \
libmediainfo-dev
2020-03-21 05:11:47 +11:00
2020-03-20 10:13:08 +11:00
export PATH="/usr/lib/qt5/bin:$PATH"
```
#### Arch Linux / pacman & AUR
**libolm** is from the AUR, this example uses
[yay](https://github.com/Jguer/yay) to install it like other packages.
Alternatively, you can just use `pacman` and
[install libolm manually](#installing-libolm-manually).
```sh
yay -Syu qt5-base qt5-declarative qt5-quickcontrols2 qt5-svg \
qt5-graphicaleffects qt5-imageformats \
python python-pip \
python-pyotherside \
libolm \
base-devel git cmake \
libjpeg-turbo zlib libtiff libwebp openjpeg2 libmediainfo
```
#### Fedora 30+ / dnf
[PyOtherSide](#installing-pyotherside-manually) and
[libolm](#installing-libolm-manually) must be manually installed.
```sh
sudo dnf groupinstall 'Development Tools'
sudo dnf install qt5-devel qt5-qtbase qt5-qtdeclarative qt5-qtquickcontrols2 \
qt5-qtsvg qt5-qtgraphicaleffects qt5-qtimageformats \
python3-devel python3-pip \
git cmake \
libjpeg-turbo-devel zlib-devel libtiff-devel libwebp-devel \
openjpeg2-devel libmediainfo-devel
2020-03-21 05:11:47 +11:00
2020-03-20 10:13:08 +11:00
sudo ln -s /usr/bin/qmake-qt5 /usr/bin/qmake
```
2020-03-21 05:11:47 +11:00
#### Gentoo / emerge
[libolm](#installing-libolm-manually) must be manually installed.
You might need to prepend the `emerge` command with `USE=bindist`,
if `emerge` says so.
```sh
sudo emerge -av qtcore qtdeclarative qtquickcontrols2 \
qtsvg qtgraphicaleffects qtimageformats \
dev-python/pip pyotherside \
dev-vcs/git cmake \
libjpeg-turbo zlib tiff libwebp openjpeg libmediainfo
```
2020-03-20 10:13:08 +11:00
#### Ubuntu 19.04 / apt
[libolm](#installing-libolm-manually) must be manually installed.
```sh
sudo apt update
sudo apt install qt5-default qt5-qmake qt5-image-formats-plugins \
qml-module-qtquick2 qml-module-qtquick-window2 \
qml-module-qtquick-layouts qml-module-qtquick-dialogs \
qml-module-qt-labs-platform \
qtdeclarative5-dev \
qtquickcontrols2-5-dev \
python3-dev python3-pip \
qml-module:io-thp-pyotherside \
build-essential git cmake \
libjpeg-turbo8-dev zlib1g-dev libtiff5-dev libwebp-dev \
libopenjp2-7-dev libmediainfo-dev
```
#### Ubuntu 19.10+, Debian bullseye / apt
Follow the steps for [Ubuntu 19.04](#ubuntu-1904--apt), but instead of
installing libolm manually:
```sh
sudo apt install libolm-dev
```
#### Void Linux / xbps
[PyOtherSide](#installing-pyotherside-manually) must be manually installed.
```sh
sudo xbps-install -Su qt5-devel qt5-declarative-devel \
qt5-quickcontrols2-devel \
qt5-svg-devel qt5-graphicaleffects qt5-imageformats \
python3-devel python3-pip \
olm-devel \
base-devel git cmake \
libjpeg-turbo-devel zlib-devel tiff-devel libwebp-devel \
libopenjpeg2-devel libmediainfo-devel
```
2020-03-20 10:42:49 +11:00
### Installing PyOtherSide Manually
2020-03-20 10:13:08 +11:00
Skip this section if you already installed it from your
distro's package manager.
```sh
git clone https://github.com/thp/pyotherside
cd pyotherside
make clean
qmake
make
sudo make install
```
2020-03-20 10:42:49 +11:00
### Installing libolm Manually
2020-03-20 10:13:08 +11:00
Skip this section if you already installed it from your
distro's package manager.
```sh
git clone https://gitlab.matrix.org/matrix-org/olm/
cd olm
cmake . -Bbuild
cmake --build build
sudo make install
```
2020-03-27 22:06:38 +11:00
### Installing Mirage
2020-03-20 10:13:08 +11:00
After following the above sections instructions depending on your system,
clone the repository, install the python dependencies, compile and install:
```sh
2020-03-22 06:20:57 +11:00
git clone --recursive https://github.com/mirukana/mirage
2020-03-20 10:13:08 +11:00
cd mirage
pip3 install --user -Ur requirements.txt
pip3 install --user -U uvloop==0.14.0
qmake mirage.pro
make
sudo make install
```
`uvloop` brings performance improvements, but can be skipped
if you have trouble installing it.
If everything went fine, run `mirage` to start.
2020-03-27 22:06:38 +11:00
### Common Issues
2020-03-20 10:13:08 +11:00
2020-03-27 22:06:38 +11:00
#### cffi version mismatch
2020-03-20 10:13:08 +11:00
When installing the python dependencies, if you get a version mismatch error
related to `cffi`, try:
```sh
pip3 install --user --upgrade --force-reinstall cffi
```
2020-03-27 22:06:38 +11:00
#### Component is not ready
2020-03-20 10:13:08 +11:00
If the application doesn't start when you run `mirage` and shows a
`QQmlComponent: Component is not ready` message in the terminal,
a QML component failed to import due to either missing dependencies
or a programming error.
If PyOtherSide is correctly installed, you should see a similar message:
Got library name: "/usr/lib/qt5/qml/io/thp/pyotherside/libpyothersideplugin.so"
If not, verify the installed files and their permissions.
To ensure the correct permissions are set for the PyOtherSide plugin files:
sudo chmod -R 755 /usr/lib/qt5/qml/io
sudo chmod 644 /usr/lib/qt5/qml/io/thp/pyotherside/*
sudo chmod 755 /usr/lib/qt5/qml/io/thp/pyotherside/*.so
Note that the Qt lib path might be `/usr/lib/qt/` instead of `/usr/lib/qt5/`,
depending on the distro.