added mavlink-router package instead of prebuild binary (#1004)

pull/1005/head
cronyx 2023-09-22 03:07:33 +03:00 committed by GitHub
parent a5ec76b338
commit 6078cf71d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 106 additions and 9 deletions

View File

@ -0,0 +1,38 @@
--- a/meson.build 2023-09-21 19:30:58.958516678 +0300
+++ b/meson.build 2023-09-21 19:31:43.130627605 +0300
@@ -28,11 +28,11 @@
dep_thread = dependency('threads')
# Optional dependencies
-systemd_system_unit_dir = get_option('systemdsystemunitdir')
-if systemd_system_unit_dir == 'auto'
- dep_systemd = dependency('systemd')
- systemd_system_unit_dir = dep_systemd.get_variable(pkgconfig: 'systemdsystemunitdir')
-endif
+#systemd_system_unit_dir = get_option('systemdsystemunitdir')
+#if systemd_system_unit_dir == 'auto'
+# dep_systemd = dependency('systemd')
+# systemd_system_unit_dir = dep_systemd.get_variable(pkgconfig: 'systemdsystemunitdir')
+#endif
dep_gtest = dependency('gtest', main : true, required : false)
@@ -128,12 +128,12 @@
src_inc = include_directories('src')
# Additonal data to be installed
-configure_file(
- input: 'mavlink-router.service.in',
- output: 'mavlink-router.service',
- configuration: conf,
- install_dir: systemd_system_unit_dir,
-)
+#configure_file(
+# input: 'mavlink-router.service.in',
+# output: 'mavlink-router.service',
+# configuration: conf,
+# install_dir: systemd_system_unit_dir,
+#)
subdir('src')
subdir('examples')

View File

@ -0,0 +1,11 @@
--- a/src/main.cpp 2022-07-18 18:28:46.427813305 +0300
+++ b/src/main.cpp 2022-07-18 18:29:18.859907624 +0300
@@ -36,7 +36,7 @@
#include "logendpoint.h"
#include "mainloop.h"
-#define DEFAULT_CONFFILE "/etc/mavlink-router/main.conf"
+#define DEFAULT_CONFFILE "/etc/mavlink.conf"
#define DEFAULT_CONF_DIR "/etc/mavlink-router/config.d"
extern const char *BUILD_VERSION;

View File

@ -0,0 +1,16 @@
[constants]
arch = 'arm-openipc'
abi = 'musleabi'
[binaries]
c = arch + '-linux-' + abi + '-gcc'
cpp = arch + '-linux-' + abi + '-g++'
ar = arch + '-linux-'+ abi + '-gcc-ar'
strip = arch + '-linux-' + abi + '-strip'
pkgconfig = 'pkg-config'
[host_machine]
system = 'linux'
cpu_family = 'arm'
cpu = 'armv7l'
endian = 'little'

View File

@ -0,0 +1,16 @@
[constants]
arch = 'mipsel-openipc'
abi = 'musl'
[binaries]
c = arch + '-linux-' + abi + '-gcc'
cpp = arch + '-linux-' + abi + '-g++'
ar = arch + '-linux-'+ abi + '-gcc-ar'
strip = arch + '-linux-' + abi + '-strip'
pkgconfig = 'pkg-config'
[host_machine]
system = 'linux'
cpu_family = 'mips'
cpu = 'mips32'
endian = 'little'

View File

@ -0,0 +1,4 @@
#!/bin/sh
git clone https://github.com/mavlink/c_library_v2.git -b master modules/mavlink_c_library_v2

View File

@ -4,11 +4,30 @@
#
################################################################################
MAVLINK_ROUTER_VERSION = 18c06da77563db9ba1b7c4173ff5cae1646b383e
MAVLINK_ROUTER_SITE = $(call github,mavlink-router,mavlink-router,$(MAVLINK_ROUTER_VERSION))
MAVLINK_ROUTER_LICENSE = ASF-2.0
MAVLINK_ROUTER_DEPENDENCIES += host-meson host-pkgconf
MAVLINK_ROUTER_CONF_OPTS += \
--buildtype=release \
--cross-file $(MAVLINK_ROUTER_PKGDIR)/files/meson-cross-$(ARCH)-openipc.ini
define MAVLINK_ROUTER_CONFIGURE_CMDS
rm -rf $(@D)/build
mkdir -p $(@D)/build
cp -f $(MAVLINK_ROUTER_PKGDIR)/files/prepare.sh $(@D)/prepare.sh
cd $(@D) ; sh prepare.sh
$(TARGET_MAKE_ENV) meson setup $(MAVLINK_ROUTER_CONF_OPTS) $(@D) $(@D)/build
endef
define MAVLINK_ROUTER_BUILD_CMDS
$(TARGET_MAKE_ENV) ninja -C $(@D)/build
endef
define MAVLINK_ROUTER_INSTALL_TARGET_CMDS
$(INSTALL) -m 0755 -d $(TARGET_DIR)/usr/bin
cp $(MAVLINK_ROUTER_PKGDIR)/files/mavlink-routerd $(TARGET_DIR)/usr/bin/mavlink-routerd
$(TARGET_MAKE_ENV) DESTDIR=$(TARGET_DIR) ninja -C $(@D)/build install
$(INSTALL) -m 755 -d $(TARGET_DIR)/etc
cp $(MAVLINK_ROUTER_PKGDIR)/files/mavlink.conf $(TARGET_DIR)/etc/mavlink.conf

View File

@ -1,7 +0,0 @@
# MAVLink Router Package
Все необходимые настройки находятся в /etc/mavlink.conf
Запуск и остановка сервиса /etc/init.d/S97mavlink [start|stop]
Полный список всех возможных [настроек](https://github.com/mavlink-router/mavlink-router/blob/master/examples/config.sample) можно получить из сэмпла конфига с официального гитхаба.