Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add files to allow generation of Flatpak packages. #600

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions flatpak/LPCNet-flatpak-support.patch
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per current project policy, having flatpak-builder patch LPCNet is preferable to opening a PR in this project as it will eventually become deprecated/obsolete.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Flatpak does not appear to provide the ability to copy lpcnet_191005_v1.0.tgz to the correct location in the unpatched version. Without this patch, CMake will attempt to download this file, which as mentioned in the PR's README, will fail in the Flatpak environment.)

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1600871..613cb09 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -169,10 +169,10 @@ set(LPCNET_ROOT http://rowetel.com/downloads/deep/)
set(LPCNET_FILE lpcnet_191005_v1.0.tgz)
set(LPCNET_URL ${LPCNET_ROOT}${LPCNET_FILE})

-if(EXISTS ${CMAKE_BINARY_DIR}/${LPCNET_FILE})
+if(EXISTS ${CMAKE_SOURCE_DIR}/${LPCNET_FILE})
set(lpcnet_SOURCE_DIR ${CMAKE_BINARY_DIR}/src)
file(MAKE_DIRECTORY ${lpcnet_SOURCE_DIR})
- execute_process(COMMAND tar -xzf ${CMAKE_BINARY_DIR}/${LPCNET_FILE} -C ${CMAKE_BINARY_DIR}/src)
+ execute_process(COMMAND tar -xzf ${CMAKE_SOURCE_DIR}/${LPCNET_FILE} -C ${CMAKE_BINARY_DIR}/src)

# Work around not having the FetchContent module.
elseif(CMAKE_VERSION VERSION_LESS 3.11.4)
37 changes: 37 additions & 0 deletions flatpak/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Flatpak packaging

This folder contains the files necessary to generate a Flatpak package for FreeDV. Flatpak
is a container-based packaging scheme available on most common Linux distros that enables
the generation of a single package that works on multiple systems with no modifications
required.

## Setting up a Flatpak build environment

Execute the following command (Debian/Ubuntu):

```
$ git config --global protocol.file.allow always
$ sudo apt install flatpak flatpak-builder gnome-software-plugin-flatpak
$ flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
$ flatpak install flathub org.freedesktop.Platform//23.08 org.freedesktop.Sdk//23.08
```

On other distros, the packages should be similar.

## Generating a Flatpak package

```
$ flatpak-builder flatpak-build org.freedv.freedv.yml
```

## Installing and testing the generated package

```
$ flatpak-builder --user --install --force-clean flatpak-build org.freedv.freedv.yml
$ flatpak run org.freedv.freedv
```

## Additional notes

The Flatpak build container has no network access, so any new dependencies added to FreeDV will
need to be downloaded and built as a separate module to ensure that the package can still be built.
71 changes: 71 additions & 0 deletions flatpak/org.freedv.freedv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
app-id: org.freedv.freedv
runtime: org.freedesktop.Platform
runtime-version: '23.08'
sdk: org.freedesktop.Sdk
command: freedv
finish-args:
- --share=network
- --socket=wayland
- --share=ipc
- --socket=fallback-x11
- --socket=pulseaudio
- --filesystem=home
modules:
- name: wxWidgets
buildsystem: cmake
builddir: true
sources:
- type: git
url: https://github.com/wxWidgets/wxWidgets
tag: v3.2.3
- name: LPCNet
buildsystem: cmake
builddir: true
sources:
- type: git
url: https://github.com/drowe67/LPCNet.git
tag: v0.5
- type: file
url: http://rowetel.com/downloads/deep/lpcnet_191005_v1.0.tgz
sha256: 509440924751fdd87ffaa5683ee3dddd937af5c833b9104ccce65d51614926c8
- type: patch
path: LPCNet-flatpak-support.patch
- name: codec2
buildsystem: cmake
builddir: true
modules:
- LPCNet
sources:
- type: git
url: https://github.com/drowe67/codec2.git
tag: 1.2.0
config-opts:
- -DLPCNET=ON
- name: hamlib
buildsystem: autotools
sources:
- type: git
url: https://github.com/Hamlib/Hamlib.git
tag: 4.5.5
- name: socketio-cpp
buildsystem: cmake
sources:
- type: git
url: https://github.com/socketio/socket.io-client-cpp.git
tag: master
config-opts:
- -DBUILD_TESTING=OFF
- name: freedv
buildsystem: cmake
builddir: true
modules:
- wxWidgets
- LPCNet
- codec2
- hamlib
- socketio-cpp
sources:
- type: git
url: https://github.com/drowe67/freedv-gui.git
tag: v1.9.4

Loading