-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from gort818/gort818-meson
Update to meson build
- Loading branch information
Showing
14 changed files
with
492 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from os import environ, path | ||
from subprocess import call | ||
|
||
prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local') | ||
datadir = path.join(prefix, 'share') | ||
destdir = environ.get('DESTDIR', '') | ||
|
||
# Package managers set this so we don't need to run | ||
if not destdir: | ||
print('Updating icon cache...') | ||
call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')]) | ||
|
||
print('Updating desktop database...') | ||
call(['update-desktop-database', '-q', path.join(datadir, 'applications')]) | ||
|
||
print('Compiling GSettings schemas...') | ||
call(['glib-compile-schemas', path.join(datadir, 'glib-2.0', 'schemas')]) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
desktop_file = i18n.merge_file( | ||
input: 'org.gnome.Ddgtk.desktop.in', | ||
output: 'org.gnome.Ddgtk.desktop', | ||
type: 'desktop', | ||
po_dir: '../po', | ||
install: true, | ||
install_dir: join_paths(get_option('datadir'), 'applications') | ||
) | ||
|
||
desktop_utils = find_program('desktop-file-validate', required: false) | ||
if desktop_utils.found() | ||
test('Validate desktop file', desktop_utils, | ||
args: [desktop_file] | ||
) | ||
endif | ||
|
||
appstream_file = i18n.merge_file( | ||
input: 'org.gnome.Ddgtk.appdata.xml.in', | ||
output: 'org.gnome.Ddgtk.appdata.xml', | ||
po_dir: '../po', | ||
install: true, | ||
install_dir: join_paths(get_option('datadir'), 'appdata') | ||
) | ||
|
||
appstream_util = find_program('appstream-util', required: false) | ||
if appstream_util.found() | ||
test('Validate appstream file', appstream_util, | ||
args: ['validate', appstream_file] | ||
) | ||
endif | ||
|
||
install_data('org.gnome.Ddgtk.gschema.xml', | ||
install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas') | ||
) | ||
|
||
compile_schemas = find_program('glib-compile-schemas', required: false) | ||
if compile_schemas.found() | ||
test('Validate schema file', compile_schemas, | ||
args: ['--strict', '--dry-run', meson.current_source_dir()] | ||
) | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<component type="desktop"> | ||
<id>org.gnome.Ddgtk.desktop</id> | ||
<licence>CC0</licence> | ||
<description> | ||
</description> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[Desktop Entry] | ||
Name=ddgtk | ||
Exec=ddgtk | ||
Terminal=false | ||
Type=Application | ||
Categories=GTK; | ||
StartupNotify=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<schemalist gettext-domain="ddgtk"> | ||
<schema id="org.gnome.Ddgtk" path="/org/gnome/Ddgtk/"> | ||
</schema> | ||
</schemalist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
project('ddgtk', | ||
version: '0.1.0', | ||
meson_version: '>= 0.40.0', | ||
) | ||
i18n = import('i18n') | ||
|
||
|
||
subdir('data') | ||
subdir('src') | ||
subdir('po') | ||
meson.add_install_script('build-aux/meson/postinstall.py') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
data/org.gnome.Ddgtk.desktop.in | ||
data/org.gnome.Ddgtk.appdata.xml.in | ||
data/org.gnome.Ddgtk.gschema.xml | ||
src/window.ui | ||
|
||
|
||
|
||
src/main.py | ||
src/window.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
i18n.gettext('ddgtk', preset: 'glib') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<gresources> | ||
<gresource prefix="/org/gnome/Ddgtk"> | ||
<file>window.ui</file> | ||
</gresource> | ||
</gresources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!@PYTHON@ | ||
|
||
# ddgtk.in | ||
# | ||
# Copyright (C) 2017 Alessandro | ||
# | ||
# This program 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 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program 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, see <http://www.gnu.org/licenses/>. | ||
|
||
import os | ||
import sys | ||
import signal | ||
import gettext | ||
|
||
VERSION = '@VERSION@' | ||
pkgdatadir = '@pkgdatadir@' | ||
localedir = '@localedir@' | ||
|
||
sys.path.insert(1, pkgdatadir) | ||
signal.signal(signal.SIGINT, signal.SIG_DFL) | ||
gettext.install('ddgtk', localedir) | ||
|
||
if __name__ == '__main__': | ||
import gi | ||
|
||
from gi.repository import Gio | ||
resource = Gio.Resource.load(os.path.join(pkgdatadir, 'ddgtk.gresource')) | ||
resource._register() | ||
|
||
from ddgtk import main | ||
sys.exit(main.main()) |
Oops, something went wrong.