diff options
author | Emmanuele Bassi <ebassi@gmail.com> | 2020-09-21 21:12:37 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gmail.com> | 2020-09-21 21:12:37 +0000 |
commit | 6eba02af8bfbe11170c53ea2d91222fc8e10e03a (patch) | |
tree | bc293181db7492e2bb7b6efdfbdcf8a4a1d1689d | |
parent | b6a58032d54b84b4c73f669bf0450cbcce882adf (diff) | |
parent | 9e6aa4f85e84775b0fbaedb5f50968ee6dbcb6f3 (diff) | |
download | gnome-dictionary-6eba02af8bfbe11170c53ea2d91222fc8e10e03a.tar.gz |
Merge branch 'ebassi/for-master' into 'master'
Ebassi/for master
See merge request GNOME/gnome-dictionary!12
38 files changed, 451 insertions, 377 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..9be7a9c --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,33 @@ +include: 'https://gitlab.gnome.org/GNOME/citemplates/raw/master/flatpak/flatpak_ci_initiative.yml' + +variables: + GIT_SUBMODULE_STRATEGY: normal + BUNDLE: "org.gnome.Dictionary.Devel.flatpak" + +stages: + - flatpak + - deploy + + +################## +# Flatpak Bundle # +################## + +flatpak:master: + extends: .flatpak + image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master + stage: flatpak + variables: + MANIFEST_PATH: "build-aux/flatpak/org.gnome.Dictionary.json" + RUNTIME_REPO: "https://nightly.gnome.org/gnome-nightly.flatpakrepo" + # Replace with your application name, as written in the manifest + FLATPAK_MODULE: "gnome-dictionary" + # Make sure to keep this in sync with the Flatpak manifest, all arguments + # are passed except the config-args because we build it ourselves + MESON_ARGS: "-Dprofile=development" + APP_ID: "org.gnome.Dictionary.Devel" + +flatpak:nightly: + extends: .publish_nightly + dependencies: + - flatpak:master diff --git a/build-aux/flatpak/org.gnome.Dictionary.json b/build-aux/flatpak/org.gnome.Dictionary.json new file mode 100644 index 0000000..da32d8e --- /dev/null +++ b/build-aux/flatpak/org.gnome.Dictionary.json @@ -0,0 +1,40 @@ +{ + "app-id": "org.gnome.Dictionary.Devel", + "runtime": "org.gnome.Platform", + "runtime-version": "master", + "sdk": "org.gnome.Sdk", + "command": "gnome-dictionary", + "tags": ["devel", "development", "nightly"], + "desktop-file-name-prefix": "(Development) ", + "finish-args": [ + "--share=ipc", + "--socket=fallback-x11", + "--socket=wayland", + "--share=network", + "--talk-name=org.gtk.vfs", + "--talk-name=org.gtk.vfs.*" + ], + "cleanup": [ + "/man", + "/share/man", + "/share/doc" + ], + "modules": [ + { + "name": "gnome-dictionary", + "buildsystem": "meson", + "builddir": true, + "config-opts": [ + "--libdir=/app/lib", + "-Dprofile=devel", + "-Dbuild_man=false" + ], + "sources": [ + { + "type": "git", + "url": "https://gitlab.gnome.org/GNOME/gnome-dictionary.git" + } + ] + } + ] +} diff --git a/build-aux/meson/post-install.py b/build-aux/meson/post-install.py new file mode 100644 index 0000000..b26c88a --- /dev/null +++ b/build-aux/meson/post-install.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 + +import os +import subprocess + +install_prefix = os.environ['MESON_INSTALL_PREFIX'] +icondir = os.path.join(install_prefix, 'share', 'icons', 'hicolor') +schemadir = os.path.join(install_prefix, 'share', 'glib-2.0', 'schemas') + +if not os.environ.get('DESTDIR'): + print('Update icon cache...') + subprocess.call(['gtk-update-icon-cache', '-f', '-t', icondir]) + + print('Compiling gsettings schemas...') + subprocess.call(['glib-compile-schemas', schemadir]) diff --git a/build-aux/post-install.sh b/build-aux/post-install.sh deleted file mode 100755 index 4500dcb..0000000 --- a/build-aux/post-install.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# Package managers set this so we don't need to run -if [ -z "$DESTDIR" ]; then - echo Compiling GSettings schemas... - glib-compile-schemas ${MESON_INSTALL_PREFIX}/share/glib-2.0/schemas - - echo Updating desktop database... - update-desktop-database -q ${MESON_INSTALL_PREFIX}/share/applications -fi diff --git a/data/icons/meson.build b/data/icons/meson.build index 9013b1e..1e5ad69 100644 --- a/data/icons/meson.build +++ b/data/icons/meson.build @@ -1,18 +1,12 @@ -install_data( - 'scalable/org.gnome.Dictionary.svg', - install_dir : join_paths( - get_option('prefix'), - get_option('datadir'), - 'icons/hicolor/scalable/apps' - ) +install_data([ + 'scalable/org.gnome.Dictionary.svg', + 'scalable/org.gnome.Dictionary.Devel.svg', + ], + install_dir: gdict_datadir / 'icons/hicolor/scalable/apps', ) install_data( - 'symbolic/org.gnome.Dictionary-symbolic.svg', - install_dir : join_paths( - get_option('prefix'), - get_option('datadir'), - 'icons/hicolor/symbolic/apps' - ) + 'symbolic/org.gnome.Dictionary-symbolic.svg', + install_dir: gdict_datadir / 'icons/hicolor/symbolic/apps', ) diff --git a/data/icons/scalable/org.gnome.Dictionary.Devel.svg b/data/icons/scalable/org.gnome.Dictionary.Devel.svg new file mode 100644 index 0000000..ab366be --- /dev/null +++ b/data/icons/scalable/org.gnome.Dictionary.Devel.svg @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="UTF-8"?> +<svg height="128px" viewBox="0 0 128 128" width="128px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> + <defs> + <linearGradient id="a" gradientUnits="userSpaceOnUse" x1="95.999944" x2="103.999944" y1="83" y2="83"> + <stop offset="0" stop-color="#f6f5f4"/> + <stop offset="0.5" stop-color="#f6f5f4"/> + <stop offset="1" stop-color="#c0bfbc"/> + </linearGradient> + <filter id="b" height="100%" width="100%" x="0%" y="0%"> + <feColorMatrix in="SourceGraphic" type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0"/> + </filter> + <mask id="c"> + <g filter="url(#b)"> + <rect fill-opacity="0.3" height="128" width="128"/> + </g> + </mask> + <mask id="d"> + <g filter="url(#b)"> + <rect fill-opacity="0.1" height="128" width="128"/> + </g> + </mask> + <mask id="e"> + <g filter="url(#b)"> + <rect fill-opacity="0.3" height="128" width="128"/> + </g> + </mask> + <clipPath id="f"> + <rect height="128" width="128"/> + </clipPath> + <g id="g" clip-path="url(#f)"> + <path d="m 26 8 h 2 v 72 h -2 z m 0 0" fill="#ffffff"/> + </g> + <mask id="h"> + <g filter="url(#b)"> + <rect fill-opacity="0.1" height="128" width="128"/> + </g> + </mask> + <clipPath id="i"> + <rect height="128" width="128"/> + </clipPath> + <g id="j" clip-path="url(#i)"> + <path d="m 236.000225 223.5 h 104 m -128 -16 h 65.5 m -33.5 -16 h 128 m -152 -16 h 128" stroke="#000000" stroke-linecap="round" stroke-width="8" transform="matrix(0.25 0 0 0.25 -0.000056 53.125)"/> + </g> + <clipPath id="k"> + <rect height="128" width="128"/> + </clipPath> + <clipPath id="l"> + <rect height="128" width="128"/> + </clipPath> + <mask id="m"> + <g clip-path="url(#l)" filter="url(#b)"> + <g clip-path="url(#k)"> + <path d="m 24 28 v 92 h 72 c 4.433594 0 8 -3.566406 8 -8 v -76 c 0 -4.433594 -3.566406 -8 -8 -8 z m 0 0" fill="#26a269"/> + <path d="m 26 48 v 70 h 70 c 4.433594 0 8 -3.566406 8 -8 v -54 c 0 -4.433594 -3.566406 -8 -8 -8 z m 0 0" fill="url(#a)"/> + <path d="m 24 16 v 66 h 72 c 4.433594 0 8 -3.566406 8 -8 v -50 c 0 -4.433594 -3.566406 -8 -8 -8 z m 0 0" fill="#26a269"/> + <path d="m 24 8 v 72 h 72 c 4.433594 0 8 -3.566406 8 -8 v -56 c 0 -4.433594 -3.566406 -8 -8 -8 z m 0 0" fill="#2ec27e"/> + <path d="m 24 20.125 h 80 v 48 h -80 z m 0 0" fill="#57e389"/> + <use mask="url(#e)" xlink:href="#g"/> + <use mask="url(#h)" xlink:href="#j"/> + <path d="m 32 88.125 h 16 v 20 l -8 -7 l -8 7 z m 0 0" fill="#ed333b"/> + <path d="m 49.96875 44.40625 c -0.878906 0 -1.160156 -0.121094 -1.039062 -0.519531 l 3.558593 -8.960938 h 0.28125 l 3.28125 9.480469 z m -4.320312 8.160156 l 2.121093 -5.5625 c 0.199219 -0.519531 0.441407 -0.679687 1.398438 -0.679687 h 7.601562 l 2.238281 6.519531 c 0.5625 1.640625 -1.078124 1.480469 -2.957031 1.601562 c -0.242187 0.238282 -0.242187 1.121094 0 1.359376 c 1.480469 -0.039063 5.277344 -0.078126 6.839844 -0.078126 c 1.640625 0 3.878906 0.039063 5.359375 0.078126 c 0.238281 -0.238282 0.238281 -1.121094 0 -1.359376 c -1.558594 -0.121093 -2.878906 -0.121093 -3.601562 -2.160156 l -8.238282 -22.878906 c -0.601562 0.359375 -3 1.757812 -4.441406 1.757812 l -8.640625 20.480469 c -1.039063 2.480469 -2.277344 2.679688 -4 2.800781 c -0.238281 0.238282 -0.238281 1.121094 0 1.359376 c 1.480469 -0.039063 2.203125 -0.078126 3.761719 -0.078126 c 1.640625 0 3.839844 0.039063 5.320312 0.078126 c 0.238282 -0.238282 0.238282 -1.121094 0 -1.359376 c -1.519531 -0.082031 -3.402344 -0.242187 -2.761718 -1.878906 z m 0 0" fill="#1f8455"/> + <path d="m 79.992188 53.804688 c 0.277343 1.601562 1.359374 2.320312 3.117187 2.320312 c 2.199219 0 3.761719 -0.839844 5.242187 -2.238281 c -0.121093 -0.441407 -0.28125 -0.761719 -0.722656 -1.121094 c -0.519531 0.398437 -0.917968 0.558594 -1.679687 0.558594 c -0.878907 0 -1.117188 -0.71875 -1.117188 -2.679688 l 0.078125 -5.757812 c 0 -5.761719 -3.558594 -6.921875 -6.839844 -6.921875 c -2.921874 0 -7.441406 1.679687 -7.441406 4.320312 c 0 1.160156 0.480469 2.039063 2.082032 2.039063 c 1.398437 0 2.480468 -0.878907 2.480468 -1.878907 c 0 -0.519531 -0.28125 -1.199218 -0.199218 -1.878906 c 0.078124 -0.441406 0.359374 -0.921875 1.71875 -0.921875 c 1.679687 0 3.078124 0.71875 3.078124 5.800781 l -2.679687 0.839844 c -4.238281 1.320313 -7.160156 2.480469 -7.160156 5.640625 c 0 2.757813 1.519531 4.199219 5 4.199219 c 1.160156 0 3.480469 -1.28125 4.800781 -2.320312 z m -0.203126 -6.800782 v 5.28125 c -1 0.800782 -2 1.441406 -2.71875 1.441406 c -1.71875 0 -2.320312 -1.160156 -2.320312 -2.402343 c 0 -1.480469 0.121094 -2.679688 2.960938 -3.640625 z m 0 0" fill="#1f8455"/> + </g> + </g> + </mask> + <mask id="n"> + <g filter="url(#b)"> + <rect fill-opacity="0.8" height="128" width="128"/> + </g> + </mask> + <linearGradient id="o" gradientTransform="matrix(0 0.37 -0.98462 0 295.38501 -30.360001)" gradientUnits="userSpaceOnUse" x1="300" x2="428" y1="235" y2="235"> + <stop offset="0" stop-color="#f9f06b"/> + <stop offset="1" stop-color="#f5c211"/> + </linearGradient> + <clipPath id="p"> + <rect height="128" width="128"/> + </clipPath> + <clipPath id="q"> + <rect height="128" width="128"/> + </clipPath> + </defs> + <path d="m 24 28 v 92 h 72 c 4.433594 0 8 -3.566406 8 -8 v -76 c 0 -4.433594 -3.566406 -8 -8 -8 z m 0 0" fill="#26a269"/> + <path d="m 26 48 v 70 h 70 c 4.433594 0 8 -3.566406 8 -8 v -54 c 0 -4.433594 -3.566406 -8 -8 -8 z m 0 0" fill="url(#a)"/> + <path d="m 24 16 v 66 h 72 c 4.433594 0 8 -3.566406 8 -8 v -50 c 0 -4.433594 -3.566406 -8 -8 -8 z m 0 0" fill="#26a269"/> + <path d="m 24 8 v 72 h 72 c 4.433594 0 8 -3.566406 8 -8 v -56 c 0 -4.433594 -3.566406 -8 -8 -8 z m 0 0" fill="#2ec27e"/> + <path d="m 24 20.125 h 80 v 48 h -80 z m 0 0" fill="#57e389"/> + <use mask="url(#c)" xlink:href="#g"/> + <use mask="url(#d)" xlink:href="#j"/> + <path d="m 32 88.125 h 16 v 20 l -8 -7 l -8 7 z m 0 0" fill="#ed333b"/> + <path d="m 49.96875 44.40625 c -0.878906 0 -1.160156 -0.121094 -1.039062 -0.519531 l 3.558593 -8.960938 h 0.28125 l 3.28125 9.480469 z m -4.320312 8.160156 l 2.121093 -5.5625 c 0.199219 -0.519531 0.441407 -0.679687 1.398438 -0.679687 h 7.601562 l 2.238281 6.519531 c 0.5625 1.640625 -1.078124 1.480469 -2.957031 1.601562 c -0.242187 0.238282 -0.242187 1.121094 0 1.359376 c 1.480469 -0.039063 5.277344 -0.078126 6.839844 -0.078126 c 1.640625 0 3.878906 0.039063 5.359375 0.078126 c 0.238281 -0.238282 0.238281 -1.121094 0 -1.359376 c -1.558594 -0.121093 -2.878906 -0.121093 -3.601562 -2.160156 l -8.238282 -22.878906 c -0.601562 0.359375 -3 1.757812 -4.441406 1.757812 l -8.640625 20.480469 c -1.039063 2.480469 -2.277344 2.679688 -4 2.800781 c -0.238281 0.238282 -0.238281 1.121094 0 1.359376 c 1.480469 -0.039063 2.203125 -0.078126 3.761719 -0.078126 c 1.640625 0 3.839844 0.039063 5.320312 0.078126 c 0.238282 -0.238282 0.238282 -1.121094 0 -1.359376 c -1.519531 -0.082031 -3.402344 -0.242187 -2.761718 -1.878906 z m 0 0" fill="#1f8455"/> + <path d="m 79.992188 53.804688 c 0.277343 1.601562 1.359374 2.320312 3.117187 2.320312 c 2.199219 0 3.761719 -0.839844 5.242187 -2.238281 c -0.121093 -0.441407 -0.28125 -0.761719 -0.722656 -1.121094 c -0.519531 0.398437 -0.917968 0.558594 -1.679687 0.558594 c -0.878907 0 -1.117188 -0.71875 -1.117188 -2.679688 l 0.078125 -5.757812 c 0 -5.761719 -3.558594 -6.921875 -6.839844 -6.921875 c -2.921874 0 -7.441406 1.679687 -7.441406 4.320312 c 0 1.160156 0.480469 2.039063 2.082032 2.039063 c 1.398437 0 2.480468 -0.878907 2.480468 -1.878907 c 0 -0.519531 -0.28125 -1.199218 -0.199218 -1.878906 c 0.078124 -0.441406 0.359374 -0.921875 1.71875 -0.921875 c 1.679687 0 3.078124 0.71875 3.078124 5.800781 l -2.679687 0.839844 c -4.238281 1.320313 -7.160156 2.480469 -7.160156 5.640625 c 0 2.757813 1.519531 4.199219 5 4.199219 c 1.160156 0 3.480469 -1.28125 4.800781 -2.320312 z m -0.203126 -6.800782 v 5.28125 c -1 0.800782 -2 1.441406 -2.71875 1.441406 c -1.71875 0 -2.320312 -1.160156 -2.320312 -2.402343 c 0 -1.480469 0.121094 -2.679688 2.960938 -3.640625 z m 0 0" fill="#1f8455"/> + <g clip-path="url(#q)" mask="url(#m)"> + <g clip-path="url(#p)" mask="url(#n)"> + <path d="m 128 80.640625 v 47.359375 h -128 v -47.359375 z m 0 0" fill="url(#o)"/> + <path d="m 13.308594 80.640625 l 47.355468 47.359375 h 21.214844 l -47.359375 -47.359375 z m 42.421875 0 l 47.363281 47.359375 h 21.214844 l -47.363282 -47.359375 z m 42.429687 0 l 29.839844 29.839844 v -21.210938 l -8.628906 -8.628906 z m -98.160156 7.90625 v 21.214844 l 18.238281 18.238281 h 21.214844 z m 0 0"/> + </g> + </g> +</svg> diff --git a/data/meson.build b/data/meson.build index 33730a5..a143741 100644 --- a/data/meson.build +++ b/data/meson.build @@ -1,43 +1,61 @@ -i18n.merge_file ('desktop', - input: 'org.gnome.Dictionary.desktop.in', - output: 'org.gnome.Dictionary.desktop', - install: true, - install_dir: join_paths(gdict_datadir, 'applications'), - po_dir: po_dir, - type: 'desktop') +desktop_conf = configuration_data() +desktop_conf.set('icon', application_id) +desktop_conf.set('application_id', application_id) +i18n.merge_file('desktop', + input: configure_file( + input: 'org.gnome.Dictionary.desktop.in.in', + output: 'org.gnome.Dictionary.desktop.in', + configuration: desktop_conf, + ), + output: application_id + '.desktop', + install: true, + install_dir: gdict_datadir / 'applications', + po_dir: po_dir, + type: 'desktop', +) desktop_file_validate = find_program('desktop-file-validate', required: false) if desktop_file_validate.found() test('validate-desktop', - desktop_file_validate, - args: 'org.gnome.Dictionary.desktop', - workdir: meson.current_build_dir()) + desktop_file_validate, + args: application_id + '.desktop', + workdir: meson.current_build_dir(), + ) endif -i18n.merge_file ('appdata', - input: 'org.gnome.Dictionary.appdata.xml.in', - output: 'org.gnome.Dictionary.appdata.xml', - install: true, - install_dir: join_paths(gdict_datadir, 'metainfo'), - po_dir: po_dir) +appdata_conf = configuration_data() +appdata_conf.set('application_id', application_id) +i18n.merge_file('appdata', + input: configure_file( + input: 'org.gnome.Dictionary.appdata.xml.in.in', + output: 'org.gnome.Dictionary.appdata.xml.in', + configuration: appdata_conf, + ), + output: application_id + '.appdata.xml', + install: true, + install_dir: gdict_datadir / 'metainfo', + po_dir: po_dir, +) appstream_util = find_program('appstream-util', required: false) if appstream_util.found() test('validate-appdata', - appstream_util, - args: [ 'validate', '--nonet', 'org.gnome.Dictionary.appdata.xml' ], - workdir: meson.current_build_dir()) + appstream_util, + args: [ 'validate', '--nonet', application_id + '.appdata.xml' ], + workdir: meson.current_build_dir(), + ) endif service_conf = configuration_data () -service_conf.set ('bindir', gdict_bindir) -configure_file (input: 'org.gnome.Dictionary.service.in', - output: 'org.gnome.Dictionary.service', - configuration: service_conf, - install_dir: gdict_servicedir) +service_conf.set('bindir', gdict_bindir) +service_conf.set('application_id', application_id) +configure_file(input: 'org.gnome.Dictionary.service.in', + output: application_id + '.service', + configuration: service_conf, + install_dir: gdict_servicedir, +) -install_data ('org.gnome.dictionary.gschema.xml', - install_dir: gdict_schemadir) +install_data('org.gnome.dictionary.gschema.xml', install_dir: gdict_schemadir) subdir('icons') @@ -50,12 +68,13 @@ sources = [ foreach s: sources i18n.merge_file('sources', - input: '@0@.in'.format(s), - output: s, - install: true, - install_dir: join_paths(gdict_datadir, 'gdict-1.0', 'sources'), - po_dir: po_dir, - type: 'desktop') + input: '@0@.in'.format(s), + output: s, + install: true, + install_dir: gdict_datadir / 'gdict-1.0' / 'sources', + po_dir: po_dir, + type: 'desktop', + ) endforeach xsltproc = find_program('xsltproc', required: false) @@ -71,15 +90,16 @@ if get_option('build_man') and xsltproc.found() ] custom_target('man pages', - input: 'gnome-dictionary.xml', - output: 'gnome-dictionary.1', - command: [ - xsltproc, - xlstproc_flags, - '-o', '@OUTPUT@', - 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl', - '@INPUT@', - ], - install: true, - install_dir: join_paths(gdict_mandir, 'man1')) + input: 'gnome-dictionary.xml', + output: 'gnome-dictionary.1', + command: [ + xsltproc, + xlstproc_flags, + '-o', '@OUTPUT@', + 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl', + '@INPUT@', + ], + install: true, + install_dir: gdict_mandir / 'man1', + ) endif diff --git a/data/org.gnome.Dictionary.appdata.xml.in b/data/org.gnome.Dictionary.appdata.xml.in.in index 6ab2abd..4adfa79 100644 --- a/data/org.gnome.Dictionary.appdata.xml.in +++ b/data/org.gnome.Dictionary.appdata.xml.in.in @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <component type="desktop"> - <id>org.gnome.Dictionary.desktop</id> + <id>@application_id@</id> <metadata_license>CC0-1.0</metadata_license> - <project_license>GPL-3.0+ AND LGPL-2.0+ AND GFDL-1.3</project_license> + <project_license>GPL-2.0+ AND LGPL-2.0+ AND GFDL-1.3</project_license> <name>GNOME Dictionary</name> <summary>Check word definitions and spellings in an online dictionary</summary> <description> @@ -14,7 +14,7 @@ needs. </p> </description> - <url type="homepage">https://wiki.gnome.org/Dictionary</url> + <url type="homepage">https://wiki.gnome.org/Apps/Dictionary</url> <url type="bugtracker">https://gitlab.gnome.org/GNOME/gnome-dictionary/issues</url> <url type="donation">http://www.gnome.org/friends/</url> <url type="help">https://help.gnome.org/users/gnome-dictionary/stable/</url> diff --git a/data/org.gnome.Dictionary.desktop.in b/data/org.gnome.Dictionary.desktop.in.in index 3694979..d1c97ae 100644 --- a/data/org.gnome.Dictionary.desktop.in +++ b/data/org.gnome.Dictionary.desktop.in.in @@ -7,7 +7,7 @@ Exec=gnome-dictionary Terminal=false Type=Application # Translators: Do NOT translate or transliterate this text (this is an icon file name)! -Icon=org.gnome.Dictionary +Icon=@application_id@ StartupNotify=true Categories=GNOME;GTK;Office;Dictionary; NotShowIn=KDE; diff --git a/data/org.gnome.Dictionary.json b/data/org.gnome.Dictionary.json deleted file mode 100644 index 78d6241..0000000 --- a/data/org.gnome.Dictionary.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "app-id": "org.gnome.Dictionary", - "runtime": "org.gnome.Platform", - "runtime-version": "master", - "sdk": "org.gnome.Sdk", - "command": "gnome-dictionary", - "tags": ["nightly"], - "desktop-file-name-prefix": "(Nightly) ", - "finish-args": [ - "--share=ipc", "--socket=x11", - "--socket=wayland", - "--share=network", - "--filesystem=xdg-run/dconf", "--filesystem=~/.config/dconf:ro", - "--talk-name=ca.desrt.dconf", "--env=DCONF_USER_CONFIG_DIR=.config/dconf" - ], - "build-options" : { - "cflags": "-O2 -g", - "cxxflags": "-O2 -g", - "env": { - "V": 1 - } - }, - "cleanup": ["/include", "/lib/pkgconfig", - "/share/pkgconfig", "/share/aclocal", - "/man", "/share/man", "/share/gtk-doc", - "*.la", "*.a", - "/lib/girepository-1.0", - "/share/doc", "/share/gir-1.0" - ], - "modules": [ - { - "name": "gnome-dictionary", - "buildsystem": "meson", - "builddir": true, - "config-opts": [ "--libdir=/app/lib", "-Dbuild_man=false" ], - "sources": [ - { - "type": "git", - "url": "https://gitlab.gnome.org/GNOME/gnome-dictionary.git" - } - ] - } - ] -} diff --git a/data/org.gnome.Dictionary.service.in b/data/org.gnome.Dictionary.service.in index e33fc01..9bf55d3 100644 --- a/data/org.gnome.Dictionary.service.in +++ b/data/org.gnome.Dictionary.service.in @@ -1,3 +1,3 @@ [D-BUS Service] -Name=org.gnome.Dictionary +Name=@application_id@ Exec=@bindir@/gnome-dictionary --gapplication-service diff --git a/gnome-dictionary.doap b/gnome-dictionary.doap index cc2427a..92373c1 100644 --- a/gnome-dictionary.doap +++ b/gnome-dictionary.doap @@ -6,11 +6,10 @@ <name xml:lang="en">gnome-dictionary</name> <shortdesc xml:lang="en">Look up words in dictionary sources</shortdesc> - <description xml:lang="en">GNOME Dictionary can look for the definition -or translation of a word in existing databases over the internet.</description> + <description xml:lang="en">GNOME Dictionary can look for the definition or translation of a word in existing databases over the internet.</description> <homepage rdf:resource="https://wiki.gnome.org/Apps/Dictionary" /> - <mailing-list rdf:resource="http://mail.gnome.org/mailman/listinfo/gnome-utils-list" /> - <download-page rdf:resource="http://download.gnome.org/sources/gnome-dictionary/"/> + <support-forum rdf:resource="https://discourse.gnome.org/tag/dictionary" /> + <download-page rdf:resource="https://download.gnome.org/sources/gnome-dictionary/"/> <bug-database rdf:resource="https://gitlab.gnome.org/GNOME/gnome-dictionary/issues/" /> <license rdf:resource="http://usefulinc.com/doap/licenses/gpl"/> <category rdf:resource="http://api.gnome.org/doap-extensions#apps" /> @@ -19,23 +18,9 @@ or translation of a word in existing databases over the internet.</description> <maintainer> <foaf:Person> <foaf:name>Emmanuele Bassi</foaf:name> - <foaf:mbox rdf:resource="mailto:ebassi@gmail.com" /> + <foaf:mbox rdf:resource="mailto:ebassi@gnome.org" /> <gnome:userid>ebassi</gnome:userid> </foaf:Person> </maintainer> - <maintainer> - <foaf:Person> - <foaf:name>Sindhu S</foaf:name> - <foaf:mbox rdf:resource="mailto:sindhus@live.in" /> - <gnome:userid>sindhus</gnome:userid> - </foaf:Person> - </maintainer> - <maintainer> - <foaf:Person> - <foaf:name>Juan R. GarcĂa Blanco</foaf:name> - <foaf:mbox rdf:resource="mailto:juanrgar@gmail.com" /> - <gnome:userid>juanrgar</gnome:userid> - </foaf:Person> - </maintainer> </Project> diff --git a/help/meson.build b/help/meson.build index c742dad..d6a1fdb 100644 --- a/help/meson.build +++ b/help/meson.build @@ -1,27 +1,28 @@ gnome.yelp('gnome-dictionary', - sources: [ - 'definition.page', - 'dictionary-select.page', - 'find.page', - 'index.page', - 'introduction.page', - 'keyboard-shortcuts.page', - 'legal.xml', - 'pref.page', - 'print-font.page', - 'print.page', - 'prob-retrieving-definition.page', - 'save-definition.page', - 'similar-words.page', - 'source-add-local.page', - 'sources-default.page', - 'sources-delete.page', - 'sources-edit.page', - 'sources.page', - 'sources-select.page', - 'text-copy.page', - ], - media: [ - 'figures/gnome-dictionary-icon.png', - 'figures/gnome-dictionary-3-26.png', - ]) + sources: [ + 'definition.page', + 'dictionary-select.page', + 'find.page', + 'index.page', + 'introduction.page', + 'keyboard-shortcuts.page', + 'legal.xml', + 'pref.page', + 'print-font.page', + 'print.page', + 'prob-retrieving-definition.page', + 'save-definition.page', + 'similar-words.page', + 'source-add-local.page', + 'sources-default.page', + 'sources-delete.page', + 'sources-edit.page', + 'sources.page', + 'sources-select.page', + 'text-copy.page', + ], + media: [ + 'figures/gnome-dictionary-icon.png', + 'figures/gnome-dictionary-3-26.png', + ], +) diff --git a/libgdict/gdict-client-context.c b/libgdict/gdict-client-context.c index 6875366..6fed76b 100644 --- a/libgdict/gdict-client-context.c +++ b/libgdict/gdict-client-context.c @@ -28,9 +28,7 @@ * #GdictSource instead. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include <stdio.h> #include <stdlib.h> @@ -157,7 +155,6 @@ enum static guint gdict_client_context_signals[LAST_SIGNAL] = { 0 }; -#define GDICT_CLIENT_CONTEXT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GDICT_TYPE_CLIENT_CONTEXT, GdictClientContextPrivate)) struct _GdictClientContextPrivate { #ifdef ENABLE_IPV6 @@ -193,8 +190,9 @@ static void gdict_client_context_iface_init (GdictContextIface *iface); G_DEFINE_TYPE_WITH_CODE (GdictClientContext, gdict_client_context, G_TYPE_OBJECT, + G_ADD_PRIVATE (GdictClientContext) G_IMPLEMENT_INTERFACE (GDICT_TYPE_CONTEXT, - gdict_client_context_iface_init)); + gdict_client_context_iface_init)) /* GObject methods */ static void gdict_client_context_set_property (GObject *object, @@ -366,8 +364,6 @@ gdict_client_context_class_init (GdictClientContextClass *klass) klass->connected = gdict_client_context_real_connected; klass->disconnected = gdict_client_context_real_disconnected; - - g_type_class_add_private (gobject_class, sizeof (GdictClientContextPrivate)); } static void @@ -375,7 +371,7 @@ gdict_client_context_init (GdictClientContext *context) { GdictClientContextPrivate *priv; - priv = GDICT_CLIENT_CONTEXT_GET_PRIVATE (context); + priv = gdict_client_context_get_instance_private (context); context->priv = priv; priv->hostname = NULL; @@ -405,8 +401,9 @@ gdict_client_context_set_property (GObject *object, const GValue *value, GParamSpec *pspec) { - GdictClientContextPrivate *priv = GDICT_CLIENT_CONTEXT_GET_PRIVATE (object); - + GdictClientContext *self = GDICT_CLIENT_CONTEXT (object); + GdictClientContextPrivate *priv = gdict_client_context_get_instance_private (self); + switch (prop_id) { case PROP_HOSTNAME: @@ -438,8 +435,9 @@ gdict_client_context_get_property (GObject *object, GValue *value, GParamSpec *pspec) { - GdictClientContextPrivate *priv = GDICT_CLIENT_CONTEXT_GET_PRIVATE (object); - + GdictClientContext *self = GDICT_CLIENT_CONTEXT (object); + GdictClientContextPrivate *priv = gdict_client_context_get_instance_private (self); + switch (prop_id) { case PROP_STATUS: diff --git a/libgdict/gdict-context.c b/libgdict/gdict-context.c index ccab7a8..dfadc99 100644 --- a/libgdict/gdict-context.c +++ b/libgdict/gdict-context.c @@ -35,9 +35,7 @@ * implementations. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include <glib/gi18n-lib.h> diff --git a/libgdict/gdict-database-chooser-button.c b/libgdict/gdict-database-chooser-button.c index fbdb191..52ceabb 100644 --- a/libgdict/gdict-database-chooser-button.c +++ b/libgdict/gdict-database-chooser-button.c @@ -29,9 +29,7 @@ * #GdictDatabaseChooserButton is available since Gdict 0.10 */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include <stdio.h> #include <stdlib.h> diff --git a/libgdict/gdict-database-chooser.c b/libgdict/gdict-database-chooser.c index 2c4d5ab..36ab547 100644 --- a/libgdict/gdict-database-chooser.c +++ b/libgdict/gdict-database-chooser.c @@ -27,9 +27,7 @@ * #GdictDatabaseChooser is available since Gdict 0.10 */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include <stdio.h> #include <stdlib.h> @@ -47,9 +45,6 @@ #include "gdict-enum-types.h" #include "gdict-marshal.h" -#define GDICT_DATABASE_CHOOSER_GET_PRIVATE(obj) \ -(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GDICT_TYPE_DATABASE_CHOOSER, GdictDatabaseChooserPrivate)) - struct _GdictDatabaseChooserPrivate { GtkListStore *store; @@ -108,9 +103,9 @@ enum static guint db_chooser_signals[LAST_SIGNAL] = { 0 }; -G_DEFINE_TYPE (GdictDatabaseChooser, - gdict_database_chooser, - GTK_TYPE_BOX) +G_DEFINE_TYPE_WITH_PRIVATE (GdictDatabaseChooser, + gdict_database_chooser, + GTK_TYPE_BOX) static void set_gdict_context (GdictDatabaseChooser *chooser, @@ -361,6 +356,7 @@ gdict_database_chooser_constructor (GType type, gtk_widget_show (priv->treeview); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); + gtk_style_context_add_class (gtk_widget_get_style_context (hbox), "inline-toolbar"); priv->buttons_box = hbox; priv->refresh_button = gtk_button_new (); @@ -472,8 +468,6 @@ gdict_database_chooser_class_init (GdictDatabaseChooserClass *klass) NULL, NULL, gdict_marshal_VOID__VOID, G_TYPE_NONE, 0); - - g_type_class_add_private (gobject_class, sizeof (GdictDatabaseChooserPrivate)); } static void @@ -481,7 +475,7 @@ gdict_database_chooser_init (GdictDatabaseChooser *chooser) { GdictDatabaseChooserPrivate *priv; - chooser->priv = priv = GDICT_DATABASE_CHOOSER_GET_PRIVATE (chooser); + chooser->priv = priv = gdict_database_chooser_get_instance_private (chooser); gtk_orientable_set_orientation (GTK_ORIENTABLE (chooser), GTK_ORIENTATION_VERTICAL); diff --git a/libgdict/gdict-defbox.c b/libgdict/gdict-defbox.c index 4f07868..dda7109 100644 --- a/libgdict/gdict-defbox.c +++ b/libgdict/gdict-defbox.c @@ -28,9 +28,7 @@ * bar. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include <stdio.h> #include <stdlib.h> diff --git a/libgdict/gdict-source-chooser.c b/libgdict/gdict-source-chooser.c index 8ec33a2..1eb7003 100644 --- a/libgdict/gdict-source-chooser.c +++ b/libgdict/gdict-source-chooser.c @@ -27,9 +27,7 @@ * #GdictSourceChooser is available since Gdict 0.12. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include <stdlib.h> #include <string.h> diff --git a/libgdict/gdict-source-loader.c b/libgdict/gdict-source-loader.c index 1dd4740..4ba5414 100644 --- a/libgdict/gdict-source-loader.c +++ b/libgdict/gdict-source-loader.c @@ -24,9 +24,7 @@ * files inside a set of paths and return a #GdictSource using its name. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include <stdio.h> #include <stdlib.h> @@ -47,8 +45,6 @@ #define GDICT_SOURCE_FILE_SUFFIX ".desktop" -#define GDICT_SOURCE_LOADER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GDICT_TYPE_SOURCE_LOADER, GdictSourceLoaderPrivate)) - struct _GdictSourceLoaderPrivate { GSList *paths; @@ -76,38 +72,18 @@ enum static guint loader_signals[LAST_SIGNAL] = { 0 }; - - -G_DEFINE_TYPE (GdictSourceLoader, gdict_source_loader, G_TYPE_OBJECT); - +G_DEFINE_TYPE_WITH_PRIVATE (GdictSourceLoader, gdict_source_loader, G_TYPE_OBJECT) static void gdict_source_loader_finalize (GObject *object) { - GdictSourceLoaderPrivate *priv = GDICT_SOURCE_LOADER_GET_PRIVATE (object); - - if (priv->paths) - { - g_slist_foreach (priv->paths, - (GFunc) g_free, - NULL); - g_slist_free (priv->paths); - - priv->paths = NULL; - } - - if (priv->sources_by_name) - g_hash_table_destroy (priv->sources_by_name); - - if (priv->sources) - { - g_slist_foreach (priv->sources, - (GFunc) g_object_unref, - NULL); - g_slist_free (priv->sources); - - priv->sources = NULL; - } + GdictSourceLoader *self = GDICT_SOURCE_LOADER (object); + GdictSourceLoaderPrivate *priv = gdict_source_loader_get_instance_private (self); + + g_clear_pointer (&priv->sources_by_name, g_hash_table_unref); + + g_slist_free_full (priv->paths, g_free); + g_slist_free_full (priv->sources, g_object_unref); G_OBJECT_CLASS (gdict_source_loader_parent_class)->finalize (object); } @@ -203,8 +179,6 @@ gdict_source_loader_class_init (GdictSourceLoaderClass *klass) gdict_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GDICT_TYPE_SOURCE); - - g_type_class_add_private (klass, sizeof (GdictSourceLoaderPrivate)); } static void @@ -212,7 +186,7 @@ gdict_source_loader_init (GdictSourceLoader *loader) { GdictSourceLoaderPrivate *priv; - priv = GDICT_SOURCE_LOADER_GET_PRIVATE (loader); + priv = gdict_source_loader_get_instance_private (loader); loader->priv = priv; priv->paths = NULL; diff --git a/libgdict/gdict-source.c b/libgdict/gdict-source.c index d6f8b62..6afef9a 100644 --- a/libgdict/gdict-source.c +++ b/libgdict/gdict-source.c @@ -29,9 +29,7 @@ * #GdictContext, already set up with the right parameters. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include <stdio.h> #include <stdlib.h> @@ -61,9 +59,6 @@ #define SOURCE_KEY_HOSTNAME "Hostname" #define SOURCE_KEY_PORT "Port" - -#define GDICT_SOURCE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GDICT_TYPE_SOURCE, GdictSourcePrivate)) - struct _GdictSourcePrivate { gchar *filename; @@ -118,8 +113,7 @@ gdict_source_error_quark (void) } -G_DEFINE_TYPE (GdictSource, gdict_source, G_TYPE_OBJECT); - +G_DEFINE_TYPE_WITH_PRIVATE (GdictSource, gdict_source, G_TYPE_OBJECT) static void @@ -197,21 +191,17 @@ gdict_source_get_property (GObject *object, static void gdict_source_finalize (GObject *object) { - GdictSourcePrivate *priv = GDICT_SOURCE_GET_PRIVATE (object); + GdictSource *self = GDICT_SOURCE (object); + GdictSourcePrivate *priv = gdict_source_get_instance_private (self); g_free (priv->filename); - - if (priv->keyfile) - g_key_file_free (priv->keyfile); - g_free (priv->name); g_free (priv->description); - g_free (priv->database); g_free (priv->strategy); - if (priv->context) - g_object_unref (priv->context); + g_clear_pointer (&priv->keyfile, g_key_file_unref); + g_clear_object (&priv->context); G_OBJECT_CLASS (gdict_source_parent_class)->finalize (object); } @@ -338,8 +328,6 @@ gdict_source_class_init (GdictSourceClass *klass) "The GdictContext bound to this source", GDICT_TYPE_CONTEXT, G_PARAM_READABLE)); - - g_type_class_add_private (klass, sizeof (GdictSourcePrivate)); } static void @@ -347,20 +335,12 @@ gdict_source_init (GdictSource *source) { GdictSourcePrivate *priv; - priv = GDICT_SOURCE_GET_PRIVATE (source); + priv = gdict_source_get_instance_private (source); source->priv = priv; - priv->filename = NULL; priv->keyfile = g_key_file_new (); - - priv->name = NULL; - priv->description = NULL; - priv->editable = TRUE; - priv->database = NULL; - priv->strategy = NULL; priv->transport = GDICT_SOURCE_TRANSPORT_INVALID; - - priv->context = NULL; + priv->editable = TRUE; } /** diff --git a/libgdict/gdict-speller.c b/libgdict/gdict-speller.c index 792ff34..05889cf 100644 --- a/libgdict/gdict-speller.c +++ b/libgdict/gdict-speller.c @@ -24,9 +24,7 @@ * #GdictContext query, using a specific database and a matching strategy. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include <stdio.h> #include <stdlib.h> diff --git a/libgdict/gdict-strategy-chooser.c b/libgdict/gdict-strategy-chooser.c index 901ac19..a2a9ffb 100644 --- a/libgdict/gdict-strategy-chooser.c +++ b/libgdict/gdict-strategy-chooser.c @@ -25,9 +25,7 @@ * displays the list of available matching strategies. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include <stdio.h> #include <stdlib.h> diff --git a/libgdict/gdict-utils.c b/libgdict/gdict-utils.c index 7de6c36..f3ee8dc 100644 --- a/libgdict/gdict-utils.c +++ b/libgdict/gdict-utils.c @@ -16,9 +16,7 @@ * along with this library. If not, see <http://www.gnu.org/licenses/>. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include <stdio.h> #include <string.h> diff --git a/libgdict/meson.build b/libgdict/meson.build index 5df874c..18bd715 100644 --- a/libgdict/meson.build +++ b/libgdict/meson.build @@ -33,20 +33,22 @@ sources_c = [ ] libgdict_enums = gnome.mkenums('gdict-enum-types', sources: sources_h, - h_template: 'gdict-enum-types.h.in', - c_template: 'gdict-enum-types.c.in', - install_header: false) + h_template: 'gdict-enum-types.h.in', + c_template: 'gdict-enum-types.c.in', + install_header: false, +) + libgdict_marshal = gnome.genmarshal('gdict-marshal', - sources: 'gdict-marshal.list', - prefix: 'gdict_marshal') + sources: 'gdict-marshal.list', + prefix: 'gdict_marshal', +) libgdict_version = meson.project_version().split('.') libgdict_major = libgdict_version[0].to_int() -libgdict_minor = libgdict_version[1].to_int() -libgdict_micro = libgdict_version[2].to_int() +libgdict_minor = libgdict_version[1] in ['alpha', 'beta', 'rc'] ? 0 : libgdict_version[1].to_int() +libgdict_micro = 0 libgdict_cflags = [ - '-DHAVE_CONFIG_H', '-D_GNU_SOURCE', '-DG_LOG_DOMAIN="Gdict"', '-DDATADIR="@0@"'.format(gdict_datadir), @@ -67,26 +69,23 @@ libgdict_cflags = [ '-DGTK_DISABLE_SINGLE_INCLUDES', ] -libgdict_ldflags = [] -if cc.get_id() == 'gcc' - libgdict_ldflags += [ - '-Wl,-Bsymbolic-functions', - '-Wl,-z,relro', - '-Wl,-z,now', - ] -endif - -libgdict_inc = include_directories('.') +libgdict_ldflags = cc.get_supported_link_arguments([ + '-Wl,-Bsymbolic-functions', + '-Wl,-z,relro', + '-Wl,-z,now', +]) libgdict_lib = static_library('libgdict-1.0', - sources: sources_h_priv + sources_c + libgdict_enums + libgdict_marshal, - dependencies: [ gio_dep, gtk_dep, ipv6_deps ], - include_directories: [ root_dir, libgdict_inc ], - c_args: common_cflags + debug_cflags + libgdict_cflags, - link_args: libgdict_ldflags, - install: false) + sources: sources_c + libgdict_enums + libgdict_marshal, + dependencies: [ gio_dep, gtk_dep, ipv6_deps ], + include_directories: root_inc, + c_args: common_cflags + debug_cflags + libgdict_cflags, + link_args: libgdict_ldflags, + install: false, +) libgdict_dep = declare_dependency(sources: libgdict_enums + libgdict_marshal, - link_with: libgdict_lib, - include_directories: [ libgdict_inc ], - dependencies: [ gio_dep, gtk_dep, ipv6_deps ]) + link_with: libgdict_lib, + include_directories: [ libgdict_inc ], + dependencies: [ gio_dep, gtk_dep, ipv6_deps ], +) diff --git a/meson.build b/meson.build index 819371e..3be6c46 100644 --- a/meson.build +++ b/meson.build @@ -1,23 +1,27 @@ -project('gnome-dictionary', 'c', version: '3.26.2', +project('gnome-dictionary', 'c', version: '40.alpha', default_options: [ 'buildtype=debugoptimized', 'c_std=c99', 'warning_level=1', ], license: 'GPLv2+', - meson_version: '>= 0.42.0') + meson_version: '>= 0.54.0') + +gdict_version = meson.project_version().split('.') +gdict_major_version = gdict_version[0].to_int() +gdict_minor_version = gdict_version[1] # Paths for the pkg-config file gdict_prefix = get_option('prefix') -gdict_bindir = join_paths(gdict_prefix, get_option('bindir')) -gdict_libdir = join_paths(gdict_prefix, get_option('libdir')) -gdict_datadir = join_paths(gdict_prefix, get_option('datadir')) -gdict_includedir = join_paths(gdict_prefix, get_option('includedir')) -gdict_libexecdir = join_paths(gdict_prefix, get_option('libexecdir')) -gdict_mandir = join_paths(gdict_prefix, get_option('mandir')) -gdict_sysconfdir = join_paths(gdict_prefix, get_option('sysconfdir')) -gdict_schemadir = join_paths (gdict_datadir, 'glib-2.0', 'schemas') -gdict_servicedir = join_paths (gdict_datadir, 'dbus-1', 'services') +gdict_bindir = gdict_prefix / get_option('bindir') +gdict_libdir = gdict_prefix / get_option('libdir') +gdict_datadir = gdict_prefix / get_option('datadir') +gdict_includedir = gdict_prefix / get_option('includedir') +gdict_libexecdir = gdict_prefix / get_option('libexecdir') +gdict_mandir = gdict_prefix / get_option('mandir') +gdict_sysconfdir = gdict_prefix / get_option('sysconfdir') +gdict_schemadir = gdict_datadir / 'glib-2.0' / 'schemas' +gdict_servicedir = gdict_datadir / 'dbus-1' / 'services' cc = meson.get_compiler('c') host_system = host_machine.system() @@ -68,20 +72,27 @@ else test_cflags = [] endif -common_cflags = [] -foreach cflag: test_cflags - if cc.has_argument(cflag) - common_cflags += [ cflag ] - endif -endforeach +common_cflags = cc.get_supported_arguments(test_cflags) -debug_cflags = [] +profile = get_option('profile') +debug = get_option('debug') +optimization = get_option('optimization') buildtype = get_option('buildtype') -if buildtype == 'debug' - debug_cflags += [ '-DGDICT_ENABLE_DEBUG', ] -elif buildtype == 'debugoptimized' - debug_cflags += [ '-DGDICT_ENABLE_DEBUG', '-DG_DISABLE_CAST_CHECKS', ] -elif buildtype == 'release' +debug_cflags = [] + +if profile == 'devel' or gdict_minor_version in ['alpha', 'beta', 'rc'] + application_id = 'org.gnome.Dictionary.Devel' +else + application_id = 'org.gnome.Dictionary' +endif + +if debug + debug_cflags += '-DGDICT_ENABLE_DEBUG' +elif optimization in ['2', '3', 's'] + debug_cflags += '-DG_DISABLE_CAST_CHECKS' +endif + +if buildtype == 'release' debug_cflags += [ '-DG_DISABLE_ASSERT', '-DG_DISABLE_CHECKS', '-DG_DISABLE_CAST_CHECKS', ] endif @@ -121,7 +132,9 @@ endif conf.set10('ENABLE_IPV6', use_ipv6) -root_dir = include_directories('.') +root_inc = include_directories('.') +libgdict_inc = include_directories('libgdict') +src_inc = include_directories('src') po_dir = join_paths(meson.current_source_dir(), 'po') configure_file(output: 'config.h', configuration: conf) @@ -139,4 +152,4 @@ subdir('data') subdir('help') # Post-installation trigger -meson.add_install_script ('build-aux/post-install.sh') +meson.add_install_script ('build-aux/meson/post-install.py') diff --git a/meson_options.txt b/meson_options.txt index 4c1b206..9d1a5dd 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,2 +1,3 @@ option('use_ipv6', type: 'boolean', value: true, description: 'Enable IPv6 support') option('build_man', type: 'boolean', value: true, description: 'Generate man page (requires xsltproc)') +option('profile', type: 'combo', choices: ['stable', 'devel'], value: 'stable', description: 'The build profile') diff --git a/po/POTFILES.in b/po/POTFILES.in index 15574ac..95ada05 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,8 +1,8 @@ # List of source files containing translatable strings. # Please keep this file sorted alphabetically. data/default.desktop.in -data/org.gnome.Dictionary.appdata.xml.in -data/org.gnome.Dictionary.desktop.in +data/org.gnome.Dictionary.appdata.xml.in.in +data/org.gnome.Dictionary.desktop.in.in data/org.gnome.dictionary.gschema.xml data/spanish.desktop.in data/thai.desktop.in diff --git a/src/gdict-about.c b/src/gdict-about.c index 94a5820..3125487 100644 --- a/src/gdict-about.c +++ b/src/gdict-about.c @@ -18,9 +18,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include <stdio.h> #include <stdlib.h> @@ -30,6 +28,7 @@ #include <gdk-pixbuf/gdk-pixbuf.h> #include "gdict-about.h" +#include "gdict-common.h" void gdict_show_about_dialog (GtkWidget *parent) @@ -51,21 +50,23 @@ gdict_show_about_dialog (GtkWidget *parent) }; const gchar *translator_credits = _("translator-credits"); - const gchar *copyright = "Copyright \xc2\xa9 2005-2006 Emmanuele Bassi"; + const gchar *copyright = "Copyright \xc2\xa9 2005 Emmanuele Bassi"; const gchar *comments = _("Look up words in dictionaries"); - g_return_if_fail (GTK_IS_WIDGET (parent)); + g_return_if_fail (GTK_IS_WINDOW (parent)); - gtk_show_about_dialog (GTK_IS_WINDOW (parent) ? GTK_WINDOW (parent) : NULL, - "program-name", _("Dictionary"), - "version", VERSION, - "copyright", copyright, - "comments", comments, - "authors", authors, - "documenters", documenters, - "translator-credits", translator_credits, - "logo-icon-name", "org.gnome.Dictionary", - "license-type", GTK_LICENSE_GPL_2_0, - "screen", gtk_widget_get_screen (parent), - NULL); + gtk_show_about_dialog (GTK_WINDOW (parent), + "program-name", + gdict_is_devel_build () + ? _("Dictionary (development build)") + : _("Dictionary"), + "version", VERSION, + "copyright", copyright, + "comments", comments, + "authors", authors, + "documenters", documenters, + "translator-credits", translator_credits, + "logo-icon-name", APPLICATION_ID, + "license-type", GTK_LICENSE_GPL_2_0, + NULL); } diff --git a/src/gdict-app.c b/src/gdict-app.c index 751fd32..12021f2 100644 --- a/src/gdict-app.c +++ b/src/gdict-app.c @@ -18,9 +18,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include <stdio.h> #include <stdlib.h> @@ -367,14 +365,14 @@ gdict_app_init (GdictApp *app) g_application_add_main_option_entries (G_APPLICATION (app), gdict_app_goptions); /* Set main application icon */ - gtk_window_set_default_icon_name ("org.gnome.Dictionary"); + gtk_window_set_default_icon_name (APPLICATION_ID); } GApplication * gdict_app_new (void) { return g_object_new (gdict_app_get_type (), - "application-id", "org.gnome.Dictionary", + "application-id", APPLICATION_ID, "resource-base-path", "/org/gnome/Dictionary", "flags", G_APPLICATION_HANDLES_COMMAND_LINE, NULL); diff --git a/src/gdict-common.c b/src/gdict-common.c index a3541b9..ad2e77a 100644 --- a/src/gdict-common.c +++ b/src/gdict-common.c @@ -18,9 +18,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include <stdio.h> #include <stdlib.h> @@ -243,3 +241,13 @@ gdict_show_gerror_dialog (GtkWindow *parent, g_error_free (error); error = NULL; } + +gboolean +gdict_is_devel_build (void) +{ +#ifdef DEVELOPMENT_BUILD + return TRUE; +#else + return FALSE; +#endif +} diff --git a/src/gdict-common.h b/src/gdict-common.h index 234ab1d..c9a646d 100644 --- a/src/gdict-common.h +++ b/src/gdict-common.h @@ -25,7 +25,7 @@ G_BEGIN_DECLS -gchar * gdict_get_data_dir (void) G_GNUC_MALLOC; +gchar * gdict_get_data_dir (void) G_GNUC_MALLOC; gchar * gdict_get_old_data_dir (void) G_GNUC_MALLOC; gchar * gdict_get_config_dir (void) G_GNUC_MALLOC; @@ -39,6 +39,8 @@ void gdict_show_gerror_dialog (GtkWindow *parent, const gchar *message, GError *error); +gboolean gdict_is_devel_build (void); + G_END_DECLS #endif /* __GDICT_COMMON_H__ */ diff --git a/src/gdict-pref-dialog.c b/src/gdict-pref-dialog.c index 5bc7ab4..632ffa7 100644 --- a/src/gdict-pref-dialog.c +++ b/src/gdict-pref-dialog.c @@ -18,9 +18,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include <stdio.h> #include <stdlib.h> diff --git a/src/gdict-print.c b/src/gdict-print.c index c165f75..d244d2f 100644 --- a/src/gdict-print.c +++ b/src/gdict-print.c @@ -18,9 +18,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include <stdio.h> #include <string.h> diff --git a/src/gdict-sidebar.c b/src/gdict-sidebar.c index bccb89d..8a535d6 100644 --- a/src/gdict-sidebar.c +++ b/src/gdict-sidebar.c @@ -20,9 +20,7 @@ * Copyright (C) 2004 Red Hat, Inc. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include <stdio.h> #include <stdlib.h> @@ -46,8 +44,6 @@ typedef struct GtkWidget *menu_item; } SidebarPage; -#define GDICT_SIDEBAR_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GDICT_TYPE_SIDEBAR, GdictSidebarPrivate)) - struct _GdictSidebarPrivate { GHashTable *pages_by_id; @@ -72,7 +68,7 @@ enum static guint sidebar_signals[LAST_SIGNAL] = { 0 }; static GQuark sidebar_page_id_quark = 0; -G_DEFINE_TYPE (GdictSidebar, gdict_sidebar, GTK_TYPE_BOX); +G_DEFINE_TYPE_WITH_PRIVATE (GdictSidebar, gdict_sidebar, GTK_TYPE_BOX) SidebarPage * sidebar_page_new (const gchar *id, @@ -300,8 +296,6 @@ gdict_sidebar_class_init (GdictSidebarClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - g_type_class_add_private (gobject_class, sizeof (GdictSidebarPrivate)); - sidebar_page_id_quark = g_quark_from_static_string ("gdict-sidebar-page-id"); gobject_class->finalize = gdict_sidebar_finalize; @@ -335,7 +329,7 @@ gdict_sidebar_init (GdictSidebar *sidebar) GtkWidget *close_button; GtkWidget *arrow; - sidebar->priv = priv = GDICT_SIDEBAR_GET_PRIVATE (sidebar); + sidebar->priv = priv = gdict_sidebar_get_instance_private (sidebar); gtk_orientable_set_orientation (GTK_ORIENTABLE (sidebar), GTK_ORIENTATION_VERTICAL); diff --git a/src/gdict-source-dialog.c b/src/gdict-source-dialog.c index f955078..df99999 100644 --- a/src/gdict-source-dialog.c +++ b/src/gdict-source-dialog.c @@ -18,9 +18,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include <stdio.h> #include <stdlib.h> @@ -34,7 +34,7 @@ main (int argc, char *argv[]) bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); - g_set_prgname ("gnome-dictionary"); + g_set_prgname (APPLICATION_ID); if (!gdict_create_config_dir ()) exit (1); diff --git a/src/meson.build b/src/meson.build index 4caa1aa..915331a 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,44 +1,44 @@ app_sources = [ 'gdict-about.c', - 'gdict-about.h', 'gdict-app.c', 'gdict-app.h', 'gdict-common.c', - 'gdict-common.h', 'gdict-pref-dialog.c', - 'gdict-pref-dialog.h', 'gdict-print.c', - 'gdict-print.h', 'gdict-sidebar.c', - 'gdict-sidebar.h', 'gdict-source-dialog.c', - 'gdict-source-dialog.h', 'gdict-window.c', - 'gdict-window.h', 'main.c', ] resources = gnome.compile_resources ('gdict-resources', - 'gdict.gresource.xml', - source_dir: '.', - c_name: 'gdict') + 'gdict.gresource.xml', + source_dir: '.', + c_name: 'gdict', +) + +gdict_cflags = [ + '-DPREFIX="@0@"'.format(gdict_prefix), + '-DSYSCONFDIR="@0@"'.format(gdict_sysconfdir), + '-DLIBDIR="@0@"'.format(gdict_libdir), + '-DDATADIR="@0@"'.format(gdict_datadir), + '-DPKGDATADIR="@0@"'.format(join_paths(gdict_datadir, 'gnome-dictionary')), + '-DGNOMELOCALEDIR="@0@"'.format(join_paths(gdict_datadir, 'locale')), + '-DAPPLICATION_ID="@0@"'.format(application_id), +] + +if profile == 'devel' or gdict_minor_version in ['alpha', 'beta', 'rc'] + gdict_cflags += [ + '-DDEVELOPMENT_BUILD', + ] +endif mathlib = cc.find_library('m', required: false) -executable('gnome-dictionary', app_sources + resources, - c_args: [ - '-DHAVE_CONFIG_H', - '-DPREFIX="@0@"'.format(gdict_prefix), - '-DSYSCONFDIR="@0@"'.format(gdict_sysconfdir), - '-DLIBDIR="@0@"'.format(gdict_libdir), - '-DDATADIR="@0@"'.format(gdict_datadir), - '-DPKGDATADIR="@0@"'.format(join_paths(gdict_datadir, 'gnome-dictionary')), - '-DGNOMELOCALEDIR="@0@"'.format(join_paths(gdict_datadir, 'locale')), - ], - dependencies: [ libgdict_dep, mathlib ], - include_directories: [ - root_dir, - libgdict_inc, - include_directories('.'), - ], - install: true) +executable('gnome-dictionary', + sources: app_sources + resources, + c_args: gdict_cflags, + dependencies: [ libgdict_dep, mathlib ], + include_directories: root_inc, + install: true, +) |