summaryrefslogtreecommitdiffstats
path: root/src/meson.build
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2023-01-03 00:51:50 -0500
committerScott Murray <scott.murray@konsulko.com>2023-01-19 00:37:11 +0000
commit7f26a2d06410fd3a2768612b9c9daf869778e480 (patch)
tree4dfffa78e14c8eadb42a731ae15cc87137e17723 /src/meson.build
parent6191be9c1e4b628f60ccaeabcef2aaa9de00800b (diff)
Repurpose into gRPC servicequillback_17.0.0quillback/17.0.017.0.0
Repurpose repository into a spiritual successor of the previous binding. The backend code is retained behind a new gRPC API defined in protos/radio.proto. The simpler synchronous gRPC API had been used for expediency, this may warrant revisiting to rework into an async or callback API based server instead. As well, authentication has been left until some consensus on an approach can be worked out. Bug-AGL: SPEC-4665 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I28b122ce6e0ecfc7504aa08b90394cb1b9e22976 (cherry picked from commit dd23c157bdba1b25bbb50cdb99a60aa597735f43)
Diffstat (limited to 'src/meson.build')
-rw-r--r--src/meson.build81
1 files changed, 81 insertions, 0 deletions
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..6446066
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,81 @@
+#
+# Copyright (C) 2021 Collabora Ltd
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+cpp = meson.get_compiler('cpp')
+grpcpp_reflection_dep = cpp.find_library('grpc++_reflection')
+
+gstreamer_dep = dependency('gstreamer-1.0')
+
+radio_deps = [
+ dependency('gobject-2.0'),
+ dependency('gio-unix-2.0'),
+ gstreamer_dep,
+ dependency('protobuf'),
+ dependency('grpc'),
+ dependency('grpc++'),
+ grpcpp_reflection_dep
+]
+
+protoc = find_program('protoc')
+grpc_cpp = find_program('grpc_cpp_plugin')
+
+protoc_gen = generator(protoc, \
+ output : ['@BASENAME@.pb.cc', '@BASENAME@.pb.h'],
+ arguments : ['--proto_path=@CURRENT_SOURCE_DIR@/../protos',
+ '--cpp_out=@BUILD_DIR@',
+ '@INPUT@'])
+generated_protoc_sources = protoc_gen.process('../protos/radio.proto')
+
+grpc_gen = generator(protoc, \
+ output : ['@BASENAME@.grpc.pb.cc', '@BASENAME@.grpc.pb.h'],
+ arguments : ['--proto_path=@CURRENT_SOURCE_DIR@/../protos',
+ '--grpc_out=@BUILD_DIR@',
+ '--plugin=protoc-gen-grpc=' + grpc_cpp.path(),
+ '@INPUT@'])
+generated_grpc_sources = grpc_gen.process('../protos/radio.proto')
+
+# FIXME: debug radio_impl_tef665x.c compile issues and add
+executable (
+ 'agl-service-radio',
+ [
+ generated_protoc_sources,
+ generated_grpc_sources,
+ 'main-grpc.cc',
+ 'RadioImpl.cc',
+ 'radio_impl_null.c',
+ 'radio_impl_kingfisher.c',
+ 'radio_impl_rtlsdr.c'
+ ],
+ dependencies : radio_deps,
+ install : true,
+ install_dir : get_option('sbindir')
+)
+
+cc = meson.get_compiler('c')
+m_dep = cc.find_library('m', required : false)
+helper_deps = [ gstreamer_dep, m_dep, dependency('librtlsdr'), dependency('libusb-1.0') ]
+executable (
+ 'rtl_fm_helper',
+ [
+ 'rtl_fm_helper.c',
+ 'radio_output_gstreamer.c',
+ 'rtl_fm.c',
+ 'convenience/convenience.c'
+ ],
+ dependencies : helper_deps,
+ install : true,
+ install_dir : get_option('sbindir')
+)