Commit fb31fd79 authored by Bilal Elmoussaoui's avatar Bilal Elmoussaoui

build: set up dual installation

parent 3701dec6
Pipeline #87941 passed with stage
in 38 seconds
......@@ -8,8 +8,9 @@ flatpak:
variables:
MANIFEST_PATH: "org.gnome.SoundRecorder.json"
FLATPAK_MODULE: "gnome-sound-recorder"
MESON_ARGS: "-Dprofile=development"
RUNTIME_REPO: "https://sdk.gnome.org/gnome-nightly.flatpakrepo"
APP_ID: "org.gnome.SoundRecorder"
APP_ID: "org.gnome.SoundRecorderDevel"
extends: .flatpak
review:
......
......@@ -7,11 +7,13 @@ import sys
destdir = os.environ.get('DESTDIR', '')
datadir = sys.argv[1]
bindir = os.path.normpath(destdir + os.sep + sys.argv[2])
pkgdatadir = sys.argv[3]
application_id = sys.argv[4]
if not os.path.exists(bindir):
os.makedirs(bindir)
src = os.path.join(datadir, 'gnome-sound-recorder', 'org.gnome.SoundRecorder')
src = os.path.join(pkgdatadir, application_id)
dest = os.path.join(bindir, 'gnome-sound-recorder')
subprocess.call(['ln', '-s', '-f', src, dest])
......
appdata_conf = configuration_data()
appdata_conf.set('app-id', application_id)
appdata_file = i18n.merge_file(
'appdata-file',
input: '@0@.appdata.xml.in'.format(application_id),
input: configure_file(
input: 'org.gnome.SoundRecorder.appdata.xml.in.in',
output: '@BASENAME@',
configuration: appdata_conf
),
output: '@0@.appdata.xml'.format(application_id),
po_dir: po_dir,
install: true,
install_dir: join_paths(sound_recorder_datadir, 'metainfo')
)
appstream_util = find_program('appstream-util', required: false)
if appstream_util.found()
test(
......@@ -14,4 +22,4 @@ if appstream_util.found()
'validate-relax', '--nonet', appdata_file.full_path()
]
)
endif
\ No newline at end of file
endif
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2014 Richard Hughes <richard@hughsie.com> -->
<component type="desktop-application">
<id>org.gnome.SoundRecorder.desktop</id>
<id>@app-id@.desktop</id>
<name>Sound Recorder</name>
<summary>A simple, modern sound recorder for GNOME</summary>
<project_license>GPL-2.0+</project_license>
......@@ -33,7 +33,7 @@
<kudo>HiDpiIcon</kudo>
<kudo>ModernToolkit</kudo>
</kudos>
<launchable type="destkop-id">org.gnome.SoundRecorder</launchable>
<launchable type="destkop-id">@app-id@.desktop</launchable>
<url type="homepage">https://wiki.gnome.org/Apps/SoundRecorder</url>
<url type="bugtracker">https://gitlab.gnome.org/GNOME/gnome-sound-recorder/issues</url>
<url type="donation">https://www.gnome.org/friends/</url>
......
icon_dir = join_paths('icons', 'hicolor', 'scalable', 'apps')
install_data(
join_paths(icon_dir, '@0@.svg'.format(application_id)),
join_paths(icon_dir, 'org.gnome.SoundRecorder.svg'),
rename: '@0@.svg'.format(application_id),
install_dir: join_paths(sound_recorder_datadir, icon_dir)
)
icon_dir = join_paths('icons', 'hicolor', 'symbolic', 'apps')
install_data(
join_paths(icon_dir, '@0@-symbolic.svg'.format(application_id)),
join_paths(icon_dir, 'org.gnome.SoundRecorder-symbolic.svg'),
rename: '@0@-symbolic.svg'.format(application_id),
install_dir: join_paths(sound_recorder_datadir, icon_dir)
)
desktop_conf = configuration_data()
desktop_conf.set('app-id', application_id)
desktop_file = i18n.merge_file(
'desktop',
input: '@0@.desktop.in'.format(application_id),
input: configure_file(
input: 'org.gnome.SoundRecorder.desktop.in.in',
output: '@BASENAME@',
configuration: desktop_conf
),
output: '@0@.desktop'.format(application_id),
install: true,
install_dir: join_paths(sound_recorder_datadir, 'applications'),
......@@ -31,10 +39,9 @@ if desktop_file_validate.found()
endif
gsettings_conf = configuration_data()
gsettings_conf.set('GETTEXT_PACKAGE', meson.project_name ())
gsettings_conf.set('APP_ID', application_id)
gsettings_conf.set('app-id', application_id)
configure_file(
input: '@0@.gschema.xml.in'.format(application_id),
input: 'org.gnome.SoundRecorder.gschema.xml.in',
output: '@0@.gschema.xml'.format(application_id),
configuration: gsettings_conf,
install: true,
......@@ -43,7 +50,7 @@ configure_file(
gnome.compile_resources(
application_id + '.data',
application_id + '.data.gresource.xml',
'org.gnome.SoundRecorder.data.gresource.xml',
gresource_bundle: true,
install_dir: sound_recorder_pkgdatadir,
install: true
......
......@@ -3,7 +3,7 @@ Type=Application
Name=Sound Recorder
Comment=Record sound via the microphone and play it back
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
Icon=org.gnome.SoundRecorder
Icon=@app-id@
Categories=GNOME;GTK;Audio;AudioVideo;
# Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
Keywords=Audio;Application;Record;
......
<schemalist>
<schema id="@APP_ID@" path="/org/gnome/SoundRecorder/" gettext-domain="@GETTEXT_PACKAGE@">
<schema id="@app-id@" path="/org/gnome/SoundRecorder/" gettext-domain="gnome-sound-recorder">
<key name="window-size" type="ai">
<default>[780, 480]</default>
<summary>Window size</summary>
......
......@@ -2,10 +2,26 @@ project(
'gnome-sound-recorder',
version: '3.33.0',
license: 'GPL2+',
meson_version: '>= 0.46.0'
meson_version: '>= 0.50.0'
)
application_id = 'org.gnome.SoundRecorder'
if get_option('profile') == 'development'
profile = 'Devel'
name_suffix = ' (Development)'
vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD').stdout().strip()
if vcs_tag == ''
version_suffix = '-devel'
else
version_suffix = '-@0@'.format (vcs_tag)
endif
else
profile = ''
name_suffix = ''
version_suffix = ''
endif
application_id = 'org.gnome.SoundRecorder@0@'.format(profile)
sound_recorder_prefix = get_option('prefix')
sound_recorder_bindir = join_paths(sound_recorder_prefix, get_option('bindir'))
......@@ -36,5 +52,7 @@ subdir('po')
meson.add_install_script(
join_paths('build-aux', 'meson_post_install.py'),
sound_recorder_datadir,
sound_recorder_bindir
sound_recorder_bindir,
sound_recorder_pkgdatadir,
application_id
)
option(
'profile',
type: 'combo',
choices: [
'default',
'development'
],
value: 'default'
)
{
"app-id" : "org.gnome.SoundRecorder",
"app-id" : "org.gnome.SoundRecorderDevel",
"runtime" : "org.gnome.Platform",
"runtime-version" : "master",
"sdk" : "org.gnome.Sdk",
......@@ -23,6 +23,9 @@
{
"name" : "gnome-sound-recorder",
"buildsystem": "meson",
"config-opts": [
"-Dprofile=development"
],
"sources" : [
{
"type" : "git",
......
data/appdata/org.gnome.SoundRecorder.appdata.xml.in
data/appdata/org.gnome.SoundRecorder.appdata.xml.in.in
data/org.gnome.SoundRecorder.gschema.xml.in
data/org.gnome.SoundRecorder.desktop.in
data/org.gnome.SoundRecorder.desktop.in.in
src/audioProfile.js
src/application.js
src/fileUtil.js
......
......@@ -84,6 +84,8 @@ var Application = GObject.registerClass(class Application extends Gtk.Applicatio
vfunc_activate() {
(this.window = new MainWindow.MainWindow({ application: this })).show();
if (pkg.name.endsWith('Devel'))
this.window.get_style_context().add_class("devel");
}
onWindowDestroy() {
......
......@@ -13,9 +13,15 @@ configure_file(
configuration: app_conf
)
source_res_conf = configuration_data()
source_res_conf.set('profile', profile)
gnome.compile_resources(
application_id + '.src',
'org.gnome.SoundRecorder.src.gresource.xml',
configure_file(
input: 'org.gnome.SoundRecorder.src.gresource.xml.in',
output: '@BASENAME@',
configuration: source_res_conf
),
source_dir: '.',
gresource_bundle: true,
install: true,
......
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/SoundRecorder/js">
<gresource prefix="/org/gnome/SoundRecorder@profile@/js">
<file>application.js</file>
<file>audioProfile.js</file>
<file>fileUtil.js</file>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment