Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit acbdbf7
Showing
18 changed files
with
982 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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: 're.sonny.gigagram.desktop.in', | ||
output: 're.sonny.gigagram.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: 're.sonny.gigagram.appdata.xml.in', | ||
output: 're.sonny.gigagram.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('re.sonny.gigagram.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,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<component type="desktop"> | ||
<id>re.sonny.gigagram.desktop</id> | ||
<metadata_license>CC0-1.0</metadata_license> | ||
<project_license>GPL-3.0-or-later</project_license> | ||
<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=gigagram | ||
Exec=re.sonny.gigagram | ||
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="gigagram"> | ||
<schema id="re.sonny.gigagram" path="/re/sonny/gigagram/"> | ||
</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,13 @@ | ||
project('gigagram', | ||
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') |
Empty file.
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 @@ | ||
data/re.sonny.gigagram.desktop.in | ||
data/re.sonny.gigagram.appdata.xml.in | ||
data/re.sonny.gigagram.gschema.xml | ||
src/window.ui | ||
src/main.js | ||
src/window.js | ||
|
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('gigagram', 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,48 @@ | ||
{ | ||
"app-id": "re.sonny.gigagram", | ||
"runtime": "org.gnome.Platform", | ||
"runtime-version": "3.32", | ||
"sdk": "org.gnome.Sdk", | ||
"command": "re.sonny.gigagram", | ||
"finish-args": [ | ||
"--share=network", | ||
"--share=ipc", | ||
"--socket=x11", | ||
"--socket=wayland", | ||
"--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", | ||
"/man", | ||
"/share/doc", | ||
"/share/gtk-doc", | ||
"/share/man", | ||
"/share/pkgconfig", | ||
"*.la", | ||
"*.a" | ||
], | ||
"modules": [ | ||
{ | ||
"name": "gigagram", | ||
"builddir": true, | ||
"buildsystem": "meson", | ||
"sources": [ | ||
{ | ||
"type": "git", | ||
"url": "file:///home/sonny/Projects/gigagram" | ||
} | ||
] | ||
} | ||
] | ||
} |
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,47 @@ | ||
/* main.js | ||
* | ||
* Copyright 2019 Sonny Piers | ||
* | ||
* 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/>. | ||
*/ | ||
|
||
pkg.initGettext(); | ||
pkg.initFormat(); | ||
pkg.require({ | ||
'Gio': '2.0', | ||
'Gtk': '3.0' | ||
}); | ||
|
||
const { Gio, Gtk } = imports.gi; | ||
|
||
const { GigagramWindow } = imports.window; | ||
|
||
function main(argv) { | ||
const application = new Gtk.Application({ | ||
application_id: 're.sonny.gigagram', | ||
flags: Gio.ApplicationFlags.FLAGS_NONE, | ||
}); | ||
|
||
application.connect('activate', app => { | ||
let activeWindow = app.activeWindow; | ||
|
||
if (!activeWindow) { | ||
activeWindow = new GigagramWindow(app); | ||
} | ||
|
||
activeWindow.present(); | ||
}); | ||
|
||
return application.run(argv); | ||
} |
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,32 @@ | ||
pkgdatadir = join_paths(get_option('datadir'), meson.project_name()) | ||
gnome = import('gnome') | ||
|
||
src_res = gnome.compile_resources('re.sonny.gigagram.src', | ||
're.sonny.gigagram.src.gresource.xml', | ||
gresource_bundle: true, | ||
install: true, | ||
install_dir: pkgdatadir, | ||
) | ||
|
||
data_res = gnome.compile_resources('re.sonny.gigagram.data', | ||
're.sonny.gigagram.data.gresource.xml', | ||
gresource_bundle: true, | ||
install: true, | ||
install_dir: pkgdatadir, | ||
) | ||
|
||
bin_conf = configuration_data() | ||
bin_conf.set('GJS', find_program('gjs').path()) | ||
bin_conf.set('PACKAGE_VERSION', meson.project_version()) | ||
bin_conf.set('PACKAGE_NAME', meson.project_name()) | ||
bin_conf.set('prefix', get_option('prefix')) | ||
bin_conf.set('libdir', join_paths(get_option('prefix'), get_option('libdir'))) | ||
bin_conf.set('datadir', join_paths(get_option('prefix'), get_option('datadir'))) | ||
|
||
configure_file( | ||
input: 're.sonny.gigagram.in', | ||
output: 're.sonny.gigagram', | ||
configuration: bin_conf, | ||
install: true, | ||
install_dir: get_option('bindir') | ||
) |
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="/re/sonny/gigagram"> | ||
<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,9 @@ | ||
#!@GJS@ | ||
imports.package.init({ | ||
name: "@PACKAGE_NAME@", | ||
version: "@PACKAGE_VERSION@", | ||
prefix: "@prefix@", | ||
libdir: "@libdir@", | ||
datadir: "@datadir@", | ||
}); | ||
imports.package.run(imports.main); |
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"?> | ||
<gresources> | ||
<gresource prefix="/re/sonny/gigagram/js"> | ||
<file>main.js</file> | ||
<file>window.js</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,30 @@ | ||
/* window.js | ||
* | ||
* Copyright 2019 Sonny Piers | ||
* | ||
* 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/>. | ||
*/ | ||
|
||
const { GObject, Gtk } = imports.gi; | ||
|
||
var GigagramWindow = GObject.registerClass({ | ||
GTypeName: 'GigagramWindow', | ||
Template: 'resource:///re/sonny/gigagram/window.ui', | ||
InternalChildren: ['label'] | ||
}, class GigagramWindow extends Gtk.ApplicationWindow { | ||
_init(application) { | ||
super._init({ application }); | ||
} | ||
}); | ||
|
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,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<interface> | ||
<requires lib="gtk+" version="3.20"/> | ||
<template class="GigagramWindow" parent="GtkApplicationWindow"> | ||
<property name="default-width">600</property> | ||
<property name="default-height">300</property> | ||
<child type="titlebar"> | ||
<object class="GtkHeaderBar" id="headerBar"> | ||
<property name="visible">True</property> | ||
<property name="show-close-button">True</property> | ||
<property name="title">Hello, World!</property> | ||
</object> | ||
</child> | ||
<child> | ||
<object class="GtkLabel" id="label"> | ||
<property name="label">Hello, World!</property> | ||
<property name="visible">True</property> | ||
<attributes> | ||
<attribute name="weight" value="bold"/> | ||
<attribute name="scale" value="2"/> | ||
</attributes> | ||
</object> | ||
</child> | ||
</template> | ||
</interface> |