mirror of
https://github.com/zoriya/astal.git
synced 2025-12-06 06:06:10 +00:00
update meson format
This commit is contained in:
6
flake.lock
generated
6
flake.lock
generated
@@ -2,11 +2,11 @@
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1715266358,
|
||||
"narHash": "sha256-doPgfj+7FFe9rfzWo1siAV2mVCasW+Bh8I1cToAXEE4=",
|
||||
"lastModified": 1716293225,
|
||||
"narHash": "sha256-pU9ViBVE3XYb70xZx+jK6SEVphvt7xMTbm6yDIF4xPs=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "f1010e0469db743d14519a1efd37e23f8513d714",
|
||||
"rev": "3eaeaeb6b1e08a016380c279f8846e0bd8808916",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -14,4 +14,9 @@ project(
|
||||
# math
|
||||
add_project_arguments(['-X', '-lm'], language: 'vala')
|
||||
|
||||
assert(
|
||||
get_option('lib') or get_option('cli'),
|
||||
'Either lib or cli option must be set to true.',
|
||||
)
|
||||
|
||||
subdir('src')
|
||||
|
||||
@@ -1,2 +1,11 @@
|
||||
option('typelib', type: 'boolean', value: true, description: 'Needed files for runtime bindings')
|
||||
option('cli_client', type: 'boolean', value: true, description: 'Minimal cli client for Astal applications')
|
||||
option(
|
||||
'lib',
|
||||
type: 'boolean',
|
||||
value: true,
|
||||
)
|
||||
|
||||
option(
|
||||
'cli',
|
||||
type: 'boolean',
|
||||
value: true,
|
||||
)
|
||||
|
||||
@@ -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;
|
||||
|
||||
6
src/config.vala.in
Normal file
6
src/config.vala.in
Normal file
@@ -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@";
|
||||
}
|
||||
@@ -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(
|
||||
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: astal_gir,
|
||||
vala_gir: gir,
|
||||
version: meson.project_version(),
|
||||
install: true,
|
||||
install_dir: [true, true, true, true],
|
||||
)
|
||||
)
|
||||
|
||||
import('pkgconfig').generate(
|
||||
description: 'libastal',
|
||||
libraries: libastal,
|
||||
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: 'gio-2.0',
|
||||
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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user