Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
44 changes: 1 addition & 43 deletions .github/workflows/build_flatpak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,57 +36,15 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Clone flatpak manifest from Flathub
uses: GuillaumeFalourd/clone-github-repo-action@v1
with:
owner: 'flathub'
repository: 'com.github.chipmuenk.pyfda'

- name: list
run: ls

- name: Replace git tag by the commit id on which it runs
if: github.ref_type != 'tag'
run: >
sed -i 's@\&git_tag .*@\&git_tag "${{ github.sha }}"@' com.github.chipmuenk.pyfda/com.github.chipmuenk.pyfda.yaml

- name: Use correct git tag
if: github.ref_type == 'tag'
run: >
sed -i 's@\&git_tag .*@\&git_tag "${{ github.ref_name }}"@' com.github.chipmuenk.pyfda/com.github.chipmuenk.pyfda.yaml

- name: Replace source url
run: >
sed -i "s@\&git_url .*pyfda.git@\&git_url $GITHUB_SERVER_URL/$GITHUB_REPOSITORY@" com.github.chipmuenk.pyfda/com.github.chipmuenk.pyfda.yaml

- name: Add dev build marker to cmake options
if: github.ref_type != 'tag'
run: >
sed -i 's@config-opts: \["\(.*\)"\]@config-opts: ["\1", "-DDEV_BUILD=${{ github.ref_name }}"]@' com.github.chipmuenk.pyfda/com.github.chipmuenk.pyfda.yaml

- name: Replace desktop file name suffix
if: github.ref_type != 'tag'
run: >
sed -i 's@desktop-file-name-suffix: ""@desktop-file-name-suffix: " (Development)"@' com.github.chipmuenk.pyfda/com.github.chipmuenk.pyfda.yaml

- name: Show Flatpak manifest
run: cat com.github.chipmuenk.pyfda/com.github.chipmuenk.pyfda.yaml

- name: Build package
uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v6
with:
bundle: com.github.chipmuenk.pyfda.flatpak
manifest-path: com.github.chipmuenk.pyfda/com.github.chipmuenk.pyfda.yaml
manifest-path: ressource/flatpak/com.github.chipmuenk.pyfda.yaml
cache: false
branch: development
# Uploaded /__w/pyfda/pyfda/com.github.chipmuenk.pyfda.flatpak

- name: Publish build artifacts
uses: actions/upload-artifact@v4
with:
path: com.github.chipmuenk.pyfda/*
name: pyfda_Flatpak

Validate_appdata_file:
name: Validate appdata file
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@ target/
*.blg
*.bib.bak
*.synctex
.flatpak-builder
1 change: 1 addition & 0 deletions ressource/flatpak/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
flatpak-builder --force-clean --repo=pyfdaRepo build com.github.chipmuenk.pyfda.yaml
44 changes: 44 additions & 0 deletions ressource/flatpak/com.github.chipmuenk.pyfda.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
app-id: com.github.chipmuenk.pyfda
runtime: org.kde.Platform
runtime-version: 6.6
sdk: org.kde.Sdk
base: com.riverbankcomputing.PyQt.BaseApp
base-version: 6.6
# when the runtime version changes, check if python version changed, because in pyqt5 the
# python version is hardcoded!
command: pyfdax
rename-icon: pyfda_icon #Image will renamed to match the app-id convention
rename-appdata-file: pyfda.appdata.xml
rename-desktop-file: pyfda.desktop
finish-args:
- --share=ipc
- --socket=wayland
- --socket=fallback-x11
- --device=dri
- --persist=.pyfda # so the configuration of different installations will not be overwritten

Parameters:
git_url: &git_url https://github.com/chipmuenk/pyfda.git
# set commit id here for stables on flathub
git_tag: &git_tag develop

modules:
# generated with https://github.com/flatpak/flatpak-builder-tools/tree/master/pip
- python3-pyfda.json

- name: pyfda
buildsystem: simple
build-commands:
- python3 setup.py install --prefix=${FLATPAK_DEST} --root=/ --optimize=1
- desktop-file-install --dir=/app/share/applications ressource/mime/applications/pyfda.desktop
- install -Dm755 ressource/linux/pyfda.appdata.xml /app/share/appdata/pyfda.appdata.xml
- install -Dm755 pyfda/images/icons/pyfda_icon_16.png /app/share/icons/hicolor/16x16/apps/pyfda_icon.png
- install -Dm755 pyfda/images/icons/pyfda_icon_32.png /app/share/icons/hicolor/32x32/apps/pyfda_icon.png
- install -Dm755 pyfda/images/icons/pyfda_icon_64.png /app/share/icons/hicolor/64x64/apps/pyfda_icon.png
- install -Dm755 pyfda/images/icons/pyfda_icon_128.png /app/share/icons/hicolor/128x128/apps/pyfda_icon.png
- install -Dm755 pyfda/images/icons/pyfda_icon_256.png /app/share/icons/hicolor/256x256/apps/pyfda_icon.png
- install -Dm755 pyfda/images/icons/pyfda_icon.svg /app/share/icons/hicolor/scalable/apps/pyfda_icon.svg
sources:
- type: git
url: *git_url
tag: *git_tag
3 changes: 3 additions & 0 deletions ressource/flatpak/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
flatpak remove com.github.chipmuenk.pyfda
flatpak remote-add pyfdaRepo pyfdaRepo --no-gpg-verify
flatpak install pyfdaRepo com.github.chipmuenk.pyfda
41 changes: 41 additions & 0 deletions ressource/flatpak/matplotlib-setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[metadata]
license_files = LICENSE/*

[egg_info]

[libs]
# By default, Matplotlib builds with LTO, which may be slow if you re-compile
# often, and don't need the space saving/speedup.
#enable_lto = True
# By default, Matplotlib downloads and builds its own copies of FreeType and of
# Qhull. You may set the following to True to instead link against a system
# FreeType/Qhull. As an exception, Matplotlib defaults to the system version
# of FreeType on AIX.
system_freetype = True
system_qhull = True

[packages]
# There are a number of data subpackages from Matplotlib that are
# considered optional. All except 'tests' data (meaning the baseline
# image files) are installed by default, but that can be changed here.
#tests = False

[gui_support]
# Matplotlib supports multiple GUI toolkits, known as backends.
# The MacOSX backend requires the Cocoa headers included with XCode.
# You can select whether to build it by uncommenting the following line.
# It is never built on Linux or Windows, regardless of the config value.
#
#macosx = True

[rc_options]
# User-configurable options
#
# Default backend, one of: Agg, Cairo, GTK3Agg, GTK3Cairo, MacOSX, Pdf, Ps,
# Qt4Agg, Qt5Agg, SVG, TkAgg, WX, WXAgg.
#
# The Agg, Ps, Pdf and SVG backends do not require external dependencies. Do
# not choose MacOSX if you have disabled the relevant extension modules. The
# default is determined by fallback.
#
#backend = Agg
30 changes: 30 additions & 0 deletions ressource/flatpak/pyqt5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "PyQt5",
"cleanup": ["/bin/sip", "/include", "/lib/python3.9/site-packages/*.pyi"],
"config-opts": ["--disable-static", "--enable-x11"],
"buildsystem": "simple",
"build-commands": [
"python3 configure.py --confirm-license --no-docstrings --assume-shared --no-sip-files --no-qml-plugin --no-tools --no-qsci-api -d ${FLATPAK_DEST}/lib/python3.9/site-packages --sip=${FLATPAK_DEST}/bin/sip --sip-incdir=${FLATPAK_DEST}/include --stubsdir=${FLATPAK_DEST}/lib/python3.9/site-packages --disable=QtSensors --disable=QtWebEngine --disable=QtQuick --disable=QtQml --disable=QtWebChannel --disable=QtWebEngineCore --disable=QWebEngineWidgets --disable=QtQuickWidgets --disable=QtSql --disable=QtXmlPatterns --disable=QtMultimedia --disable=QtMultimediaWidgets --disable=QtLocation --disable=QtDesigner --disable=QtOpenGL --disable=QtBluetooth --disable=QtWebKit --disable=QtWebKitWidgets --disable=QtNfc --disable=QtPositioning",
"make -j $FLATPAK_BUILDER_N_JOBS",
"make install"
],
"sources": [{
"type": "archive",
"url": "https://pypi.io/packages/source/P/PyQt5/PyQt5-5.15.4.tar.gz",
"sha256": "2a69597e0dd11caabe75fae133feca66387819fc9bc050f547e5551bce97e5be"
}],
"modules": [{
"name": "sip",
"buildsystem": "simple",
"build-commands": [
"python3 configure.py --sip-module PyQt5.sip -b ${FLATPAK_DEST}/bin -d ${FLATPAK_DEST}/lib/python3.9/site-packages -e ${FLATPAK_DEST}/include -v ${FLATPAK_DEST}/share/sip --stubsdir=${FLATPAK_DEST}/lib/python3.9/site-packages",
"make",
"make install"
],
"sources": [{
"type": "archive",
"url": "https://www.riverbankcomputing.com/static/Downloads/sip/4.19.25/sip-4.19.25.tar.gz",
"sha256": "b39d93e937647807bac23579edbff25fe46d16213f708370072574ab1f1b4211"
}]
}]
}
Loading