From 92b76d254fcc34dd1545154f9fe0e0b079c43ea8 Mon Sep 17 00:00:00 2001 From: Jan Havran Date: Sun, 20 Feb 2022 15:08:11 +0100 Subject: [PATCH] package/rtklib: new package RTKLIB is an open source program package for standard and precise positioning with GNSS. Version used here is from rtkexplorer, which is better optimized and more frequently updated than original version by Tomoji Takasu. Signed-off-by: Jan Havran --- v1: WIP: For SkiffOS: - https://patchwork.ozlabs.org/project/buildroot/patch/YhJLS73VW3szIXR+@arch-zen.localdomain/ - Changes applied from Thomas's review. - There are still Changes Requested before submitting upstream. - Updated to latest revision of the pkg. - Skip building the fortran files, need to investigate when this is necessary. Tested-by: Christian Stewart --- DEVELOPERS | 1 + package/Config.in | 1 + package/rtklib/Config.in | 38 ++++++++++++++++++++++++++++++++++++++ package/rtklib/rtklib.hash | 3 +++ package/rtklib/rtklib.mk | 38 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 81 insertions(+) create mode 100644 package/rtklib/Config.in create mode 100644 package/rtklib/rtklib.hash create mode 100644 package/rtklib/rtklib.mk diff --git a/DEVELOPERS b/DEVELOPERS index dcc43583ae..22cd6e94a0 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1500,6 +1500,7 @@ F: package/microchip-hss-payload-generator/ N: Jan Havran F: board/pine64/pinecube/ F: configs/pine64_pinecube_defconfig +F: package/rtklib/ N: Jan Heylen F: package/opentracing-cpp/ diff --git a/package/Config.in b/package/Config.in index 3b20b0c227..c98d69e77b 100644 --- a/package/Config.in +++ b/package/Config.in @@ -602,6 +602,7 @@ endmenu source "package/rpi-userland/Config.in" source "package/rs485conf/Config.in" source "package/rtc-tools/Config.in" + source "package/rtklib/Config.in" source "package/rtl8188eu/Config.in" source "package/rtl8189es/Config.in" source "package/rtl8189fs/Config.in" diff --git a/package/rtklib/Config.in b/package/rtklib/Config.in new file mode 100644 index 0000000000..dc694d6b7d --- /dev/null +++ b/package/rtklib/Config.in @@ -0,0 +1,38 @@ +comment "rtklib needs a toolchain w/ threads" + depends on !BR2_TOOLCHAIN_HAS_THREADS + +config BR2_PACKAGE_RTKLIB + bool "rtklib" + depends on BR2_TOOLCHAIN_HAS_THREADS + help + RTKLIB is an open source program package for standard and + precise positioning with GNSS (global navigation satellite + system). + + This is a version of RTKLIB optimized for single and dual + frequency low cost GPS receivers, especially u-blox receivers. + + https://rtkexplorer.com/ + +if BR2_PACKAGE_RTKLIB + +config BR2_PACKAGE_RTKLIB_CONVBIN + bool "convbin" + +config BR2_PACKAGE_RTKLIB_POS2KML + bool "pos2kml" + +comment "rnx2rtkp needs Fortran" + depends on !BR2_TOOLCHAIN_HAS_FORTRAN + +config BR2_PACKAGE_RTKLIB_RNX2RTKP + bool "rnx2rtkp" + depends on BR2_TOOLCHAIN_HAS_FORTRAN + +config BR2_PACKAGE_RTKLIB_RTKRCV + bool "rtkrcv" + +config BR2_PACKAGE_RTKLIB_STR2STR + bool "str2str" + +endif diff --git a/package/rtklib/rtklib.hash b/package/rtklib/rtklib.hash new file mode 100644 index 0000000000..d892fa774f --- /dev/null +++ b/package/rtklib/rtklib.hash @@ -0,0 +1,3 @@ +# Locally computed +sha256 f10efd2cc9e22d9e4a0c950ab86660747241d8b8a34d657952b5d2b9d14cb81b rtklib-620fa2873ce9182ab3ceab223170a3a2b7c3d651.tar.gz +sha256 219747832d49ee958457b2934080ab8d94bd9d8e45fcb1c36f89776fd2c5ed8a license.txt diff --git a/package/rtklib/rtklib.mk b/package/rtklib/rtklib.mk new file mode 100644 index 0000000000..ef12741df3 --- /dev/null +++ b/package/rtklib/rtklib.mk @@ -0,0 +1,38 @@ +################################################################################ +# +# rtklib +# +################################################################################ + +RTKLIB_VERSION = 620fa2873ce9182ab3ceab223170a3a2b7c3d651 +RTKLIB_SITE = $(call github,rtklibexplorer,RTKLIB,$(RTKLIB_VERSION)) +RTKLIB_LICENSE = BSD-2-Clause +RTKLIB_LICENSE_FILES = license.txt + +RTKLIB_APPS = \ + $(if $(BR2_PACKAGE_RTKLIB_CONVBIN),convbin) \ + $(if $(BR2_PACKAGE_RTKLIB_POS2KML),pos2kml) \ + $(if $(BR2_PACKAGE_RTKLIB_RNX2RTKP),rnx2rtkp) \ + $(if $(BR2_PACKAGE_RTKLIB_RTKRCV),rtkrcv) \ + $(if $(BR2_PACKAGE_RTKLIB_STR2STR),str2str) + +define RTKLIB_BUILD_CMDS + find $(@D) -name '*.a' | xargs rm -f + # TODO: Requires fortran compiler. Build conditional on RNX2RTKP. + # $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/lib/iers/gcc \ + # CC="$(TARGET_CC)" \ + # F77="$(TARGET_FC)" + $(foreach app,$(RTKLIB_APPS),\ + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/app/consapp/$(app)/gcc \ + CC="$(TARGET_CC)" + ) +endef + +define RTKLIB_INSTALL_TARGET_CMDS + $(foreach app,$(RTKLIB_APPS), \ + $(INSTALL) -m 0755 $(@D)/app/consapp/$(app)/gcc/$(app) \ + $(TARGET_DIR)/usr/bin/$(app) + ) +endef + +$(eval $(generic-package))