diff --git a/network/misc/florb/actions.py b/network/misc/florb/actions.py new file mode 100644 index 0000000000..c987000b27 --- /dev/null +++ b/network/misc/florb/actions.py @@ -0,0 +1,34 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# +# Licensed under the GNU General Public License, version 3. +# See the file https://www.gnu.org/licenses/gpl-3.0.txt + +from pisi.actionsapi import shelltools +from pisi.actionsapi import cmaketools +from pisi.actionsapi import pisitools +from pisi.actionsapi import get + +j = "-DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX=/usr -L \ + " + +def setup(): + pisitools.flags.add("-pthread -lXpm") + pisitools.unlinkDir("src/i18n/de_DE") + shelltools.makedirs("build") + shelltools.cd("build") + cmaketools.configure(j, sourceDir = '..') + +def build(): + shelltools.cd("build") + cmaketools.make() + +def install(): + pisitools.dobin("build/src/florb") + pisitools.dopixmaps("src/res/florb.png") + shelltools.chmod("src/res/florb.svg", mode = 0644) + pisitools.insinto("/usr/share/icons/hicolor/scalable/apps", "src/res/florb.svg") + +# pisitools.dodoc("LICENSE.txt", "README.txt") + diff --git a/network/misc/florb/files/allow_startup_with_missing_config_file.patch b/network/misc/florb/files/allow_startup_with_missing_config_file.patch new file mode 100644 index 0000000000..8d6cf1f48b --- /dev/null +++ b/network/misc/florb/files/allow_startup_with_missing_config_file.patch @@ -0,0 +1,31 @@ +From ab015e4f1c31bd9769b0b7c8b447ff0c9c680e2c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Claes=20N=C3=A4st=C3=A9n?= +Date: Mon, 31 Aug 2020 21:49:57 +0200 +Subject: [PATCH] Allow startup with missing config file + +Initial startup without a config file fails with a yaml-cpp exception, +use an empty node instead of crashing. +--- + src/settings.cpp | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/src/settings.cpp b/src/settings.cpp +index 1a8e679..a1d93d2 100644 +--- a/src/settings.cpp ++++ b/src/settings.cpp +@@ -7,7 +7,14 @@ florb::settings::settings() + m_cfgfile = florb::utils::appdir() + florb::utils::pathsep() + "config"; + florb::utils::mkdir(florb::utils::appdir()); + +- m_rootnode = YAML::LoadFile(m_cfgfile); ++ if (florb::utils::exists(m_cfgfile)) ++ { ++ m_rootnode = YAML::LoadFile(m_cfgfile); ++ } ++ else ++ { ++ m_rootnode = YAML::Node(); ++ } + defaults(m_cfgfile); + } + diff --git a/network/misc/florb/files/florb.desktop.in b/network/misc/florb/files/florb.desktop.in new file mode 100644 index 0000000000..aeca008307 --- /dev/null +++ b/network/misc/florb/files/florb.desktop.in @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Icon=florb +NoDisplay=false +Exec=florb +Name=florb +GenericName=A simple map viewer and GPX editor +Comment=florb is a really simple map viewer and GPX editor written in C++ using the FLTK UI toolkit +Categories=Network;Maps; diff --git a/network/misc/florb/files/no_build_about_resources.patch b/network/misc/florb/files/no_build_about_resources.patch new file mode 100644 index 0000000000..2f0f20a344 --- /dev/null +++ b/network/misc/florb/files/no_build_about_resources.patch @@ -0,0 +1,130 @@ +--- a/src/dlg_ui_ex.cpp 2019-07-16 16:54:55.000000000 +0000 ++++ b/src/dlg_ui_ex.cpp 2020-12-19 18:28:04.920908321 +0000 +@@ -13,16 +13,16 @@ + #include "fluid/dlg_ui.hpp" + #include "version.hpp" + +-extern "C" +-{ +- extern char _binary_LICENSE_res_start; +- extern char _binary_LICENSE_res_end; +- extern char _binary_LICENSE_res_size; +- +- extern char _binary_KEYS_res_start; +- extern char _binary_KEYS_res_end; +- extern char _binary_KEYS_res_size; +-} ++//extern "C" ++//{ ++// extern char _binary_LICENSE_res_start; ++// extern char _binary_LICENSE_res_end; ++// extern char _binary_LICENSE_res_size; ++ ++// extern char _binary_KEYS_res_start; ++// extern char _binary_KEYS_res_end; ++// extern char _binary_KEYS_res_size; ++//} + + static dlg_ui *ui; + +@@ -188,8 +188,8 @@ + m_menuitem_gpsd_lockcursor->label(_("Lock to cursor")); + // Help + m_menuitem_help->label(_("Help")); +- m_menuitem_help_about->label(_("About")); +- m_menuitem_help_usage->label(_("Usage")); ++// m_menuitem_help_about->label(_("About")); ++// m_menuitem_help_usage->label(_("Usage")); + + // Populate the Basemap selector + update_choice_map_ex(); +@@ -492,38 +492,38 @@ + m_dlg_search->show(); + } + +-void dlg_ui::about_ex() +-{ ++//void dlg_ui::about_ex() ++//{ + // Show about dialog +- if (!m_dlg_txtdisp) +- m_dlg_txtdisp = new dlg_txtdisp; +- +- std::string v(std::string(_("Version: ")) + std::string(FLORB_PROGSTR)); +- std::string l(&_binary_LICENSE_res_start, (size_t)&_binary_LICENSE_res_size); +- +- m_dlg_txtdisp->title(_("About / License")); +- m_dlg_txtdisp->clear(); +- m_dlg_txtdisp->append(v); +- m_dlg_txtdisp->append("\n\n"); +- m_dlg_txtdisp->append(florb::utils::str_split(l, "\n\n"), "\n\n", true); +- +- m_dlg_txtdisp->show(); +-} +-void dlg_ui::usage_ex() +-{ ++// if (!m_dlg_txtdisp) ++// m_dlg_txtdisp = new dlg_txtdisp; ++// ++// std::string v(std::string(_("Version: ")) + std::string(FLORB_PROGSTR)); ++// std::string l(&_binary_LICENSE_res_start, (size_t)&_binary_LICENSE_res_size); ++// ++// m_dlg_txtdisp->title(_("About / License")); ++// m_dlg_txtdisp->clear(); ++// m_dlg_txtdisp->append(v); ++// m_dlg_txtdisp->append("\n\n"); ++// m_dlg_txtdisp->append(florb::utils::str_split(l, "\n\n"), "\n\n", true); ++// ++// m_dlg_txtdisp->show(); ++//} ++//void dlg_ui::usage_ex() ++//{ + // Show about dialog +- if (!m_dlg_txtdisp) +- m_dlg_txtdisp = new dlg_txtdisp; +- +- std::string u(&_binary_KEYS_res_start, (size_t)&_binary_KEYS_res_size); +- +- m_dlg_txtdisp->title(_("Usage")); +- m_dlg_txtdisp->clear(); +- m_dlg_txtdisp->append(florb::utils::str_split(u, "\n\n"), "\n\n", true); +- +- m_dlg_txtdisp->show(); +-} +- ++// if (!m_dlg_txtdisp) ++// m_dlg_txtdisp = new dlg_txtdisp; ++// ++// std::string u(&_binary_KEYS_res_start, (size_t)&_binary_KEYS_res_size); ++// ++// m_dlg_txtdisp->title(_("Usage")); ++// m_dlg_txtdisp->clear(); ++// m_dlg_txtdisp->append(florb::utils::str_split(u, "\n\n"), "\n\n", true); ++// ++// m_dlg_txtdisp->show(); ++//} ++// + + void dlg_ui::cb_btn_loadtrack_ex(Fl_Widget *widget) + { +@@ -709,13 +709,13 @@ + } + + // Help submenu +- else if (mit == m_menuitem_help_about) { +- about_ex(); +- } +- else if (mit == m_menuitem_help_usage) { +- usage_ex(); +- } +- ++// else if (mit == m_menuitem_help_about) { ++// about_ex(); ++// } ++// else if (mit == m_menuitem_help_usage) { ++// usage_ex(); ++// } ++// + m_wgtmap->take_focus(); + } + diff --git a/network/misc/florb/files/support_building_with_cmake.patch b/network/misc/florb/files/support_building_with_cmake.patch new file mode 100644 index 0000000000..3089e56196 --- /dev/null +++ b/network/misc/florb/files/support_building_with_cmake.patch @@ -0,0 +1,613 @@ +From cb0eb27e06d93f315f8cea8b7657b6cae58226a7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Claes=20N=C3=A4st=C3=A9n?= +Date: Wed, 2 Sep 2020 08:29:56 +0200 +Subject: [PATCH] Support building with CMake + +Preparing for OS X support with a build system that is available in +homebrew and helps with abstracting platform differences. +Correct link libararies are missing and missing resource compilation. + +libgps not supported at all on Windows (if such a port is to be +made in the future) and unavailable in homebrew. Allow compilation +without it as florb is very usable without it. +--- + CMake/config.h.in | 6 ++ + CMakeLists.txt | 36 +++++++++ + src/CMakeLists.txt | 100 +++++++++++++++++++++++++ + src/OMakefile | 19 ++--- + src/dlg_bulkdl_ex.cpp | 2 +- + src/dlg_editselection_ex.cpp | 2 +- + src/dlg_eleprofile_ex.cpp | 2 +- + src/dlg_garmindl_ex.cpp | 2 +- + src/dlg_garminul_ex.cpp | 2 +- + src/dlg_search_ex.cpp | 2 +- + src/dlg_settings_ex.cpp | 14 +++- + src/dlg_tileserver_ex.cpp | 2 +- + src/dlg_txtdisp_ex.cpp | 2 +- + src/dlg_ui_ex.cpp | 6 +- + src/fluid/dlg_ui.fl | 20 ++--- + src/gpsdclient.cpp | 7 +- + src/gpsdclient.hpp | 6 ++ + src/i18n/CMakeLists.txt | 1 + + src/i18n/{de_DE/florb.po => de_DE.po} | 0 + src/i18n/de_DE/florb.mo | Bin 10279 -> 0 bytes + src/mkversionhpp.sh | 25 +++++-- + src/res/audio-input-microphone-ina.png | Bin 0 -> 1315 bytes + src/utils.cpp | 2 + + 23 files changed, 217 insertions(+), 41 deletions(-) + create mode 100644 CMake/config.h.in + create mode 100644 CMakeLists.txt + create mode 100644 src/CMakeLists.txt + create mode 100644 src/i18n/CMakeLists.txt + rename src/i18n/{de_DE/florb.po => de_DE.po} (100%) + delete mode 100644 src/i18n/de_DE/florb.mo + create mode 100644 src/res/audio-input-microphone-ina.png + +diff --git a/CMake/config.h.in b/CMake/config.h.in +new file mode 100644 +index 0000000..eb28c3f +--- /dev/null ++++ b/CMake/config.h.in +@@ -0,0 +1,6 @@ ++#ifndef _CONFIG_H_ ++#define _CONFIG_H_ ++ ++#cmakedefine HAVE_LIBGPS ++ ++#endif // _CONFIG_H_ +diff --git a/CMakeLists.txt b/CMakeLists.txt +new file mode 100644 +index 0000000..39afa50 +--- /dev/null ++++ b/CMakeLists.txt +@@ -0,0 +1,36 @@ ++cmake_minimum_required(VERSION 3.10) ++ ++project(florb) ++ ++set(CMAKE_CXX_STANDARD 11) ++set(CMAKE_CXX_STANDARD_REQUIRED ON) ++ ++set(OpenGL_GL_PREFERENCE GLVND) ++ ++include(FindPkgConfig) ++ ++find_package(Boost REQUIRED COMPONENTS system filesystem thread) ++find_package(CURL REQUIRED) ++find_package(FLTK REQUIRED) ++find_package(Gettext REQUIRED) ++find_package(Intl REQUIRED) ++find_package(TinyXML2) ++if (TinyXML2_FOUND) ++ set(TinyXML2_LIBRARIES tinyxml2::tinyxml2) ++else (Tinyxml2_FOUND) ++ pkg_check_modules(TinyXML2 REQUIRED tinyxml2) ++endif (NOT TinyXML2_FOUND) ++find_package(yaml-cpp REQUIRED) ++ ++# optional packages ++find_package(libgps) ++if (libgps_FOUND) ++ set(HAVE_LIBGPS 1) ++else (libgps_FOUND) ++ pkg_check_modules(libgps libgps) ++ if (libgps_FOUND) ++ set(HAVE_LIBGPS 1) ++ endif (libgps_FOUND) ++endif (libgps_FOUND) ++ ++add_subdirectory(src) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +new file mode 100644 +index 0000000..21ea513 +--- /dev/null ++++ b/src/CMakeLists.txt +@@ -0,0 +1,100 @@ ++set(CMAKE_EXPORT_COMPILE_COMMANDS ON) ++ ++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLOCALEDIR=\\\"${CMAKE_INSTALL_PREFIX}/share/local\\\"") ++ ++configure_file(${CMAKE_SOURCE_DIR}/CMake/config.h.in ++ ${CMAKE_CURRENT_BINARY_DIR}/config.h) ++ ++add_custom_target(version ALL) ++ ++add_custom_command(TARGET version ++ PRE_BUILD ++ COMMAND ${CMAKE_SOURCE_DIR}/src/mkversionhpp.sh ++ COMMENT "Generating version.hpp") ++ ++set(Ui_FLUID ++ fluid/dlg_bulkdl.fl ++ fluid/dlg_editselection.fl ++ fluid/dlg_eleprofile.fl ++ fluid/dlg_garmindl.fl ++ fluid/dlg_garminul.fl ++ fluid/dlg_search.fl ++ fluid/dlg_settings.fl ++ fluid/dlg_tileserver.fl ++ fluid/dlg_txtdisp.fl ++ fluid/dlg_ui.fl) ++ ++set(Ui_SOURCES ++ dlg_bulkdl_ex.cpp ++ dlg_editselection_ex.cpp ++ dlg_eleprofile_ex.cpp ++ dlg_garmindl_ex.cpp ++ dlg_garminul_ex.cpp ++ dlg_search_ex.cpp ++ dlg_settings_ex.cpp ++ dlg_tileserver_ex.cpp ++ dlg_txtdisp_ex.cpp ++ dlg_ui_ex.cpp) ++ ++set(Ui_INCLUDE_DIRS ++ ${PROJECT_SOURCE_DIR}/src ++ ${Boost_INCLUDE_DIRS} ++ ${CURL_INCLUDE_DIRS} ++ ${FLTK_INCLUDE_DIRS} ++ ${Intl_INCLUDE_DIRS} ++ ${TinyXML2_INCLUDE_DIRS}) ++ ++fltk_wrap_ui(Ui ${Ui_FLUID}) ++add_library(Ui ${Ui_SOURCES} ${Ui_FLTK_UI_SRCS}) ++add_dependencies(Ui version) ++target_include_directories(Ui PUBLIC ${Ui_INCLUDE_DIRS}) ++ ++set(florb_SOURCES ++ areaselectlayer.cpp ++ cache.cpp ++ downloader.cpp ++ event.cpp ++ gfx.cpp ++ gpsdclient.cpp ++ gpsdlayer.cpp ++ layer.cpp ++ markerlayer.cpp ++ osmlayer.cpp ++ scalelayer.cpp ++ settings.cpp ++ shell.cpp ++ tracklayer.cpp ++ unit.cpp ++ utils.cpp ++ viewport.cpp ++ wgt_eleprofile.cpp ++ wgt_map.cpp) ++ ++set(florb_INCLUDE_DIRS ++ ${Boost_INCLUDE_DIRS} ++ ${CURL_INCLUDE_DIRS} ++ ${FLTK_INCLUDE_DIRS} ++ ${Intl_INCLUDE_DIRS} ++ ${TinyXML2_INCLUDE_DIRS}) ++ ++add_executable(florb ${florb_SOURCES}) ++add_dependencies(florb Ui version) ++ ++target_include_directories(florb PUBLIC ${florb_INCLUDE_DIRS}) ++ ++link_directories(florb PRIVATE ++ ${Boost_LIBRARY_DIRS} ++ ${CURL_LIBRARY_DIRS}) ++ ++target_link_libraries(florb PRIVATE Ui) ++target_link_libraries(florb PRIVATE ${FLTK_LIBRARIES}) ++target_link_libraries(florb PRIVATE ${Boost_LIBRARIES}) ++target_link_libraries(florb PRIVATE ${TinyXML2_LIBRARIES}) ++target_link_libraries(florb PRIVATE yaml-cpp) ++target_link_libraries(florb PRIVATE ${CURL_LIBRARIES}) ++target_link_libraries(florb PRIVATE ${Intl_LIBRARIES}) ++target_link_libraries(florb PRIVATE ${libgps_LIBRARIES}) ++ ++add_subdirectory(i18n) ++ ++install(TARGETS florb DESTINATION bin) +diff --git a/src/OMakefile b/src/OMakefile +index 8eb6ede..7fa8a13 100644 +--- a/src/OMakefile ++++ b/src/OMakefile +@@ -59,10 +59,7 @@ OBJS_CPP = $(rootname $(find . -name *.cpp)) + OBJS_RES = $(rootname $(find . -name *.res)) + OBJS = $(set $(OBJS_FLUID) $(OBJS_CPP) $(OBJS_RES)) + +-# Find all translations +-TRANSLATIONS = +- foreach(d => ..., $(find ./i18n/ -regex [a-z]{2\,2}_[A-Z]{2\,2})) +- value $(d) ++TRANSLATIONS[] += de_DE + + # (Re-)generate version string (version.hpp) from repository information if present + version.hpp: :exists: ../.git/HEAD :exists: ../.git/index gittags.txt :value: $(shell ./gittags.sh) version.txt ./mkversionhpp.sh +@@ -70,7 +67,7 @@ version.hpp: :exists: ../.git/HEAD :exists: ../.git/index gittags.txt :value: $( + + # Rule for generating CPP code from fluid sources + %.cpp: %.fl +- fluid -c -o $@ -h $(replacesuffixes .cpp, .hpp, $@) $< ++ fluid -c -o $@ -h $(replacesuffixes .cpp, .h, $@) $< + + # Rule for generating binary resources + %.o: %.res +@@ -97,7 +94,7 @@ install: + #install ../LICENSE.txt $(RESOURCEDIR) + foreach(t => ..., $(basename $(TRANSLATIONS))) + mkdir -p $(LOCALEDIR)/$(t)/LC_MESSAGES/ +- install ./i18n/$(t)/florb.mo $(LOCALEDIR)/$(t)/LC_MESSAGES/ ++ install ./i18n/$(t).mo $(LOCALEDIR)/$(t)/LC_MESSAGES/ + + # clean target + clean: +@@ -110,12 +107,12 @@ i18nupdate: + txt2po -P -i $(t) -o $(t).pot + msgcat -o i18n/all.pot $(addsuffix .res.pot, $(OBJS_RES)) i18n/$(PROGRAM).pot + foreach(t => ..., $(basename $(TRANSLATIONS))) +- if $(file-exists ./i18n/$(t)/$(PROGRAM).po) +- msgmerge -U ./i18n/$(t)/$(PROGRAM).po i18n/all.pot ++ if $(file-exists ./i18n/$(t).po) ++ msgmerge -U ./i18n/$(t).po i18n/all.pot + else +- msginit --no-translator -l $(t).utf8 -o ./i18n/$(t)/$(PROGRAM).po -i i18n/all.pot +- ++ msginit --no-translator -l $(t).utf8 -o ./i18n/$(t).po -i i18n/all.pot ++ + # compile translations + i18ncompile: + foreach(t => ..., $(basename $(TRANSLATIONS))) +- msgfmt -c -o ./i18n/$(t)/florb.mo ./i18n/$(t)/$(PROGRAM).po ++ msgfmt -c -o ./i18n/$(t).mo ./i18n/$(t).po +diff --git a/src/dlg_bulkdl_ex.cpp b/src/dlg_bulkdl_ex.cpp +index e60fbf1..b02e1cc 100644 +--- a/src/dlg_bulkdl_ex.cpp ++++ b/src/dlg_bulkdl_ex.cpp +@@ -4,7 +4,7 @@ + #include + #include "settings.hpp" + #include "utils.hpp" +-#include "fluid/dlg_bulkdl.hpp" ++#include "dlg_bulkdl.h" + + void dlg_bulkdl::create_ex() + { +diff --git a/src/dlg_editselection_ex.cpp b/src/dlg_editselection_ex.cpp +index 8ee9902..75b2d47 100644 +--- a/src/dlg_editselection_ex.cpp ++++ b/src/dlg_editselection_ex.cpp +@@ -1,7 +1,7 @@ + #include + #include "settings.hpp" + #include "unit.hpp" +-#include "fluid/dlg_editselection.hpp" ++#include "dlg_editselection.h" + + void dlg_editselection::create_ex() + { +diff --git a/src/dlg_eleprofile_ex.cpp b/src/dlg_eleprofile_ex.cpp +index 12971e8..7c485e0 100644 +--- a/src/dlg_eleprofile_ex.cpp ++++ b/src/dlg_eleprofile_ex.cpp +@@ -1,6 +1,6 @@ + #include "utils.hpp" + #include "unit.hpp" +-#include "fluid/dlg_eleprofile.hpp" ++#include "dlg_eleprofile.h" + + void dlg_eleprofile::create_ex() + { +diff --git a/src/dlg_garmindl_ex.cpp b/src/dlg_garmindl_ex.cpp +index a898bdd..8357b5d 100644 +--- a/src/dlg_garmindl_ex.cpp ++++ b/src/dlg_garmindl_ex.cpp +@@ -3,7 +3,7 @@ + #include + #include "utils.hpp" + #include "shell.hpp" +-#include "fluid/dlg_garmindl.hpp" ++#include "dlg_garmindl.h" + + void dlg_garmindl::create_ex() + { +diff --git a/src/dlg_garminul_ex.cpp b/src/dlg_garminul_ex.cpp +index 1d05341..4bed5ac 100644 +--- a/src/dlg_garminul_ex.cpp ++++ b/src/dlg_garminul_ex.cpp +@@ -3,7 +3,7 @@ + #include + #include "utils.hpp" + #include "shell.hpp" +-#include "fluid/dlg_garminul.hpp" ++#include "dlg_garminul.h" + + void dlg_garminul::create_ex() + { +diff --git a/src/dlg_search_ex.cpp b/src/dlg_search_ex.cpp +index 6e00773..907c86a 100644 +--- a/src/dlg_search_ex.cpp ++++ b/src/dlg_search_ex.cpp +@@ -4,7 +4,7 @@ + #include + #include + #include "utils.hpp" +-#include "fluid/dlg_search.hpp" ++#include "dlg_search.h" + + void dlg_search::create_ex() + { +diff --git a/src/dlg_settings_ex.cpp b/src/dlg_settings_ex.cpp +index 5dca6ce..2b740be 100644 +--- a/src/dlg_settings_ex.cpp ++++ b/src/dlg_settings_ex.cpp +@@ -1,3 +1,5 @@ ++#include "config.h" ++ + #include + #include + #include +@@ -5,8 +7,8 @@ + #include "settings.hpp" + #include "utils.hpp" + #include "unit.hpp" +-#include "fluid/dlg_settings.hpp" +-#include "fluid/dlg_tileserver.hpp" ++#include "dlg_settings.h" ++#include "dlg_tileserver.h" + + void dlg_settings::create_ex() + { +@@ -231,7 +233,13 @@ void dlg_settings::tab_gpsd_setup_ex() + m_input_server->value(m_cfggpsd.host().c_str()); + m_input_port->value(m_cfggpsd.port().c_str()); + +- bool en = m_cfggpsd.enabled(); ++ bool en; ++#ifdef HAVE_LIBGPS ++ en = m_cfggpsd.enabled(); ++#else // ! HAVE_LIBGPS ++ en = false; ++ m_chkbtn_enable->deactivate(); ++#endif // HAVE_LIBGPS + + if (en) + { +diff --git a/src/dlg_tileserver_ex.cpp b/src/dlg_tileserver_ex.cpp +index 003c3e5..b398193 100644 +--- a/src/dlg_tileserver_ex.cpp ++++ b/src/dlg_tileserver_ex.cpp +@@ -1,6 +1,6 @@ + #include "settings.hpp" + #include "utils.hpp" +-#include "fluid/dlg_tileserver.hpp" ++#include "dlg_tileserver.h" + #include + + void dlg_tileserver::create_ex() +diff --git a/src/dlg_txtdisp_ex.cpp b/src/dlg_txtdisp_ex.cpp +index c500cbd..d3f28d9 100644 +--- a/src/dlg_txtdisp_ex.cpp ++++ b/src/dlg_txtdisp_ex.cpp +@@ -3,7 +3,7 @@ + #include + #include + #include "utils.hpp" +-#include "fluid/dlg_txtdisp.hpp" ++#include "dlg_txtdisp.h" + + void dlg_txtdisp::create_ex() + { +diff --git a/src/dlg_ui_ex.cpp b/src/dlg_ui_ex.cpp +index ff2967b..6461b83 100644 +--- a/src/dlg_ui_ex.cpp ++++ b/src/dlg_ui_ex.cpp +@@ -10,7 +10,7 @@ + #include "gpsdclient.hpp" + #include "utils.hpp" + #include "unit.hpp" +-#include "fluid/dlg_ui.hpp" ++#include "dlg_ui.h" + #include "version.hpp" + + extern "C" +@@ -186,6 +186,10 @@ void dlg_ui::create_ex(void) + m_menuitem_gpsd_gotocursor->label(_("Go to cursor")); + m_menuitem_gpsd_recordtrack->label(_("Record track")); + m_menuitem_gpsd_lockcursor->label(_("Lock to cursor")); ++#ifndef HAVE_LIBGPS ++ m_menuitem_gpsd->deactivate(); ++ m_btn_recordtrack->deactivate(); ++#endif // HAVE_LIBGPS + // Help + m_menuitem_help->label(_("Help")); + m_menuitem_help_about->label(_("About")); +diff --git a/src/fluid/dlg_ui.fl b/src/fluid/dlg_ui.fl +index 80e4b20..2aedbfd 100644 +--- a/src/fluid/dlg_ui.fl ++++ b/src/fluid/dlg_ui.fl +@@ -11,7 +11,7 @@ decl {\#include } {private global + decl {\#include } {private global + } + +-decl {\#include "dlg_ui.hpp"} {private global ++decl {\#include "dlg_ui.h"} {private global + } + + decl {\#include "wgt_map.hpp"} {public global +@@ -20,28 +20,28 @@ decl {\#include "wgt_map.hpp"} {public global + decl {\#include "event.hpp"} {public global + } + +-decl {\#include "dlg_search.hpp"} {public global ++decl {\#include "dlg_search.h"} {public global + } + +-decl {\#include "dlg_garminul.hpp"} {public global ++decl {\#include "dlg_garminul.h"} {public global + } + +-decl {\#include "dlg_garmindl.hpp"} {public global ++decl {\#include "dlg_garmindl.h"} {public global + } + +-decl {\#include "dlg_editselection.hpp"} {public global ++decl {\#include "dlg_editselection.h"} {public global + } + +-decl {\#include "dlg_settings.hpp"} {public global ++decl {\#include "dlg_settings.h"} {public global + } + +-decl {\#include "dlg_txtdisp.hpp"} {public global ++decl {\#include "dlg_txtdisp.h"} {public global + } + +-decl {\#include "dlg_bulkdl.hpp"} {public global ++decl {\#include "dlg_bulkdl.h"} {public global + } + +-decl {\#include "dlg_eleprofile.hpp"} {public global ++decl {\#include "dlg_eleprofile.h"} {public global + } + + decl {int main_ex(int argc, char* argv[]);} {private global +@@ -396,7 +396,7 @@ ui->cb_choice_overlay_ex(widget);} {} + Fl_Button m_btn_recordtrack { + user_data this + callback cb_btn_recordtrack +- private tooltip {Record track} image {../res/audio-input-microphone.png} xywh {229 29 25 25} type Toggle box NO_BOX down_box THIN_DOWN_BOX ++ private tooltip {Record track} image {../res/audio-input-microphone.png} deimage {../res/audio-input-microphone-ina.png} xywh {229 29 25 25} type Toggle box NO_BOX down_box THIN_DOWN_BOX + } + Fl_Box {} { + private xywh {254 29 5 25} box FLAT_BOX +diff --git a/src/gpsdclient.cpp b/src/gpsdclient.cpp +index 3dd542e..f975457 100644 +--- a/src/gpsdclient.cpp ++++ b/src/gpsdclient.cpp +@@ -1,3 +1,5 @@ ++#include "config.h" ++ + #include "gpsdclient.hpp" + #include "utils.hpp" + +@@ -141,6 +143,7 @@ void florb::gpsdclient::fire_event_gpsd(void) + + void florb::gpsdclient::worker(void) + { ++#ifdef HAVE_LIBGPS + int rc; + for (;;) + { +@@ -200,6 +203,7 @@ void florb::gpsdclient::worker(void) + gps_stream(&m_gpsdata, WATCH_DISABLE, NULL); + gps_close(&m_gpsdata); + } ++#endif // HAVE_LIBGPS + + // Update connection status + connected(false); +@@ -209,6 +213,7 @@ void florb::gpsdclient::worker(void) + bool florb::gpsdclient::handle_set() + { + bool ret = false; ++#ifdef HAVE_LIBGPS + + for (;;) { + +@@ -255,7 +260,7 @@ bool florb::gpsdclient::handle_set() + + break; + } +- ++#endif // HAVE_LIBGPS + return ret; + } + +diff --git a/src/gpsdclient.hpp b/src/gpsdclient.hpp +index 1256ca4..1d2cf6a 100644 +--- a/src/gpsdclient.hpp ++++ b/src/gpsdclient.hpp +@@ -1,10 +1,14 @@ + #ifndef GPSDCLIENT_HPP + #define GPSDCLIENT_HPP + ++#include "config.h" ++ + #include + #include + #include ++#ifdef HAVE_LIBGPS + #include ++#endif // HAVE_LIBGPS + #include "event.hpp" + #include "point.hpp" + +@@ -43,7 +47,9 @@ namespace florb + + void fire_event_gpsd(void); + ++#ifdef HAVE_LIBGPS + struct gps_data_t m_gpsdata; ++#endif // HAVE_LIBGPS + boost::interprocess::interprocess_mutex m_mutex; + + std::string m_host; +diff --git a/src/i18n/CMakeLists.txt b/src/i18n/CMakeLists.txt +new file mode 100644 +index 0000000..673bffe +--- /dev/null ++++ b/src/i18n/CMakeLists.txt +@@ -0,0 +1 @@ ++gettext_create_translations(florb.pot ALL de_DE.po) +diff --git a/src/i18n/de_DE/florb.po b/src/i18n/de_DE.po +similarity index 100% +rename from src/i18n/de_DE/florb.po +rename to src/i18n/de_DE.po +diff --git a/src/mkversionhpp.sh b/src/mkversionhpp.sh +index 3562cd1..6a8f81c 100755 +--- a/src/mkversionhpp.sh ++++ b/src/mkversionhpp.sh +@@ -1,7 +1,11 @@ + #!/bin/sh + + # Default version if we can't take it from git +-FLORB_V="v1.0" ++if [ -e version.txt ]; then ++ FLORB_V=`cat version.txt` ++else ++ FLORB_V="v1.0" ++fi + + # Check whether we have git installed, and do nothing if not + which git > /dev/null 2>&1 +@@ -21,11 +25,18 @@ if [ $? -eq 0 ]; then + + fi + +-echo "#ifndef VERSION_HPP" > version.hpp +-echo "#define VERSION_HPP" >> version.hpp ++echo "#ifndef VERSION_HPP" > version.hpp.tmp ++echo "#define VERSION_HPP" >> version.hpp.tmp ++ ++echo "#define FLORB_VERSION \"$FLORB_V\"" >> version.hpp.tmp ++echo "#define FLORB_PROGSTR \"florb $FLORB_V\"" >> version.hpp.tmp ++echo "#define FLORB_USERAGENT \"florb/$FLORB_V\"" >> version.hpp.tmp + +-echo "#define FLORB_VERSION \"$FLORB_V\"" >> version.hpp +-echo "#define FLORB_PROGSTR \"florb $FLORB_V\"" >> version.hpp +-echo "#define FLORB_USERAGENT \"florb/$FLORB_V\"" >> version.hpp ++echo "#endif //VERSION_HPP" >> version.hpp.tmp + +-echo "#endif //VERSION_HPP" >> version.hpp ++diff version.hpp.tmp version.hpp >/dev/null 2>&1 ++if [ $? -eq 0 ]; then ++ rm version.hpp.tmp ++else ++ mv version.hpp.tmp version.hpp ++fi +diff --git a/src/utils.cpp b/src/utils.cpp +index aa5f9cc..3e631c4 100644 +--- a/src/utils.cpp ++++ b/src/utils.cpp +@@ -1,3 +1,5 @@ ++#include "config.h" ++ + #include + #include + #include diff --git a/network/misc/florb/pspec.xml b/network/misc/florb/pspec.xml new file mode 100644 index 0000000000..44b6a9ac3f --- /dev/null +++ b/network/misc/florb/pspec.xml @@ -0,0 +1,76 @@ + + + + + florb + http://florb.shugaa.de/ + + fury + wascheme@tuta.io + + MIT + app:gui + network.misc + A simple map viewer and GPX editor. + + florb is a really simple map viewer and GPX editor written in C++ using the FLTK UI toolkit. florb makes it easy to create and edit tracks for planning short and extended trips into the wild green. Or anywhere else for that matter. + + + https://github.com/shugaa/florb/archive/85d2be7d851f83db8a289fd2018832aec295d526.zip + + + https://github.com/pekdon/florb/raw/cmake_support/src/res/audio-input-microphone-ina.png + + + cmake + yaml-cpp + curl-devel + mesa-devel + fltk-devel + gpsd-devel + boost-devel + libX11-devel + libXpm-devel + libXres-devel + tinyxml2-devel + libxkbfile-devel + libxkbcommon-devel + + + support_building_with_cmake.patch + allow_startup_with_missing_config_file.patch + no_build_about_resources.patch + + + + + florb + + fltk + curl + gpsd + libgcc + tinyxml2 + + + /usr/bin + /usr/share + + + + + florb.desktop.in + + + + + + 2020-12-19 + 1.1 + First build from git (include patches from @pekdon). + fury + wascheme@tuta.io + + + + diff --git a/science/gis/gpsd/actions.py b/science/gis/gpsd/actions.py new file mode 100644 index 0000000000..5150cabc22 --- /dev/null +++ b/science/gis/gpsd/actions.py @@ -0,0 +1,30 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# +# Licensed under the GNU General Public License, version 3. +# See the file https://www.gnu.org/licenses/gpl-3.0.txt + +from pisi.actionsapi import shelltools +from pisi.actionsapi import autotools +from pisi.actionsapi import pisitools +from pisi.actionsapi import get + +shelltools.export("PYTHONDONTWRITEBYTECODE", "1") +i = "/usr/bin/env python3 $(which scons)" + +def setup(): + pass + +def build(): + shelltools.system("%s target_python=python3 prefix=/usr sbindir=/usr/sbin udevdir=/lib/udev" % i) + +def install(): + shelltools.system("DESTDIR=%s %s udev-install prefix=/usr" % (get.installDIR(), i)) + + # fix shebang + shelltools.system("find %s/usr/bin -type f -exec sed -i 's|env\ python$|env python3|g' {} \;" % get.installDIR()) + + # Install UDEV files +# pisitools.insinto("/lib/udev/rules.d", "gpsd.rules", "99-gpsd.rules") +# pisitools.dobin("gpsd.hotplug", "/lib/udev") + diff --git a/science/gis/gpsd/comar/service.py b/science/gis/gpsd/comar/service.py new file mode 100644 index 0000000000..088f016aec --- /dev/null +++ b/science/gis/gpsd/comar/service.py @@ -0,0 +1,23 @@ +from comar.service import * + +import os + +serviceType = "local" +serviceDesc = _({"en": "GPS Daemon", + "tr": "GPS Hizmeti"}) +serviceDefault = "off" + +@synchronized +def start(): + startService(command="/usr/sbin/gpsd", + args="-P /run/gpsd.pid -F /run/sock %s %s" % + (config.get("OPTIONS", "-n"), config.get("DEVICE", "/dev/ttyUSB0"))) + +@synchronized +def stop(): + stopService(pidfile="/run/gpsd.pid", donotify=True) + if os.path.exists("/run/gpsd.pid"): + os.unlink("/run/gpsd.pid") + +def status(): + return isServiceRunning("/run/gpsd.pid") diff --git a/science/gis/gpsd/files/data/gpsd-logo.png b/science/gis/gpsd/files/data/gpsd-logo.png new file mode 100644 index 0000000000..83ca308013 Binary files /dev/null and b/science/gis/gpsd/files/data/gpsd-logo.png differ diff --git a/science/gis/gpsd/files/data/xgps.desktop b/science/gis/gpsd/files/data/xgps.desktop new file mode 100644 index 0000000000..d614d7a6e5 --- /dev/null +++ b/science/gis/gpsd/files/data/xgps.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=xgps +GenericName=GPS information +GenericName[tr]=GPS bilgi görüntüleyici +Comment=Display GPS information from a gpsd daemon +Comment[tr]=gpsd hizmetinden alınan bilgileri görüntüler +Exec=xgps +Icon=gpsd-logo +Terminal=false +Type=Application +Categories=Application;Graphics; diff --git a/science/gis/gpsd/files/data/xgpsspeed.desktop b/science/gis/gpsd/files/data/xgpsspeed.desktop new file mode 100644 index 0000000000..146d24bac7 --- /dev/null +++ b/science/gis/gpsd/files/data/xgpsspeed.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=xgpsspeed +GenericName=GPS speedometer +GenericName[tr]=GPS hızölçer +Comment=Display GPS speed from a gpsd daemon +Comment[tr]=gpsd hizmetinden alınan hız bilgilerini görüntüler +Exec=xgpsspeed +Icon=gpsd-logo +Terminal=false +Type=Application +Categories=Application;Graphics; diff --git a/science/gis/gpsd/files/gpsd.sysconfig b/science/gis/gpsd/files/gpsd.sysconfig new file mode 100644 index 0000000000..1f7b1f638a --- /dev/null +++ b/science/gis/gpsd/files/gpsd.sysconfig @@ -0,0 +1,2 @@ +OPTIONS="-n" +DEVICE="/dev/ttyUSB0" diff --git a/science/gis/gpsd/files/pylibdir_no_prefix_replace.patch b/science/gis/gpsd/files/pylibdir_no_prefix_replace.patch new file mode 100644 index 0000000000..5783e91549 --- /dev/null +++ b/science/gis/gpsd/files/pylibdir_no_prefix_replace.patch @@ -0,0 +1,13 @@ +--- a/SConstruct 2020-08-04 18:40:06.000000000 +0000 ++++ b/SConstruct 2020-12-12 18:29:38.378386573 +0000 +@@ -1460,8 +1460,8 @@ + # follow FHS, put in /usr/local/libXX, not /usr/libXX + # may be lib, lib32 or lib64 + python_libdir = polystr(python_libdir) +- python_libdir = python_libdir.replace("/usr/lib", +- "/usr/local/lib") ++# python_libdir = python_libdir.replace("/usr/lib", ++# "/usr/local/lib") + python_module_dir = str(python_libdir) + os.sep + # Many systems can have a problem with the Python path + announce("Ensure your PYTHONPATH includes %s" % python_module_dir) diff --git a/science/gis/gpsd/files/use_pythondontwritebytecode_environment_variable.patch b/science/gis/gpsd/files/use_pythondontwritebytecode_environment_variable.patch new file mode 100644 index 0000000000..6fc35d8f96 --- /dev/null +++ b/science/gis/gpsd/files/use_pythondontwritebytecode_environment_variable.patch @@ -0,0 +1,10 @@ +--- a/SConstruct 2020-08-04 18:40:06.000000000 +0000 ++++ b/SConstruct 2020-12-27 05:47:40.748197656 +0000 +@@ -516,6 +516,7 @@ + 'CWRAPPERS_CONFIG_DIR', # pkgsrc + # Variables used in testing + 'WRITE_PAD', # So we can test WRITE_PAD values on the fly. ++ 'PYTHONDONTWRITEBYTECODE', + ) + + envs = {} diff --git a/science/gis/gpsd/pspec.xml b/science/gis/gpsd/pspec.xml new file mode 100644 index 0000000000..a574c8f51c --- /dev/null +++ b/science/gis/gpsd/pspec.xml @@ -0,0 +1,134 @@ + + + + + gpsd + https://gpsd.gitlab.io/gpsd/ + + PisiLinux Community + admins@pisilinux.org + + BSD + app + library + science.gis + GPS daemon and library to support serial/USB GPS devices. + + gpsd is a service daemon that monitor one or more GPSes attached to a host computer through serial or USB ports, making all data of the sensors available to be queried on TCP port 2947 of the host computer. + + + http://download-mirror.savannah.gnu.org/releases/gpsd/gpsd-3.21.tar.xz + + + scons + xmlto + dbus-devel + libusb-devel + libxslt-devel + python3-devel + ncurses-devel + bluez-libs-devel + python3-pyserial + + + pylibdir_no_prefix_replace.patch + use_pythondontwritebytecode_environment_variable.patch + + + + + gpsd + + dbus + libgcc + libusb + ncurses + bluez-libs + python3-pyserial + + + /etc/conf.d + /usr/bin + /usr/sbin + /lib/udev/gpsd.hotplug + /usr/lib + /lib/udev/rules.d + /usr/share/man + /usr/share/gpsd/doc + + + gpsd.sysconfig + + + System.Service + + + + + gpsd-clients + + gpsd + dbus + libusb + ncurses + bluez-libs + python3-pyserial + + Various text based and graphical clients for gpsd. + + /usr/bin/cgps + /usr/bin/gpscat + /usr/bin/gpsdecode + /usr/bin/gpspipe + /usr/bin/gpxlogger + /usr/bin/lcdgps + /usr/bin/xgps + /usr/bin/xgpsspeed + /usr/share/man/man1/gps.1* + /usr/share/man/man1/cgps* + /usr/share/man/man1/gpscat* + /usr/share/man/man1/gpsdecode* + /usr/share/man/man1/gpspipe* + /usr/share/man/man1/gpxlogger* + /usr/share/man/man1/cgpxlogger* + /usr/share/man/man1/lcdgps* + /usr/share/man/man1/xgps* + /usr/share/applications + /usr/share/gpsd/icons + /usr/share/pixmaps + + + data/gpsd-logo.png + data/xgps.desktop + data/xgpsspeed.desktop + + + + + gpsd-devel + Development files for gpsd. + + gpsd + + + /usr/bin/gpsfake + /usr/lib/python*/site-packages/gps/fake.py + /usr/include + /usr/lib/pkgconfig + /usr/share/man/man3 + /usr/share/man/man5 + /usr/share/man/man1/gpsfake.1 + + + + + + 2020-12-27 + 3.21 + First build. + fury + wascheme@tuta.io + + + +