[gimp-data-extras] desktop: move the AppStream metadata from GIMP repository.



commit 28467cb7d891874aa5b0d18d94a02dde0896a926
Author: Jehan <jehan girinstud io>
Date:   Wed May 4 19:23:08 2022 +0200

    desktop: move the AppStream metadata from GIMP repository.
    
    As far as I can see, this metadata file was added in 2017. See the
    report: https://bugzilla.gnome.org/show_bug.cgi?id=763398
    (renamed recently into a proper AppStream ID)
    
    Unless I am missing something, it was created for the gimp-data-extras
    package, never for anything shipped within the main GIMP repo. The
    gimp-data-extras repo already existed back then, so I guess having
    pushed it to the main repo was a mistake (?). Therefore moving it to its
    rightful place so that this package gets proper metadata when listed in
    application catalogs.
    
    While doing this, also adding some initial localization. I know we are
    being told to drop intltool and this could be a good start to do it as
    the only localized data is this metadata, but I just wanted to make a
    very quick data move, no thinking. If anyone wishes to make the port to
    full-gettext (which is what various reports advises), we welcome merge
    requests!

 Makefile.am                                        |  2 +-
 autogen.sh                                         | 15 ++++++++
 configure.ac                                       | 42 ++++++++++++++++++++++
 desktop/Makefile.am                                | 27 ++++++++++++++
 .../org.gimp.GIMP.data_extras.metainfo.xml.in.in   | 13 +++++++
 desktop/test-appdata.sh.in                         | 12 +++++++
 po/.gitignore                                      |  4 +++
 po/POTFILES.in                                     |  6 ++++
 po/POTFILES.skip                                   |  6 ++++
 9 files changed, 126 insertions(+), 1 deletion(-)
---
diff --git a/Makefile.am b/Makefile.am
index 1ec62e6..22ba84d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,3 +1,3 @@
 ## Process this file with automake to produce Makefile.in
 
-SUBDIRS = brushes patterns scripts plug-ins
+SUBDIRS = brushes patterns scripts plug-ins desktop
diff --git a/autogen.sh b/autogen.sh
index 7605d93..cff7a45 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -131,6 +131,20 @@ if test x$AUTOMAKE != x; then
     check_version $VER $AUTOMAKE_REQUIRED_VERSION
 fi
 
+printf "checking for intltool >= $INTLTOOL_REQUIRED_VERSION ... "
+if (intltoolize --version) < /dev/null > /dev/null 2>&1; then
+    VER=`intltoolize --version \
+         | grep intltoolize | sed "s/.* \([0-9.]*\)/\1/"`
+    check_version $VER $INTLTOOL_REQUIRED_VERSION
+else
+    echo
+    echo "  You must have intltool installed to compile $PROJECT."
+    echo "  Get the latest version from"
+    echo "  ftp://ftp.gnome.org/pub/GNOME/sources/intltool/";
+    echo
+    DIE=1
+fi
+
 if test "$DIE" -eq 1; then
     echo
     echo "Please install/upgrade the missing tools and call me again."
@@ -192,6 +206,7 @@ fi
 $AUTOMAKE --add-missing || exit $?
 autoconf || exit $?
 
+intltoolize --automake || exit $?
 
 cd $ORIGDIR
 
diff --git a/configure.ac b/configure.ac
index 01eb998..b976a45 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,6 +8,8 @@ m4_define([gimp_data_extras_real_version],
           [gimp_data_extras_major_version.gimp_data_extras_minor_version.gimp_data_extras_micro_version])
 m4_define([gimp_data_extras_version], [gimp_data_extras_real_version])
 
+m4_define([intltool_required_version], [0.40.1])
+
 AC_INIT([GIMP Extra Data Files], [gimp_data_extras_version],
         [https://gitlab.gnome.org/GNOME/gimp-data-extras/issues/new],
         [gimp-data-extras])
@@ -17,6 +19,36 @@ AC_CONFIG_SRCDIR([brushes/Splatters/flower.gbr])
 AM_INIT_AUTOMAKE(no-define dist-bzip2)
 AM_MAINTAINER_MODE
 
+######################
+# Internationalisation
+######################
+
+IT_PROG_INTLTOOL(intltool_required_version)
+
+########################
+# Check for appstreamcli
+########################
+
+AC_ARG_WITH(appdata-test,  [  --without-appdata-test  do not validate the appdata file])
+
+have_appstreamcli="no (disabled)"
+if test "x$with_appdata_test" != "xno"; then
+  AC_PATH_PROG(APPSTREAM_UTIL, appstreamcli, no)
+  if test "x$APPSTREAM_UTIL" != "xno"; then
+    have_appstreamcli="yes"
+  else
+    have_appstreamcli="no (appstreamcli not found)"
+  fi
+fi
+AM_CONDITIONAL(HAVE_APPSTREAMCLI, test "x$have_appstreamcli" = "xyes")
+if test "x$have_appstreamcli" = "xyes"; then
+  have_appstreamcli="yes (this test requires network access; --without-appdata-test to disable)"
+fi
+
+################
+# Check for GIMP
+################
+
 AC_ARG_ENABLE(gimp3,
   [  --enable-gimp3          Install GIMP 2.99/3 data and plug-ins],,
   enable_gimp3=no)
@@ -49,11 +81,21 @@ brushes/Fun/Makefile
 brushes/Geometry/Makefile
 brushes/Splatters/Makefile
 brushes/Texture/Makefile
+desktop/Makefile
+desktop/org.gimp.GIMP.data_extras.metainfo.xml.in
+desktop/test-appdata.sh
 patterns/Makefile
 patterns/Legacy/Makefile
 plug-ins/Makefile
 plug-ins/python3/Makefile
+po/Makefile.in
 scripts/Makefile
 ])
 
 AC_OUTPUT
+
+AC_MSG_RESULT([
+Building gimp-data-extras with prefix=$prefix, datadir=$datadir
+
+Test appdata: $have_appstreamcli
+]);
diff --git a/desktop/Makefile.am b/desktop/Makefile.am
new file mode 100644
index 0000000..5fda387
--- /dev/null
+++ b/desktop/Makefile.am
@@ -0,0 +1,27 @@
+## Makefile.am for gimp-data-extras/desktop
+
+appstream_in_files = \
+       org.gimp.GIMP.data_extras.metainfo.xml.in
+
+appstream_files = $(appstream_in_files:.xml.in=.xml)
+
+appdatadir = $(datadir)/metainfo
+appdata_DATA = $(appstream_files)
+
+EXTRA_DIST = \
+       $(appstream_in_files) \
+       test-appdata.sh.in
+
+
+DISTCLEANFILES = $(appstream_files)
+
+@INTLTOOL_XML_RULE@
+
+TESTS_ENVIRONMENT = \
+       chmod +x test-appdata.sh; \
+       GIMP_TESTING_ABS_TOP_BUILDDIR=@abs_top_builddir@
+TESTS =
+
+if HAVE_APPSTREAMCLI
+TESTS += test-appdata.sh
+endif
diff --git a/desktop/org.gimp.GIMP.data_extras.metainfo.xml.in.in 
b/desktop/org.gimp.GIMP.data_extras.metainfo.xml.in.in
new file mode 100644
index 0000000..1251987
--- /dev/null
+++ b/desktop/org.gimp.GIMP.data_extras.metainfo.xml.in.in
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright 2015 Jiri Eischmann <eischmann redhat com> -->
+<component type="addon">
+  <id>org.gimp.GIMP.data_extras</id>
+  <extends>org.gimp.GIMP</extends>
+  <_name>Extra files for GIMP</_name>
+  <_summary>Patterns, gradients, and other extra files for GIMP</_summary>
+  <url type="homepage">https://www.gimp.org/</url>
+  <url type="bugtracker">@BUG_REPORT_URL@</url>
+  <metadata_license>CC0-1.0</metadata_license>
+  <project_license>GPL-3.0+</project_license>
+  <update_contact>alexandre prokoudine gmail com</update_contact>
+</component>
diff --git a/desktop/test-appdata.sh.in b/desktop/test-appdata.sh.in
new file mode 100755
index 0000000..641b8dd
--- /dev/null
+++ b/desktop/test-appdata.sh.in
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+appstreamcli validate ${GIMP_TESTING_ABS_TOP_BUILDDIR}/desktop/org.gimp.GIMP.data_extras.metainfo.xml && \
+if [ $(expr @GIMP_MICRO_VERSION@ % 2) = 0 ]; then
+  grep TODO ${GIMP_TESTING_ABS_TOP_BUILDDIR}/desktop/org.gimp.GIMP.appdata.xml
+  if [ $? = 0 ]; then
+    echo "ERROR: stable version with remaining TODOs in appdata."
+    false
+  fi
+else
+  true
+fi
diff --git a/po/.gitignore b/po/.gitignore
new file mode 100644
index 0000000..1d461e0
--- /dev/null
+++ b/po/.gitignore
@@ -0,0 +1,4 @@
+/Makefile
+/Makefile.in
+# Built by intltoolize in autogen.sh
+/Makefile.in.in
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 0000000..afb3233
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1,6 @@
+# Files from the Gimp distribution which have already been
+# marked to allow runtime translation of messages
+
+[encoding: UTF-8]
+
+desktop/org.gimp.GIMP.data_extras.metainfo.xml.in.in
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
new file mode 100644
index 0000000..37dc946
--- /dev/null
+++ b/po/POTFILES.skip
@@ -0,0 +1,6 @@
+brushes
+gradients
+palettes
+patterns
+plug-ins
+scripts


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]