Verified Commit f8750b0f authored by Todd Weaver's avatar Todd Weaver
Browse files

Initial commit

parents
This diff is collapsed.
#!/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')])
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="128.0px"
height="128.0px"
viewBox="0 0 128.0 128.0"
version="1.1"
id="SVGRoot"
sodipodi:docname="sm.puri.Stream.svg"
inkscape:version="1.0.2 (e86c870879, 2021-01-15)">
<defs
id="defs2253">
<linearGradient
inkscape:collect="always"
id="5000-2">
<stop
style="stop-color:#4799ff;stop-opacity:1"
offset="0"
id="stop5366" />
<stop
style="stop-color:#1a5fb4;stop-opacity:1"
offset="1"
id="stop5368" />
</linearGradient>
<linearGradient
id="linearGradient4414"
inkscape:collect="always">
<stop
id="stop4402"
offset="0"
style="stop-color:#1a5fb4;stop-opacity:1" />
<stop
style="stop-color:#99c1f1;stop-opacity:1"
offset="0.03846159"
id="stop4404" />
<stop
id="stop4406"
offset="0.07692312"
style="stop-color:#1a5fb4;stop-opacity:1" />
<stop
style="stop-color:#1a5fb4;stop-opacity:1"
offset="0.92307693"
id="stop4408" />
<stop
id="stop4410"
offset="0.96153843"
style="stop-color:#99c1f1;stop-opacity:1" />
<stop
id="stop4412"
offset="1"
style="stop-color:#1a5fb4;stop-opacity:1" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="5000-2-2">
<stop
style="stop-color:#1b549a;stop-opacity:1;"
offset="0"
id="stop4128" />
<stop
style="stop-color:#1b549a;stop-opacity:0;"
offset="1"
id="stop4130" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#5000-2-2"
id="linearGradient4134"
x1="8.4949799"
y1="64"
x2="119.50502"
y2="64"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient1222"
id="linearGradient4314"
x1="5"
y1="83"
x2="117.00001"
y2="83"
gradientUnits="userSpaceOnUse" />
<linearGradient
y2="254"
x2="116"
y1="254"
x1="11.999994"
gradientTransform="matrix(1.0769231,0,0,1.0666667,-4.9230886,-193.93336)"
gradientUnits="userSpaceOnUse"
id="linearGradient1820"
xlink:href="#linearGradient4414"
inkscape:collect="always" />
<linearGradient
id="linearGradient1222"
inkscape:collect="always">
<stop
id="stop1210"
offset="0"
style="stop-color:#77767b;stop-opacity:1" />
<stop
style="stop-color:#c0bfbc;stop-opacity:1"
offset="0.03846159"
id="stop1212" />
<stop
id="stop1214"
offset="0.07692312"
style="stop-color:#77767b;stop-opacity:1" />
<stop
style="stop-color:#77767b;stop-opacity:1"
offset="0.92307693"
id="stop1216" />
<stop
id="stop1218"
offset="0.96153843"
style="stop-color:#c0bfbc;stop-opacity:1" />
<stop
id="stop1220"
offset="1"
style="stop-color:#77767b;stop-opacity:1" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#5000-2"
id="linearGradient5364"
gradientUnits="userSpaceOnUse"
x1="65"
y1="100"
x2="65"
y2="20" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6"
inkscape:cx="73.216808"
inkscape:cy="53.283693"
inkscape:document-units="px"
inkscape:current-layer="layer1"
inkscape:document-rotation="0"
showgrid="true"
inkscape:window-width="1920"
inkscape:window-height="1016"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid2823" />
</sodipodi:namedview>
<metadata
id="metadata2256">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<rect
ry="8"
rx="7.9999995"
style="display:inline;vector-effect:none;fill:url(#linearGradient1820);fill-opacity:1;stroke:none;stroke-width:3.99999;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;enable-background:new"
id="rect1768-9"
width="112.00001"
height="64"
x="7.9999924"
y="45" />
<rect
style="display:inline;fill:url(#linearGradient5364);fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;enable-background:new"
id="rect1460"
width="111.99999"
height="79.50502"
x="8.0000038"
y="20.49498"
rx="10.089177"
ry="9.1374531" />
<path
style="display:inline;fill:#000000;fill-opacity:0.5;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.5;enable-background:new"
d="m 20.5,82.99562 h 87.0948"
id="path4438" />
<circle
style="display:inline;fill:#000000;fill-opacity:0.5;stroke:#000000;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.5;enable-background:new"
id="circle4440"
cx="36.547401"
cy="82.884537"
r="7.9999995" />
<path
style="display:inline;fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;enable-background:new"
d="m 20.5,80.995634 h 87.0948"
id="path1492" />
<circle
style="display:inline;fill:#3584e4;fill-opacity:1;stroke:#ffffff;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;enable-background:new"
id="path1494"
cx="36.547401"
cy="80.884537"
r="7.9999995" />
<path
sodipodi:type="star"
style="display:inline;fill:#000000;fill-opacity:0.5;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;enable-background:new"
id="path4442"
sodipodi:sides="3"
sodipodi:cx="-62.587959"
sodipodi:cy="51.884523"
sodipodi:r1="11.070296"
sodipodi:r2="5.5351477"
sodipodi:arg1="0"
sodipodi:arg2="1.0471976"
inkscape:flatsided="true"
inkscape:rounded="1"
inkscape:randomized="0"
inkscape:transform-center-x="2.7672682"
transform="scale(-1,1)"
d="m -51.517663,51.884521 c 0,19.174316 0,19.174316 -16.605444,9.587158 -16.605445,-9.587158 -16.605445,-9.587158 0,-19.174315 16.605444,-9.587158 16.605444,-9.587158 16.605444,9.587157 z"
inkscape:transform-center-y="1.6750734e-06" />
<path
sodipodi:type="star"
style="display:inline;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;enable-background:new"
id="path2432"
sodipodi:sides="3"
sodipodi:cx="-62.587959"
sodipodi:cy="49.884523"
sodipodi:r1="11.070296"
sodipodi:r2="5.5351477"
sodipodi:arg1="0"
sodipodi:arg2="1.0471976"
inkscape:flatsided="true"
inkscape:rounded="1"
inkscape:randomized="0"
inkscape:transform-center-x="2.7672682"
transform="scale(-1,1)"
d="m -51.517663,49.884521 c 0,19.174316 0,19.174316 -16.605444,9.587158 -16.605445,-9.587158 -16.605445,-9.587158 0,-19.174315 16.605444,-9.587158 16.605444,-9.587158 16.605444,9.587157 z"
inkscape:transform-center-y="1.6750734e-06" />
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="16.0px"
height="16.0px"
viewBox="0 0 16.0 16.0"
version="1.1"
id="SVGRoot"
sodipodi:docname="sm.puri.Stream-symbolic.svg"
inkscape:version="1.0.2 (e86c870879, 2021-01-15)">
<defs
id="defs2894" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="22.4"
inkscape:cx="11.017151"
inkscape:cy="1.4051552"
inkscape:document-units="px"
inkscape:current-layer="layer1"
inkscape:document-rotation="0"
showgrid="true"
inkscape:window-width="1920"
inkscape:window-height="1016"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid3464" />
</sodipodi:namedview>
<metadata
id="metadata2897">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<rect
style="display:inline;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;enable-background:new"
id="rect1460"
width="14"
height="10.973247"
x="1"
y="2.5133767"
rx="1.2611473"
ry="1.2611473" />
<path
sodipodi:type="star"
style="display:inline;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;enable-background:new"
id="path1490"
sodipodi:sides="3"
sodipodi:cx="-7.7665677"
sodipodi:cy="6.5348086"
sodipodi:r1="1.7665675"
sodipodi:r2="0.88328373"
sodipodi:arg1="0"
sodipodi:arg2="1.0471976"
inkscape:flatsided="true"
inkscape:rounded="1"
inkscape:randomized="0"
inkscape:transform-center-x="0.44159325"
transform="scale(-1,1)"
inkscape:transform-center-y="2.079058e-06"
d="m -6.0000002,6.5348086 c 0,3.0597846 0,3.0597846 -2.6498512,1.5298923 -2.6498516,-1.5298923 -2.6498516,-1.5298923 0,-3.0597846 2.6498512,-1.5298923 2.6498512,-1.5298923 2.6498512,1.5298923 z" />
<path
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 2,11.499993 H 14"
id="path4444" />
<circle
style="fill:#000000;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path4446"
cx="4.2232146"
cy="11.5"
r="1" />
</g>
</svg>
application_id = 'sm.puri.Stream'
icondir = join_paths('icons', 'hicolor', 'scalable', 'apps')
install_data(
join_paths(icondir, ('@0@.svg').format(application_id)),
install_dir: join_paths(get_option('datadir'), icondir),
)
icondir = join_paths('icons', 'hicolor', 'symbolic', 'apps')
install_data(
join_paths(icondir, 'sm.puri.Stream-symbolic.svg'),
install_dir: join_paths(get_option('datadir'), icondir),
rename: '@0@-symbolic.svg'.format(application_id)
)
desktop_file = i18n.merge_file(
input: 'sm.puri.Stream.desktop.in',
output: 'sm.puri.Stream.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: 'sm.puri.Stream.appdata.xml.in',
output: 'sm.puri.Stream.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('sm.puri.Stream.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
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>sm.puri.Stream.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0-or-later</project_license>
<description>
</description>
</component>
[Desktop Entry]
Name=Stream
Exec=stream
Terminal=false
Type=Application
Categories=GTK;
StartupNotify=true
Icon=@app-id@
X-Purism-FormFactor=Workstation;Mobile;
<?xml version="1.0" encoding="UTF-8"?>
<schemalist gettext-domain="stream">
<schema id="sm.puri.Stream" path="/sm/puri/Stream/">
</schema>
</schemalist>
project('stream',
version: '0.1.0',
meson_version: '>= 0.50.0',
default_options: [ 'warning_level=2',
],
)
i18n = import('i18n')
subdir('data')
subdir('src')
subdir('po')
meson.add_install_script('build-aux/meson/postinstall.py')
\ No newline at end of file
This diff is collapsed.
data/sm.puri.Stream.desktop.in
data/sm.puri.Stream.appdata.xml.in
data/sm.puri.Stream.gschema.xml
src/window.ui
src/main.py
src/window.py
i18n.gettext('stream', preset: 'glib')
{
"app-id" : "sm.puri.Stream",
"runtime" : "org.gnome.Platform",
"runtime-version" : "3.38",
"sdk" : "org.gnome.Sdk",
"command" : "stream",
"finish-args" : [
"--share=network",
"--share=ipc",
"--socket=fallback-x11",
"--socket=wayland",
"--socket=pulseaudio",
"--filesystem=~/Videos"
],
"cleanup" : [
"/include",
"/lib/pkgconfig",
"/man",
"/share/doc",
"/share/gtk-doc",
"/share/man",
"/share/pkgconfig",
"*.la",
"*.a"
],
"modules" : [
{
"name" : "libhandy",
"buildsystem" : "meson",
"config-opts" : [
"-Dprofiling=false",
"-Dintrospection=enabled",
"-Dgtk_doc=false",
"-Dtests=false",
"-Dexamples=false",
"-Dvapi=false",
"-Dglade_catalog=disabled"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/libhandy.git",
"tag" : "1.2.0"
}
]
},
{
"name" : "stream",
"builddir" : true,
"buildsystem" : "meson",
"sources" : [
{
"type" : "git",
"url" : "file:///home/todd/Projects/Stream"
}
]
}
]
}
# main.py
#
# Copyright 2021 Todd Weaver
#
# 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 sys
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gio
from .window import StreamWindow
class Application(Gtk.Application):
def __init__(self):
super().__init__(application_id='sm.puri.Stream',
flags=Gio.ApplicationFlags.FLAGS_NONE)
def do_activate(self):
win = self.props.active_window
if not win:
win = StreamWindow(application=self)
win.present()
def main(version):
app = Application()
return app.run(sys.argv)
pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())
moduledir = join_paths(pkgdatadir, 'stream')
gnome = import('gnome')
gnome.compile_resources('stream',
'stream.gresource.xml',
gresource_bundle: true,
install: true,
install_dir: pkgdatadir,
)
python = import('python')
conf = configuration_data()
conf.set('PYTHON', python.find_installation('python3').path())
conf.set('VERSION', meson.project_version())
conf.set('localedir', join_paths(get_option('prefix'), get_option('localedir')))