[gnome-screenshot] Drop intltool and clean up the build
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-screenshot] Drop intltool and clean up the build
- Date: Mon, 29 May 2017 12:54:56 +0000 (UTC)
commit 696d2ba80f3f2ea896088018da1359fb069812d6
Author: Emmanuele Bassi <ebassi gnome org>
Date: Mon May 29 13:14:24 2017 +0100
Drop intltool and clean up the build
We can use upstream gettext for everything we ship, these days.
While switching away from intltool I realised that the appdata XML we
ship is *ancient* and full of deprecated tags — to the point that
gettext's own ITS translation rules were unable to work with it; the
only reason intltool works is because it does not do any validation.
README.md | 12 +++
autogen.sh | 1 -
configure.ac | 39 ++++----
po/Makevars | 78 +++++++++++++++
po/POTFILES.in | 8 +-
src/Makefile.am | 101 ++++++++++----------
src/org.gnome.Screenshot.desktop.in | 10 +-
...xml.in => org.gnome.Screenshot.metainfo.xml.in} | 27 +++--
src/org.gnome.Screenshot.service.in | 3 +
9 files changed, 189 insertions(+), 90 deletions(-)
---
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..075779e
--- /dev/null
+++ b/README.md
@@ -0,0 +1,12 @@
+GNOME Screenshot
+================
+
+GNOME Screenshot is a small utility that takes a screenshot of the whole
+desktop; the currently focused window; or an area of the screen.
+
+### Dependencies
+
+ - GLib 2.36
+ - GTK+ 3.0
+ - libcanberra-gtk3
+ - X11
diff --git a/autogen.sh b/autogen.sh
index fa7f5a6..56b7d0a 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -23,7 +23,6 @@ if [ "$#" = 0 -a "x$NOCONFIGURE" = "x" ]; then
fi
aclocal --install || exit 1
-intltoolize --force --copy --automake || exit 1
autoreconf --verbose --force --install || exit 1
cd "$olddir"
diff --git a/configure.ac b/configure.ac
index 268347e..9812a41 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,19 +1,25 @@
dnl -*- mode: m4 -*-
AC_PREREQ(2.63)
-AC_INIT([gnome-screenshot],[3.23.0],[],[gnome-screenshot])
+AC_INIT([gnome-screenshot],
+ [3.23.0],
+ [https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-screenshot],
+ [gnome-screenshot])
-AC_CONFIG_HEADERS(config.h)
+AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
-AM_INIT_AUTOMAKE([1.11 dist-xz no-dist-gzip foreign])
+AM_INIT_AUTOMAKE([1.13 -Wno-portability subdir-objects dist-xz no-dist-gzip foreign])
AM_SILENT_RULES([yes])
+AM_MAINTAINER_MODE([enable])
+AM_GNU_GETTEXT_VERSION([0.19.8])
+AM_GNU_GETTEXT([external])
GETTEXT_PACKAGE=AC_PACKAGE_NAME
AC_SUBST(GETTEXT_PACKAGE)
-AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The name of the gettext domain])
-IT_PROG_INTLTOOL(0.50.2)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [The name of the gettext domain])
-AC_PROG_CC
+AC_PROG_CC_C99
+AC_PROG_SED
AM_PROG_CC_C_O
GLIB_GSETTINGS
@@ -22,15 +28,12 @@ GLIB_MIN_VERSION=2.35.1
GTK_MIN_VERSION=3.0.0
msg_xshape=no
-PKG_CHECK_MODULES([XSHAPE],
- [xext x11],
- [
- AC_CHECK_HEADERS([X11/extensions/shape.h],
- [
- XSHAPE_LIBS="-lXext -lX11"
- msg_xshape=yes
- ])
- ])
+PKG_CHECK_MODULES([XSHAPE], [xext x11], [
+ AC_CHECK_HEADERS([X11/extensions/shape.h], [
+ XSHAPE_LIBS="-lXext -lX11"
+ msg_xshape=yes
+ ])
+])
AC_SUBST(XSHAPE_LIBS)
PKG_CHECK_MODULES(SCREENSHOT,
@@ -39,9 +42,9 @@ PKG_CHECK_MODULES(SCREENSHOT,
libcanberra-gtk3)
AC_CONFIG_FILES([
-Makefile
-src/Makefile
-po/Makefile.in
+ Makefile
+ src/Makefile
+ po/Makefile.in
])
AC_OUTPUT
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 0000000..1452c4e
--- /dev/null
+++ b/po/Makevars
@@ -0,0 +1,78 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2
--keyword=g_dngettext:2,3 --add-comments
+
+# This is the copyright holder that gets inserted into the header of the
+# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
+# package. (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.) Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright. The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = GNOME Screenshot authors
+
+# This tells whether or not to prepend "GNU " prefix to the package
+# name that gets inserted into the header of the $(DOMAIN).pot file.
+# Possible values are "yes", "no", or empty. If it is empty, try to
+# detect it automatically by scanning the files in $(top_srcdir) for
+# "GNU packagename" string.
+PACKAGE_GNU = no
+
+# This is the email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+# in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+# understood.
+# - Strings which make invalid assumptions about notation of date, time or
+# money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS =
https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-screenshot&keywords=I18N+L10N&component=general
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used. It is usually empty.
+EXTRA_LOCALE_CATEGORIES =
+
+# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
+# context. Possible values are "yes" and "no". Set this to yes if the
+# package uses functions taking also a message context, like pgettext(), or
+# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
+USE_MSGCTXT = no
+
+# These options get passed to msgmerge.
+# Useful options are in particular:
+# --previous to keep previous msgids of translated messages,
+# --quiet to reduce the verbosity.
+MSGMERGE_OPTIONS =
+
+# These options get passed to msginit.
+# If you want to disable line wrapping when writing PO files, add
+# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and
+# MSGINIT_OPTIONS.
+MSGINIT_OPTIONS =
+
+# This tells whether or not to regenerate a PO file when $(DOMAIN).pot
+# has changed. Possible values are "yes" and "no". Set this to no if
+# the POT file is checked in the repository and the version control
+# program ignores timestamps.
+PO_DEPENDS_ON_POT = yes
+
+# This tells whether or not to forcibly update $(DOMAIN).pot and
+# regenerate PO files on "make dist". Possible values are "yes" and
+# "no". Set this to no if the POT file and PO files are maintained
+# externally.
+DIST_DEPENDS_ON_UPDATE_PO = yes
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 54698f5..7ba43c6 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,14 +1,14 @@
# List of source files containing translatable strings.
# Please keep this file sorted alphabetically.
src/gnome-screenshot.c
-src/org.gnome.Screenshot.desktop.in
-src/org.gnome.Screenshot.appdata.xml.in
-[type: gettext/glade]src/screenshot-app-menu.ui
-[type: gettext/glade]src/screenshot-dialog.ui
src/org.gnome.gnome-screenshot.gschema.xml
+src/org.gnome.Screenshot.desktop.in
+src/org.gnome.Screenshot.metainfo.xml.in
+src/screenshot-app-menu.ui
src/screenshot-application.c
src/screenshot-config.c
src/screenshot-dialog.c
+src/screenshot-dialog.ui
src/screenshot-filename-builder.c
src/screenshot-interactive-dialog.c
src/screenshot-shadow.c
diff --git a/src/Makefile.am b/src/Makefile.am
index 15f5170..89d156f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,26 +1,40 @@
-NULL =
+EXTRA_DIST =
+CLEANFILES =
+DISTCLEANFILES =
AM_CPPFLAGS = \
- -I. \
- -I$(srcdir) \
+ -I$(top_builddir)/src \
+ -I$(top_srcdir)/src \
-DLOCALEDIR=\"$(localedir)\" \
- -DUIDIR=\"$(uidir)\" \
- $(NULL)
+ -DGLIB_DISABLE_DEPRECATION_WARNINGS \
+ -DGDK_DISABLE_DEPRECATION_WARNINGS \
+ $()
-bin_PROGRAMS = \
- gnome-screenshot \
- $(NULL)
+bin_PROGRAMS = gnome-screenshot
+
+BUILT_SOURCES = \
+ screenshot-resources.c \
+ screenshot-resources.h \
+ $()
resource_files = $(shell glib-compile-resources --sourcedir=$(srcdir) --generate-dependencies
$(srcdir)/gnome-screenshot.gresource.xml)
screenshot-resources.c: gnome-screenshot.gresource.xml $(resource_files)
- $(AM_V_GEN)glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-source --c-name
screenshot $(srcdir)/gnome-screenshot.gresource.xml
+ $(AM_V_GEN) glib-compile-resources \
+ --target=$@ \
+ --sourcedir=$(srcdir) \
+ --generate-source \
+ --c-name screenshot \
+ $(srcdir)/gnome-screenshot.gresource.xml
screenshot-resources.h: gnome-screenshot.gresource.xml $(resource_files)
- $(AM_V_GEN)glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-header --c-name
screenshot $(srcdir)/gnome-screenshot.gresource.xml
+ $(AM_V_GEN) glib-compile-resources \
+ --target=$@ \
+ --sourcedir=$(srcdir) \
+ --generate-header \
+ --c-name screenshot \
+ $(srcdir)/gnome-screenshot.gresource.xml
-BUILT_SOURCES = \
- screenshot-resources.c \
- screenshot-resources.h \
- $(NULL)
+EXTRA_DIST += gnome-screenshot.gresource.xml
+CLEANFILES += screenshot-resources.c screenshot-resources.h
gnome_screenshot_SOURCES = \
$(BUILT_SOURCES) \
@@ -43,63 +57,48 @@ gnome_screenshot_SOURCES = \
screenshot-shadow.h \
screenshot-utils.c \
screenshot-utils.h \
- $(NULL)
+ $()
gnome_screenshot_CFLAGS = \
$(SCREENSHOT_CFLAGS) \
$(XSHAPE_CFLAGS) \
- $(NULL)
+ $()
gnome_screenshot_LDADD = \
$(SCREENSHOT_LIBS) \
$(XSHAPE_LIBS) \
-lm \
- $(NULL)
+ $()
gnome_screenshotdir = $(datadir)/applications
gnome_screenshot_in_files = org.gnome.Screenshot.desktop.in
gnome_screenshot_DATA = $(gnome_screenshot_in_files:.desktop.in=.desktop)
-@INTLTOOL_DESKTOP_RULE@
+org.gnome.Screenshot.desktop: $(gnome_screenshot_in_files)
+ $(AM_V_GEN)$(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
+CLEANFILES += $(gnome_screenshot_DATA)
+EXTRA_DIST += $(gnome_screenshot_in_files)
-appdatadir = $(datadir)/appdata
+appdatadir = $(datadir)/metainfo
appdata_DATA = $(appdata_in_files:.xml.in=.xml)
-appdata_in_files = org.gnome.Screenshot.appdata.xml.in
-@INTLTOOL_XML_RULE@
+appdata_in_files = org.gnome.Screenshot.metainfo.xml.in
+org.gnome.Screenshot.metainfo.xml: $(appdata_in_files)
+ $(AM_V_GEN)$(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
+CLEANFILES += $(appdata_DATA)
+EXTRA_DIST += $(appdata_in_files)
dbusservicedir = $(datadir)/dbus-1/services
-dbusservice_DATA = org.gnome.Screenshot.service
-
-org.gnome.Screenshot.service: Makefile
- $(AM_V_GEN) (echo '[D-BUS Service]'; \
- echo 'Name=org.gnome.Screenshot'; \
- echo 'Exec=${bindir}/gnome-screenshot --gapplication-service') > $@.tmp && \
- mv $@.tmp $@
-
-man_MANS = gnome-screenshot.1
+dbusservice_in_files = org.gnome.Screenshot.service.in
+dbusservice_DATA = $(dbusservice_in_files:.service.in=.service)
+org.gnome.Screenshot.service: $(dbusservice_in_files)
+ $(AM_V_GEN) $(SED) -e 's|\@bindir\@|@bindir@|' $< > $@
+CLEANFILES += $(dbusservice_DATA)
+EXTRA_DIST += $(dbusservice_in_files)
gsettings_SCHEMAS = org.gnome.gnome-screenshot.gschema.xml
+EXTRA_DIST += $(gsettings_SCHEMAS)
+@GSETTINGS_RULES@
convertdir = $(datadir)/GConf/gsettings
convert_DATA = gnome-screenshot.convert
-@GSETTINGS_RULES@
-
-EXTRA_DIST = \
- $(appdata_in_files) \
- $(gsettings_SCHEMAS) \
- $(gnome_screenshot_in_files) \
- $(man_MANS) \
- $(convert_DATA) \
- $(resource_files) \
- gnome-screenshot.gresource.xml \
- $(NULL)
-
-CLEANFILES = \
- $(BUILT_SOURCES) \
- $(appdata_DATA) \
- $(gnome_screenshot_DATA) \
- $(dbusservice_DATA) \
- $(NULL)
-
-dist-hook:
- cd $(distdir) ; rm -f $(CLEANFILES)
+man_MANS = gnome-screenshot.1
diff --git a/src/org.gnome.Screenshot.desktop.in b/src/org.gnome.Screenshot.desktop.in
index fc64e1b..434b658 100644
--- a/src/org.gnome.Screenshot.desktop.in
+++ b/src/org.gnome.Screenshot.desktop.in
@@ -1,7 +1,7 @@
[Desktop Entry]
-_Name=Screenshot
-_Comment=Save images of your screen or individual windows
-_Keywords=snapshot;capture;print;screenshot;
+Name=Screenshot
+Comment=Save images of your screen or individual windows
+Keywords=snapshot;capture;print;screenshot;
Exec=gnome-screenshot --interactive
Terminal=false
Type=Application
@@ -16,9 +16,9 @@ Actions=screen-shot;window-shot;
DBusActivatable=true
[Desktop Action screen-shot]
-_Name=Take a Screenshot of the Whole Screen
+Name=Take a Screenshot of the Whole Screen
Exec=gnome-screenshot
[Desktop Action window-shot]
-_Name=Take a Screenshot of the Current Window
+Name=Take a Screenshot of the Current Window
Exec=gnome-screenshot -w
diff --git a/src/org.gnome.Screenshot.appdata.xml.in b/src/org.gnome.Screenshot.metainfo.xml.in
similarity index 66%
rename from src/org.gnome.Screenshot.appdata.xml.in
rename to src/org.gnome.Screenshot.metainfo.xml.in
index 52fdcd8..f42cdc0 100644
--- a/src/org.gnome.Screenshot.appdata.xml.in
+++ b/src/org.gnome.Screenshot.metainfo.xml.in
@@ -1,37 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2014 Richard Hughes <richard hughsie com> -->
-<application>
- <id type="desktop">org.gnome.Screenshot.desktop</id>
+<component type="desktop">
+ <id>org.gnome.Screenshot.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
- <_name>GNOME Screenshot</_name>
- <_summary>Save images of your screen or individual windows</_summary>
+ <project_license>GPL-2.0+</project_license>
+ <name>GNOME Screenshot</name>
+ <summary>Save images of your screen or individual windows</summary>
<description>
- <_p>
+ <p>
GNOME Screenshot is a simple utility that lets you take pictures of your computer screen.
Screenshots can be of your whole screen, any specific application, or a selected
rectangular area.
You can also copy the captured screenshot directly into the GNOME clipboard and
paste it into other applications.
- </_p>
- <_p>
+ </p>
+ <p>
GNOME Screenshot allows you to take screenshots even when it’s not open: just
press the PrtSc button on your keyboard, and a snapshot of your whole screen will
be saved to your Pictures folder.
Hold Alt while pressing PrtSc and you will get a screenshot of only the currently
selected window.
- </_p>
+ </p>
</description>
<url type="homepage">https://git.gnome.org/browse/gnome-screenshot/</url>
+ <url type="bugtracker">https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-screenshot</url>
+ <url type="donation">http://www.gnome.org/friends/</url>
<screenshots>
- <screenshot
type="default">https://git.gnome.org/browse/gnome-screenshot/plain/src/gnome-screenshot.png</screenshot>
+ <screenshot type="default">
+ <image>https://git.gnome.org/browse/gnome-screenshot/plain/src/gnome-screenshot.png</image>
+ </screenshot>
</screenshots>
<kudos>
<kudo>AppMenu</kudo>
<kudo>HiDpiIcon</kudo>
<kudo>ModernToolkit</kudo>
</kudos>
- <updatecontact>richard hughsie com</updatecontact>
+ <updatecontact>ebassi gnome org</updatecontact>
<project_group>GNOME</project_group>
<compulsory_for_desktop>GNOME</compulsory_for_desktop>
<translation type="gettext">gnome-screenshot</translation>
-</application>
+</component>
diff --git a/src/org.gnome.Screenshot.service.in b/src/org.gnome.Screenshot.service.in
new file mode 100644
index 0000000..4e2d80f
--- /dev/null
+++ b/src/org.gnome.Screenshot.service.in
@@ -0,0 +1,3 @@
+[D-BUS Service]
+Name=org.gnome.Screenshot
+Exec=@bindir@/gnome-screenshot --gapplication-service
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]