Skip to content

Commit

Permalink
#625: prepare for flatpak (#647)
Browse files Browse the repository at this point in the history
  • Loading branch information
lidaobing authored Jan 1, 2025
1 parent f0224d4 commit 8e49691
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 3 deletions.
57 changes: 57 additions & 0 deletions scripts/flatpak/io.github.iptux_src.iptux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# snapcraft.yaml
name: iptux
version: 0.9.3
app-id: io.github.iptux_src.iptux
runtime: org.gnome.Platform
runtime-version: '46'
sdk: org.gnome.Sdk
command: iptux
finish-args:
- --share=network
- --share=ipc
- --socket=fallback-x11
- --socket=wayland
- --filesystem=home

modules:
- name: libsigc++
buildsystem: meson
sources:
- type: archive
url: https://download.gnome.org/sources/libsigc++/2.10/libsigc++-2.10.8.tar.xz
sha256: 235a40bec7346c7b82b6a8caae0456353dc06e71f14bc414bcc858af1838719a

- name: gflags
buildsystem: cmake-ninja
config-opts:
- -DCMAKE_BUILD_TYPE=Release
- -DBUILD_SHARED_LIBS=ON
sources:
- type: archive
url: https://github.com/gflags/gflags/archive/v2.2.2.tar.gz
sha256: 34af2f15cf7367513b352bdcd2493ab14ce43692d2dcd9dfc499492966c64dcf

- name: glog
buildsystem: cmake-ninja
config-opts:
- -DCMAKE_BUILD_TYPE=Release
- -DBUILD_SHARED_LIBS=ON
sources:
- type: archive
url: https://github.com/google/glog/archive/v0.6.0.tar.gz
sha256: 8a83bf982f37bb70825df71a9709fa90ea9f4447fb3c099e1d720a439d88bad6

- name: jsoncpp
buildsystem: meson
sources:
- type: archive
url: https://github.com/open-source-parsers/jsoncpp/archive/1.9.5.tar.gz
sha256: f409856e5920c18d0c2fb85276e24ee607d2a09b5e7d5f0a371368903c275da2

- name: iptux
buildsystem: meson
sources:
- type: dir
path: ../iptux
config-opts:
- --buildtype=release
1 change: 1 addition & 0 deletions share/meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
install_subdir('iptux', install_dir: 'share')
install_subdir('icons', install_dir: 'share')
install_subdir('appdata', install_dir: 'share')
subdir('metainfo')
15 changes: 12 additions & 3 deletions share/metainfo/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
metainfo_file = files('io.github.iptux_src.iptux.metainfo.xml')
ascli_exe = find_program('appstreamcli', required: true)
sed_exe = find_program('sed', required: true)

metainfo_with_relinfo = custom_target(
'gen-output',
Expand All @@ -21,11 +22,9 @@ i18n = import('i18n')

metainfo_i18n = i18n.merge_file(
input: metainfo_with_relinfo,
output: 'io.github.iptux_src.iptux.metainfo.xml',
output: 'io.github.iptux_src.iptux-with-icon.metainfo.xml',
type: 'xml',
po_dir: meson.source_root() / 'po',
install: true,
install_dir: get_option('datadir') / 'metainfo',
)

desktop_file = custom_target(
Expand All @@ -37,6 +36,16 @@ desktop_file = custom_target(
install_dir: join_paths(get_option('datadir'), 'applications'),
)

metainfo = custom_target(
'gen-metainfo',
input: metainfo_i18n,
output: ['io.github.iptux_src.iptux.metainfo.xml'],
capture: true,
command: [sed_exe, '/icon/d', '@INPUT@'],
install: true,
install_dir: get_option('datadir') / 'metainfo',
)

# Validate MetaInfo file
test(
'validate metainfo file',
Expand Down

0 comments on commit 8e49691

Please sign in to comment.