[pulseaudio-commits] [Git][pulseaudio/pavucontrol][master] 4 commits: i18n: Migrate to upstream gettext over intltool

Arun Raghavan (@arun) gitlab at gitlab.freedesktop.org
Thu Mar 31 03:03:54 UTC 2022



Arun Raghavan pushed to branch master at PulseAudio / pavucontrol


Commits:
32728805 by Arun Raghavan at 2022-01-14T18:39:01-05:00
i18n: Migrate to upstream gettext over intltool

Newer gettext has feature parity, rendering intltool obsolete. Details
at:

  https://wiki.gnome.org/MigratingFromIntltoolToGettext

- - - - -
791c1055 by Arun Raghavan at 2022-01-14T18:39:01-05:00
build-sys: Use list e-mail while initialising project

- - - - -
805d6522 by Arun Raghavan at 2022-01-15T13:38:28-05:00
build-sys: Add a meson-based build systeom

The only missing feature for parity with autotools is generating a text
README using lynx. I think this might be okay to skip as it seems
unnecessary as a dependency.

- - - - -
964f2987 by Arun Raghavan at 2022-01-15T13:45:17-05:00
Fix warning in .desktop file

With the underscore, we got:

../src/pavucontrol.desktop.in:12:0: warning: invalid non-blank line

- - - - -


14 changed files:

- .gitignore
- Makefile.am
- bootstrap.sh
- configure.ac
- + doc/html2txt
- + doc/meson.build
- + meson.build
- + meson_options.txt
- + po/Makevars
- po/POTFILES.in
- + po/meson.build
- src/Makefile.am
- + src/meson.build
- src/pavucontrol.desktop.in


Changes:

=====================================
.gitignore
=====================================
@@ -4,9 +4,6 @@ ChangeLog
 config.guess
 config.rpath
 config.sub
-intltool-extract.in
-intltool-merge.in
-intltool-update.in
 aclocal.m4
 *.cache
 compile
@@ -15,6 +12,7 @@ config.h.in
 config.log
 config.status
 configure
+build
 depcomp
 README
 README.html


=====================================
Makefile.am
=====================================
@@ -18,9 +18,6 @@
 EXTRA_DIST = \
 	bootstrap.sh \
 	LICENSE \
-	intltool-merge.in \
-	intltool-update.in \
-	intltool-extract.in \
 	po/pavucontrol.pot
 
 SUBDIRS=src doc po


=====================================
bootstrap.sh
=====================================
@@ -23,7 +23,6 @@ if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
     echo "Activated pre-commit hook."
 fi
 
-intltoolize --force --automake
 autoreconf --force --install --symlink
 
 if test "x$NOCONFIGURE" = "x"; then


=====================================
configure.ac
=====================================
@@ -19,7 +19,7 @@
 # along with pavucontrol. If not, see <http://www.gnu.org/licenses/>.
 
 AC_PREREQ(2.62)
-AC_INIT([pavucontrol],[5.0],[mzcnihpbageby (at) 0pointer (dot) de])
+AC_INIT([pavucontrol],[5.0],[pulseaudio-discuss (at) lists (dot) freedesktop (dot) org])
 AC_CONFIG_SRCDIR([src/pavucontrol.cc])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_HEADERS([config.h])
@@ -67,11 +67,11 @@ fi
 
 ZP_LYNX_DOC
 
-IT_PROG_INTLTOOL([0.35.0])
 GETTEXT_PACKAGE=pavucontrol
 AC_SUBST([GETTEXT_PACKAGE])
 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
-AM_GLIB_GNU_GETTEXT
+AM_GNU_GETTEXT([external])
+AM_GNU_GETTEXT_VERSION([0.19.8])
 
 AC_CONFIG_FILES([
 po/Makefile.in


=====================================
doc/html2txt
=====================================
@@ -0,0 +1,2 @@
+#!/bin/sh
+lynx --dump $1 | sed 's,file://localhost/.*/doc/README.html,README,'


=====================================
doc/meson.build
=====================================
@@ -0,0 +1,34 @@
+doc_cdata = configuration_data()
+
+doc_cdata.set('PACKAGE_VERSION', meson.project_version())
+doc_cdata.set('PACKAGE_URL', 'http://freedesktop.org/software/pulseaudio/pavucontrol/')
+
+readme_html = configure_file(
+    input : 'README.html.in',
+    output : 'README.html',
+    configuration : doc_cdata,
+    install : true,
+    install_dir : docdir,
+)
+
+if tidy.found()
+  test('XHTML documentation uses correct mark-up', tidy, args: ['-e', readme_html])
+endif
+
+if with_lynx
+  custom_target(
+    'README',
+    input: readme_html,
+    output: 'README',
+    command: [find_program('./html2txt'), '@INPUT@'],
+    capture: true,
+    build_by_default: true,
+    install : true,
+    install_dir : docdir,
+  )
+endif
+
+install_data(
+    sources : 'style.css',
+    install_dir : docdir,
+)


=====================================
meson.build
=====================================
@@ -0,0 +1,41 @@
+project('pavucontrol', 'cpp',
+        version : '5.0',
+        meson_version : '>= 0.50.0',
+        default_options : [ 'c_std=gnu11', 'cpp_std=c++11' ]
+        )
+
+with_lynx = get_option('lynx')
+
+gtkmm_dep = dependency('gtkmm-3.0', version : '>= 3.0', required : true)
+sigcpp_dep = dependency('sigc++-2.0', required : true)
+canberragtk_dep = dependency('libcanberra-gtk3', version : '>= 0.16', required : true)
+
+libpulse_dep = dependency('libpulse', version : '>= 5.0', required : true)
+libpulsemlglib_dep = dependency('libpulse-mainloop-glib', version : '>= 0.9.16', required : true)
+
+lynx = find_program('lynx', required: with_lynx)
+tidy = find_program('tidy', required: false)
+
+configinc = include_directories('.')
+
+prefix = get_option('prefix')
+datadir = join_paths(prefix, get_option('datadir'))
+docdir = join_paths(datadir, 'doc', 'pavucontrol')
+localedir = join_paths(prefix, get_option('localedir'))
+
+cdata = configuration_data()
+cdata.set('ENABLE_NLS', 1)
+cdata.set_quoted('PACKAGE', 'pavucontrol')
+cdata.set_quoted('PACKAGE_NAME', 'pavucontrol')
+cdata.set_quoted('PACKAGE_STRING', 'pavucontrol')
+cdata.set_quoted('PACKAGE_VERSION', meson.project_version())
+cdata.set_quoted('GETTEXT_PACKAGE', 'pavucontrol')
+cdata.set_quoted('LOCALEDIR', localedir)
+cdata.set_quoted('GLADE_FILE', join_paths(datadir, 'pavucontrol', 'pavucontrol.glade'))
+
+# Now generate config.h from everything above
+configure_file(output : 'config.h', configuration : cdata)
+
+subdir('doc')
+subdir('po')
+subdir('src')


=====================================
meson_options.txt
=====================================
@@ -0,0 +1,3 @@
+option('lynx',
+       type : 'boolean', value : true,
+       description : 'Enable building of the README text file for installation')


=====================================
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 = --keyword=_ --keyword=N_ --from-code=UTF-8
+
+# 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 = PulseAudio contributors
+
+# 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 =
+
+# 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 =
+
+# 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 = no
+
+# 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 = no


=====================================
po/POTFILES.in
=====================================
@@ -1,4 +1,3 @@
-[encoding: UTF-8]
 src/pavucontrol.desktop.in
 src/pavucontrol.glade
 src/pavucontrol.cc


=====================================
po/meson.build
=====================================
@@ -0,0 +1,4 @@
+i18n = import('i18n')
+i18n.gettext(meson.project_name(), preset: 'glib')
+
+po_dir = meson.current_source_dir()


=====================================
src/Makefile.am
=====================================
@@ -21,8 +21,11 @@ localedir = $(datadir)/locale
 
 bin_PROGRAMS=pavucontrol
 glade_DATA=pavucontrol.glade
+
 desktop_in_files=pavucontrol.desktop.in
 desktop_DATA=$(desktop_in_files:.desktop.in=.desktop)
+$(desktop_DATA): $(desktop_in_files)
+	$(AM_V_GEN) $(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
 
 pavucontrol_SOURCES= \
   minimalstreamwidget.h minimalstreamwidget.cc \
@@ -48,5 +51,3 @@ pavucontrol_CXXFLAGS+=-DGLADE_FILE=\"$(gladedir)/pavucontrol.glade\"
 EXTRA_DIST = $(glade_DATA) $(desktop_in_files)
 
 CLEANFILES = $(desktop_DATA)
-
- at INTLTOOL_DESKTOP_RULE@


=====================================
src/meson.build
=====================================
@@ -0,0 +1,34 @@
+pavucontrol_sources = [
+  'cardwidget.cc',
+  'channelwidget.cc',
+  'devicewidget.cc',
+  'mainwindow.cc',
+  'minimalstreamwidget.cc',
+  'pavuapplication.cc',
+  'pavucontrol.cc',
+  'rolewidget.cc',
+  'sinkinputwidget.cc',
+  'sinkwidget.cc',
+  'sourceoutputwidget.cc',
+  'sourcewidget.cc',
+  'streamwidget.cc',
+]
+
+executable('pavucontrol',
+  pavucontrol_sources,
+  install: true,
+  cpp_args: ['-DHAVE_CONFIG_H'],
+  include_directories : configinc,
+  dependencies : [gtkmm_dep, sigcpp_dep, canberragtk_dep, libpulse_dep, libpulsemlglib_dep],
+)
+
+install_data('pavucontrol.glade')
+
+desktop_file = i18n.merge_file(
+  input : 'pavucontrol.desktop.in',
+  output : 'pavucontrol.desktop',
+  po_dir : po_dir,
+  type : 'desktop',
+  install : true,
+  install_dir : join_paths(datadir, 'applications'),
+)


=====================================
src/pavucontrol.desktop.in
=====================================
@@ -1,11 +1,11 @@
 [Desktop Entry]
 Version=1.0
-_Name=PulseAudio Volume Control
-_GenericName=Volume Control
-_Comment=Adjust the volume level
+Name=PulseAudio Volume Control
+GenericName=Volume Control
+Comment=Adjust the volume level
 Exec=pavucontrol
 Icon=multimedia-volume-control
 StartupNotify=true
 Type=Application
 Categories=AudioVideo;Audio;Mixer;GTK;Settings;X-XFCE-SettingsDialog;X-XFCE-HardwareSettings;
-_Keywords=pavucontrol;Microphone;Volume;Fade;Balance;Headset;Speakers;Headphones;Audio;Mixer;Output;Input;Devices;Playback;Recording;System Sounds;Sound Card;Settings;Preferences;
+Keywords=pavucontrol;Microphone;Volume;Fade;Balance;Headset;Speakers;Headphones;Audio;Mixer;Output;Input;Devices;Playback;Recording;System Sounds;Sound Card;Settings;Preferences;



View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pavucontrol/-/compare/8b3a5999a6aff7f6088be90c92198f9efc06f955...964f2987a46aa984d9ba83369b1f27c0bb28e9af

-- 
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pavucontrol/-/compare/8b3a5999a6aff7f6088be90c92198f9efc06f955...964f2987a46aa984d9ba83369b1f27c0bb28e9af
You're receiving this email because of your account on gitlab.freedesktop.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20220331/85ef3d28/attachment-0001.htm>


More information about the pulseaudio-commits mailing list