Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# EditorConfig <https://EditorConfig.org>
root = true

# elementary defaults
[*]
charset = utf-8
end_of_line = lf
indent_size = tab
indent_style = space
insert_final_newline = true
max_line_length = 80
tab_width = 4

# Markup files
[{*.html,*.xml,*.xml.in,*.yml}]
tab_width = 2
10 changes: 5 additions & 5 deletions data/com.github.mohelm97.screenrecorder.gresource.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<gresources>
<gresource prefix="/com/github/mohelm97/screenrecorder">
<file alias="grab-area-symbolic.svg" compressed="true" preprocess="xml-stripblanks">grab-area-symbolic.svg</file>
<file alias="grab-screen-symbolic.svg" compressed="true" preprocess="xml-stripblanks">grab-screen-symbolic.svg</file>
<file alias="grab-window-symbolic.svg" compressed="true" preprocess="xml-stripblanks">grab-window-symbolic.svg</file>
<file alias="grab-area-symbolic.svg" compressed="true" preprocess="xml-stripblanks">icons/symbolic/grab-area-symbolic.svg</file>
<file alias="grab-screen-symbolic.svg" compressed="true" preprocess="xml-stripblanks">icons/symbolic/grab-screen-symbolic.svg</file>
<file alias="grab-window-symbolic.svg" compressed="true" preprocess="xml-stripblanks">icons/symbolic/grab-window-symbolic.svg</file>
</gresource>
</gresources>
</gresources>
34 changes: 34 additions & 0 deletions data/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
icon_sizes = ['32', '48', '64', '128']

foreach i : icon_sizes
install_data(
join_paths('icons', i, meson.project_name() + '.svg'),
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', i + 'x' + i, 'apps')
)
install_data(
join_paths('icons', i, meson.project_name() + '.svg'),
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', i + 'x' + i + '@2', 'apps')
)
endforeach

i18n.merge_file(
input: meson.project_name() + '.desktop.in',
output: meson.project_name() + '.desktop',
po_dir: join_paths(meson.source_root(), 'po'),
type: 'desktop',
install: true,
install_dir: join_paths(get_option('datadir'), 'applications')
)

i18n.merge_file(
input: meson.project_name() + '.appdata.xml.in',
output: meson.project_name() + '.appdata.xml',
po_dir: join_paths(meson.source_root(), 'po'),
install: true,
install_dir: join_paths(get_option('datadir'), 'metainfo')
)

install_data(
meson.project_name() + '.gschema.xml',
install_dir: join_paths(get_option('datadir'), 'glib-2.0', 'schemas')
)
76 changes: 18 additions & 58 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
# project name and programming language
project('com.github.mohelm97.screenrecorder', 'vala', 'c')
# Include the translations module
i18n = import('i18n')
gnome = import('gnome')
project('com.github.mohelm97.screenrecorder', 'vala', 'c', version: '0.2.1')

# Set our translation domain
add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format (meson.project_name()), language:'c')
gnome = import('gnome')
i18n = import('i18n')

icon_res = gnome.compile_resources(
'screenrecorder-icon-resources',
'data/' + meson.project_name() + '.gresource.xml',
source_dir: 'data'
add_project_arguments(
'-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()),
language: 'c'
)

# Adding deps
message ('Listing dependencies')
asresources = gnome.compile_resources(
'as-resources',
join_paths('data', meson.project_name()) + '.gresource.xml',
source_dir: 'data',
c_name: 'as'
)

dependencies = [
dependency('gee-0.8'),
Expand All @@ -27,56 +26,17 @@ dependencies = [
dependency('clutter-gtk-1.0')
]

# Create a new executable, list the files we want to compile, list the dependencies we need, and install
subdir('src')

executable(
meson.project_name(),
icon_res,
'src/Application.vala',
'src/MainWindow.vala',
'src/FFmpegWrapper.vala',
'src/SaveDialog.vala',
'src/Widgets/SelectionArea.vala',
'src/Widgets/VideoPlayer.vala',
'src/Widgets/FormatComboBox.vala',
'src/Widgets/ScaleComboBox.vala',
'src/Utils/KeybindingManager.vala',
asresources,
sources,
dependencies: dependencies,
install: true
)

#Translate and install our .desktop file
i18n.merge_file(
input: join_paths('data', meson.project_name() + '.desktop.in'),
output: meson.project_name() + '.desktop',
po_dir: join_paths(meson.source_root(), 'po'),
type: 'desktop',
install: true,
install_dir: join_paths(get_option('datadir'), 'applications')
)

#Translate and install our .appdata file
i18n.merge_file(
input: join_paths('data', meson.project_name() + '.appdata.xml.in'),
output: meson.project_name() + '.appdata.xml',
po_dir: join_paths(meson.source_root(), 'po'),
install: true,
install_dir: join_paths(get_option('datadir'), 'metainfo')
)

install_data(
join_paths('data', meson.project_name() + '.gschema.xml'),
install_dir: join_paths(get_option('datadir'), 'glib-2.0', 'schemas')
)

#Install Icons
icon_sizes = ['32', '48', '64', '128']

foreach i : icon_sizes
install_data(
join_paths('data/icons', i, 'com.github.mohelm97.screenrecorder.svg'),
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', i + 'x' + i, 'apps')
)
endforeach

subdir('data')
subdir('po')

meson.add_install_script('meson/post_install.py')
27 changes: 10 additions & 17 deletions meson/post_install.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
#!/usr/bin/env python3

import os
from os import path, environ
import subprocess

prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr/local')
datadir = os.path.join(prefix, 'share')
schemadir = os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share', 'glib-2.0', 'schemas')
prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local')
schemadir = path.join(environ['MESON_INSTALL_PREFIX'], 'share', 'glib-2.0', 'schemas')
datadir = path.join(prefix, 'share')
desktop_database_dir = path.join(datadir, 'applications')

if not os.environ.get('DESTDIR'):
print('Compiling gsettings schemas...')
if not environ.get('DESTDIR'):
print('Compiling gsettings schemas')
subprocess.call(['glib-compile-schemas', schemadir])

print('Updating icon cache...')
icon_cache_dir = os.path.join(datadir, 'icons', 'hicolor')
if not os.path.exists(icon_cache_dir):
os.makedirs(icon_cache_dir)
subprocess.call(['gtk-update-icon-cache', '-qtf', icon_cache_dir])

print('Updating desktop database...')
desktop_database_dir = os.path.join(datadir, 'applications')
if not os.path.exists(desktop_database_dir):
os.makedirs(desktop_database_dir)
print('Updating desktop database…')
subprocess.call(['update-desktop-database', '-q', desktop_database_dir])
print('Updating icon cache…')
subprocess.call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')])
11 changes: 11 additions & 0 deletions src/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
sources = files(
'Application.vala',
'MainWindow.vala',
'FFmpegWrapper.vala',
'SaveDialog.vala',
'Widgets/SelectionArea.vala',
'Widgets/VideoPlayer.vala',
'Widgets/FormatComboBox.vala',
'Widgets/ScaleComboBox.vala',
'Utils/KeybindingManager.vala'
)