mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-06 23:18:58 +02:00
168 lines
5.5 KiB
Plaintext
168 lines
5.5 KiB
Plaintext
From 691f1ceb388207bd990a58282782ca07bf6e6904 Mon Sep 17 00:00:00 2001
|
|
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
|
Date: Thu, 3 May 2018 21:03:11 +1000
|
|
Subject: Fix build for Haiku
|
|
|
|
Disable python and scriptplugin
|
|
Add paths for Haiku
|
|
---
|
|
CMakeLists.txt | 6 +++---
|
|
scribus/CMakeLists.txt | 2 +-
|
|
scribus/plugins/CMakeLists.txt | 4 ++--
|
|
scribus/scpaths.cpp | 25 +++++++++++++++++++++++++
|
|
scribus/third_party/pgf/PGFplatform.h | 4 ++--
|
|
scribus/util_debug.cpp | 2 +-
|
|
6 files changed, 34 insertions(+), 9 deletions(-)
|
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index 0862e48..3ac3c9c 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -406,7 +406,7 @@ endif()
|
|
add_definitions(-DLIBDIR="${CMAKE_INSTALL_PREFIX}/${LIBDIR}")
|
|
|
|
#PLUGINS
|
|
-if(WIN32)
|
|
+if(WIN32 OR HAIKU)
|
|
set(PLUGINDIR "plugins")
|
|
else()
|
|
if (APPLEBUNDLE)
|
|
@@ -748,7 +748,7 @@ endif()
|
|
|
|
#<< PYTHON
|
|
#set(PythonLibs_FIND_VERSION 2)
|
|
-find_package(PythonLibs 2 REQUIRED)
|
|
+find_package(PythonLibs 2)
|
|
if (PYTHON_LIBRARY)
|
|
message("Python Library Found OK")
|
|
set(HAVE_PYTHON 1)
|
|
@@ -931,7 +931,7 @@ pkg_check_modules(ICU REQUIRED icu-uc)
|
|
##############################################################################################################
|
|
########## Include Setup ##########
|
|
|
|
-TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
|
|
+#TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
|
|
|
|
CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H)
|
|
if(HAVE_DLFCN_H)
|
|
diff --git a/scribus/CMakeLists.txt b/scribus/CMakeLists.txt
|
|
index e652850..357cb5f 100644
|
|
--- a/scribus/CMakeLists.txt
|
|
+++ b/scribus/CMakeLists.txt
|
|
@@ -1286,7 +1286,7 @@ target_link_libraries(${EXE_NAME}
|
|
${ICU_LIBRARIES}
|
|
${FONTCONFIG_LIBRARIES}
|
|
${LIBXML2_LIBRARIES}
|
|
- ${PYTHON_LIBRARIES}
|
|
+# ${PYTHON_LIBRARIES}
|
|
${TIFF_LIBRARIES}
|
|
${JPEG_LIBRARIES}
|
|
${ZLIB_LIBRARIES}
|
|
diff --git a/scribus/plugins/CMakeLists.txt b/scribus/plugins/CMakeLists.txt
|
|
index 4debb04..9026eb1 100644
|
|
--- a/scribus/plugins/CMakeLists.txt
|
|
+++ b/scribus/plugins/CMakeLists.txt
|
|
@@ -11,12 +11,12 @@ if(NOT WANT_SCRIPTER2)
|
|
#scripter1
|
|
if(NOT WIN32)
|
|
message(STATUS "Building with Scripter 1")
|
|
- add_subdirectory(scriptplugin)
|
|
+# add_subdirectory(scriptplugin)
|
|
endif()
|
|
else()
|
|
#scripter2
|
|
message(STATUS "Building with Scripter 2")
|
|
- add_subdirectory(scripter)
|
|
+# add_subdirectory(scripter)
|
|
endif()
|
|
add_subdirectory(short-words)
|
|
add_subdirectory(tools)
|
|
diff --git a/scribus/scpaths.cpp b/scribus/scpaths.cpp
|
|
index c244d48..8de66dc 100644
|
|
--- a/scribus/scpaths.cpp
|
|
+++ b/scribus/scpaths.cpp
|
|
@@ -313,6 +313,15 @@ QStringList ScPaths::spellDirs() const
|
|
d.setPath(linuxLocalPath);
|
|
if (d.exists())
|
|
spellDirs.append(linuxLocalPath);
|
|
+#elif defined(Q_OS_HAIKU)
|
|
+ QString haikuSystemHunspellPath("/system/data/hunspell/");
|
|
+ QString haikuUserHunspellPath("/boot/home/config/non-packaged/data/hunspell/");
|
|
+ d.setPath(haikuSystemHunspellPath);
|
|
+ if (d.exists())
|
|
+ spellDirs.append(haikuSystemHunspellPath);
|
|
+ d.setPath(haikuUserHunspellPath);
|
|
+ if (d.exists())
|
|
+ spellDirs.append(haikuUserHunspellPath);
|
|
#endif
|
|
return spellDirs;
|
|
}
|
|
@@ -382,6 +391,19 @@ QStringList ScPaths::hyphDirs() const
|
|
d.setPath(linuxLocalPath);
|
|
if (d.exists())
|
|
hyphDirs.append(linuxLocalPath);
|
|
+#elif defined(Q_OS_HAIKU)
|
|
+ QString haikuSystemHyphenPath("/system/data/hyphen/");
|
|
+ QString haikuSystemHunspellPath("/system/data/hunspell/");
|
|
+ QString haikuUserHunspellPath("/boot/home/config/non-packaged/data/hunspell/");
|
|
+ d.setPath(haikuSystemHyphenPath);
|
|
+ if (d.exists())
|
|
+ hyphDirs.append(haikuSystemHyphenPath);
|
|
+ d.setPath(haikuSystemHunspellPath);
|
|
+ if (d.exists())
|
|
+ hyphDirs.append(haikuSystemHunspellPath);
|
|
+ d.setPath(haikuUserHunspellPath);
|
|
+ if (d.exists())
|
|
+ hyphDirs.append(haikuUserHunspellPath);
|
|
#endif
|
|
return hyphDirs;
|
|
}
|
|
@@ -396,6 +418,9 @@ QStringList ScPaths::systemFontDirs(void)
|
|
fontDirs.append("/System/Library/Fonts/");
|
|
#elif defined(_WIN32)
|
|
fontDirs.append( windowsSpecialDir(CSIDL_FONTS) );
|
|
+#elif defined(Q_OS_HAIKU)
|
|
+ fontDirs.append("/system/data/fonts/ttfonts");
|
|
+ fontDirs.append("/boot/home/config/non-packaged/data/fonts");
|
|
#endif
|
|
return fontDirs;
|
|
}
|
|
diff --git a/scribus/third_party/pgf/PGFplatform.h b/scribus/third_party/pgf/PGFplatform.h
|
|
index c3e3ed0..5184be9 100644
|
|
--- a/scribus/third_party/pgf/PGFplatform.h
|
|
+++ b/scribus/third_party/pgf/PGFplatform.h
|
|
@@ -528,7 +528,7 @@ __inline OSError FileWrite(HANDLE hFile, int *count, void *buffPtr) {
|
|
}
|
|
|
|
__inline OSError GetFPos(HANDLE hFile, UINT64 *pos) {
|
|
- #ifdef __APPLE__
|
|
+ #if defined(__APPLE__) || defined(__HAIKU__)
|
|
off_t ret;
|
|
if ((ret = lseek(hFile, 0, SEEK_CUR)) == -1) {
|
|
return errno;
|
|
@@ -548,7 +548,7 @@ __inline OSError GetFPos(HANDLE hFile, UINT64 *pos) {
|
|
}
|
|
|
|
__inline OSError SetFPos(HANDLE hFile, int posMode, INT64 posOff) {
|
|
- #ifdef __APPLE__
|
|
+ #if defined(__APPLE__) || defined(__HAIKU__)
|
|
if ((lseek(hFile, (off_t)posOff, posMode)) == -1) {
|
|
return errno;
|
|
} else {
|
|
diff --git a/scribus/util_debug.cpp b/scribus/util_debug.cpp
|
|
index 483a7dc..228614b 100644
|
|
--- a/scribus/util_debug.cpp
|
|
+++ b/scribus/util_debug.cpp
|
|
@@ -51,7 +51,7 @@ void tDebug(QString message)
|
|
*/
|
|
void printBacktrace ( int nFrames )
|
|
{
|
|
-#if !defined(_WIN32) && !defined(Q_OS_MAC) && !defined(Q_OS_OPENBSD) && !defined(Q_OS_FREEBSD)
|
|
+#if !defined(_WIN32) && !defined(Q_OS_MAC) && !defined(Q_OS_OPENBSD) && !defined(Q_OS_FREEBSD) && !defined(Q_OS_HAIKU)
|
|
void ** trace = new void*[nFrames + 1];
|
|
char **messages = ( char ** ) NULL;
|
|
int i, trace_size = 0;
|
|
--
|
|
2.21.0
|
|
|