Package: openorienteering-mapper / 0.6.7-1

fix-help-data-dir.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Description: Fix path to help files and QT assistant
 Instead of assuming relative paths work, use the paths configured by CMake.
 This is important to make the wrapper work on Debian where the executable is
 moved to /usr/lib/openorienteering-mapper/bin and invoked from a wrapper in 
 /usr/bin.
Author: Gaudenz Steinlin <gaudenz@debian.org>
Forwarded: no
Last-Update: 2015-09-22
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: openorienteering-mapper/src/mapper_resource.cpp
===================================================================
--- openorienteering-mapper.orig/src/mapper_resource.cpp
+++ openorienteering-mapper/src/mapper_resource.cpp
@@ -122,8 +122,8 @@ QStringList MapperResource::getLocations
 #endif
 	
 #if defined(MAPPER_PACKAGE_NAME)
-	// Linux: program in xxx/bin, resources in xxx/bin/../share/PACKAGE_NAME
-	QString linux_dir(app_dir.absoluteFilePath(QLatin1String("../share/") + QString::fromUtf8(MAPPER_PACKAGE_NAME) + resource_path));
+	// Linux: resources in MAPPER_DATA_DESTINATION
+	QString linux_dir(app_dir.absoluteFilePath(QString::fromUtf8(MAPPER_DATA_DESTINATION) + resource_path));
 	addIfExists(locations, linux_dir);
 #endif
 	
@@ -175,8 +175,9 @@ QStringList MapperResource::getProgramLo
 	QDir app_dir(QCoreApplication::applicationDirPath());
 	
 #if defined(Mapper_PACKAGE_ASSISTANT) and defined(MAPPER_PACKAGE_NAME)
-	// Linux: extra binaries in xxx/bin/../share/PACKAGE_NAME/bin
-	addIfExists(locations, app_dir.absoluteFilePath(QLatin1String("../lib/") + QString::fromUtf8(MAPPER_PACKAGE_NAME) + QLatin1String("/bin/") + program_name));
+	// Linux: extra binaries in MAPPER_LIBRARY_DESTINATION/bin
+	addIfExists(locations, app_dir.absoluteFilePath(QString::fromUtf8(MAPPER_LIBRARY_DESTINATION) + QLatin1String("/bin/") + program_name));
+
 #endif
 	
 	// Find the program which is in the same directory as Mapper
Index: openorienteering-mapper/src/mapper_config.h.in
===================================================================
--- openorienteering-mapper.orig/src/mapper_config.h.in
+++ openorienteering-mapper/src/mapper_config.h.in
@@ -26,6 +26,8 @@
 #define APP_NAME qApp->translate("Global", QT_TRANSLATE_NOOP("Global", "OpenOrienteering Mapper"))
 #define APP_VERSION "@Mapper_VERSION_DISPLAY@"
 #define MAPPER_HELP_NAMESPACE "@Mapper_HELP_NAMESPACE@"
+#define MAPPER_DATA_DESTINATION "@MAPPER_DATA_DESTINATION@"
+#define MAPPER_LIBRARY_DESTINATION "@MAPPER_LIBRARY_DESTINATION@"
 
 #cmakedefine Mapper_BUILD_PROJ
 #cmakedefine Mapper_TRANSLATIONS_EMBEDDED