summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAylur <[email protected]>2024-05-22 00:14:54 +0200
committerAylur <[email protected]>2024-05-22 00:14:54 +0200
commit2f8354f13466bcccb031953923b91918e6cacc97 (patch)
tree9b1f597c6db30c376e3b72fa0f2f922b49201e51 /src
parentf81468a398a0b1363b77d1052498554f7bd2682a (diff)
update meson format
Diffstat (limited to 'src')
-rw-r--r--src/astal.vala6
-rw-r--r--src/cli.vala (renamed from src/client.vala.in)0
-rw-r--r--src/config.vala.in6
-rw-r--r--src/meson.build86
4 files changed, 54 insertions, 44 deletions
diff --git a/src/astal.vala b/src/astal.vala
index e9d1484..fe6558c 100644
--- a/src/astal.vala
+++ b/src/astal.vala
@@ -97,14 +97,13 @@ public class Application : Gtk.Application {
}
try {
- SocketAddress _;
service = new SocketService();
service.add_address(
new UnixSocketAddress(socket),
SocketType.STREAM,
SocketProtocol.DEFAULT,
null,
- out _);
+ null);
service.incoming.connect((conn) => {
_socket_request.begin(conn);
@@ -151,8 +150,7 @@ public errordomain WindowError {
public async string read_sock(SocketConnection conn) {
try {
var stream = new DataInputStream(conn.input_stream);
- size_t size;
- return yield stream.read_upto_async("\x04", -1, Priority.DEFAULT, null, out size);
+ return yield stream.read_upto_async("\x04", -1, Priority.DEFAULT, null, null);
} catch (Error err) {
critical(err.message);
return err.message;
diff --git a/src/client.vala.in b/src/cli.vala
index 82a99a4..82a99a4 100644
--- a/src/client.vala.in
+++ b/src/cli.vala
diff --git a/src/config.vala.in b/src/config.vala.in
new file mode 100644
index 0000000..88bfe9c
--- /dev/null
+++ b/src/config.vala.in
@@ -0,0 +1,6 @@
+namespace Astal {
+ public const int MAJOR_VERSION = @MAJOR_VERSION@;
+ public const int MINOR_VERSION = @MINOR_VERSION@;
+ public const int MICRO_VERSION = @MICRO_VERSION@;
+ public const string VERSION = "@VERSION@";
+}
diff --git a/src/meson.build b/src/meson.build
index 2227075..f6b0db0 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,8 +1,19 @@
version_split = meson.project_version().split('.')
api_version = version_split[0] + '.' + version_split[1]
-astal_gir = 'Astal-' + api_version + '.gir'
-astal_typelib = 'Astal-' + api_version + '.typelib'
-astal_so = 'libastal.so.' + meson.project_version()
+gir = 'Astal-' + api_version + '.gir'
+typelib = 'Astal-' + api_version + '.typelib'
+so = 'libastal.so.' + meson.project_version()
+
+config = configure_file(
+ input: 'config.vala.in',
+ output: 'config.vala',
+ configuration: {
+ 'VERSION': meson.project_version(),
+ 'MAJOR_VERSION': version_split[0],
+ 'MINOR_VERSION': version_split[1],
+ 'MICRO_VERSION': version_split[2],
+ },
+)
deps = [
dependency('glib-2.0'),
@@ -14,7 +25,8 @@ deps = [
dependency('gtk-layer-shell-0'),
]
-sources = files(
+sources = [
+ config,
'widget/box.vala',
'widget/button.vala',
'widget/centerbox.vala',
@@ -27,58 +39,52 @@ sources = files(
'process.vala',
'time.vala',
'variable.vala',
-)
+]
-libastal = library(
- meson.project_name(),
- sources,
- dependencies: deps,
- vala_header: meson.project_name() + '.h',
- vala_vapi: meson.project_name() + '.vapi',
- vala_gir: astal_gir,
- version: meson.project_version(),
- install: true,
- install_dir: [true, true, true, true],
-)
+if get_option('lib')
+ lib = library(
+ meson.project_name(),
+ sources,
+ dependencies: deps,
+ vala_header: meson.project_name() + '.h',
+ vala_vapi: meson.project_name() + '.vapi',
+ vala_gir: gir,
+ version: meson.project_version(),
+ install: true,
+ install_dir: [true, true, true, true],
+ )
-import('pkgconfig').generate(
- description: 'libastal',
- libraries: libastal,
- name: meson.project_name(),
- filebase: meson.project_name() + '-' + api_version,
- version: meson.project_version(),
- subdirs: meson.project_name(),
- requires: 'gio-2.0',
- install_dir: get_option('libdir') / 'pkgconfig',
-)
+ import('pkgconfig').generate(
+ description: 'libastal-notifd',
+ libraries: lib,
+ name: meson.project_name(),
+ filebase: meson.project_name() + '-' + api_version,
+ version: meson.project_version(),
+ subdirs: meson.project_name(),
+ requires: deps,
+ install_dir: get_option('libdir') / 'pkgconfig',
+ )
-if get_option('typelib')
custom_target(
- astal_typelib,
+ typelib,
command: [
find_program('g-ir-compiler'),
'--output', '@OUTPUT@',
'--shared-library', get_option('prefix') / get_option('libdir') / '@PLAINNAME@',
- meson.current_build_dir() / astal_gir,
+ meson.current_build_dir() / gir,
],
- input: libastal,
- output: astal_typelib,
- depends: libastal,
+ input: lib,
+ output: typelib,
+ depends: lib,
install: true,
install_dir: get_option('libdir') / 'girepository-1.0',
)
endif
-if get_option('cli_client')
+if get_option('cli')
executable(
meson.project_name(),
- configure_file(
- input: 'client.vala.in',
- output: 'client.vala',
- configuration: {
- 'VERSION': meson.project_version(),
- },
- ),
+ ['cli.vala', sources],
dependencies: deps,
install: true,
)