[gnome-subtitles] Meson port including gstreamer-sharp and gtk-sharp



commit 79b0d308d9451986e75671c34748861dc5e82cb8
Author: Pedro Castro <pedro gnomesubtitles org>
Date:   Sat Jun 18 15:26:00 2022 +0100

    Meson port including gstreamer-sharp and gtk-sharp
    
    Ported autotools to Meson. Closes #106.
    Includes building gstreamer-sharp and gtk-sharp via Meson wrap files.
    Also Updated build and runtime dependencies.

 .gitignore                                         |   67 +-
 ChangeLog                                          |    1 -
 INSTALL                                            |  368 --
 Makefile.am                                        |   16 -
 README.md                                          |   65 +-
 autogen.sh                                         |   17 -
 build-aux/cairo-sharp.dll.config                   |    3 +
 .../gnome-subtitles.exe.config                     |    0
 build-aux/gnome-subtitles.in                       |    3 +
 build-aux/meson.build                              |   14 +
 build-aux/meson_post_install.py                    |   50 +
 configure.ac                                       |  109 -
 data/Makefile.am                                   |   29 -
 data/meson.build                                   |   36 +
 data/org.gnome.GnomeSubtitles.appdata.xml.in       |   18 +-
 ...p.in.in => org.gnome.GnomeSubtitles.desktop.in} |   12 +-
 etc/samples/CC Mayer and Bettle Animation.srt      |  398 --
 etc/samples/Romeo and Juliet.srt                   |   87 -
 etc/samples/sample.srt                             | 4312 --------------------
 etc/samples/sample.sub                             |  934 -----
 gnome-subtitles.csproj                             |   29 +-
 gnome-subtitles.doap                               |   23 -
 m4/gtk-doc.m4                                      |  113 -
 m4/intltool.m4                                     |  212 -
 meson.build                                        |   29 +
 meson_options.txt                                  |    4 +
 po/POTFILES.in                                     |    4 +-
 po/POTFILES.skip                                   |    2 +-
 po/meson.build                                     |    5 +
 src/GnomeSubtitles/Dialog/AboutDialog.cs           |    4 +-
 src/GnomeSubtitles/Execution/AssemblyInfo.cs.in    |    6 +-
 src/GnomeSubtitles/Execution/DummyAssemblyInfo.cs  |   28 +
 src/GnomeSubtitles/Execution/ExecutionContext.cs   |    4 +
 src/GnomeSubtitles/Execution/gnome-subtitles.in    |    9 -
 src/GnomeSubtitles/Execution/meson.build           |    8 +
 src/Makefile.am                                    |   70 -
 src/SubLib/ChangeLog                               | 2084 ----------
 src/meson.build                                    |  237 ++
 subprojects/gstreamer-sharp.wrap                   |    6 +
 39 files changed, 501 insertions(+), 8915 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 2f38f36..a512ea6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,67 +1,10 @@
 /po/*.gmo
 *~
-/autom4te.cache/*
-/help/*/*.mo
-/help/gnome-subtitles-*.omf
-/help/*/gnome-subtitles.xml
-/help/*/*.stamp
-/help/*/index.docbook
-/help/*/legal.xml
-/aclocal.m4
-/install-sh
-/intltool-extract.in
-/intltool-merge.in
-/intltool-update.in
-/Makefile
-/Makefile.in
-/mkinstalldirs
-/missing
-/po/Makefile
-/po/Makefile.in.in
-/po/Makefile.in
-/po/stamp-it
 /po/POTFILES
-/po/.intltool-merge-cache
-/po/.intltool-merge-cache.lock
-/src/GnomeSubtitles/Execution/ConfigureDefines.cs
-/src/GnomeSubtitles/Execution/AssemblyInfo.cs
-/src/GnomeSubtitles/Execution/gnome-subtitles
-/src/Makefile
-/src/Makefile.in
 /build/*
-/config.log
-/config.status
-/configure
-/gtk-doc.make
-/gnome-subtitles.pidb
-/depcomp
-/data/Makefile.in
-/data/Makefile
-/data/org.gnome.GnomeSubtitles.desktop
-/data/org.gnome.GnomeSubtitles.desktop.in
-/data/org.gnome.GnomeSubtitles.gschema.valid
-/data/org.gnome.GnomeSubtitles.appdata.xml
-/gnome-subtitles.userprefs
-/gnome-subtitles.usertasks
-/help/Makefile
-/help/Makefile.in
 /po/gnome-subtitles.pot
-/config.sub
-/config.guess
-/m4/libtool.m4
-/m4/lt~obsolete.m4
-/m4/ltoptions.m4
-/m4/ltsugar.m4
-/m4/ltversion.m4
-/ltmain.sh
-/libtool
-/po/missing
-/.vs/gnome-subtitles/xs/UserPrefs.xml
-/obj/*
-compile
-/src/.libs
-/src/External/GstBackend/.deps
-/src/External/GstBackend/.dirstamp
-/src/External/GstBackend/.libs
-/src/External/GstBackend/libgst_backend_la-gst-backend.lo
-/src/libgst_backend.la
+/subprojects/bindinator/
+/subprojects/bindinator.wrap
+/subprojects/gtk-sharp/
+/subprojects/gtk-sharp.wrap
+/subprojects/gstreamer-sharp/
diff --git a/README.md b/README.md
index 9dbccbb..75d7bdb 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 # Gnome Subtitles
 
-http://gnomesubtitles.org
+https://gnomesubtitles.org
 
 Gnome Subtitles is a subtitle editor for the GNOME desktop. It supports the most
 common text-based subtitle formats and allows for subtitle editing, translation
@@ -9,52 +9,53 @@ and synchronization.
 
 ## Dependencies
 
-
-Run time dependencies:
-- mono-runtime         >= 4.0
-- libmono-i18n4.0-all  >= 4.0
-- libmono-posix4.0-cil >= 4.0
-- libgtk3.0            >= 3.12
-- libgtk3.0-cil                >= 2.99.2
-- gstreamer1.0         >= 1.0
-- gstreamer1.0-x       >= 1.0
-- gstreamer1.0-gtk3    >= 1.0
-- gstreamer1.0-plugins-good    >= 1.0
-- gstreamer1.0-libav   >= 1.0
-- enchant              >= 1.6
-- gtkspell3            >= 3.0
+Runtime dependencies:
+- mono-runtime                 >= 4.0
+- libmono-i18n4.0-all          >= 4.0
+- libmono-posix4.0-cil         >= 4.0
+- libgtk3.0                    >= 3.12
+- libenchant                   >= 1.6
+- libgtkspell3                 >= 3.0
+- libgstreamer1.0              >= 1.18
+- gstreamer1.0-gtk3            >= 1.18
+- gstreamer1.0-plugins-good    >= 1.18
+- gstreamer1.0-libav           >= 1.18 (optional, for media codecs)
 
 Build time dependencies:
-- pkg-config, intltool, autoconf, automake, libtool and yelp-tools
-- libgtk-3-dev         >= 3.12
+- git
+- xsltproc
+- gettext
+- gcc
+- meson                        >= 0.53
 - mono-devel           >= 4.0
-- gtk-sharp3           >= 2.99.2
-- libgstreamer1.0-dev  >= 1.0
-- libgstreamer-plugins-base1.0-dev >= 1.0
+- libgtk-3-dev         >= 3.12
+- libgstreamer1.0-dev  >= 1.18
+- libges-1.0-dev       >= 1.18
+- libgstreamer-plugins-base1.0-dev     >= 1.18
+- libgstreamer-plugins-bad1.0-dev      >= 1.18
 
 
-## Packaging Notes
+## Building
 
-Check the NEWS file for dependency changes and other packaging notes.
+       meson build && meson compile -C build
 
 
-## Hacking Gnome Subtitles
+## Installing
 
-Get the latest code from the GNOME Git repository:
+       meson install -C build
 
-       git gitlab gnome org:GNOME/gnome-subtitles.git
 
-Install all required run time and build time dependencies (see above) plus the following which
-are required to run autogen.sh:
+## Hacking
 
-       gnome-common
-       gtk-doc-tools
+Build the solution with Meson (see Building above) to compile all dependencies
+and make them available in Monodevelop. This only needs to be done once.
+Fire up Monodevelop and open the solution file 'gnome-subtitles.sln'.
 
-Run the build tools to make sure necessary libraries are compiled and placed on the 'build' dir:
 
-       ./autogen.sh && make
+## License
 
-Fire up Monodevelop and open solution file 'gnome-subtitles.sln'.
+Gnome Subtitles is released under the GNU General Public License (GPL) version 2 or
+later, see the file [COPYING](COPYING) for more information.
 
 
 ## Need help?
diff --git a/build-aux/cairo-sharp.dll.config b/build-aux/cairo-sharp.dll.config
new file mode 100644
index 0000000..7ee8a33
--- /dev/null
+++ b/build-aux/cairo-sharp.dll.config
@@ -0,0 +1,3 @@
+<configuration>
+  <dllmap dll="cairo-2.dll" target="libcairo.so.2"/>
+</configuration>
diff --git a/src/GnomeSubtitles/Execution/gnome-subtitles.exe.config b/build-aux/gnome-subtitles.exe.config
similarity index 100%
rename from src/GnomeSubtitles/Execution/gnome-subtitles.exe.config
rename to build-aux/gnome-subtitles.exe.config
diff --git a/build-aux/gnome-subtitles.in b/build-aux/gnome-subtitles.in
new file mode 100755
index 0000000..6d1e157
--- /dev/null
+++ b/build-aux/gnome-subtitles.in
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+exec -a gnome-subtitles @mono@ @libdir@/gnome-subtitles/gnome-subtitles.exe "$@"
diff --git a/build-aux/meson.build b/build-aux/meson.build
new file mode 100644
index 0000000..669f031
--- /dev/null
+++ b/build-aux/meson.build
@@ -0,0 +1,14 @@
+meson.add_install_script('meson_post_install.py', get_option('libdir'), 
get_option('install_gtk_sharp').to_string(), get_option('install_gst_sharp').to_string())
+
+configure_file(
+       input: 'gnome-subtitles.in',
+       output: 'gnome-subtitles',
+       configuration: {
+               'mono': find_program('mono', required: true).path(),
+               'libdir': join_paths(get_option('prefix'), get_option('libdir'))
+       },
+       install_dir: get_option('bindir')
+)
+
+install_data('gnome-subtitles.exe.config', install_dir: get_option('libdir') / 'gnome-subtitles')
+
diff --git a/build-aux/meson_post_install.py b/build-aux/meson_post_install.py
new file mode 100644
index 0000000..d7b0f37
--- /dev/null
+++ b/build-aux/meson_post_install.py
@@ -0,0 +1,50 @@
+#!/usr/bin/env python3
+
+import os
+import shutil
+import subprocess
+import sys
+
+libdir = sys.argv[1]
+install_gtk_sharp = (sys.argv[2] == 'true')
+install_gst_sharp = (sys.argv[3] == 'true')
+destdir = os.environ.get('DESTDIR')
+
+#Install gsettings schemas (TODO use meson's gnome module instead for installing schemas (since 0.57))
+if not destdir:
+       print('Compiling gsettings schemas...')
+       subprocess.call(['glib-compile-schemas', os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share', 
'glib-2.0', 'schemas')])
+
+#Install gtk-sharp and gst-sharp libs
+build_path_subprojects = os.path.join(os.environ['MESON_BUILD_ROOT'], 'subprojects/')
+cs_libs = []
+
+if install_gtk_sharp:
+       print('Installing gtk-sharp libs')
+       cs_libs += [
+               os.path.join(os.environ['MESON_SOURCE_ROOT'], 'build-aux/') + 'cairo-sharp.dll.config',
+               build_path_subprojects + 'gtk-sharp/Source/atk/atk-sharp.dll',
+               build_path_subprojects + 'gtk-sharp/Source/atk/atk-sharp.dll.config',
+               build_path_subprojects + 'gtk-sharp/Source/cairo/cairo-sharp.dll',
+               build_path_subprojects + 'gtk-sharp/Source/gdk/gdk-sharp.dll',
+               build_path_subprojects + 'gtk-sharp/Source/gdk/gdk-sharp.dll.config',
+               build_path_subprojects + 'gtk-sharp/Source/gio/gio-sharp.dll',
+               build_path_subprojects + 'gtk-sharp/Source/gio/gio-sharp.dll.config',
+               build_path_subprojects + 'gtk-sharp/Source/glib/glib-sharp.dll',
+               build_path_subprojects + 'gtk-sharp/Source/glib/glib-sharp.dll.config',
+               build_path_subprojects + 'gtk-sharp/Source/gtk/gtk-sharp.dll',
+               build_path_subprojects + 'gtk-sharp/Source/gtk/gtk-sharp.dll.config',
+               build_path_subprojects + 'gtk-sharp/Source/pango/pango-sharp.dll',
+               build_path_subprojects + 'gtk-sharp/Source/pango/pango-sharp.dll.config',
+       ]
+
+if install_gst_sharp:
+       print('Installing gstreamer-sharp libs')
+       cs_libs += [
+               build_path_subprojects + 'gstreamer-sharp/sources/gstreamer-sharp.dll',
+               build_path_subprojects + 'gstreamer-sharp/sources/gstreamer-sharp.dll.config'
+       ]
+
+dst = os.path.join((destdir if destdir else '') + os.environ['MESON_INSTALL_PREFIX'], libdir, 
'gnome-subtitles')
+for lib in cs_libs:
+       shutil.copy2(lib, dst)
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 0000000..ab4a011
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,36 @@
+install_man('gnome-subtitles.1')
+
+appdata_file = i18n.merge_file(
+       input: 'org.gnome.GnomeSubtitles.appdata.xml.in',
+       output: 'org.gnome.GnomeSubtitles.appdata.xml',
+       type: 'xml',
+       po_dir: meson.source_root() / 'po',
+       install: true,
+       install_dir: get_option('datadir') / 'metainfo'
+)
+
+appstream_util = find_program('appstream-util', required: get_option('require_all_tests'))
+if appstream_util.found()
+       test('validate-appdata', appstream_util, depends: appdata_file, args: ['validate', '--nonet', 
appdata_file])
+endif
+
+
+desktop_file = i18n.merge_file(
+       input: 'org.gnome.GnomeSubtitles.desktop.in',
+       output: 'org.gnome.GnomeSubtitles.desktop',
+       type: 'desktop',
+       po_dir: meson.source_root() / 'po',
+       install: true,
+       install_dir: get_option('datadir') / 'applications'
+)
+
+desktop_file_validate = find_program('desktop-file-validate', required: get_option('require_all_tests'))
+if desktop_file_validate.found()
+       test('validate-desktop', desktop_file_validate, depends: desktop_file, args: [desktop_file])
+endif
+
+install_data('org.gnome.GnomeSubtitles.gschema.xml', install_dir: get_option('datadir') / 'glib-2.0' / 
'schemas')
+#Note: schema installed in /build-aux/meson_post_install.py
+
+install_data('gnome-subtitles.svg', install_dir: get_option('datadir') / 'icons/hicolor/scalable/apps')
+
diff --git a/data/org.gnome.GnomeSubtitles.appdata.xml.in b/data/org.gnome.GnomeSubtitles.appdata.xml.in
index 4d005aa..3ad249d 100644
--- a/data/org.gnome.GnomeSubtitles.appdata.xml.in
+++ b/data/org.gnome.GnomeSubtitles.appdata.xml.in
@@ -4,16 +4,16 @@
   <id>org.gnome.GnomeSubtitles.desktop</id>
   <metadata_license>CC0-1.0</metadata_license>
   <project_license>GPL-2.0-only</project_license>
-  <_name>Gnome Subtitles</_name>
-  <_summary>Video subtitling for the GNOME desktop</_summary>
+  <name>Gnome Subtitles</name>
+  <summary>Video subtitling for the GNOME desktop</summary>
   <description>
-    <_p>
+    <p>
       Gnome Subtitles is a subtitle editor for the GNOME desktop environment.
       It allows to create, synchronize, convert and translate subtitles by using a friendly user interface 
with video preview.
-    </_p>
-    <_p>
+    </p>
+    <p>
       A total of 22 subtitle formats are supported, including but not limited to: SubRip, MicroDVD, FAB 
Subtitler, MPlayer, Sub Station Alpha, MPSub and SubViewer.
-    </_p>
+    </p>
   </description>
   <categories>
     <category>AudioVideo</category>
@@ -28,7 +28,7 @@
   <screenshots>
     <screenshot type="default">
       
<image>https://gnomesubtitles.org/files/screenshots/Screenshot-GnomeSubtitles-VideoTimesTranslation.png</image>
-      <_caption>Main window</_caption>
+      <caption>Main window</caption>
     </screenshot>
   </screenshots>
   <launchable type="desktop-id">org.gnome.GnomeSubtitles.desktop</launchable>
@@ -41,4 +41,8 @@
   </mimetypes>
   <project_group>GNOME</project_group>
   <translation type="gettext">gnome-subtitles</translation>
+  <content_rating type="oars-1.1" />
+  <releases>
+    <release version="1.8" date="2022-05-17" />
+  </releases>
 </component>
diff --git a/data/org.gnome.GnomeSubtitles.desktop.in.in b/data/org.gnome.GnomeSubtitles.desktop.in
similarity index 61%
rename from data/org.gnome.GnomeSubtitles.desktop.in.in
rename to data/org.gnome.GnomeSubtitles.desktop.in
index 5ec8777..5492f01 100644
--- a/data/org.gnome.GnomeSubtitles.desktop.in.in
+++ b/data/org.gnome.GnomeSubtitles.desktop.in
@@ -1,8 +1,8 @@
 [Desktop Entry]
 Version=1.0
-_Name=Gnome Subtitles
-_GenericName=Subtitle Editor
-_Comment=Video subtitling for the GNOME desktop
+Name=Gnome Subtitles
+GenericName=Subtitle Editor
+Comment=Video subtitling for the GNOME desktop
 TryExec=gnome-subtitles
 Exec=gnome-subtitles %f
 Icon=gnome-subtitles
@@ -11,9 +11,5 @@ Terminal=false
 Type=Application
 Categories=AudioVideo;Video;GTK;AudioVideoEditing;GNOME;
 # Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list 
MUST also end with a semicolon!
-_Keywords=subtitles;video;captions;
+Keywords=subtitles;video;captions;
 MimeType=application/x-subrip;text/x-mpsub;text/x-ssa;text/x-microdvd;text/x-subviewer;text/vtt;
-X-GNOME-Bugzilla-Bugzilla=GNOME
-X-GNOME-Bugzilla-Product=gnome-subtitles
-X-GNOME-Bugzilla-Component=general
-X-GNOME-Bugzilla-Version=@VERSION@
diff --git a/gnome-subtitles.csproj b/gnome-subtitles.csproj
index dbc4727..52994c7 100644
--- a/gnome-subtitles.csproj
+++ b/gnome-subtitles.csproj
@@ -30,31 +30,28 @@
     <PlatformTarget>x86</PlatformTarget>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="System" />
     <Reference Include="Mono.Posix" />
-    <Reference Include="atk-sharp">
-      <HintPath>build\atk-sharp.dll</HintPath>
-    </Reference>
-    <Reference Include="gdk-sharp">
-      <HintPath>build\gdk-sharp.dll</HintPath>
+    <Reference Include="cairo-sharp">
+      <HintPath>build\subprojects\gtk-sharp\Source\cairo\cairo-sharp.dll</HintPath>
     </Reference>
     <Reference Include="gio-sharp">
-      <HintPath>build\gio-sharp.dll</HintPath>
+      <HintPath>build\subprojects\gtk-sharp\Source\gio\gio-sharp.dll</HintPath>
     </Reference>
     <Reference Include="glib-sharp">
-      <HintPath>build\glib-sharp.dll</HintPath>
+      <HintPath>build\subprojects\gtk-sharp\Source\glib\glib-sharp.dll</HintPath>
+    </Reference>
+    <Reference Include="gtk-sharp">
+      <HintPath>build\subprojects\gtk-sharp\Source\gtk\gtk-sharp.dll</HintPath>
     </Reference>
     <Reference Include="gstreamer-sharp">
-      <HintPath>build\gstreamer-sharp.dll</HintPath>
+      <HintPath>build\subprojects\gstreamer-sharp\sources\gstreamer-sharp.dll</HintPath>
     </Reference>
-    <Reference Include="gtk-sharp">
-      <HintPath>build\gtk-sharp.dll</HintPath>
+    <Reference Include="gdk-sharp">
+      <HintPath>build\subprojects\gtk-sharp\Source\gdk\gdk-sharp.dll</HintPath>
     </Reference>
+    <Reference Include="System" />
     <Reference Include="pango-sharp">
-      <HintPath>build\pango-sharp.dll</HintPath>
-    </Reference>
-    <Reference Include="cairo-sharp">
-      <HintPath>build\cairo-sharp.dll</HintPath>
+      <HintPath>build\subprojects\gtk-sharp\Source\pango\pango-sharp.dll</HintPath>
     </Reference>
   </ItemGroup>
   <ItemGroup>
@@ -156,7 +153,6 @@
     <Compile Include="src\GnomeSubtitles\Dialog\Message\SubtitleFileOpenErrorDialog.cs" />
     <Compile Include="src\GnomeSubtitles\Dialog\Message\VideoFileOpenErrorDialog.cs" />
     <Compile Include="src\GnomeSubtitles\Dialog\Message\WarningDialog.cs" />
-    <Compile Include="src\GnomeSubtitles\Execution\AssemblyInfo.cs" />
     <Compile Include="src\GnomeSubtitles\Execution\BugReporter.cs" />
     <Compile Include="src\GnomeSubtitles\Execution\Executable.cs" />
     <Compile Include="src\GnomeSubtitles\Execution\ExecutionContext.cs" />
@@ -281,6 +277,7 @@
     <Compile Include="src\GnomeSubtitles\Dialog\Message\DialogUtil.cs" />
     <Compile Include="src\External\GStreamer\GstBackend.cs" />
     <Compile Include="src\External\GStreamer\GstMediaInfo.cs" />
+    <Compile Include="src\GnomeSubtitles\Execution\DummyAssemblyInfo.cs" />
   </ItemGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
   <ItemGroup>
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..f6b276c
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,29 @@
+project('gnome-subtitles', 'cs',
+       version : '1.8',
+       meson_version : '>= 0.53',
+       license: 'GPL-2.0-or-later')
+
+sources_copyright_last_year = '2022'
+
+i18n = import('i18n')
+
+dependency('mono', version : '>= 4.0')
+dependency('gtk+-3.0', version : '>= 3.12')
+dependency('gstreamer-1.0', version : '>= 1.18')
+dependency('gstreamer-video-1.0', version : '>= 1.18')
+dependency('gstreamer-plugins-base-1.0', version : '>= 1.18')
+dependency('gstreamer-pbutils-1.0', version : '>= 1.18')
+
+gst_sharp = subproject('gstreamer-sharp')
+gst_sharp_dep = gst_sharp.get_variable('gst_sharp_dep')
+gtk_sharp_dep = gst_sharp.get_variable('gtk_sharp_dep')
+
+subdir('data')
+subdir('po')
+subdir('src')
+subdir('build-aux')
+
+summary('Install gtk-sharp', get_option('install_gtk_sharp'))
+summary('Install gstreamer-sharp', get_option('install_gst_sharp'))
+summary('Require all tests', get_option('require_all_tests'))
+
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..0ed38fe
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,4 @@
+option('install_gtk_sharp', type: 'boolean', value: true, description: 'Install GtkSharp libs (from 
https://github.com/GLibSharp/GtkSharp)')
+option('install_gst_sharp', type: 'boolean', value: true, description: 'Install GStreamerSharp libs (from 
https://gstreamer.freedesktop.org/modules/gstreamer-sharp.html)')
+option('require_all_tests', type: 'boolean', value: false, description: 'Require all tests to be run')
+
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 76f0d51..fc38caa 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,10 +1,10 @@
 # List of source files containing translatable strings.
 # Please keep this file sorted alphabetically.
 data/org.gnome.GnomeSubtitles.appdata.xml.in
-data/org.gnome.GnomeSubtitles.desktop.in.in
+data/org.gnome.GnomeSubtitles.desktop.in
 data/org.gnome.GnomeSubtitles.gschema.xml
 src/External/GStreamer/GstBackend.cs
-[type: gettext/glade]src/Glade/MainWindow.ui
+src/Glade/MainWindow.ui
 src/GnomeSubtitles/Core/Command/AdjustTimingsCommand.cs
 src/GnomeSubtitles/Core/Command/ChangeFrameRateCommand.cs
 src/GnomeSubtitles/Core/Command/ChangeStyleCommand.cs
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
index d41577a..2ad3ef2 100644
--- a/po/POTFILES.skip
+++ b/po/POTFILES.skip
@@ -1,5 +1,5 @@
 data/org.gnome.GnomeSubtitles.appdata.xml
-data/org.gnome.GnomeSubtitles.desktop.in
+data/org.gnome.GnomeSubtitles.desktop
 src/Glade/old.glade/AboutDialog.glade
 src/Glade/old.glade/AboutDialog.ui
 src/Glade/old.glade/EncodingsDialog.glade
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..b4453fc
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1,5 @@
+gettext_package = 'org.gnome.GnomeSubtitles'
+
+i18n.gettext(gettext_package, preset: 'glib')
+
+
diff --git a/src/GnomeSubtitles/Dialog/AboutDialog.cs b/src/GnomeSubtitles/Dialog/AboutDialog.cs
index 5a10c58..2f583c6 100644
--- a/src/GnomeSubtitles/Dialog/AboutDialog.cs
+++ b/src/GnomeSubtitles/Dialog/AboutDialog.cs
@@ -45,7 +45,7 @@ public class AboutDialog : BaseDialog {
                dialog.Website = "https://gnomesubtitles.org";;
                dialog.WebsiteLabel = dialog.Website;
                dialog.Comments = Catalog.GetString("Video subtitling for the GNOME desktop");
-               dialog.Copyright = "Copyright © 2006-2022 Pedro Castro";
+               dialog.Copyright = Base.ExecutionContext.Copyright;
                dialog.LicenseType = License.Gpl20;
 
                dialog.Authors = new string[]{
@@ -61,4 +61,4 @@ public class AboutDialog : BaseDialog {
 
 }
 
-}
+}
\ No newline at end of file
diff --git a/src/GnomeSubtitles/Execution/AssemblyInfo.cs.in b/src/GnomeSubtitles/Execution/AssemblyInfo.cs.in
index 18af87f..8b78258 100644
--- a/src/GnomeSubtitles/Execution/AssemblyInfo.cs.in
+++ b/src/GnomeSubtitles/Execution/AssemblyInfo.cs.in
@@ -1,6 +1,6 @@
 /*
  * This file is part of Gnome Subtitles.
- * Copyright (C) 2006-2021 Pedro Castro
+ * Copyright (C) 2006-2022 Pedro Castro
  *
  * Gnome Subtitles is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -19,8 +19,8 @@
 
 using System.Reflection;
 
-[assembly: AssemblyVersion("@VERSION@")]
+[assembly: AssemblyVersion("@version@")]
 [assembly: AssemblyTitle ("Gnome Subtitles")]
 [assembly: AssemblyDescription ("Video subtitling for the GNOME desktop")]
-[assembly: AssemblyCopyright ("Copyright (c) 2006-2021 Pedro Castro")]
+[assembly: AssemblyCopyright ("Copyright 2006-@copyright@ Pedro Castro")]
 
diff --git a/src/GnomeSubtitles/Execution/DummyAssemblyInfo.cs 
b/src/GnomeSubtitles/Execution/DummyAssemblyInfo.cs
new file mode 100644
index 0000000..1c607c9
--- /dev/null
+++ b/src/GnomeSubtitles/Execution/DummyAssemblyInfo.cs
@@ -0,0 +1,28 @@
+/*
+ * This file is part of Gnome Subtitles.
+ * Copyright (C) 2006-2022 Pedro Castro
+ *
+ * Gnome Subtitles is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Gnome Subtitles is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+using System.Reflection;
+
+/* Dummy class for building without Meson (ex: in Monodevelop), as Meson doesn't allow
+ * creating source files. AssemblyInfo.cs.in used instead when building with Meson.
+ */
+[assembly: AssemblyVersion("0.0.0")]
+[assembly: AssemblyTitle ("Gnome Subtitles")]
+[assembly: AssemblyDescription ("Video subtitling for the GNOME desktop")]
+[assembly: AssemblyCopyright ("Copyright 0000-0000 Pedro Castro")]
diff --git a/src/GnomeSubtitles/Execution/ExecutionContext.cs 
b/src/GnomeSubtitles/Execution/ExecutionContext.cs
index eab5aff..2d7682e 100644
--- a/src/GnomeSubtitles/Execution/ExecutionContext.cs
+++ b/src/GnomeSubtitles/Execution/ExecutionContext.cs
@@ -68,6 +68,10 @@ public class ExecutionContext {
        public string Version {
                get { return 
RemoveTrailingZeros(Assembly.GetExecutingAssembly().GetName().Version.ToString()); }
        }
+       
+       public string Copyright {
+               get { return 
((AssemblyCopyrightAttribute)Assembly.GetExecutingAssembly().GetCustomAttribute(typeof(AssemblyCopyrightAttribute))).Copyright;
 }
+       }
 
        public string GtkSharpVersion {
                get { return RemoveTrailingZeros(Assembly.Load("gtk-sharp").GetName().Version.ToString()); }
diff --git a/src/GnomeSubtitles/Execution/meson.build b/src/GnomeSubtitles/Execution/meson.build
new file mode 100644
index 0000000..cb78125
--- /dev/null
+++ b/src/GnomeSubtitles/Execution/meson.build
@@ -0,0 +1,8 @@
+sources_assembly_info = configure_file(
+       input: 'AssemblyInfo.cs.in',
+       output: 'AssemblyInfo.cs',
+       configuration: {
+               'version': meson.project_version(),
+               'copyright': sources_copyright_last_year
+       }
+)
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..db93359
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,237 @@
+subdir('GnomeSubtitles/Execution')
+
+sources = [
+       './External/Enchant/Enchant.cs',
+       './External/GStreamer/GstBackend.cs',
+       './External/GStreamer/GstMediaInfo.cs',
+       './External/GtkSpell/SpellChecker.cs',
+       './External/Interop/Interop.cs',
+       './External/NCharDet/Big5Statistics.cs',
+       './External/NCharDet/EUCJPStatistics.cs',
+       './External/NCharDet/EUCKRStatistics.cs',
+       './External/NCharDet/EUCTWStatistics.cs',
+       './External/NCharDet/GB2312Statistics.cs',
+       './External/NCharDet/nsBIG5Verifier.cs',
+       './External/NCharDet/nsCP1252Verifier.cs',
+       './External/NCharDet/nsDetector.cs',
+       './External/NCharDet/nsEUCJPVerifier.cs',
+       './External/NCharDet/nsEUCKRVerifier.cs',
+       './External/NCharDet/nsEUCSampler.cs',
+       './External/NCharDet/nsEUCStatistics.cs',
+       './External/NCharDet/nsEUCTWVerifier.cs',
+       './External/NCharDet/nsGB18030Verifier.cs',
+       './External/NCharDet/nsGB2312Verifier.cs',
+       './External/NCharDet/nsHZVerifier.cs',
+       './External/NCharDet/nsICharsetDetectionObserver.cs',
+       './External/NCharDet/nsICharsetDetector.cs',
+       './External/NCharDet/nsISO2022CNVerifier.cs',
+       './External/NCharDet/nsISO2022JPVerifier.cs',
+       './External/NCharDet/nsISO2022KRVerifier.cs',
+       './External/NCharDet/nsPSMDetector.cs',
+       './External/NCharDet/nsSJISVerifier.cs',
+       './External/NCharDet/nsUCS2BEVerifier.cs',
+       './External/NCharDet/nsUCS2LEVerifier.cs',
+       './External/NCharDet/nsUTF8Verifier.cs',
+       './External/NCharDet/nsVerifier.cs',
+       './GnomeSubtitles/Core/Backup.cs',
+       './GnomeSubtitles/Core/Base.cs',
+       './GnomeSubtitles/Core/Clipboards.cs',
+       './GnomeSubtitles/Core/Command/AdjustTimingsCommand.cs',
+       './GnomeSubtitles/Core/Command/BaseCommand.cs',
+       './GnomeSubtitles/Core/Command/ChangeFrameRateCommand.cs',
+       './GnomeSubtitles/Core/Command/ChangeStyleCommand.cs',
+       './GnomeSubtitles/Core/Command/ChangeTimingCommand.cs',
+       './GnomeSubtitles/Core/Command/CommandActivatedArgs.cs',
+       './GnomeSubtitles/Core/Command/CommandActivatedHandler.cs',
+       './GnomeSubtitles/Core/Command/CommandManager.cs',
+       './GnomeSubtitles/Core/Command/CommandTarget.cs',
+       './GnomeSubtitles/Core/Command/DeleteSubtitlesCommand.cs',
+       './GnomeSubtitles/Core/Command/DeleteTextCommand.cs',
+       './GnomeSubtitles/Core/Command/DeleteTextContentCommand.cs',
+       './GnomeSubtitles/Core/Command/DeleteTranslationCommand.cs',
+       './GnomeSubtitles/Core/Command/FixedMultipleSelectionCommand.cs',
+       './GnomeSubtitles/Core/Command/FixedSingleSelectionCommand.cs',
+       './GnomeSubtitles/Core/Command/InsertSubtitleCommand.cs',
+       './GnomeSubtitles/Core/Command/InsertTextCommand.cs',
+       './GnomeSubtitles/Core/Command/InsertTextContentCommand.cs',
+       './GnomeSubtitles/Core/Command/InsertTranslationCommand.cs',
+       './GnomeSubtitles/Core/Command/MergeSubtitlesCommand.cs',
+       './GnomeSubtitles/Core/Command/MultipleSelectionCommand.cs',
+       './GnomeSubtitles/Core/Command/ReplaceAllCommand.cs',
+       './GnomeSubtitles/Core/Command/ShiftTimingsCommand.cs',
+       './GnomeSubtitles/Core/Command/SingleSelectionCommand.cs',
+       './GnomeSubtitles/Core/Command/SplitSubtitlesCommand.cs',
+       './GnomeSubtitles/Core/Command/SynchronizeTimingsCommand.cs',
+       './GnomeSubtitles/Core/Command/TranslatorCommand.cs',
+       './GnomeSubtitles/Core/Command/VideoSetSubtitleTimingCommand.cs',
+       './GnomeSubtitles/Core/ConfigBackendGSettings.cs',
+       './GnomeSubtitles/Core/ConfigBackendInMemory.cs',
+       './GnomeSubtitles/Core/ConfigBackendUnavailableException.cs',
+       './GnomeSubtitles/Core/Config.cs',
+       './GnomeSubtitles/Core/Document.cs',
+       './GnomeSubtitles/Core/DragDrop.cs',
+       './GnomeSubtitles/Core/EncodingDescription.cs',
+       './GnomeSubtitles/Core/Encodings.cs',
+       './GnomeSubtitles/Core/EventHandlers.cs',
+       './GnomeSubtitles/Core/GlobalAccelerators.cs',
+       './GnomeSubtitles/Core/IConfigBackend.cs',
+       './GnomeSubtitles/Core/Search.cs',
+       './GnomeSubtitles/Core/SpellLanguage.cs',
+       './GnomeSubtitles/Core/SpellLanguages.cs',
+       './GnomeSubtitles/Core/SyncPoints.cs',
+       './GnomeSubtitles/Core/Util.cs',
+       './GnomeSubtitles/Dialog/AboutDialog.cs',
+       './GnomeSubtitles/Dialog/BaseDialog.cs',
+       './GnomeSubtitles/Dialog/BuilderDialog.cs',
+       './GnomeSubtitles/Dialog/DialogScope.cs',
+       './GnomeSubtitles/Dialog/Dialogs.cs',
+       './GnomeSubtitles/Dialog/DialogStrings.cs',
+       './GnomeSubtitles/Dialog/EncodingsDialog.cs',
+       './GnomeSubtitles/Dialog/FileHeadersDialog.cs',
+       './GnomeSubtitles/Dialog/FileOpenDialog.cs',
+       './GnomeSubtitles/Dialog/FilePropertiesDialog.cs',
+       './GnomeSubtitles/Dialog/FileSaveDialog.cs',
+       './GnomeSubtitles/Dialog/FileTranslationOpenDialog.cs',
+       './GnomeSubtitles/Dialog/FileTranslationSaveDialog.cs',
+       './GnomeSubtitles/Dialog/Message/BasicErrorDialog.cs',
+       './GnomeSubtitles/Dialog/Message/DialogUtil.cs',
+       './GnomeSubtitles/Dialog/Message/ErrorDialog.cs',
+       './GnomeSubtitles/Dialog/Message/FileSaveErrorDialog.cs',
+       './GnomeSubtitles/Dialog/Message/MessageDialog.cs',
+       './GnomeSubtitles/Dialog/Message/SaveConfirmationDialog.cs',
+       './GnomeSubtitles/Dialog/Message/SubtitleFileOpenErrorDialog.cs',
+       './GnomeSubtitles/Dialog/Message/VideoFileOpenErrorDialog.cs',
+       './GnomeSubtitles/Dialog/Message/WarningDialog.cs',
+       './GnomeSubtitles/Dialog/PreferencesDialog.cs',
+       './GnomeSubtitles/Dialog/SearchDialog.cs',
+       './GnomeSubtitles/Dialog/SetLanguagesDialog.cs',
+       './GnomeSubtitles/Dialog/TimingsAdjustDialog.cs',
+       './GnomeSubtitles/Dialog/TimingsShiftDialog.cs',
+       './GnomeSubtitles/Dialog/TimingsSynchronizeDialog.cs',
+       './GnomeSubtitles/Dialog/VideoOpenDialog.cs',
+       './GnomeSubtitles/Dialog/VideoSeekToDialog.cs',
+       './GnomeSubtitles/Execution/BugReporter.cs',
+       './GnomeSubtitles/Execution/Executable.cs',
+       './GnomeSubtitles/Execution/ExecutionContext.cs',
+       './GnomeSubtitles/Ui/Component/ComboBoxUtil.cs',
+       './GnomeSubtitles/Ui/Component/EncodingComboBox.cs',
+       './GnomeSubtitles/Ui/Component/NewlineTypeComboBox.cs',
+       './GnomeSubtitles/Ui/Component/SubtitleFormatComboBox.cs',
+       './GnomeSubtitles/Ui/Edit/SubtitleEdit.cs',
+       './GnomeSubtitles/Ui/Edit/SubtitleEditSpinButtons.cs',
+       './GnomeSubtitles/Ui/Edit/SubtitleEditText.cs',
+       './GnomeSubtitles/Ui/Edit/SubtitleEditTextView.cs',
+       './GnomeSubtitles/Ui/Edit/SubtitleEditTextViewMargin.cs',
+       './GnomeSubtitles/Ui/Edit/SubtitleEditTranslation.cs',
+       './GnomeSubtitles/Ui/MainUi.cs',
+       './GnomeSubtitles/Ui/Menus.cs',
+       './GnomeSubtitles/Ui/Status.cs',
+       './GnomeSubtitles/Ui/VideoPreview/Exceptions/PlayerException.cs',
+       './GnomeSubtitles/Ui/VideoPreview/MediaBackend.cs',
+       './GnomeSubtitles/Ui/VideoPreview/Player.cs',
+       './GnomeSubtitles/Ui/VideoPreview/PlayerPositionWatcher.cs',
+       './GnomeSubtitles/Ui/VideoPreview/SubtitleOverlay.cs',
+       './GnomeSubtitles/Ui/VideoPreview/SubtitleTracker.cs',
+       './GnomeSubtitles/Ui/VideoPreview/Video.cs',
+       './GnomeSubtitles/Ui/VideoPreview/VideoFiles.cs',
+       './GnomeSubtitles/Ui/VideoPreview/VideoPosition.cs',
+       './GnomeSubtitles/Ui/View/CellRendererCenteredText.cs',
+       './GnomeSubtitles/Ui/View/SelectionIntended.cs',
+       './GnomeSubtitles/Ui/View/SelectionType.cs',
+       './GnomeSubtitles/Ui/View/Subtitles.cs',
+       './GnomeSubtitles/Ui/View/SubtitleSelection.cs',
+       './GnomeSubtitles/Ui/View/SubtitleView.cs',
+       './GnomeSubtitles/Ui/WidgetNames.cs',
+       './GnomeSubtitles/Ui/WidgetStyles.cs',
+       './GnomeSubtitles/Ui/WindowState.cs',
+       './SubLib/Core/Domain/Enumerations.cs',
+       './SubLib/Core/Domain/FileProperties.cs',
+       './SubLib/Core/Domain/Frames.cs',
+       './SubLib/Core/Domain/Headers.cs',
+       './SubLib/Core/Domain/IncompleteSubtitleCollection.cs',
+       './SubLib/Core/Domain/IncompleteSubtitle.cs',
+       './SubLib/Core/Domain/Style.cs',
+       './SubLib/Core/Domain/SubtitleCollection.cs',
+       './SubLib/Core/Domain/SubtitleConstants.cs',
+       './SubLib/Core/Domain/Subtitle.cs',
+       './SubLib/Core/Domain/SubtitleProperties.cs',
+       './SubLib/Core/Domain/Subtitles.cs',
+       './SubLib/Core/Domain/SubtitleText.cs',
+       './SubLib/Core/Domain/SubtitleTypeInfo.cs',
+       './SubLib/Core/Domain/SyncPoint.cs',
+       './SubLib/Core/Domain/SyncPoints.cs',
+       './SubLib/Core/Domain/Times.cs',
+       './SubLib/Core/Domain/Timing.cs',
+       './SubLib/Core/MatchEvaluationCounter.cs',
+       './SubLib/Core/Search/SearchOperator.cs',
+       './SubLib/Core/Search/SubtitleReplaceResult.cs',
+       './SubLib/Core/Search/SubtitleSearchOptions.cs',
+       './SubLib/Core/Search/SubtitleSearchResults.cs',
+       './SubLib/Core/SubtitleFactory.cs',
+       './SubLib/Core/SubtitleSaver.cs',
+       './SubLib/Core/Timing/AdjustOperator.cs',
+       './SubLib/Core/Timing/FrameRateOperator.cs',
+       './SubLib/Core/Timing/MergeOperator.cs',
+       './SubLib/Core/Timing/ShiftOperator.cs',
+       './SubLib/Core/Timing/SplitOperator.cs',
+       './SubLib/Core/Timing/SynchronizeOperator.cs',
+       './SubLib/Core/Timing/SyncUtil.cs',
+       './SubLib/Core/Timing/TimingUtil.cs',
+       './SubLib/Core/Translations.cs',
+       './SubLib/Core/Translator.cs',
+       './SubLib/Exceptions/EncodingNotSupportedException.cs',
+       './SubLib/Exceptions/FileTooLargeException.cs',
+       './SubLib/Exceptions/TranslatorException.cs',
+       './SubLib/Exceptions/UnknownEncodingException.cs',
+       './SubLib/Exceptions/UnknownSubtitleFormatException.cs',
+       './SubLib/IO/FileInputOutput.cs',
+       './SubLib/IO/Input/ParsingProperties.cs',
+       './SubLib/IO/Input/PlainTextParser.cs',
+       './SubLib/IO/Input/SubtitleInput.cs',
+       './SubLib/IO/Input/SubtitleParser.cs',
+       './SubLib/IO/Output/SubtitleOutput.cs',
+       './SubLib/IO/SubtitleFormats/BuiltInSubtitleFormats.cs',
+       './SubLib/IO/SubtitleFormats/SubtitleFormatAdobeEncoreDVD.cs',
+       './SubLib/IO/SubtitleFormats/SubtitleFormatAdvancedSubStationAlpha.cs',
+       './SubLib/IO/SubtitleFormats/SubtitleFormatAQTitle.cs',
+       './SubLib/IO/SubtitleFormats/SubtitleFormat.cs',
+       './SubLib/IO/SubtitleFormats/SubtitleFormatDKSSubtitleFormat.cs',
+       './SubLib/IO/SubtitleFormats/SubtitleFormatFABSubtitler.cs',
+       './SubLib/IO/SubtitleFormats/SubtitleFormatKaraokeLyricsLRC.cs',
+       './SubLib/IO/SubtitleFormats/SubtitleFormatKaraokeLyricsVKT.cs',
+       './SubLib/IO/SubtitleFormats/SubtitleFormatMacSUB.cs',
+       './SubLib/IO/SubtitleFormats/SubtitleFormatMicroDVD.cs',
+       './SubLib/IO/SubtitleFormats/SubtitleFormatMPlayer2.cs',
+       './SubLib/IO/SubtitleFormats/SubtitleFormatMPlayer.cs',
+       './SubLib/IO/SubtitleFormats/SubtitleFormatMPSub.cs',
+       './SubLib/IO/SubtitleFormats/SubtitleFormatPanimator.cs',
+       './SubLib/IO/SubtitleFormats/SubtitleFormatPhoenixJapanimationSociety.cs',
+       './SubLib/IO/SubtitleFormats/SubtitleFormatPowerDivX.cs',
+       './SubLib/IO/SubtitleFormats/SubtitleFormatSofni.cs',
+       './SubLib/IO/SubtitleFormats/SubtitleFormatSubCreator1x.cs',
+       './SubLib/IO/SubtitleFormats/SubtitleFormatSubRip.cs',
+       './SubLib/IO/SubtitleFormats/SubtitleFormatSubStationAlpha.cs',
+       './SubLib/IO/SubtitleFormats/SubtitleFormatSubViewer1.cs',
+       './SubLib/IO/SubtitleFormats/SubtitleFormatSubViewer2.cs',
+       './SubLib/IO/SubtitleFormats/SubtitleFormatViPlaySubtitleFile.cs',
+       './SubLib/Util/Logger.cs',
+       sources_assembly_info
+]
+
+system_deps = [
+       '-r:Mono.Posix'
+]
+
+resources = [
+       '-resource:' + meson.source_root() / 'data/gnome-subtitles-logo.png',
+       '-resource:' + meson.current_source_dir() / 'Glade/MainWindow.ui'
+]
+
+executable('gnome-subtitles',
+       sources: sources,
+       dependencies: [gst_sharp_dep, gtk_sharp_dep],
+       cs_args: system_deps + resources,
+       install: true,
+       install_dir: get_option('libdir') / 'gnome-subtitles'
+)
+
diff --git a/subprojects/gstreamer-sharp.wrap b/subprojects/gstreamer-sharp.wrap
new file mode 100644
index 0000000..a008943
--- /dev/null
+++ b/subprojects/gstreamer-sharp.wrap
@@ -0,0 +1,6 @@
+[wrap-git]
+directory=gstreamer-sharp
+url=https://gitlab.freedesktop.org/noup/gstreamer-sharp.git
+revision=tags/1.18.0-gnome-subtitles
+#url=https://gitlab.freedesktop.org/gstreamer/gstreamer-sharp.git
+#revision=tags/1.18.0


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