Added flatpak build manifests with split dependencies

Removed extra lines from build sequence

Added Dockerfile for Flatpak repo-server & Build instructions under docs/ dir

Modified Dockerfile & Flatpak build doc

updated docs

fixed code quality issues

fixed code quality, added doc string

fixed branch & added build commands

run setuptools

fixed code quality

refactor pip install

updated flatpak build doc & added link to index.rst

Removed extra lines from build sequence

Added Dockerfile for Flatpak repo-server & Build instructions under docs/ dir

Modified Dockerfile & Flatpak build doc

updated docs

fixed code quality issues

fixed code quality, added doc string

fixed branch & added build commands

run setuptools

fixed code quality

refactor pip install

updated flatpak build doc & added link to index.rst

fixed docs

rebased

removed unnecessary files

removed .gitmodules: should be part of build process
This commit is contained in:
cis-kuldeep 2021-04-27 23:08:18 +05:30 committed by kuldeep.k@cisinlabs.com
parent 971c79b3f5
commit f7f5457d46
No known key found for this signature in database
GPG Key ID: AF4FB299BF7C7C2A
4 changed files with 204 additions and 0 deletions

97
docs/Flatpak_Build.md Normal file
View File

@ -0,0 +1,97 @@
# PyBitmessage Linux flatpak instructions
## Requirements
First make sure you have `flatpak` and `flatpak-builder` installed along with these dependencies (Ubuntu 20.4) `git xz-utils elfutils librsvg2-common` needs to be installed.
Follow the instructions for your distribution on [flathub](https://flatpak.org/setup/). The instructions there only cover the installation of `flatpak`, but
`flatpak-builder` should be the same.
## Build and Install
Once you have `flatpak` and `flatpak-builder` installed:
Build and Install the Base App
```
git clone git://github.com/Bitmessage/PyBitmessage.git
cd PyBitmessage/
git submodule update --init --recursive
flatpak-builder --install --install-deps-from=flathub --force-clean --state-dir=build/.flatpak-builder build/_baseApp packages/flatpak/org.bitmessage.BaseApp.json
```
This will install the base app to your local flatpak user repository, it
takes a while to compile because Qt4 and PyQt4 have to be build, among others. But this is only required once.
Now Build and Install PyBitmessage App
```
flatpak-builder --install --install-deps-from=flathub --force-clean --state-dir=build/.flatpak-builder build/_PyBit packages/flatpak/org.bitmessage.PyBitmessage.json
```
# Run
When installation is done you can launch PyBitmessage via the **command line**:
`flatpak run org.bitmessage.PyBitmessage`
Flatpak also exports a `.desktop` file, so you should be able to find and launch
PyBitmessage via the **application launcher** of your Desktop (Gnome, KDE, ...).
# Export
You can create a single file "bundle", which allows you to copy and install the
PyBitmessage flatpak on other devices of the same architecture as the build machine.
## Create a local flatpak repository
```
flatpak-builder --repo=build/_flatpak_repo --force-clean --state-dir=build/.flatpak-builder build/_PyBit packages/flatpak/org.bitmessage.PyBitmessage.json
```
This will create a local flatpak repository in `build/_flatpak_repo/`.
## Hosting the repository
Place the `_flatpak_repo/` repo directory in the same directory as the dockerfile i.e `packages/flatpak/dockerfile`
Build and run the docker image
```
sudo docker build -t repo-server:latest .
sudo docker run -d -p 5000:5000 repo-server
```
## Installing PyBitmessage from repo-server
Add the repository
```
sudo flatpak remote-add --no-gpg-verify pybitmessage http://localhost:5000/repo
```
Install and Run the app
```
sudo flatpak install test org.bitmessage.PyBitmessage
flatpak run org.bitmessage.PyBitmessage
```
## Create a bundle
```
flatpak build-bundle build/_flatpak_repo build/pybitmessage.flatpak org.bitmessage.PyBitmessage
```
This will create a `pybitmessage.flatpak` bundle file in the `build/` directory.
This bundle can be copied to other systems or installed locally:
```
flatpak install pybitmessage.flatpak
```
The application can be run using flatpak:
```
flatpak run org.bitmessage.PyBitmessage
```
It can then be uninstalled with this command:
```
flatpak uninstall org.bitmessage.PyBitmessage
```
This way of building an application is very convenient when preparing flatpaks
for testing on another system of the same processor architecture.
## Cleanup
If you want to free up disk space you can remove the `Sdk` runtime again:
`flatpak uninstall org.freedesktop.Sdk//19.08`
You can also delete the `build` directory again.

View File

@ -1,4 +1,12 @@
.. mdinclude:: ../README.md
:end-line: 20
Build Instructions
------------------
.. toctree::
:maxdepth: 1
Flatpak_Build
Documentation
-------------

View File

@ -0,0 +1,57 @@
{
"id": "org.bitmessage.BaseApp",
"branch": "stable",
"runtime": "org.freedesktop.Platform",
"sdk": "org.freedesktop.Sdk",
"runtime-version": "19.08",
"separate-locales": false,
"modules": [
"shared-modules/python2.7/python-2.7.json",
"shared-modules/qt4/qt4-4.8.7-minimal.json",
{
"name": "python-sip",
"sources": [
{
"type": "archive",
"url": "https://www.riverbankcomputing.com/static/Downloads/sip/4.19.25/sip-4.19.25.tar.gz",
"sha256": "b39d93e937647807bac23579edbff25fe46d16213f708370072574ab1f1b4211"
}
],
"buildsystem": "simple",
"build-commands": [
"python configure.py --sip-module PyQt4.sip --no-dist-info",
"make",
"make install"
]
},
{
"name": "python-qt4",
"sources": [
{
"type": "archive",
"url": "http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.12.3/PyQt4_gpl_x11-4.12.3.tar.gz",
"sha256": "a00f5abef240a7b5852b7924fa5fdf5174569525dc076cd368a566619e56d472"
}
],
"buildsystem": "simple",
"build-commands": [
"python configure.py -w --confirm-license",
"make",
"make install"
]
},
{
"name" : "PyBitmessage-dependencies",
"buildsystem" : "simple",
"build-options": {
"build-args": [
"--share=network"
]
},
"build-commands": [
"pip --version",
"pip install setuptools msgpack six"
]
}
]
}

View File

@ -0,0 +1,42 @@
{
"app-id": "org.bitmessage.PyBitmessage",
"runtime": "org.freedesktop.Platform",
"runtime-version": "19.08",
"branch": "stable",
"sdk": "org.freedesktop.Sdk",
"base": "org.bitmessage.BaseApp",
"command": "pybitmessage",
"base-version":"stable",
"finish-args" : [
"--share=network",
"--socket=x11",
"--share=ipc",
"--filesystem=xdg-config/PyBitmessage:create"
],
"modules": [
{
"name" : "PyBitmessage",
"buildsystem" : "simple",
"build-options": {
"build-args": [
"--share=network"
]
},
"build-commands": [
"python setup.py install --prefix=/app --exec-prefix=/app",
"mv /app/share/applications/pybitmessage.desktop /app/share/applications/org.bitmessage.PyBitmessage.desktop",
"sed -i 's~Icon=pybitmessage~Icon=org.bitmessage.PyBitmessage~' /app/share/applications/org.bitmessage.PyBitmessage.desktop",
"mv /app/share/icons/hicolor/scalable/apps/pybitmessage.svg /app/share/icons/hicolor/scalable/apps/org.bitmessage.PyBitmessage.svg",
"mv /app/share/icons/hicolor/24x24/apps/pybitmessage.png /app/share/icons/hicolor/24x24/apps/org.bitmessage.PyBitmessage.png",
"which pybitmessage"
],
"sources" : [
{
"type" : "dir",
"path" : "../../"
}
]
}
]
}