View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0008232 | Scribus | Build System | public | 2009-07-02 14:12 | 2011-02-16 16:33 |
| Reporter | sharkcz | Assigned To | cbradney | ||
| Priority | normal | Severity | major | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Product Version | 1.3.5svn | ||||
| Target Version | 1.4.0 | Fixed in Version | 1.4.0svn | ||
| Summary | 0008232: use system hyphenation library if available | ||||
| Description | Scribus should use system hyphenation library if it is available in the system. references: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=533081 http://bugzilla.redhat.com/show_bug.cgi?id=506074 The attached patch is an improved version of the one included in Debian package. | ||||
| Tags | No tags attached. | ||||
| Attached Files | system_hyphen.diff (3,768 bytes)
diff -Nrup scribus-1.3.5.rc3.orig/cmake/modules/FindHYPHEN.cmake scribus-1.3.5.rc3/cmake/modules/FindHYPHEN.cmake
--- scribus-1.3.5.rc3.orig/cmake/modules/FindHYPHEN.cmake 1970-01-01 01:00:00.000000000 +0100
+++ scribus-1.3.5.rc3/cmake/modules/FindHYPHEN.cmake 2009-07-02 14:23:26.000000000 +0200
@@ -0,0 +1,28 @@
+# - Find HYPHEN library
+# Find the native HYPHEN includes and library
+# This module defines
+# HYPHEN_INCLUDE_DIR, where to find hyphen.h, etc.
+# HYPHEN_LIBRARIES, libraries to link against to use HYPHEN.
+# HYPHEN_FOUND, If false, do not try to use HYPHEN.
+# also defined, but not for general use are
+# HYPHEN_LIBRARY, where to find the HYPHEN library.
+
+FIND_PATH(HYPHEN_INCLUDE_DIR hyphen.h)
+
+SET(HYPHEN_NAMES_RELEASE ${HYPHEN_NAMES_RELEASE} ${HYPHEN_NAMES} hyphen libhyphen)
+SET(HYPHEN_NAMES_DEBUG ${HYPHEN_NAMES_DEBUG} hyphend libhyphend)
+
+FIND_LIBRARY(HYPHEN_LIBRARY_RELEASE NAMES ${HYPHEN_NAMES_RELEASE} )
+FIND_LIBRARY(HYPHEN_LIBRARY_DEBUG NAMES ${HYPHEN_NAMES_DEBUG} )
+
+INCLUDE(LibraryDebugAndRelease)
+SET_LIBRARY_FROM_DEBUG_AND_RELEASE(HYPHEN)
+
+# handle the QUIETLY and REQUIRED arguments and set HYPHEN_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(ScribusFindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(HYPHEN DEFAULT_MSG HYPHEN_LIBRARY HYPHEN_INCLUDE_DIR)
+
+IF(HYPHEN_FOUND)
+ SET( HYPHEN_LIBRARIES ${HYPHEN_LIBRARY} )
+ENDIF(HYPHEN_FOUND)
--- scribus-1.3.5.rc3.orig/CMakeLists.txt 2009-05-30 14:38:09.000000000 +0200
+++ scribus-1.3.5.rc3/CMakeLists.txt 2009-07-02 14:32:24.000000000 +0200
@@ -638,6 +638,16 @@ ELSE(LIBPODOFO_FOUND)
ENDIF(LIBPODOFO_FOUND)
#>>PoDoFo for AI PDF import
+#<<HYPHEN for system hyphenation library
+FIND_PACKAGE(HYPHEN)
+IF(HYPHEN_FOUND)
+ MESSAGE("system hyphenation library found OK")
+ SET(HAVE_HYPHEN 1)
+ELSE(HYPHEN_FOUND)
+ MESSAGE("system hyphenation library NOT found - will use internal one")
+ENDIF(HYPHEN_FOUND)
+#>>HYPHEN for system hyphenation library
+
##############################################################################################################
########## Include Setup ##########
diff -Nrup -x CMakeFiles -x Makefile -x FindHYPHEN.cmake scribus-1.3.5.rc3.orig/scribus/CMakeLists.txt scribus-1.3.5.rc3/scribus/CMakeLists.txt
--- scribus-1.3.5.rc3.orig/scribus/CMakeLists.txt 2009-06-07 09:05:54.000000000 +0200
+++ scribus-1.3.5.rc3/scribus/CMakeLists.txt 2009-07-02 15:22:52.000000000 +0200
@@ -402,10 +402,8 @@ SET(SCRIBUS_SOURCES
guidesmodel.cpp
guidesview.cpp
ui/helpbrowser.cpp
- hnjalloc.c
ui/hruler.cpp
ui/hyask.cpp
- hyphen.c
hyphenator.cpp
ui/hysettings.cpp
ui/imageinfodialog.cpp
@@ -642,6 +640,14 @@ SET(SCRIBUS_SOURCES
ui/vruler.cpp
)
+IF(NOT HAVE_HYPHEN)
+ SET(SCRIBUS_SOURCES
+ ${SCRIBUS_SOURCES}
+ hnjalloc.c
+ hyphen.c
+ )
+ENDIF(NOT HAVE_HYPHEN)
+
IF(WIN32)
SET(SCRIBUS_MOC_WIN32_ONLY_CLASSES scprintengine_gdi.h)
SET(SCRIBUS_WIN32_ONLY_SOURCES
@@ -786,6 +792,12 @@ IF(HAVE_PODOFO)
)
ENDIF(HAVE_PODOFO)
+IF(HAVE_HYPHEN)
+ TARGET_LINK_LIBRARIES(${EXE_NAME}
+ ${HYPHEN_LIBRARY}
+ )
+ENDIF(HAVE_HYPHEN)
+
# Now build plugins
SET(PLUGIN_LIBRARIES)
IF(WIN32)
diff -Nrup -x CMakeFiles -x Makefile -x '*.cmake' scribus-1.3.5.rc3.orig/scribus/hyphenator.h scribus-1.3.5.rc3/scribus/hyphenator.h
--- scribus-1.3.5.rc3.orig/scribus/hyphenator.h 2007-07-10 22:33:09.000000000 +0200
+++ scribus-1.3.5.rc3/scribus/hyphenator.h 2009-07-02 14:03:11.000000000 +0200
@@ -13,7 +13,7 @@ for which a new license (GPL+exception)
#include <QSet>
#include "scribusapi.h"
-#include "hyphen.h"
+#include <hyphen.h>
class ScribusDoc;
class ScribusMainWindow;
class PageItem;
system_hyphen-1.3.5.diff (3,754 bytes)
diff -Nrup scribus-1.3.5.rc3.orig/cmake/modules/FindHYPHEN.cmake scribus-1.3.5.rc3/cmake/modules/FindHYPHEN.cmake
--- scribus-1.3.5.rc3.orig/cmake/modules/FindHYPHEN.cmake 1970-01-01 01:00:00.000000000 +0100
+++ scribus-1.3.5.rc3/cmake/modules/FindHYPHEN.cmake 2009-07-02 14:23:26.000000000 +0200
@@ -0,0 +1,28 @@
+# - Find HYPHEN library
+# Find the native HYPHEN includes and library
+# This module defines
+# HYPHEN_INCLUDE_DIR, where to find hyphen.h, etc.
+# HYPHEN_LIBRARIES, libraries to link against to use HYPHEN.
+# HYPHEN_FOUND, If false, do not try to use HYPHEN.
+# also defined, but not for general use are
+# HYPHEN_LIBRARY, where to find the HYPHEN library.
+
+FIND_PATH(HYPHEN_INCLUDE_DIR hyphen.h)
+
+SET(HYPHEN_NAMES_RELEASE ${HYPHEN_NAMES_RELEASE} ${HYPHEN_NAMES} hyphen libhyphen)
+SET(HYPHEN_NAMES_DEBUG ${HYPHEN_NAMES_DEBUG} hyphend libhyphend)
+
+FIND_LIBRARY(HYPHEN_LIBRARY_RELEASE NAMES ${HYPHEN_NAMES_RELEASE} )
+FIND_LIBRARY(HYPHEN_LIBRARY_DEBUG NAMES ${HYPHEN_NAMES_DEBUG} )
+
+INCLUDE(LibraryDebugAndRelease)
+SET_LIBRARY_FROM_DEBUG_AND_RELEASE(HYPHEN)
+
+# handle the QUIETLY and REQUIRED arguments and set HYPHEN_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(ScribusFindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(HYPHEN DEFAULT_MSG HYPHEN_LIBRARY HYPHEN_INCLUDE_DIR)
+
+IF(HYPHEN_FOUND)
+ SET( HYPHEN_LIBRARIES ${HYPHEN_LIBRARY} )
+ENDIF(HYPHEN_FOUND)
--- scribus-1.3.5.rc3.orig/CMakeLists.txt 2009-05-30 14:38:09.000000000 +0200
+++ scribus-1.3.5.rc3/CMakeLists.txt 2009-07-02 14:32:24.000000000 +0200
@@ -638,6 +638,16 @@ ELSE(LIBPODOFO_FOUND)
ENDIF(LIBPODOFO_FOUND)
#>>PoDoFo for AI PDF import
+#<<HYPHEN for system hyphenation library
+FIND_PACKAGE(HYPHEN)
+IF(HYPHEN_FOUND)
+ MESSAGE("system hyphenation library found OK")
+ SET(HAVE_HYPHEN 1)
+ELSE(HYPHEN_FOUND)
+ MESSAGE("system hyphenation library NOT found - will use internal one")
+ENDIF(HYPHEN_FOUND)
+#>>HYPHEN for system hyphenation library
+
##############################################################################################################
########## Include Setup ##########
diff -Nrup -x CMakeFiles -x Makefile -x FindHYPHEN.cmake scribus-1.3.5.rc3.orig/scribus/CMakeLists.txt scribus-1.3.5.rc3/scribus/CMakeLists.txt
--- scribus-1.3.5.rc3.orig/scribus/CMakeLists.txt 2009-06-07 09:05:54.000000000 +0200
+++ scribus-1.3.5.rc3/scribus/CMakeLists.txt 2009-07-02 15:22:52.000000000 +0200
@@ -403,10 +403,8 @@ SET(SCRIBUS_SOURCES
guidesdelegate.cpp
guidesmodel.cpp
helpbrowser.cpp
- hnjalloc.c
hruler.cpp
hyask.cpp
- hyphen.c
hyphenator.cpp
hysettings.cpp
imageinfodialog.cpp
@@ -641,6 +639,14 @@ SET(SCRIBUS_SOURCES
vruler.cpp
)
+IF(NOT HAVE_HYPHEN)
+ SET(SCRIBUS_SOURCES
+ ${SCRIBUS_SOURCES}
+ hnjalloc.c
+ hyphen.c
+ )
+ENDIF(NOT HAVE_HYPHEN)
+
IF(WIN32)
SET(SCRIBUS_MOC_WIN32_ONLY_CLASSES scprintengine_gdi.h)
SET(SCRIBUS_WIN32_ONLY_SOURCES
@@ -785,6 +791,12 @@ IF(HAVE_PODOFO)
)
ENDIF(HAVE_PODOFO)
+IF(HAVE_HYPHEN)
+ TARGET_LINK_LIBRARIES(${EXE_NAME}
+ ${HYPHEN_LIBRARY}
+ )
+ENDIF(HAVE_HYPHEN)
+
# Now build plugins
SET(PLUGIN_LIBRARIES)
IF(WIN32)
diff -Nrup -x CMakeFiles -x Makefile -x '*.cmake' scribus-1.3.5.rc3.orig/scribus/hyphenator.h scribus-1.3.5.rc3/scribus/hyphenator.h
--- scribus-1.3.5.rc3.orig/scribus/hyphenator.h 2007-07-10 22:33:09.000000000 +0200
+++ scribus-1.3.5.rc3/scribus/hyphenator.h 2009-07-02 14:03:11.000000000 +0200
@@ -13,7 +13,7 @@ for which a new license (GPL+exception)
#include <QSet>
#include "scribusapi.h"
-#include "hyphen.h"
+#include <hyphen.h>
class ScribusDoc;
class ScribusMainWindow;
class PageItem;
scribus-1.3.7-system-hyphen.patch (3,980 bytes)
From 714923566c62dbe89991ca8e100d9c47e9aa38fc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Tue, 1 Jun 2010 10:54:50 +0200
Subject: [PATCH] use system hyphen library
---
Scribus/CMakeLists.txt | 10 ++++++++++
Scribus/cmake/modules/FindHYPHEN.cmake | 28 ++++++++++++++++++++++++++++
Scribus/scribus/CMakeLists.txt | 16 ++++++++++++++--
Scribus/scribus/hyphenator.h | 2 +-
4 files changed, 53 insertions(+), 3 deletions(-)
create mode 100644 Scribus/cmake/modules/FindHYPHEN.cmake
diff --git a/Scribus/CMakeLists.txt b/Scribus/CMakeLists.txt
index 482fb4c..2547d3b 100644
--- a/Scribus/CMakeLists.txt
+++ b/Scribus/CMakeLists.txt
@@ -684,6 +684,16 @@ IF (WITH_PODOFO)
ENDIF (WITH_PODOFO)
#>>PoDoFo for AI PDF import
+#<<HYPHEN for system hyphenation library
+FIND_PACKAGE(HYPHEN)
+IF(HYPHEN_FOUND)
+ MESSAGE("system hyphenation library found OK")
+ SET(HAVE_HYPHEN 1)
+ELSE(HYPHEN_FOUND)
+ MESSAGE("system hyphenation library NOT found - will use internal one")
+ENDIF(HYPHEN_FOUND)
+#>>HYPHEN for system hyphenation library
+
##############################################################################################################
########## Include Setup ##########
diff --git a/Scribus/cmake/modules/FindHYPHEN.cmake b/Scribus/cmake/modules/FindHYPHEN.cmake
new file mode 100644
index 0000000..d67bd59
--- /dev/null
+++ b/Scribus/cmake/modules/FindHYPHEN.cmake
@@ -0,0 +1,28 @@
+# - Find HYPHEN library
+# Find the native HYPHEN includes and library
+# This module defines
+# HYPHEN_INCLUDE_DIR, where to find hyphen.h, etc.
+# HYPHEN_LIBRARIES, libraries to link against to use HYPHEN.
+# HYPHEN_FOUND, If false, do not try to use HYPHEN.
+# also defined, but not for general use are
+# HYPHEN_LIBRARY, where to find the HYPHEN library.
+
+FIND_PATH(HYPHEN_INCLUDE_DIR hyphen.h)
+
+SET(HYPHEN_NAMES_RELEASE ${HYPHEN_NAMES_RELEASE} ${HYPHEN_NAMES} hyphen libhyphen)
+SET(HYPHEN_NAMES_DEBUG ${HYPHEN_NAMES_DEBUG} hyphend libhyphend)
+
+FIND_LIBRARY(HYPHEN_LIBRARY_RELEASE NAMES ${HYPHEN_NAMES_RELEASE} )
+FIND_LIBRARY(HYPHEN_LIBRARY_DEBUG NAMES ${HYPHEN_NAMES_DEBUG} )
+
+INCLUDE(LibraryDebugAndRelease)
+SET_LIBRARY_FROM_DEBUG_AND_RELEASE(HYPHEN)
+
+# handle the QUIETLY and REQUIRED arguments and set HYPHEN_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(ScribusFindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(HYPHEN DEFAULT_MSG HYPHEN_LIBRARY HYPHEN_INCLUDE_DIR)
+
+IF(HYPHEN_FOUND)
+ SET( HYPHEN_LIBRARIES ${HYPHEN_LIBRARY} )
+ENDIF(HYPHEN_FOUND)
diff --git a/Scribus/scribus/CMakeLists.txt b/Scribus/scribus/CMakeLists.txt
index e856781..49da5f6 100644
--- a/Scribus/scribus/CMakeLists.txt
+++ b/Scribus/scribus/CMakeLists.txt
@@ -396,10 +396,8 @@ SET(SCRIBUS_SOURCES
guidesdelegate.cpp
guidesmodel.cpp
helpbrowser.cpp
- hnjalloc.c
hruler.cpp
hyask.cpp
- hyphen.c
hyphenator.cpp
hysettings.cpp
imageinfodialog.cpp
@@ -634,6 +632,14 @@ SET(SCRIBUS_SOURCES
vruler.cpp
)
+IF(NOT HAVE_HYPHEN)
+ SET(SCRIBUS_SOURCES
+ ${SCRIBUS_SOURCES}
+ hnjalloc.c
+ hyphen.c
+ )
+ENDIF(NOT HAVE_HYPHEN)
+
IF(WIN32)
SET(SCRIBUS_MOC_WIN32_ONLY_CLASSES scprintengine_gdi.h)
SET(SCRIBUS_WIN32_ONLY_SOURCES
@@ -783,6 +789,12 @@ IF(HAVE_PODOFO)
)
ENDIF(HAVE_PODOFO)
+IF(HAVE_HYPHEN)
+ TARGET_LINK_LIBRARIES(${EXE_NAME}
+ ${HYPHEN_LIBRARY}
+ )
+ENDIF(HAVE_HYPHEN)
+
# Now build plugins
SET(PLUGIN_LIBRARIES)
IF(WIN32)
diff --git a/Scribus/scribus/hyphenator.h b/Scribus/scribus/hyphenator.h
index 7712c37..1312950 100644
--- a/Scribus/scribus/hyphenator.h
+++ b/Scribus/scribus/hyphenator.h
@@ -13,7 +13,7 @@ for which a new license (GPL+exception) is in place.
#include <QSet>
#include "scribusapi.h"
-#include "hyphen.h"
+#include <hyphen.h>
class ScribusDoc;
class ScribusMainWindow;
class PageItem;
--
1.6.6.1
| ||||
| Patch | |||||
|
|
Can you include this patch? |
|
|
I have my 1.4.0svn patched now.. but what package would provide the files required? |
|
|
I want to know for other distros too.. eg opensuse.. if that lib i not provided across distros, then its not worth it. |
|
|
ping |
|
|
The hyphenation library is provided by hyphen/hyphen-devel in Fedora/RHEL, by libhyphen0/libhyphen-dev in Debian/Ubuntu, can't find it in OpenSUSE though. |
|
|
Applied to 1.4.0.svn and 1.5.0.svn |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2009-07-02 14:12 | sharkcz | New Issue | |
| 2009-07-02 14:12 | sharkcz | File Added: system_hyphen.diff | |
| 2009-07-02 18:13 | jghali | Severity | major => feature |
| 2009-07-21 11:34 | sharkcz | File Added: system_hyphen-1.3.5.diff | |
| 2009-07-30 23:09 |
|
Status | new => assigned |
| 2009-07-30 23:09 |
|
Assigned To | => cbradney |
| 2010-09-27 07:39 | sharkcz | File Added: scribus-1.3.7-system-hyphen.patch | |
| 2010-09-27 07:41 | sharkcz | Note Added: 0024595 | |
| 2011-02-11 19:12 | malex | Severity | feature => major |
| 2011-02-11 19:12 | malex | Target Version | => 1.4.0 |
| 2011-02-11 23:29 | cbradney | Note Added: 0025560 | |
| 2011-02-11 23:45 | cbradney | Note Added: 0025561 | |
| 2011-02-13 21:21 | cbradney | Note Added: 0025578 | |
| 2011-02-14 17:13 | sharkcz | Note Added: 0025589 | |
| 2011-02-14 19:30 | cbradney | Note Added: 0025592 | |
| 2011-02-14 19:30 | cbradney | Status | assigned => resolved |
| 2011-02-14 19:30 | cbradney | Fixed in Version | => 1.4.0svn |
| 2011-02-14 19:30 | cbradney | Resolution | open => fixed |
| 2011-02-16 16:33 | cbradney | Status | resolved => closed |