Merge pull request #8915 from 4fury-c3440d8/xfce

florb - map viewer for lightweight desktop environments.
This commit is contained in:
Kamil ATLI
2021-01-02 19:22:06 +03:00
committed by GitHub
15 changed files with 1131 additions and 0 deletions
+34
View File
@@ -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")
@@ -0,0 +1,31 @@
From ab015e4f1c31bd9769b0b7c8b447ff0c9c680e2c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Claes=20N=C3=A4st=C3=A9n?= <pekdon@gmail.com>
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);
}
+11
View File
@@ -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;
@@ -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();
}
@@ -0,0 +1,613 @@
From cb0eb27e06d93f315f8cea8b7657b6cae58226a7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Claes=20N=C3=A4st=C3=A9n?= <pekdon@gmail.com>
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 <algorithm>
#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 <FL/fl_ask.H>
#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 <iostream>
#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 <iostream>
#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 <clocale>
#include <limits>
#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 <sstream>
#include <iostream>
#include <FL/Fl_Color_Chooser.H>
@@ -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 <FL/fl_ask.H>
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 <iostream>
#include <fstream>
#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 <signal.h>} {private global
decl {\#include <curl/curl.h>} {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 <string>
#include <boost/thread.hpp>
#include <boost/interprocess/sync/interprocess_mutex.hpp>
+#ifdef HAVE_LIBGPS
#include <gps.h>
+#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 <cmath>
#include <limits>
#include <stdexcept>
+76
View File
@@ -0,0 +1,76 @@
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "https://pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
<Source>
<Name>florb</Name>
<Homepage>http://florb.shugaa.de/</Homepage>
<Packager>
<Name>fury</Name>
<Email>wascheme@tuta.io</Email>
</Packager>
<License>MIT</License>
<IsA>app:gui</IsA>
<PartOf>network.misc</PartOf>
<Summary>A simple map viewer and GPX editor.</Summary>
<Description>
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.
</Description>
<Archive sha1sum="074ee0eca20fd8977e659a8bf353e28028ef3107" type="zip">
https://github.com/shugaa/florb/archive/85d2be7d851f83db8a289fd2018832aec295d526.zip
</Archive>
<Archive target="florb-85d2be7d851f83db8a289fd2018832aec295d526/src/res" sha1sum="0857fd36313ceeed06b19c3c37a121d34bd621ee" type="binary">
https://github.com/pekdon/florb/raw/cmake_support/src/res/audio-input-microphone-ina.png
</Archive>
<BuildDependencies>
<Dependency>cmake</Dependency>
<Dependency>yaml-cpp</Dependency>
<Dependency>curl-devel</Dependency>
<Dependency>mesa-devel</Dependency>
<Dependency>fltk-devel</Dependency>
<Dependency>gpsd-devel</Dependency>
<Dependency>boost-devel</Dependency>
<Dependency>libX11-devel</Dependency>
<Dependency>libXpm-devel</Dependency>
<Dependency>libXres-devel</Dependency>
<Dependency>tinyxml2-devel</Dependency>
<Dependency>libxkbfile-devel</Dependency>
<Dependency>libxkbcommon-devel</Dependency>
</BuildDependencies>
<Patches>
<Patch level="1">support_building_with_cmake.patch</Patch>
<Patch level="1">allow_startup_with_missing_config_file.patch</Patch>
<Patch level="1">no_build_about_resources.patch</Patch>
</Patches>
</Source>
<Package>
<Name>florb</Name>
<RuntimeDependencies>
<Dependency>fltk</Dependency>
<Dependency>curl</Dependency>
<Dependency>gpsd</Dependency>
<Dependency>libgcc</Dependency>
<Dependency>tinyxml2</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="executable">/usr/bin</Path>
<Path fileType="data">/usr/share</Path>
<!-- <Path fileType="localedata">/usr/share/locale</Path> -->
<!-- <Path fileType="doc">/usr/share/doc</Path> -->
</Files>
<AdditionalFiles>
<AdditionalFile owner="root" permission="0644" target="/usr/share/applications/florb.desktop">florb.desktop.in</AdditionalFile>
</AdditionalFiles>
</Package>
<History>
<Update release="1">
<Date>2020-12-19</Date>
<Version>1.1</Version>
<Comment>First build from git (include patches from @pekdon).</Comment>
<Name>fury</Name>
<Email>wascheme@tuta.io</Email>
</Update>
</History>
</PISI>
+30
View File
@@ -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")
+23
View File
@@ -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")
Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

+12
View File
@@ -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;
@@ -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;
+2
View File
@@ -0,0 +1,2 @@
OPTIONS="-n"
DEVICE="/dev/ttyUSB0"
@@ -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)
@@ -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 = {}
+134
View File
@@ -0,0 +1,134 @@
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "https://pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
<Source>
<Name>gpsd</Name>
<Homepage>https://gpsd.gitlab.io/gpsd/</Homepage>
<Packager>
<Name>PisiLinux Community</Name>
<Email>admins@pisilinux.org</Email>
</Packager>
<License>BSD</License>
<IsA>app</IsA>
<IsA>library</IsA>
<PartOf>science.gis</PartOf>
<Summary>GPS daemon and library to support serial/USB GPS devices.</Summary>
<Description>
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.
</Description>
<Archive sha1sum="6d5d232b2a6580390268d27fe67b527df224a646" type="tarxz">
http://download-mirror.savannah.gnu.org/releases/gpsd/gpsd-3.21.tar.xz
</Archive>
<BuildDependencies>
<Dependency>scons</Dependency>
<Dependency>xmlto</Dependency>
<Dependency>dbus-devel</Dependency>
<Dependency>libusb-devel</Dependency>
<Dependency>libxslt-devel</Dependency>
<Dependency>python3-devel</Dependency>
<Dependency>ncurses-devel</Dependency>
<Dependency>bluez-libs-devel</Dependency>
<Dependency>python3-pyserial</Dependency>
</BuildDependencies>
<Patches>
<Patch level="1">pylibdir_no_prefix_replace.patch</Patch>
<Patch level="1">use_pythondontwritebytecode_environment_variable.patch</Patch>
</Patches>
</Source>
<Package>
<Name>gpsd</Name>
<RuntimeDependencies>
<Dependency>dbus</Dependency>
<Dependency>libgcc</Dependency>
<Dependency>libusb</Dependency>
<Dependency>ncurses</Dependency>
<Dependency>bluez-libs</Dependency>
<Dependency>python3-pyserial</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="config">/etc/conf.d</Path>
<Path fileType="executable">/usr/bin</Path>
<Path fileType="executable">/usr/sbin</Path>
<Path fileType="executable">/lib/udev/gpsd.hotplug</Path>
<Path fileType="library">/usr/lib</Path>
<Path fileType="data">/lib/udev/rules.d</Path>
<Path fileType="man">/usr/share/man</Path>
<Path fileType="doc">/usr/share/gpsd/doc</Path>
</Files>
<AdditionalFiles>
<AdditionalFile owner="root" permission="0644" target="/etc/conf.d/gpsd">gpsd.sysconfig</AdditionalFile>
</AdditionalFiles>
<Provides>
<COMAR script="service.py">System.Service</COMAR>
</Provides>
</Package>
<Package>
<Name>gpsd-clients</Name>
<RuntimeDependencies>
<Dependency release="current">gpsd</Dependency>
<Dependency>dbus</Dependency>
<Dependency>libusb</Dependency>
<Dependency>ncurses</Dependency>
<Dependency>bluez-libs</Dependency>
<Dependency>python3-pyserial</Dependency>
</RuntimeDependencies>
<Summary>Various text based and graphical clients for gpsd.</Summary>
<Files>
<Path fileType="executable">/usr/bin/cgps</Path>
<Path fileType="executable">/usr/bin/gpscat</Path>
<Path fileType="executable">/usr/bin/gpsdecode</Path>
<Path fileType="executable">/usr/bin/gpspipe</Path>
<Path fileType="executable">/usr/bin/gpxlogger</Path>
<Path fileType="executable">/usr/bin/lcdgps</Path>
<Path fileType="executable">/usr/bin/xgps</Path>
<Path fileType="executable">/usr/bin/xgpsspeed</Path>
<Path fileType="man">/usr/share/man/man1/gps.1*</Path>
<Path fileType="man">/usr/share/man/man1/cgps*</Path>
<Path fileType="man">/usr/share/man/man1/gpscat*</Path>
<Path fileType="man">/usr/share/man/man1/gpsdecode*</Path>
<Path fileType="man">/usr/share/man/man1/gpspipe*</Path>
<Path fileType="man">/usr/share/man/man1/gpxlogger*</Path>
<Path fileType="man">/usr/share/man/man1/cgpxlogger*</Path>
<Path fileType="man">/usr/share/man/man1/lcdgps*</Path>
<Path fileType="man">/usr/share/man/man1/xgps*</Path>
<Path fileType="data">/usr/share/applications</Path>
<Path fileType="data">/usr/share/gpsd/icons</Path>
<Path fileType="data">/usr/share/pixmaps</Path>
</Files>
<AdditionalFiles>
<AdditionalFile owner="root" permission="0644" target="/usr/share/pixmaps/gpsd-logo.png">data/gpsd-logo.png</AdditionalFile>
<AdditionalFile owner="root" permission="0644" target="/usr/share/applications/xgps.desktop">data/xgps.desktop</AdditionalFile>
<AdditionalFile owner="root" permission="0644" target="/usr/share/applications/xgpsspeed.desktop">data/xgpsspeed.desktop</AdditionalFile>
</AdditionalFiles>
</Package>
<Package>
<Name>gpsd-devel</Name>
<Summary>Development files for gpsd.</Summary>
<RuntimeDependencies>
<Dependency release="current">gpsd</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="executable">/usr/bin/gpsfake</Path>
<Path fileType="library">/usr/lib/python*/site-packages/gps/fake.py</Path>
<Path fileType="header">/usr/include</Path>
<Path fileType="data">/usr/lib/pkgconfig</Path>
<Path fileType="man">/usr/share/man/man3</Path>
<Path fileType="man">/usr/share/man/man5</Path>
<Path fileType="man">/usr/share/man/man1/gpsfake.1</Path>
</Files>
</Package>
<History>
<Update release="1">
<Date>2020-12-27</Date>
<Version>3.21</Version>
<Comment>First build.</Comment>
<Name>fury</Name>
<Email>wascheme@tuta.io</Email>
</Update>
</History>
</PISI>