Skip to content

Commit

Permalink
fix:sailfish:enable sandboxing for sailfish OS. (#1182)
Browse files Browse the repository at this point in the history
* FIX:graphics:qt5 switch path of navit qml to org.navitproject

Android uses org/navitproject/navit so do we on qt5 now

* FEATURE:core: allow to configure linux home config dir

* FIX:sailfish: configure to enable sailjail

* CI: remove docker install step from sailfish

* SAILFISH: bump release version to .2

* fix:sailfish: add Audio perrmission for espeak
  • Loading branch information
metalstrolch committed May 23, 2022
1 parent f93a8df commit 6c1762a
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 14 deletions.
3 changes: 0 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ jobs:
steps:
- checkout
- run: if scripts/check_need_build.sh; then circleci step halt; fi
- run:
name: install docker
command: circleci-install docker
- run:
name: make build dir
command: mkdir ../rpmbuild
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ set(TEXTURE_DIR share/navit/textures CACHE PATH "Navit texture path")
add_definitions ("-DTEXTURE_DIR=\"${TEXTURE_DIR}\"")
set(MAN_DIR share/man/man1 CACHE PATH "Navit man path")
add_definitions ("-DMAN_DIR=\"${MAN_DIR}\"")
set(HOMECONFIG_DIR .navit CACHE PATH "Navit config path in home dir")
add_definitions ("-DHOMECONFIG_DIR=\"${HOMECONFIG_DIR}\"")
# LIB_DIR
IF(UNIX AND NOT ANDROID AND NOT APPLE)
IF (NOT LIBDIR)
Expand Down
8 changes: 7 additions & 1 deletion contrib/sailfish/navit-sailfish.spec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Name: harbour-navit
Summary: Open Source car navigation system
#Version: %{navit_version}_%{git_version}
Version: 0.5.6
Release: 1
Release: 2
License: GPL
Group: Applications/Productivity
URL: http://navit-project.org/
Expand Down Expand Up @@ -83,6 +83,7 @@ cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DLOCALE_DIR:PATH=share/harbour-navit/locale \
-DIMAGE_DIR:PATH=share/harbour-navit/icons \
-DTEXTURE_DIR:PATH=share/harbour-navit/textures \
-DHOMECONFIG_DIR:PATH=.config/org.navitproject/navit \
-DLIB_DIR:PATH=share/harbour-navit/lib \
-DBUILD_MAPTOOL:BOOL=FALSE \
-Dfont/freetype:BOOL=FALSE \
Expand Down Expand Up @@ -138,6 +139,11 @@ fi


%changelog
*Thu May 19 2022 metalstrolch 0.5.6-2
- Enable sailjail
- local config dir in $HOME changed to ~/.config/org.naviproject/navit
- default map location now /home/nemo/Documents/map.navit.bin due to sailjail

*Mon Oct 01 2018 metalstrolch 0.5.3-1
- fix rpm updating from 0.5.1 by adding %pre section

Expand Down
4 changes: 3 additions & 1 deletion navit/graphics/qt5/graphics_qt5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,8 @@ static struct graphics_priv* graphics_qt5_new(struct navit* nav, struct graphics
#else
navit_app = new QGuiApplication(graphics_priv->argc, graphics_priv->argv);
#endif
navit_app->setOrganizationName(QStringLiteral("org.navitproject"));
navit_app->setApplicationName(QStringLiteral("navit"));

#if HAVE_FREETYPE
graphics_priv->font_freetype_new = font_freetype_new;
Expand All @@ -1044,7 +1046,7 @@ static struct graphics_priv* graphics_qt5_new(struct navit* nav, struct graphics
graphics_priv->GPriv = NULL;
if (use_qml) {
/* register our QtQuick widget to allow it's usage within QML */
qmlRegisterType<QNavitQuick>("com.navit.graphics_qt5", 1, 0, "QNavitQuick");
qmlRegisterType<QNavitQuick>("org.navitproject.graphics_qt5", 1, 0, "QNavitQuick");
/* get our qml application from embedded resources. May be replaced by the
* QtQuick gui component if enabled */
graphics_priv->engine = new QQmlApplicationEngine();
Expand Down
2 changes: 1 addition & 1 deletion navit/graphics/qt5/graphics_qt5.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import com.navit.graphics_qt5 1.0
import org.navitproject.graphics_qt5 1.0
import QtQuick 2.2
import QtQuick.Window 2.0

Expand Down
2 changes: 1 addition & 1 deletion navit/graphics/qt5/loader.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import com.navit.graphics_qt5 1.0
import org.navitproject.graphics_qt5 1.0
import QtQuick 2.2
import QtQuick.Window 2.0

Expand Down
2 changes: 1 addition & 1 deletion navit/gui/qt5_qml/skins/modern/bookmark.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import QtQuick 2.0
import QtQuick.Layouts 1.0
import com.navit.graphics_qt5 1.0
import org.navitproject.graphics_qt5 1.0


Item {
Expand Down
2 changes: 1 addition & 1 deletion navit/gui/qt5_qml/skins/modern/main.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import com.navit.graphics_qt5 1.0
import org.navitproject.graphics_qt5 1.0
import QtQuick 2.2

Rectangle {
Expand Down
2 changes: 1 addition & 1 deletion navit/gui/qt5_qml/skins/modern/poi.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import QtQuick 2.0
import QtQuick.Layouts 1.0
import com.navit.graphics_qt5 1.0
import org.navitproject.graphics_qt5 1.0


Item {
Expand Down
5 changes: 5 additions & 0 deletions navit/icons/desktop_icons/navit.desktop.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ Categories=GTK;Utility;Geography;
GenericName=Navit
GenericName[de]=Navit
X-Nemo-Application-Type=no-invoker
#sailfish jail. Doesn't hurt others hopefully
[X-Sailjail]
Permissions=Documents;Location;RemovableMedia;Audio
OrganizationName=org.navitproject
ApplicationName=navit
2 changes: 1 addition & 1 deletion navit/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static char *environment_vars[][6]= {
{"NAVIT_LIBDIR", ":", ":/"LIB_DIR, ":\\lib", ":/lib", ":\\lib"},
{"NAVIT_SHAREDIR", ":", ":/"SHARE_DIR, ":", ":/share", ":"},
{"NAVIT_LOCALEDIR", ":/../locale",":/"LOCALE_DIR, ":\\locale", ":/locale", ":\\locale"},
{"NAVIT_USER_DATADIR",":", "~/.navit", ":\\data", ":/home", "~\\navit"},
{"NAVIT_USER_DATADIR",":", "~/"HOMECONFIG_DIR, ":\\data", ":/home", "~\\navit"},
{"NAVIT_LOGFILE", NULL, NULL, ":\\navit.log",NULL, ":\\navit.log"},
{"NAVIT_LIBPREFIX", "*/.libs/", NULL, NULL, NULL, NULL},
{NULL, NULL, NULL, NULL, NULL, NULL},
Expand Down
2 changes: 1 addition & 1 deletion navit/navit.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ char* navit_get_user_data_directory(int create) {
dir = getenv("NAVIT_USER_DATADIR");
if (create && !file_exists(dir)) {
dbg(lvl_debug,"creating dir %s", dir);
if (file_mkdir(dir,0)) {
if (file_mkdir(dir,1)) {
dbg(lvl_error,"failed creating dir %s", dir);
return NULL;
}
Expand Down
4 changes: 2 additions & 2 deletions navit/xslt/sailfish_mapset.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<xsl:text>&#x0A; </xsl:text>
<map type="binfile" enabled="yes" active="no" data="/usr/share/harbour-navit/maps/osm_bbox_11.3,47.9,11.7,48.2.bin"/>
<xsl:text>&#x0A; </xsl:text>
<map type="binfile" enabled="yes" data="~/Maps/map.navit.bin"/>
<map type="binfile" enabled="yes" data="~/Documents/map.navit.bin"/>
<xsl:text>&#x0A; </xsl:text>
<map type="binfile" enabled="yes" active="no" name="map.navit.heightlines.bin" data="~/Maps/map.navit.heightlines.bin"/>
<map type="binfile" enabled="yes" active="no" name="map.navit.heightlines.bin" data="~/Documents/map.navit.heightlines.bin"/>
<xsl:text>&#x0A; </xsl:text>
</mapset>
<xsl:text>&#x0A; </xsl:text>
Expand Down

0 comments on commit 6c1762a

Please sign in to comment.