mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-04-19 19:14:53 +00:00
feat: gnome project structure and accessory files
This commit is contained in:
parent
812946786b
commit
9e90c1b253
21 changed files with 460 additions and 11 deletions
9
.gitignore
vendored
9
.gitignore
vendored
|
@ -1 +1,10 @@
|
|||
/target
|
||||
build/
|
||||
_build/
|
||||
builddir/
|
||||
build-aux/app
|
||||
build-aux/.flatpak-builder/
|
||||
src/constants.rs
|
||||
.flatpak/
|
||||
vendor
|
||||
*.mo
|
||||
|
|
9
build-aux/dist-vendor.sh
Normal file
9
build-aux/dist-vendor.sh
Normal file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
export DIST="$1"
|
||||
export SOURCE_ROOT="$2"
|
||||
|
||||
cd "$SOURCE_ROOT"
|
||||
mkdir "$DIST"/.cargo
|
||||
cargo vendor | sed 's/^directory = ".*"/directory = "vendor"/g' > $DIST/.cargo/config
|
||||
# Move vendor into dist tarball directory
|
||||
mv vendor "$DIST"
|
10
data/icons/meson.build
Normal file
10
data/icons/meson.build
Normal file
|
@ -0,0 +1,10 @@
|
|||
install_data(
|
||||
'@0@.svg'.format(application_id),
|
||||
install_dir: iconsdir / 'hicolor' / 'scalable' / 'apps'
|
||||
)
|
||||
|
||||
install_data(
|
||||
'@0@-symbolic.svg'.format(base_id),
|
||||
install_dir: iconsdir / 'hicolor' / 'symbolic' / 'apps',
|
||||
rename: '@0@-symbolic.svg'.format(application_id)
|
||||
)
|
74
data/icons/org.gabmus.rex2.Devel.svg
Normal file
74
data/icons/org.gabmus.rex2.Devel.svg
Normal file
|
@ -0,0 +1,74 @@
|
|||
<?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">
|
||||
<linearGradient id="a" gradientTransform="matrix(1.458807 0 0 1.906515 -415.501769 -150.163364)" gradientUnits="userSpaceOnUse" x1="339.272705" x2="339.272705" y1="83.120338" y2="109.264557">
|
||||
<stop offset="0" stop-color="#c0bfbc"/>
|
||||
<stop offset="1" stop-color="#241f31"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="b" gradientTransform="matrix(1.589925 0 0 1.907133 -458.59952 -141.699123)" gradientUnits="userSpaceOnUse" x1="339.272705" x2="339.272705" y1="91.225945" y2="113.737442">
|
||||
<stop offset="0" stop-color="#9a9996"/>
|
||||
<stop offset="1" stop-color="#3d3846"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="c" gradientTransform="matrix(1.589925 0 0 1.745081 -458.59952 -123.465599)" gradientUnits="userSpaceOnUse" x1="293.458923" x2="363.924652" y1="109.130287" y2="109.130287">
|
||||
<stop offset="0" stop-color="#241f31"/>
|
||||
<stop offset="0.0479414" stop-color="#77767b"/>
|
||||
<stop offset="0.0937468" stop-color="#5e5c64"/>
|
||||
<stop offset="0.8943" stop-color="#5e5c64"/>
|
||||
<stop offset="0.945474" stop-color="#77767b"/>
|
||||
<stop offset="1" stop-color="#241f31"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="d" gradientTransform="matrix(1.589925 0 0 1.674808 -308.505085 -97.176639)" gradientUnits="userSpaceOnUse" x1="188.163925" x2="280.755829" y1="107.404694" y2="107.404694">
|
||||
<stop offset="0" stop-color="#3d3846"/>
|
||||
<stop offset="0.507021" stop-color="#241f31"/>
|
||||
<stop offset="1" stop-color="#3d3846"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="e" gradientUnits="userSpaceOnUse" x1="18.78087990973" x2="106.95173311429" y1="67.63639825207" y2="102.31274676078">
|
||||
<stop offset="0" stop-color="#33d17a"/>
|
||||
<stop offset="1" stop-color="#a347ba"/>
|
||||
</linearGradient>
|
||||
<clipPath id="f">
|
||||
<rect height="128" width="128"/>
|
||||
</clipPath>
|
||||
<clipPath id="g">
|
||||
<rect height="128" width="128"/>
|
||||
</clipPath>
|
||||
<filter id="h" 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="i">
|
||||
<g clip-path="url(#g)" filter="url(#h)">
|
||||
<g clip-path="url(#f)">
|
||||
<path d="m 22.511719 25.277344 c -2.308594 0 -3.390625 5.304687 -4.1875 12.089844 c 7.90625 1.042968 26.65625 10.417968 45.675781 10.425781 c 19.019531 -0.007813 37.769531 -9.382813 45.675781 -10.425781 c -0.796875 -6.785157 -1.882812 -12.089844 -4.1875 -12.089844 c -6.164062 0 -23.695312 9.292968 -41.488281 9.296875 c -17.792969 -0.003907 -35.328125 -9.296875 -41.488281 -9.296875 z m 0 0" fill="url(#a)"/>
|
||||
<path d="m 18.78125 33.796875 c -4.960938 0 -6.429688 24.6875 -8.800781 36.667969 l 54.019531 -4.039063 l 54.019531 4.039063 c -2.371093 -11.980469 -3.839843 -36.667969 -8.804687 -36.667969 c -6.714844 0 -25.824219 9.296875 -45.214844 9.300781 c -19.390625 -0.003906 -38.5 -9.300781 -45.21875 -9.300781 z m 0 0" fill="url(#b)"/>
|
||||
<path d="m 47.179688 50.792969 c -18.644532 0.695312 -39.179688 6.8125 -39.179688 22.628906 v 7.484375 c 0 15.816406 20.179688 28.859375 38.824219 29.550781 c 7.980469 0 8.191406 -12.511719 17.175781 -12.511719 c 8.988281 0 9.167969 12.511719 17.148438 12.511719 c 18.648437 -0.691406 38.851562 -13.734375 38.851562 -29.550781 v -7.484375 c 0 -15.816406 -20.535156 -21.933594 -39.179688 -22.628906 z m 0 0" fill="url(#c)"/>
|
||||
<path d="m 47.179688 56.332031 c -18.644532 0.695313 -39.179688 6.816407 -39.179688 22.628907 v 7.488281 c 0 15.8125 20.179688 28.855469 38.824219 29.550781 c 7.980469 0 8.191406 -12.511719 17.175781 -12.511719 c 8.988281 0 9.167969 12.511719 17.148438 12.511719 c 18.648437 -0.695312 38.851562 -13.738281 38.851562 -29.550781 v -7.488281 c 0 -15.8125 -20.535156 -21.933594 -39.179688 -22.628907 z m 0 0" fill="url(#d)"/>
|
||||
<path d="m 47.179688 56.335938 c -18.644532 0.691406 -39.179688 6.8125 -39.179688 22.628906 v 7.484375 c 0 15.8125 20.179688 28.855469 38.824219 29.550781 c 7.980469 0 8.191406 -12.511719 17.175781 -12.511719 c 8.988281 0 9.167969 12.511719 17.148438 12.511719 c 18.648437 -0.695312 38.851562 -13.738281 38.851562 -29.550781 v -7.484375 c 0 -15.816406 -20.535156 -21.9375 -39.179688 -22.628906 z m 0.117187 4.035156 h 33.40625 c 17.867187 0.671875 35.261719 6.273437 35.261719 18.59375 v 7.484375 c 0 12.992187 -17.675782 24.808593 -34.847656 25.5 c -4.980469 -0.054688 -5.515626 -12.5 -17.117188 -12.5 c -11.59375 0 -12.160156 12.445312 -17.144531 12.5 c -17.171875 -0.691407 -34.820313 -12.503907 -34.820313 -25.5 v -7.484375 c 0 -12.320313 17.394532 -17.921875 35.261719 -18.59375 z m 0 0" fill="url(#e)"/>
|
||||
</g>
|
||||
</g>
|
||||
</mask>
|
||||
<mask id="j">
|
||||
<g filter="url(#h)">
|
||||
<rect fill-opacity="0.8" height="128" width="128"/>
|
||||
</g>
|
||||
</mask>
|
||||
<linearGradient id="k" 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="l">
|
||||
<rect height="128" width="128"/>
|
||||
</clipPath>
|
||||
<clipPath id="m">
|
||||
<rect height="128" width="128"/>
|
||||
</clipPath>
|
||||
<path d="m 22.511719 25.277344 c -2.308594 0 -3.390625 5.304687 -4.1875 12.089844 c 7.90625 1.042968 26.65625 10.417968 45.675781 10.425781 c 19.019531 -0.007813 37.769531 -9.382813 45.675781 -10.425781 c -0.796875 -6.785157 -1.882812 -12.089844 -4.1875 -12.089844 c -6.164062 0 -23.695312 9.292968 -41.488281 9.296875 c -17.792969 -0.003907 -35.328125 -9.296875 -41.488281 -9.296875 z m 0 0" fill="url(#a)"/>
|
||||
<path d="m 18.78125 33.796875 c -4.960938 0 -6.429688 24.6875 -8.800781 36.667969 l 54.019531 -4.039063 l 54.019531 4.039063 c -2.371093 -11.980469 -3.839843 -36.667969 -8.804687 -36.667969 c -6.714844 0 -25.824219 9.296875 -45.214844 9.300781 c -19.390625 -0.003906 -38.5 -9.300781 -45.21875 -9.300781 z m 0 0" fill="url(#b)"/>
|
||||
<path d="m 47.179688 50.792969 c -18.644532 0.695312 -39.179688 6.8125 -39.179688 22.628906 v 7.484375 c 0 15.816406 20.179688 28.859375 38.824219 29.550781 c 7.980469 0 8.191406 -12.511719 17.175781 -12.511719 c 8.988281 0 9.167969 12.511719 17.148438 12.511719 c 18.648437 -0.691406 38.851562 -13.734375 38.851562 -29.550781 v -7.484375 c 0 -15.816406 -20.535156 -21.933594 -39.179688 -22.628906 z m 0 0" fill="url(#c)"/>
|
||||
<path d="m 47.179688 56.332031 c -18.644532 0.695313 -39.179688 6.816407 -39.179688 22.628907 v 7.488281 c 0 15.8125 20.179688 28.855469 38.824219 29.550781 c 7.980469 0 8.191406 -12.511719 17.175781 -12.511719 c 8.988281 0 9.167969 12.511719 17.148438 12.511719 c 18.648437 -0.695312 38.851562 -13.738281 38.851562 -29.550781 v -7.488281 c 0 -15.8125 -20.535156 -21.933594 -39.179688 -22.628907 z m 0 0" fill="url(#d)"/>
|
||||
<path d="m 47.179688 56.335938 c -18.644532 0.691406 -39.179688 6.8125 -39.179688 22.628906 v 7.484375 c 0 15.8125 20.179688 28.855469 38.824219 29.550781 c 7.980469 0 8.191406 -12.511719 17.175781 -12.511719 c 8.988281 0 9.167969 12.511719 17.148438 12.511719 c 18.648437 -0.695312 38.851562 -13.738281 38.851562 -29.550781 v -7.484375 c 0 -15.816406 -20.535156 -21.9375 -39.179688 -22.628906 z m 0.117187 4.035156 h 33.40625 c 17.867187 0.671875 35.261719 6.273437 35.261719 18.59375 v 7.484375 c 0 12.992187 -17.675782 24.808593 -34.847656 25.5 c -4.980469 -0.054688 -5.515626 -12.5 -17.117188 -12.5 c -11.59375 0 -12.160156 12.445312 -17.144531 12.5 c -17.171875 -0.691407 -34.820313 -12.503907 -34.820313 -25.5 v -7.484375 c 0 -12.320313 17.394532 -17.921875 35.261719 -18.59375 z m 0 0" fill="url(#e)"/>
|
||||
<g clip-path="url(#m)" mask="url(#i)">
|
||||
<g clip-path="url(#l)" mask="url(#j)">
|
||||
<path d="m 128 80.640625 v 47.359375 h -128 v -47.359375 z m 0 0" fill="url(#k)"/>
|
||||
<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>
|
After Width: | Height: | Size: 8.3 KiB |
77
data/meson.build
Normal file
77
data/meson.build
Normal file
|
@ -0,0 +1,77 @@
|
|||
subdir('icons')
|
||||
# Desktop file
|
||||
desktop_file = i18n.merge_file(
|
||||
type: 'desktop',
|
||||
input: configure_file(
|
||||
input: '@0@.desktop.in.in'.format(base_id),
|
||||
output: '@BASENAME@',
|
||||
configuration: global_conf
|
||||
),
|
||||
output: '@0@.desktop'.format(application_id),
|
||||
po_dir: podir,
|
||||
install: true,
|
||||
install_dir: datadir / 'applications'
|
||||
)
|
||||
# Validate Desktop file
|
||||
if desktop_file_validate.found()
|
||||
test(
|
||||
'validate-desktop',
|
||||
desktop_file_validate,
|
||||
args: [
|
||||
desktop_file.full_path()
|
||||
],
|
||||
depends: desktop_file,
|
||||
)
|
||||
endif
|
||||
|
||||
# Appdata
|
||||
appdata_file = i18n.merge_file(
|
||||
input: configure_file(
|
||||
input: '@0@.metainfo.xml.in.in'.format(base_id),
|
||||
output: '@BASENAME@',
|
||||
configuration: global_conf
|
||||
),
|
||||
output: '@0@.metainfo.xml'.format(application_id),
|
||||
po_dir: podir,
|
||||
install: true,
|
||||
install_dir: datadir / 'metainfo'
|
||||
)
|
||||
# Validate Appdata
|
||||
if appstream_util.found()
|
||||
test(
|
||||
'validate-appdata', appstream_util,
|
||||
args: [
|
||||
'validate', '--nonet', appdata_file.full_path()
|
||||
],
|
||||
depends: appdata_file,
|
||||
)
|
||||
endif
|
||||
|
||||
#### Gschema currently disabled, using json config
|
||||
# GSchema
|
||||
# configure_file(
|
||||
# input: '@0@.gschema.xml.in'.format(base_id),
|
||||
# output: '@0@.gschema.xml'.format(application_id),
|
||||
# configuration: global_conf,
|
||||
# install: true,
|
||||
# install_dir: datadir / 'glib-2.0' / 'schemas'
|
||||
# )
|
||||
|
||||
# Validata GSchema
|
||||
# if glib_compile_schemas.found()
|
||||
# test(
|
||||
# 'validate-gschema', glib_compile_schemas,
|
||||
# args: [
|
||||
# '--strict', '--dry-run', meson.current_build_dir()
|
||||
# ],
|
||||
# )
|
||||
# endif
|
||||
|
||||
resources = gnome.compile_resources(
|
||||
'resources',
|
||||
'resources.gresource.xml',
|
||||
gresource_bundle: true,
|
||||
source_dir: meson.current_build_dir(),
|
||||
install: true,
|
||||
install_dir: pkgdatadir,
|
||||
)
|
13
data/org.gabmus.rex2.desktop.in.in
Normal file
13
data/org.gabmus.rex2.desktop.in.in
Normal file
|
@ -0,0 +1,13 @@
|
|||
[Desktop Entry]
|
||||
# Translators: Do NOT translate or transliterate this text
|
||||
Name=@PRETTY_NAME@
|
||||
Comment=GUI for Monado
|
||||
Type=Application
|
||||
Exec=@CMD_NAME@
|
||||
Terminal=false
|
||||
Categories=GNOME;GTK;Game;
|
||||
# Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
|
||||
Keywords=vr;virtual;reality;monado;
|
||||
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
|
||||
Icon=@APP_ID@
|
||||
StartupNotify=true
|
35
data/org.gabmus.rex2.metainfo.xml.in.in
Normal file
35
data/org.gabmus.rex2.metainfo.xml.in.in
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop-application">
|
||||
<id>@APP_ID@</id>
|
||||
<metadata_license>CC0</metadata_license>
|
||||
<project_license>AGPL-3.0</project_license>
|
||||
<name translatable="no">@PRETTY_NAME@</name>
|
||||
<summary>GUI for Monado</summary>
|
||||
<description>
|
||||
<p>GUI for Monado</p> <!-- temporary -->
|
||||
</description>
|
||||
<!--screenshots>
|
||||
<screenshot type="default">
|
||||
<image>https://gitlab.com/gabmus/rex2/raw/main/misc/screenshots/screenshot1.png</image>
|
||||
<caption>Main window</caption>
|
||||
</screenshot>
|
||||
</screenshots-->
|
||||
<url type="homepage">@REPO_URL@</url>
|
||||
<url type="bugtracker">@REPO_URL@/issues</url>
|
||||
<content_rating type="oars-1.0" />
|
||||
<releases>
|
||||
<release version="0.1.0" date="2032-06-18" />
|
||||
</releases>
|
||||
<kudos>
|
||||
<!--
|
||||
GNOME Software kudos:
|
||||
https://gitlab.gnome.org/GNOME/gnome-software/-/blob/main/doc/kudos.md
|
||||
-->
|
||||
<kudo>ModernToolkit</kudo>
|
||||
<kudo>HiDpiIcon</kudo>
|
||||
</kudos>
|
||||
<developer_name translatable="no">Gabriele Musco</developer_name>
|
||||
<update_contact>gabmus@disroot.org</update_contact>
|
||||
<translation type="gettext">@GETTEXT_PACKAGE@</translation>
|
||||
<launchable type="desktop-id">@APP_ID@.desktop</launchable>
|
||||
</component>
|
9
data/resources.gresource.xml
Normal file
9
data/resources.gresource.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<gresources>
|
||||
<gresource prefix="/org/gabmus/rex2/">
|
||||
<file compressed="true">style.css</file>
|
||||
|
||||
<file compressed="true" preprocess="xml-stripblanks">icons/org.gabmus.rex2.svg</file>
|
||||
<file compressed="true" preprocess="xml-stripblanks">icons/org.gabmus.rex2-symbolic.svg</file>
|
||||
</gresource>
|
||||
</gresources>
|
0
data/style.css
Normal file
0
data/style.css
Normal file
81
meson.build
Normal file
81
meson.build
Normal file
|
@ -0,0 +1,81 @@
|
|||
project(
|
||||
'rex2',
|
||||
'rust',
|
||||
version: '0.1.0',
|
||||
meson_version: '>= 0.59',
|
||||
license: 'AGPL-3.0',
|
||||
)
|
||||
|
||||
i18n = import('i18n')
|
||||
gnome = import('gnome')
|
||||
|
||||
base_id = 'org.gabmus.rex2'
|
||||
pretty_name = 'Rex2'
|
||||
upstream_repo = 'https://gitlab.com/gabmus/rex2'
|
||||
author = 'The Rex2 Team'
|
||||
description = 'GUI for Monado' # temporary
|
||||
|
||||
dependency('glib-2.0', version: '>= 2.66')
|
||||
dependency('gio-2.0', version: '>= 2.66')
|
||||
dependency('gtk4', version: '>= 4.10.0')
|
||||
|
||||
glib_compile_resources = find_program('glib-compile-resources', required: true)
|
||||
# glib_compile_schemas = find_program('glib-compile-schemas', required: true)
|
||||
desktop_file_validate = find_program('desktop-file-validate', required: false)
|
||||
appstream_util = find_program('appstream-util', required: false)
|
||||
cargo = find_program('cargo', required: true)
|
||||
|
||||
version = meson.project_version()
|
||||
|
||||
prefix = get_option('prefix')
|
||||
bindir = prefix / get_option('bindir')
|
||||
localedir = prefix / get_option('localedir')
|
||||
|
||||
datadir = prefix / get_option('datadir')
|
||||
pkgdatadir = datadir / meson.project_name()
|
||||
iconsdir = datadir / 'icons'
|
||||
podir = meson.project_source_root() / 'po'
|
||||
gettext_package = meson.project_name()
|
||||
|
||||
if get_option('profile') == 'development'
|
||||
profile = 'Devel'
|
||||
vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD', check: false).stdout().strip()
|
||||
if vcs_tag == ''
|
||||
version_suffix = '-devel'
|
||||
else
|
||||
version_suffix = '-@0@'.format(vcs_tag)
|
||||
endif
|
||||
application_id = '@0@.@1@'.format(base_id, profile)
|
||||
else
|
||||
profile = ''
|
||||
version_suffix = ''
|
||||
application_id = base_id
|
||||
endif
|
||||
|
||||
meson.add_dist_script(
|
||||
'build-aux/dist-vendor.sh',
|
||||
meson.project_build_root() / 'meson-dist' / meson.project_name() + '-' + version,
|
||||
meson.project_source_root()
|
||||
)
|
||||
|
||||
global_conf = configuration_data()
|
||||
global_conf.set('APP_ID', application_id)
|
||||
global_conf.set('PKGDATADIR', pkgdatadir)
|
||||
global_conf.set('PROFILE', profile)
|
||||
global_conf.set('VERSION', version + version_suffix)
|
||||
global_conf.set('GETTEXT_PACKAGE', gettext_package)
|
||||
global_conf.set('LOCALEDIR', localedir)
|
||||
global_conf.set('AUTHOR', author)
|
||||
global_conf.set('PRETTY_NAME', pretty_name)
|
||||
global_conf.set('CMD_NAME', meson.project_name())
|
||||
global_conf.set('REPO_URL', upstream_repo)
|
||||
|
||||
subdir('data')
|
||||
subdir('po')
|
||||
subdir('src')
|
||||
|
||||
gnome.post_install(
|
||||
gtk_update_icon_cache: true,
|
||||
glib_compile_schemas: false,
|
||||
update_desktop_database: true,
|
||||
)
|
10
meson_options.txt
Normal file
10
meson_options.txt
Normal file
|
@ -0,0 +1,10 @@
|
|||
option(
|
||||
'profile',
|
||||
type: 'combo',
|
||||
choices: [
|
||||
'default',
|
||||
'development'
|
||||
],
|
||||
value: 'default',
|
||||
description: 'The build profile. One of "default" or "development".'
|
||||
)
|
1
po/LINGUAS
Normal file
1
po/LINGUAS
Normal file
|
@ -0,0 +1 @@
|
|||
# it
|
2
po/POTFILES.in
Normal file
2
po/POTFILES.in
Normal file
|
@ -0,0 +1,2 @@
|
|||
data/org.gabmus.rex2.desktop.in.in
|
||||
data/org.gabmus.rex2.metainfo.xml.in.in
|
5
po/make-pot.sh
Executable file
5
po/make-pot.sh
Executable file
|
@ -0,0 +1,5 @@
|
|||
if [[ ! -d build ]]; then
|
||||
meson setup build -Dprefix="$PWD/build/testdir"
|
||||
fi
|
||||
|
||||
ninja -C build rex2-pot
|
15
po/meson.build
Normal file
15
po/meson.build
Normal file
|
@ -0,0 +1,15 @@
|
|||
# SPDX-FileCopyrightText: 2022 Emmanuele Bassi
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
i18n.gettext(
|
||||
gettext_package,
|
||||
args: [
|
||||
'--keyword=i18n',
|
||||
'--keyword=i18n_f',
|
||||
'--keyword=i18n_k',
|
||||
'--keyword=ni18n:1,2',
|
||||
'--keyword=ni18n_f:1,2',
|
||||
'--keyword=ni18n_k:1,2',
|
||||
],
|
||||
preset: 'glib',
|
||||
)
|
34
po/rex2.pot
Normal file
34
po/rex2.pot
Normal file
|
@ -0,0 +1,34 @@
|
|||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the rex2 package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: rex2\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2023-06-18 11:17+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#. Translators: Do NOT translate or transliterate this text
|
||||
#: data/org.gabmus.rex2.desktop.in.in:4
|
||||
msgid "@PRETTY_NAME@"
|
||||
msgstr ""
|
||||
|
||||
#: data/org.gabmus.rex2.desktop.in.in:5
|
||||
#: data/org.gabmus.rex2.metainfo.xml.in.in:7
|
||||
#: data/org.gabmus.rex2.metainfo.xml.in.in:9
|
||||
msgid "GUI for Monado"
|
||||
msgstr ""
|
||||
|
||||
#. Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
|
||||
#: data/org.gabmus.rex2.desktop.in.in:11
|
||||
msgid "vr;virtual;reality;monado;"
|
||||
msgstr ""
|
15
po/update_potfiles.sh
Executable file
15
po/update_potfiles.sh
Executable file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
APPID="org.gabmus.rex2"
|
||||
|
||||
rm po/POTFILES.in po/POTFILES.in.in
|
||||
|
||||
{
|
||||
grep -Fl "gettext(\"" src/**.rs
|
||||
# grep -Fl "_(\"" data/resources/ui/**.blp
|
||||
echo "data/${APPID}.desktop.in.in"
|
||||
echo "data/${APPID}.metainfo.xml.in.in"
|
||||
} >> po/POTFILES.in.in
|
||||
|
||||
sort < po/POTFILES.in.in | uniq > po/POTFILES.in
|
||||
rm po/POTFILES.in.in
|
|
@ -1,10 +0,0 @@
|
|||
pub const APP_NAME: &str = "Rex2";
|
||||
pub const APP_ID: &str = "org.gabmus.rex2";
|
||||
pub const CMD_NAME: &str = "rex2";
|
||||
pub const VERSION: &str = "0.1";
|
||||
pub const REPO_URL: &str = "https://gitlab.com/gabmus/rex2";
|
||||
pub const SINGLE_DEVELOPER: &str = "The Rex2 Team";
|
||||
|
||||
pub fn get_developers() -> Vec<String> {
|
||||
vec!["Gabriele Musco <gabmus@disroot.org>".to_string()]
|
||||
}
|
14
src/constants.rs.in
Normal file
14
src/constants.rs.in
Normal file
|
@ -0,0 +1,14 @@
|
|||
pub const APP_NAME: &str = "@PRETTY_NAME@";
|
||||
pub const APP_ID: &str = "@APP_ID@";
|
||||
pub const PKG_DATA_DIR: &str = "@PKGDATADIR@";
|
||||
pub const CMD_NAME: &str = "@CMD_NAME@";
|
||||
pub const VERSION: &str = "@VERSION@";
|
||||
pub const REPO_URL: &str = "@UPSTREAM_REPO_URL@";
|
||||
pub const SINGLE_DEVELOPER: &str = "@AUTHOR@";
|
||||
pub const GETTEXT_PACKAGE: &str = "@GETTEXT_PACKAGE@";
|
||||
pub const LOCALE_DIR: &str = "@LOCALEDIR@";
|
||||
pub const BUILD_PROFILE: &str = "@PROFILE@";
|
||||
|
||||
pub fn get_developers() -> Vec<String> {
|
||||
vec!["Gabriele Musco <gabmus@disroot.org>".to_string()]
|
||||
}
|
45
src/meson.build
Normal file
45
src/meson.build
Normal file
|
@ -0,0 +1,45 @@
|
|||
config = configure_file(
|
||||
input: 'constants.rs.in',
|
||||
output: 'constants.rs',
|
||||
configuration: global_conf
|
||||
)
|
||||
# Copy the config.rs output to the source directory.
|
||||
run_command(
|
||||
'cp',
|
||||
meson.project_build_root() / 'src' / 'constants.rs',
|
||||
meson.project_source_root() / 'src' / 'constants.rs',
|
||||
check: true
|
||||
)
|
||||
|
||||
cargo_options = [ '--manifest-path', meson.project_source_root() / 'Cargo.toml' ]
|
||||
cargo_options += [ '--target-dir', meson.project_build_root() / 'src' ]
|
||||
|
||||
if get_option('profile') == 'default'
|
||||
cargo_options += [ '--release' ]
|
||||
rust_target = 'release'
|
||||
message('Building in release mode')
|
||||
else
|
||||
rust_target = 'debug'
|
||||
message('Building in debug mode')
|
||||
endif
|
||||
|
||||
cargo_env = [ 'CARGO_HOME=' + meson.project_build_root() / 'cargo-home' ]
|
||||
|
||||
cargo_build = custom_target(
|
||||
'cargo-build',
|
||||
build_by_default: true,
|
||||
build_always_stale: true,
|
||||
output: meson.project_name(),
|
||||
console: true,
|
||||
install: true,
|
||||
install_dir: bindir,
|
||||
depends: resources,
|
||||
command: [
|
||||
'env',
|
||||
cargo_env,
|
||||
cargo, 'build',
|
||||
cargo_options,
|
||||
'&&',
|
||||
'cp', 'src' / rust_target / meson.project_name(), '@OUTPUT@',
|
||||
]
|
||||
)
|
|
@ -1,4 +1,4 @@
|
|||
use crate::constants::{get_developers, APP_NAME, REPO_URL, SINGLE_DEVELOPER, VERSION};
|
||||
use crate::constants::{get_developers, APP_NAME, REPO_URL, SINGLE_DEVELOPER, VERSION, APP_ID};
|
||||
use relm4::gtk::traits::GtkWindowExt;
|
||||
use relm4::prelude::*;
|
||||
use relm4::{ComponentParts, SimpleComponent};
|
||||
|
@ -15,6 +15,7 @@ impl SimpleComponent for AboutDialog {
|
|||
fn init_root() -> Self::Root {
|
||||
adw::AboutWindow::builder()
|
||||
.application_name(APP_NAME)
|
||||
.application_icon(APP_ID)
|
||||
.license_type(gtk::License::Agpl30)
|
||||
.version(VERSION)
|
||||
.website(REPO_URL)
|
||||
|
|
Loading…
Add table
Reference in a new issue