Skip to content

Commit

Permalink
flatpak: automatically add <release> tag to LinGui appdata
Browse files Browse the repository at this point in the history
Also add translation support for appdata
  • Loading branch information
jstebbins committed Jun 7, 2018
1 parent 7f59018 commit 1424cd4
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 22 deletions.
1 change: 1 addition & 0 deletions gtk/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ esac
PKG_PROG_PKG_CONFIG

#PKG_CHECK_MODULES([GHB_GTK_4_0], [gtk+-4.0 >= 3.92], [HAVE_GTK_400=1], [HAVE_GTK_400=0])
HAVE_GTK_400=0
PKG_CHECK_MODULES([GHB_GTK_3_16], [gtk+-3.0 >= 3.16], [HAVE_GTK_316=1], [HAVE_GTK_316=0])
PKG_CHECK_MODULES([GHB_GTK_3_14], [gtk+-3.0 >= 3.14], [HAVE_GTK_314=1], [HAVE_GTK_314=0])
PKG_CHECK_MODULES([GHB_GTK_3_12], [gtk+-3.0 >= 3.12], [HAVE_GTK_312=1], [HAVE_GTK_312=0])
Expand Down
2 changes: 2 additions & 0 deletions gtk/module.defs
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ endif
ifeq (1,$(FEATURE.flatpak))
GTK.CONFIGURE.extra += --enable-flatpak
endif

export HB.version HB.repo.date
22 changes: 14 additions & 8 deletions gtk/src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,21 @@ icons_dep = \
if GHB_FLATPAK
icons += fr.handbrake.ghb.svg
hb_menu = fr.handbrake.ghb.desktop
flatpak_appdata = fr.handbrake.ghb.appdata.xml
else
hb_menu = ghb.desktop
endif

@INTLTOOL_XML_RULE@
appdatadir = $(datarootdir)/metainfo
appdata_in_files = fr.handbrake.ghb.appdata.xml.in
appdata_DATA = $(appdata_in_files:.xml.in=.xml)
dist_appdata_DATA = $(appdata_files)

EXTRA_DIST = \
$(appdata_in_files)

DISTCLEANFILES = \
$(appdata_files)

AM_CPPFLAGS = \
-DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
Expand Down Expand Up @@ -167,6 +177,9 @@ widget_reverse.deps: makedeps.py
widget.deps: makedeps.py
python2 $(srcdir)/makedeps.py

fr.handbrake.ghb.appdata.xml.in: fr.handbrake.ghb.appdata.xml.template
sed -e 's^RELEASE_TAG^<release version="$(HB.version)" date="$(word 1,$(HB.repo.date))" />^' $< > $@

ghbcellrenderertext.$(OBJEXT): marshalers.h

$(srcdir)/marshalers.h: marshalers.list
Expand All @@ -189,9 +202,6 @@ uninstall-local:
echo "*** $(gtk_update_icon_cache)"; \
fi
rm -f $(DESTDIR)/$(datadir)/applications/$(hb_menu)
@-if test -n "$(flatpak_appdata)"; then \
rm -f $(DESTDIR)/$(datadir)/metainfo/$(flatpak_appdata); \
fi

install-data-local:
for icon in $(icons); do \
Expand All @@ -207,7 +217,3 @@ install-data-local:
fi
mkdir -p $(DESTDIR)/$(datadir)/applications/; \
$(INSTALL_DATA) $(srcdir)/$(hb_menu) $(DESTDIR)/$(datadir)/applications/$(hb_menu)
@-if test -n "$(flatpak_appdata)"; then \
mkdir -p $(DESTDIR)/$(datadir)/metainfo/; \
$(INSTALL_DATA) $(srcdir)/$(flatpak_appdata) $(DESTDIR)/$(datadir)/metainfo/$(flatpak_appdata); \
fi
31 changes: 17 additions & 14 deletions gtk/src/fr.handbrake.ghb.appdata.xml.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@
<!-- Copyright 2018 John Stebbins <[email protected]> -->
<component type="desktop-application">
<id>fr.handbrake.ghb</id>
<translation>ghb</translation>
<update_contact>jstebbins.hb_AT_gmail.com</update_contact>
<launchable type="desktop-id">fr.handbrake.ghb.desktop</launchable>
<metadata_license>CC0</metadata_license>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-2.0+</project_license>
<name>HandBrake</name>
<summary>Video Transcoder</summary>
<_name>HandBrake</_name>
<_summary>Video Transcoder</_summary>

<description>
<p>
HandBrake is a tool for converting video from nearly any format to a
selection of modern, widely supported codecs.
</p>
<p>Reasons you'll love Handbrake:</p>
<_p>HandBrake is a tool for converting video from nearly any format to a selection of modern, widely supported codecs.</_p>
<_p>Reasons you'll love Handbrake:</_p>
<ul>
<li>Convert video from nearly any format</li>
<li>Free and Open Source</li>
<li>Multi-Platform (Windows, Mac and Linux)</li>
<_li>Convert video from nearly any format</_li>
<_li>Free and Open Source</_li>
<_li>Multi-Platform (Windows, Mac and Linux)</_li>
</ul>
</description>

Expand Down Expand Up @@ -60,21 +59,25 @@
<screenshots>
<screenshot type="default">
<image>https://handbrake.fr/img/slides/slide1_lin.jpg</image>
<caption>Main window and settings summary</caption>
<_caption>Main window and settings summary</_caption>
</screenshot>
<screenshot>
<image>https://handbrake.fr/img/slides/slide2_lin.jpg</image>
<caption>Video encoder settings</caption>
<_caption>Video encoder settings</_caption>
</screenshot>
<screenshot>
<image>https://handbrake.fr/img/slides/slide3_lin.jpg</image>
<caption>Audio track selection and settings</caption>
<_caption>Audio track selection and settings</_caption>
</screenshot>
</screenshots>

<provides>
<binary>ghb</binary>
</provides>

<releases>
RELEASE_TAG
</releases>

</component>

0 comments on commit 1424cd4

Please sign in to comment.