Commit 68ddfeb3 authored by Erik Reider's avatar Erik Reider

Added meson dev-env support

parent aafe626a
...@@ -11,7 +11,7 @@ max_line_length = 100 ...@@ -11,7 +11,7 @@ max_line_length = 100
tab_width = 4 tab_width = 4
# Markup files # Markup files
[{*.html,*.xml,*.xml.in,*.yml}] [{*.html,*.xml,*.xml.in,*.yml,meson.build}]
tab_width = 2 tab_width = 2
# Man pages # Man pages
......
*.ui~ *.ui~
*.ui# *.ui#
gschemas.compiled
pkg pkg
build build
SwayNotificationCenter SwayNotificationCenter
......
...@@ -224,10 +224,27 @@ sudo xbps-install -S SwayNotificationCenter ...@@ -224,10 +224,27 @@ sudo xbps-install -S SwayNotificationCenter
```zsh ```zsh
meson setup build --prefix=/usr meson setup build --prefix=/usr
ninja -C build meson compile -C build
meson install -C build meson install -C build
``` ```
## Development
### Setup and build
```sh
meson setup build
meson compile -C build
```
### Set the environment
```sh
# Sets the correct environment variables
meson devenv -C build -w .
# Now you can start nvim, vscode, etc in the development environment
```
## Sway Usage ## Sway Usage
```ini ```ini
......
install_data('org.erikreider.swaync.gschema.xml', # GSchema
install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas') compile_schemas = find_program('glib-compile-schemas', required: true)
install_data(
'org.erikreider.swaync.gschema.xml',
install_dir: join_paths(datadir, 'glib-2.0/schemas'),
) )
compile_schemas = find_program('glib-compile-schemas', required: false) test(
if compile_schemas.found() 'Validate schema file',
test('Validate schema file', compile_schemas, compile_schemas,
args: ['--strict', '--dry-run', meson.current_source_dir()] args: ['--strict', '--dry-run', meson.current_source_dir()],
)
if get_option('buildtype') != 'release'
app_resources += custom_target(
'gschemas',
input: 'org.erikreider.swaync.gschema.xml',
output: 'gschemas.compiled',
command: [
compile_schemas,
'--strict', meson.current_source_dir(),
],
) )
dev_env.set('GSETTINGS_SCHEMA_DIR', meson.current_source_dir())
endif endif
# SCSS Dependency # SCSS Dependency
......
...@@ -9,6 +9,8 @@ add_project_arguments(['-Wno-error=int-conversion'], language: 'c') ...@@ -9,6 +9,8 @@ add_project_arguments(['-Wno-error=int-conversion'], language: 'c')
add_project_arguments(['--enable-gobject-tracing'], language: 'vala') add_project_arguments(['--enable-gobject-tracing'], language: 'vala')
add_project_arguments(['--enable-checking'], language: 'vala') add_project_arguments(['--enable-checking'], language: 'vala')
dev_env = environment()
cc = meson.get_compiler('c') cc = meson.get_compiler('c')
vala = meson.get_compiler('vala') vala = meson.get_compiler('vala')
...@@ -17,6 +19,8 @@ gnome = import('gnome') ...@@ -17,6 +19,8 @@ gnome = import('gnome')
app_resources = [] app_resources = []
config_path = join_paths(get_option('sysconfdir'), 'xdg', 'swaync') config_path = join_paths(get_option('sysconfdir'), 'xdg', 'swaync')
datadir = get_option('datadir')
libdir = get_option('libdir')
# Wayland protocols # Wayland protocols
protocol_dep = [] protocol_dep = []
...@@ -25,8 +29,7 @@ subdir('protocols') ...@@ -25,8 +29,7 @@ subdir('protocols')
subdir('data') subdir('data')
subdir('src') subdir('src')
datadir = get_option('datadir') meson.add_devenv(dev_env)
libdir = get_option('libdir')
conf_data = configuration_data() conf_data = configuration_data()
conf_data.set('bindir', join_paths(get_option('prefix'), get_option('bindir'))) conf_data.set('bindir', join_paths(get_option('prefix'), get_option('bindir')))
......
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