Skip to content

Commit

Permalink
Convert Appstream metainfo to static file and install it
Browse files Browse the repository at this point in the history
  • Loading branch information
oskirby committed Aug 27, 2024
1 parent 305dbef commit 261cd60
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 150 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/flatpak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,29 @@ jobs:
with:
path: src
sparse-checkout: |
linux/flatpak
linux/
Cargo.lock
- name: Checkout tools
uses: actions/checkout@v4
with:
repository: flatpak/flatpak-builder-tools
path: tools

- name: Install pip tools
shell: bash
run: pip install requirements-parser PyYAML toml aiohttp yq python-dateutil
run: pip install requirements-parser PyYAML toml aiohttp yq

- name: Update Cargo dependencies
shell: bash
run: src/linux/flatpak/flatpak-update-crates.sh src/Cargo.lock

- name: Generate Appstream metainfo
- name: Fetch Appstream metainfo
shell: bash
working-directory: src/linux/flatpak
run: ./appstream-metainfo.sh | tee org.mozilla.vpn.metainfo.xml
run: |
cp src/linux/extra/org.mozilla.vpn.metainfo.xml src/linux/flatpak/
curl -sSL -o src/linux/flatpak/org.mozilla.vpn.releases.xml \
https://mozilla.github.io/mozillavpn-product-details/org.mozilla.vpn.releases.xml
- name: Update git reference
shell: bash
Expand Down Expand Up @@ -80,7 +82,7 @@ jobs:
sudo apt-get install flatpak flatpak-builder -y
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install --user flathub -y org.flatpak.Builder
- name: Run Manifest Linters
shell: bash
run: flatpak run --command=flatpak-builder-lint org.flatpak.Builder manifest manifest/org.mozilla.vpn.yml
Expand Down
5 changes: 1 addition & 4 deletions linux/flatpak/appstream-metainfo.sh → linux/extra/org.mozilla.vpn.metainfo.xml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/sh
cat << EOF
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>org.mozilla.vpn</id>
Expand All @@ -15,7 +13,7 @@ cat << EOF
<name>Mozilla Corporation</name>
</developer>

$(python $(dirname $0)/appstream-releases.py | sed s'/^/ /g')
<releases type="external" url="https://mozilla.github.io/mozillavpn-product-details/org.mozilla.vpn.releases.xml" />

<url type="homepage">https://vpn.mozilla.org</url>
<url type="vcs-browser">https://github.com/mozilla-mobile/mozilla-vpn-client</url>
Expand All @@ -35,4 +33,3 @@ $(python $(dirname $0)/appstream-releases.py | sed s'/^/ /g')

<launchable type="desktop-id">org.mozilla.vpn.desktop</launchable>
</component>
EOF
138 changes: 0 additions & 138 deletions linux/flatpak/appstream-releases.py

This file was deleted.

1 change: 1 addition & 0 deletions linux/flatpak/org.mozilla.vpn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ modules:
- flatpak-glean-parser.yaml
- flatpak-libnm.yaml
- flatpak-qt5compat.yaml

- name: mozillavpn
buildsystem: cmake-ninja
config-opts:
Expand Down
3 changes: 3 additions & 0 deletions src/cmake/linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ configure_file(${CMAKE_SOURCE_DIR}/linux/extra/org.mozilla.vpn.desktop.in
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.mozilla.vpn.desktop
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)

install(FILES ${CMAKE_SOURCE_DIR}/linux/extra/org.mozilla.vpn.metainfo.xml
DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)

install(FILES ${CMAKE_SOURCE_DIR}/linux/extra/icons/16x16/org.mozilla.vpn.png
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/16x16/apps)

Expand Down

0 comments on commit 261cd60

Please sign in to comment.