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 Flatpak target and workflow #421

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
19 changes: 19 additions & 0 deletions .github/workflows/buildflatpak.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
on:
push:
branches: [master,flatpak]
pull_request:
name: flatpak build
jobs:
flatpak:
name: "Flatpak"
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:gnome-40
options: --privileged
steps:
- uses: actions/checkout@v2
- uses: flatpak/flatpak-github-actions/flatpak-builder@v5
with:
bundle: iio-oscilloscope.flatpak
manifest-path: CI/flatpak/app.yml
cache-key: flatpak-builder-${{ github.sha }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ adi-osc.desktop
org.adi.pkexec.osc.policy
osc-wrapper
.vscode
.flatpak-builder
CI/flatpak/repo
59 changes: 59 additions & 0 deletions CI/flatpak/app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
app-id: org.adi.IIO-Oscilloscope
runtime: org.gnome.Platform
runtime-version: '43'
command: osc
sdk: org.gnome.Sdk
rename-desktop-file: adi-osc.desktop
rename-icon: adi-osc
finish-args:
- --socket=x11
- --socket=wayland
- --share=network
- --share=ipc
- --device=all
- --system-talk-name=org.freedesktop.Avahi
- --filesystem=xdg-config/org.adi.IIO-Oscilloscope:create
tags:
- devel
- development
- nightly
cleanup:
- /include
- /lib/cmake
- /lib/pkgconfig
- /lib/debug
- /lib/girepository-*
- /share/pkgconfig
- /share/aclocal
- /man
- /share/man
- '*.la'
- '*.a'
- /share/doc
modules:
# -- gtk3 widgets
- deps/gtkdatabox.yml
# -- libaio
- deps/libaio.yml
# -- libiio
- deps/libxml2.yml
- deps/libusb.yml
- deps/intltool.yml
- deps/avahi.yml
- deps/libiio.yml
# -- libad*-iio
- deps/libad9166-iio.yml
- deps/libad9361-iio.yml
# -- jansson
- deps/jansson.yml
# -- matio
- deps/matio.yml
# -- app
- name: osc
buildsystem: cmake
builddir: true
sources:
- type: dir
path: ../../
config-opts:
- -D CMAKE_INSTALL_PREFIX=/app
18 changes: 18 additions & 0 deletions CI/flatpak/deps/avahi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: avahi
config-opts:
- --with-distro=none
- --disable-libdaemon
- --disable-core-docs
- --disable-manpages
- --disable-mono
- --disable-qt3
- --disable-qt4
- --disable-python
- --disable-gtk
- --disable-gtk3
cleanup:
- /lib/avahi
sources:
- type: archive
url: https://avahi.org/download/avahi-0.7.tar.gz
sha256: 57a99b5dfe7fdae794e3d1ee7a62973a368e91e414bd0dfa5d84434de5b14804
7 changes: 7 additions & 0 deletions CI/flatpak/deps/gtkdatabox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: gtkdatabox
cleanup:
- /lib/gtkdatabox-*
sources:
- type: archive
url: https://download.sourceforge.net/project/gtkdatabox/gtkdatabox-1/gtkdatabox-1.0.0.tar.gz
sha256: 8bee70206494a422ecfec9a88d32d914c50bb7a0c0e8fedc4512f5154aa9d3e3
5 changes: 5 additions & 0 deletions CI/flatpak/deps/intltool.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: intltool
sources:
- type: archive
url: https://launchpad.net/intltool/trunk/0.51.0/+download/intltool-0.51.0.tar.gz
md5: 12e517cac2b57a0121cda351570f1e63
7 changes: 7 additions & 0 deletions CI/flatpak/deps/jansson.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: jansson
cleanup:
- /lib/jansson-*
sources:
- type: archive
url: https://github.com/akheron/jansson/releases/download/v2.14/jansson-2.14.tar.gz
sha256: 5798d010e41cf8d76b66236cfb2f2543c8d082181d16bc3085ab49538d4b9929
8 changes: 8 additions & 0 deletions CI/flatpak/deps/libad9166-iio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: libad9166-iio
buildsystem: cmake
cleanup:
- /lib/ad9166-iio-*
sources:
- type: git
url: https://github.com/analogdevicesinc/libad9166-iio
branch: master
8 changes: 8 additions & 0 deletions CI/flatpak/deps/libad9361-iio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: libad9361-iio
buildsystem: cmake
cleanup:
- /lib/ad9361-iio-*
sources:
- type: git
url: https://github.com/analogdevicesinc/libad9361-iio
branch: master
9 changes: 9 additions & 0 deletions CI/flatpak/deps/libaio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: libaio
buildsystem: simple
build-commands:
- make prefix=$FLATPAK_DEST install
sources:
- type: git
url: https://pagure.io/libaio.git
tag: libaio-0.3.113
commit: 1b18bfafc6a2f7b9fa2c6be77a95afed8b7be448
14 changes: 14 additions & 0 deletions CI/flatpak/deps/libiio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: libiio
builddir: true
buildsystem: cmake
config-opts:
- -DCMAKE_INSTALL_PREFIX:PATH=/app
- -DCMAKE_INSTALL_LIBDIR:STRING=lib
- -DWITH_TESTS:BOOL=OFF
- -DWITH_DOC:BOOL=OFF
- -DWITH_IIOD:BOOL=OFF
- -DINSTALL_UDEV_RULE:BOOL=OFF
sources:
- type: git
url: https://github.com/analogdevicesinc/libiio
commit: v0.24
9 changes: 9 additions & 0 deletions CI/flatpak/deps/libusb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: libusb
config-opts:
- --disable-udev
- --prefix=/app
sources:
- type: archive
url: https://downloads.sourceforge.net/project/libusb/libusb-1.0/libusb-1.0.26/libusb-1.0.26.tar.bz2
sha256: 12ce7a61fc9854d1d2a1ffe095f7b5fac19ddba095c259e6067a46500381b5a5

7 changes: 7 additions & 0 deletions CI/flatpak/deps/libxml2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: libxml2
config-opts:
- --without-python
sources:
- type: archive
url: https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.9.tar.xz
sha256: 58a5c05a2951f8b47656b676ce1017921a29f6b1419c45e3baed0d6435ba03f5
7 changes: 7 additions & 0 deletions CI/flatpak/deps/matio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: matio
cleanup:
- /lib/matio-*
sources:
- type: archive
url: https://github.com/tbeu/matio/releases/download/v1.5.23/matio-1.5.23.tar.gz
sha256: 9f91eae661df46ea53c311a1b2dcff72051095b023c612d7cbfc09406c9f4d6e
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,11 @@ install(TARGETS oscmain RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

# Set default CMAKE_PREFIX_PATH to CMAKE_SYSTEM_PREFIX_PATH
set(CMAKE_PREFIX_PATH ${CMAKE_SYSTEM_PREFIX_PATH})

if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
# Flatpaks have policies defined in the yml manifest file
if (${CMAKE_INSTALL_PREFIX} MATCHES "/app")
set(IS_FLATPAK_CI ON)
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND NOT(IS_FLATPAK_CI))
configure_file(org.adi.pkexec.osc.policy.cmakein ${CMAKE_CURRENT_BINARY_DIR}/org.adi.pkexec.osc.policy @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.adi.pkexec.osc.policy
DESTINATION ${CMAKE_POLKIT_PREFIX}/${CMAKE_INSTALL_DATADIR}/polkit-1/actions/)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![windows-mingw build](https://github.com/analogdevicesinc/iio-oscilloscope/actions/workflows/buildmingw.yml/badge.svg?branch=master)](https://github.com/analogdevicesinc/iio-oscilloscope/actions/workflows/buildmingw.yml?query=branch%3Amaster+)
[![flatpak build](https://github.com/analogdevicesinc/iio-oscilloscope/actions/workflows/buildflatpak.yml/badge.svg?branch=master)](https://github.com/analogdevicesinc/iio-oscilloscope/actions/workflows/buildflatpak.yml?query=branch%3Amaster+)

IIO Oscilloscope [![GitHub Release](https://img.shields.io/github/release/analogdevicesinc/iio-oscilloscope.svg)](https://github.com/analogdevicesinc/iio-oscilloscope/releases/latest) [![Application License](https://img.shields.io/badge/license-GPL2-blue.svg)](https://github.com/analogdevicesinc/libiio/blob/master/COPYING_GPL.txt)
================
Expand Down