Skip to content

Commit

Permalink
docs: flatpak readme (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gergely Gombos authored Sep 27, 2020
1 parent d2f5dbc commit 6b5b78d
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 59 deletions.
112 changes: 56 additions & 56 deletions BUILDING.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,64 @@
# Building AntiMicroX

- [Building AntiMicroX](#building-antimicrox)
- [Build Dependencies](#build-dependencies)
- [Building Under Linux](#building-under-linux)
- [Build Options for CMake](#build-options-for-cmake)
- [Universal Options](#universal-options)
- [Linux Options](#linux-options)
- [Building deb package](#building-deb-package)
- [Building AppImage](#building-appimage)
- [Running with Docker](#running-with-docker)
- [Building Flatpak](#building-flatpak)

## Build Dependencies

### Dependencies
This program is written in C++ using the [Qt](https://www.qt.io/)
framework. A C++ compiler and a proper C++ build environment will need to be installed on your system prior to building this program. Under Debian and Debian-based distributions like Ubuntu, the easiest way to get a base build environment set up is to install the meta-package **build-essential**. The following packages are required to be
installed on your system in order to build this program:

* g++
* cmake
* extra-cmake-modules
* qttools5-dev and qttools5-dev-tools (qt5-tools on distros based on Arch Linux) (Qt5 support)
* libsdl2-dev (sdl2 on distros based on Arch Linux) (SDL2)
* libxi-dev (libxi on distros based on Arch Linux) (Optional. Needed to compile with X11 and uinput support)
* libxtst-dev (libxtst on distros based on Arch Linux) (Optional. Needed to compile with XTest support)
* libx11-dev (libx11 on distros based on Arch Linux) (Needed to compile with Qt5 support)
* itstool (extracts messages from XML files and outputs PO template files, then merges translations from MO files to create translated XML files)
* gettext
* libqt5x11extras5-dev

<br/>
- `g++`
- `cmake`
- `extra-cmake-modules`
- `qttools5-dev` and `qttools5-dev-tools` (`qt5-tools` on distros based on Arch Linux) (Qt5 support)
- `libsdl2-dev` (`sdl2` on distros based on Arch Linux) (SDL2)
- `libxi-dev` (`libxi` on distros based on Arch Linux) (Optional. Needed to compile with X11 and uinput support)
- `libxtst-dev` (`libxtst` on distros based on Arch Linux) (Optional. Needed to compile with XTest support)
- `libx11-dev` (`libx11` on distros based on Arch Linux) (Needed to compile with Qt5 support)
- `itstool` (extracts messages from XML files and outputs PO template files, then merges translations from MO files to create translated XML files)
- `gettext`
- `libqt5x11extras5-dev`

### Building Under Linux
## Building Under Linux

In order to build this program, open a terminal and cd into the antimicrox
directory. Enter the following commands in order to build the program:

cd antimicrox
mkdir build && cd build
cmake ..
make
sudo make install

```bash
cd antimicrox
mkdir build && cd build
cmake ..
make
sudo make install
```

or

```
```bash
cd antimicrox
mkdir build && cd build
cmake --build .
sudo cmake --install .
```

#### Build Options for CMake
### Build Options for CMake

There are a few application specific options that can be used when running
cmake to build antimicrox. The following file will attempt to list some of those
options and describe their use in the project.


#### Universal Options
### Universal Options

-DUPDATE_TRANSLATIONS

Expand All @@ -62,9 +74,7 @@ command for qm files. -noobsolete is a method for getting rid of obsolete text e

Default: OFF. Allows for the launch of test sources with unit tests



#### Linux Options
### Linux Options

-DAPPDATA

Expand All @@ -82,31 +92,24 @@ Default: ON. Compile the program with X11 support.

Default: ON. Compile the program with XTest support.



#### Building deb package
## Building deb package

Already built .deb files are available on [Release Page](https://github.com/AntiMicroX/antimicrox/releases)

```bash
cd antimicrox
mkdir build && cd build
cmake .. -DCPACK_GENERATOR="DEB"
cmake --build . --target package
cd antimicrox
mkdir build && cd build
cmake .. -DCPACK_GENERATOR="DEB"
cmake --build . --target package
```


<br/>

#### Building AppImage
## Building AppImage

Create build directory
```bash
mkdir build && cd ./build
```

<br/>

Download tools used for creating appimages (and make them executable)
```bash
wget https://github.com/linuxdeploy/linuxdeploy/releases/downloacontinuous/linuxdeploy-x86_64.AppImage
Expand All @@ -117,36 +120,32 @@ chmod +x appimagetool-x86_64.AppImage
chmod +x linuxdeploy-plugin-qt-x86_64.AppImage
```

<br/>

Build antimicrox and install it in AppDir directory
```bash
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
make
make install DESTDIR=AppDir
```

<br/>

Create AppImage file
```bash
./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt
./appimagetool-x86_64.AppImage AppDir/ --no-appstream
```
<br/>

### Running with Docker
## Running with Docker

If you want to run application without building process and choose between various distributions, then [look here](https://hub.docker.com/r/juliagoda/antimicrox)
⚠ Warning: these Docker images are from the parent repo that we have forked from. See [#50](https://github.com/AntiMicroX/antimicrox/issues/50).

<br/>
If you want to run application without building process and choose between various distributions, then [look here](https://hub.docker.com/r/juliagoda/antimicrox).

All full tags variations:

- juliagoda/antimicrox:latest
- juliagoda/antimicrox:3.0-ubuntu-bionic
- juliagoda/antimicrox:3.0-fedora-latest
- juliagoda/antimicrox:3.0-suseleap15.2
- `juliagoda/antimicrox:latest`
- `juliagoda/antimicrox:3.0-ubuntu-bionic`
- `juliagoda/antimicrox:3.0-fedora-latest`
- `juliagoda/antimicrox:3.0-suseleap15.2`


Because the docker likes to replace the README on the docker hub website with this one. I need to add informations about how to run image:
Expand All @@ -161,15 +160,16 @@ where "3.0-ubuntu-bionic" is a tag and can be replaced by other chosen tag. Next

To finally run image:

`docker run -it -e DISPLAY=unix$DISPLAY --mount type=bind,source=/dev/input,target=/dev/input --device /dev/input --mount type=bind,source=/home/$USER,target=/home/$USER --net=host -e HOME=$HOME --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" --device /dev/dri:/dev/dri --workdir=$HOME antimicrox:3.0-ubuntu-bionic`
```
docker run -it -e DISPLAY=unix$DISPLAY --mount type=bind,source=/dev/input,target=/dev/input --device /dev/input --mount type=bind,source=/home/$USER,target=/home/$USER --net=host -e HOME=$HOME --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" --device /dev/dri:/dev/dri --workdir=$HOME antimicrox:3.0-ubuntu-bionic
```

This allows the use your files from your home directory and the use of your connected devices without other workarounds

<br/>

### Building Flatpak
## Building Flatpak

The command builds the package into the `build` folder and installs the resulting flatpak. Flathub submission is in progress.
The command builds the package into the `build` folder and installs the created flatpak.
The Flathub manifest can be located in [Flathub's Github repo](https://github.com/flathub/io.github.antimicrox.antimicrox).

```bash
flatpak install flathub org.kde.Platform//5.11 org.kde.Sdk//5.11
Expand Down
11 changes: 8 additions & 3 deletions other/io.github.antimicrox.antimicrox.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Maintained on Flathub at https://github.com/flathub/io.github.antimicrox.antimicrox

app-id: io.github.antimicrox.antimicrox
runtime: org.kde.Platform
runtime-version: '5.11'
Expand All @@ -7,7 +9,6 @@ finish-args:
# X11 + XShm access
- --share=ipc
- --socket=x11
- --device=dri
# Gamepads
- --device=all

Expand All @@ -20,5 +21,9 @@ modules:
sources:
- type: git
url: https://github.com/AntiMicroX/antimicrox.git
tag: 3.1
commit: 58cbb66bb4e079ca3e08de991ebed6a51d755426
# Build top commit of master branch
branch: master
# You can also set a tag and/or commit to build
# tag: 3.xx
# commit: xxx

0 comments on commit 6b5b78d

Please sign in to comment.