Sunday, February 02, 2020

Re: WIP: print/scribus (segmentation fault)

Stuart Henderson writes:

> On 2020/02/02 20:06, Rafael Sadowski wrote:
>> On Sun Feb 02, 2020 at 10:59:13AM -0800, Nam Nguyen wrote:
>> > Rafael Sadowski writes:
>> >
>> > > Here is an update for scribus to the newest qt5 version. Long time ago
>> > > Landry tried to update scribus without response from ports@.
>> > >
>> > > Here is a new try. Unfortunately this version crashes immediately
>> > > without a backtrace.
>> > >
>> > > Anyone want to take a look at this? I would be very grateful.
>> > >
>> > > Diff below includes patches from ArchLinux to unbreak the build with
>> > > our popper.
>> >
>> > Please reattach the diff because it has ^M endings.
>
> Please fix those up in the file in post-extract so the diff doesn't have to cope
> with these.
>
> post-extract:
> @cd ${WRKSRC} && perl -i -pe 's/\r$$//' $somefile

I pasted a diff with Stuart's hint. Also, it fixes malformed patch with
patches/patch-scribus_plugins_import_pdf_slaoutput_h.

I built scribus using this and see the immediate segmentation fault on
startup as reported.

Index: Makefile
===================================================================
RCS file: /cvs/ports/print/scribus/Makefile,v
retrieving revision 1.67
diff -u -p -r1.67 Makefile
--- Makefile 12 Jul 2019 20:48:57 -0000 1.67
+++ Makefile 2 Feb 2020 20:48:47 -0000
@@ -1,58 +1,52 @@
# $OpenBSD: Makefile,v 1.67 2019/07/12 20:48:57 sthen Exp $

COMMENT= desktop publishing program
-DISTNAME= scribus-1.4.6
+DISTNAME= scribus-1.5.5
CATEGORIES= print
-REVISION= 3

HOMEPAGE= https://www.scribus.net/

# GPLv2+
PERMIT_PACKAGE= Yes

-WANTLIB += ${COMPILER_LIBCXX} ${MODPY_WANTLIB}
-WANTLIB += QtGui QtNetwork QtXml c cairo cups fontconfig freetype
-WANTLIB += hyphen jpeg lcms2 m podofo tiff xml2 z
-
-COMPILER = base-clang ports-gcc base-gcc
+WANTLIB += ${COMPILER_LIBCXX} Qt5Core Qt5Gui Qt5Network Qt5OpenGL
+WANTLIB += Qt5PrintSupport Qt5Widgets Qt5Xml c cairo cups execinfo
+WANTLIB += fontconfig freetype harfbuzz harfbuzz-icu hunspell-1.6
+WANTLIB += icudata icuuc jpeg lcms2 m podofo poppler ${MODPY_WANTLIB}
+WANTLIB += tiff util xml2 z

MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=scribus/}
-
EXTRACT_SUFX= .tar.xz

-MODULES= x11/qt4 \
+MODULES= x11/qt5 \
devel/cmake \
lang/python

-MODPY_RUNDEP= No
-
BUILD_DEPENDS= devel/boost
+
RUN_DEPENDS= devel/desktop-file-utils \
graphics/py-Pillow \
+ misc/shared-mime-info \
print/ghostscript/gnu \
textproc/antiword \
- misc/shared-mime-info \
${MODPY_TKINTER_DEPENDS}
-LIB_DEPENDS= graphics/lcms2 \
+
+LIB_DEPENDS= devel/harfbuzz,-icu \
+ graphics/jpeg \
+ graphics/lcms2 \
graphics/tiff \
print/cups,-libs \
- textproc/hyphen \
+ print/poppler \
+ textproc/hunspell \
textproc/libxml \
textproc/podofo \
- graphics/jpeg \
${MODPY_LIB_DEPENDS}

-FLAVORS= debug
-FLAVOR?=
+CONFIGURE_ARGS+= -DCMAKE_INSTALL_MANDIR="${LOCALBASE}/man/"

-CONFIGURE_ARGS += -DCMAKE_SKIP_RPATH:BOOL=1 \
- -DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
- -DCMAKE_C_FLAGS="${CFLAGS}" \
- -DMANDIR="${LOCALBASE}/man/"
-
-.if ${FLAVOR:Mdebug}
-CONFIGURE_ARGS+=-DWANT_DEBUG=1
-.endif
+post-extract:
+ @find ${WRKSRC} -type f -name "*.cpp" | xargs perl -i -pe 's/\r$$//'
+ @find ${WRKSRC} -type f -name "*.h" | xargs perl -i -pe 's/\r$$//'

post-install:
@${INSTALL_DATA_DIR} ${PREFIX}/share/applications
Index: distinfo
===================================================================
RCS file: /cvs/ports/print/scribus/distinfo,v
retrieving revision 1.12
diff -u -p -r1.12 distinfo
--- distinfo 13 Apr 2018 20:51:12 -0000 1.12
+++ distinfo 2 Feb 2020 20:48:47 -0000
@@ -1,2 +1,2 @@
-SHA256 (scribus-1.4.6.tar.xz) = IeM2UA2e3JyQzPcwh+XvPfWew+Sjy/7BU2e82NB4oZo=
-SIZE (scribus-1.4.6.tar.xz) = 73601104
+SHA256 (scribus-1.5.5.tar.xz) = eQiyGmzoQyafWM7fX495GJMlfmIBzOX73ccNrKL+P3E=
+SIZE (scribus-1.5.5.tar.xz) = 73861836
Index: patches/patch-CMakeLists_txt
===================================================================
RCS file: patches/patch-CMakeLists_txt
diff -N patches/patch-CMakeLists_txt
--- patches/patch-CMakeLists_txt 13 Apr 2018 20:51:12 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,24 +0,0 @@
-$OpenBSD: patch-CMakeLists_txt,v 1.3 2018/04/13 20:51:12 sthen Exp $
-Index: CMakeLists.txt
---- CMakeLists.txt.orig
-+++ CMakeLists.txt
-@@ -275,7 +275,9 @@ ENDIF (APPLEBUNDLE)
- #Setp all the directories we will use
- #MAN
- CMAKE_POLICY(SET CMP0005 OLD)
--SET(MANDIR "${CMAKE_INSTALL_DATAROOTDIR}/man/")
-+IF(!MANDIR)
-+ SET(MANDIR "${CMAKE_INSTALL_DATAROOTDIR}/man/")
-+ENDIF(MANDIR)
- IF(WANT_VERSIONING)
- SET(SHAREDIR "${CMAKE_INSTALL_DATAROOTDIR}/${MAIN_DIR_NAME}${TAG_VERSION}/")
- ELSE(WANT_VERSIONING)
-@@ -374,7 +376,7 @@ IF(WANT_LIB64)
- ENDIF(NOT ARCH_X86_64)
- SET(LIB_SUFFIX "64" CACHE TYPE STRING)
- ENDIF(WANT_LIB64)
--SET(LIB_DIR_NAME "lib${LIB_SUFFIX}")
-+SET(LIB_DIR_NAME "lib")
- IF (APPLEBUNDLE)
- SET(LIBDIR "lib/")
- ELSE (APPLEBUNDLE)
Index: patches/patch-resources_manpages_CMakeLists_txt
===================================================================
RCS file: patches/patch-resources_manpages_CMakeLists_txt
diff -N patches/patch-resources_manpages_CMakeLists_txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-resources_manpages_CMakeLists_txt 2 Feb 2020 20:48:47 -0000
@@ -0,0 +1,21 @@
+$OpenBSD$
+
+Index: resources/manpages/CMakeLists.txt
+--- resources/manpages/CMakeLists.txt.orig
++++ resources/manpages/CMakeLists.txt
+@@ -7,15 +7,3 @@ scribus.1
+ DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
+ RENAME scribus${TAG_VERSION}.1
+ )
+-
+-install(FILES
+-scribus.1.de
+- DESTINATION ${CMAKE_INSTALL_MANDIR}/de/man1
+- RENAME scribus${TAG_VERSION}.1
+-)
+-
+-install(FILES
+-scribus.1.pl
+- DESTINATION ${CMAKE_INSTALL_MANDIR}/pl/man1
+- RENAME scribus${TAG_VERSION}.1
+-)
Index: patches/patch-scribus_CMakeLists_txt
===================================================================
RCS file: patches/patch-scribus_CMakeLists_txt
diff -N patches/patch-scribus_CMakeLists_txt
--- patches/patch-scribus_CMakeLists_txt 13 Apr 2018 20:51:12 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,18 +0,0 @@
-$OpenBSD: patch-scribus_CMakeLists_txt,v 1.1 2018/04/13 20:51:12 sthen Exp $
-
-Index: scribus/CMakeLists.txt
---- scribus/CMakeLists.txt.orig
-+++ scribus/CMakeLists.txt
-@@ -791,10 +791,9 @@ IF(UNIX AND NOT CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" A
- TARGET_LINK_LIBRARIES(${EXE_NAME} dl)
- ENDIF(UNIX AND NOT CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" AND NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND NOT HAIKU)
-
--# #9311 for the OpenBSD addition
--IF(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
-+IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
- TARGET_LINK_LIBRARIES(${EXE_NAME} util execinfo)
--ENDIF(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
-+ENDIF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
-
- IF(WIN32)
- TARGET_LINK_LIBRARIES(${EXE_NAME} ${QT_QTMAIN_LIBRARY})
Index: patches/patch-scribus_gtdialogs_cpp
===================================================================
RCS file: patches/patch-scribus_gtdialogs_cpp
diff -N patches/patch-scribus_gtdialogs_cpp
--- patches/patch-scribus_gtdialogs_cpp 21 Jan 2019 21:19:48 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-$OpenBSD: patch-scribus_gtdialogs_cpp,v 1.1 2019/01/21 21:19:48 naddy Exp $
-
-Index: scribus/gtdialogs.cpp
---- scribus/gtdialogs.cpp.orig
-+++ scribus/gtdialogs.cpp
-@@ -160,7 +160,7 @@ bool gtDialogs::runImporterDialog(const QStringList& i
- if (imp != "false")
- {
- res = imp;
-- if (importers.contains(res) > 0)
-+ if (importers.contains(res))
- ok = true;
- }
-
Index: patches/patch-scribus_plugins_import_pdf_importpdf_cpp
===================================================================
RCS file: patches/patch-scribus_plugins_import_pdf_importpdf_cpp
diff -N patches/patch-scribus_plugins_import_pdf_importpdf_cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-scribus_plugins_import_pdf_importpdf_cpp 2 Feb 2020 20:48:47 -0000
@@ -0,0 +1,88 @@
+$OpenBSD$
+
+Index: scribus/plugins/import/pdf/importpdf.cpp
+--- scribus/plugins/import/pdf/importpdf.cpp.orig
++++ scribus/plugins/import/pdf/importpdf.cpp
+@@ -75,7 +75,11 @@ PdfPlug::PdfPlug(ScribusDoc* doc, int flags)
+ QImage PdfPlug::readThumbnail(const QString& fName)
+ {
+ QString pdfFile = QDir::toNativeSeparators(fName);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
++ globalParams.reset(new GlobalParams());
++#else
+ globalParams = new GlobalParams();
++

No comments:

Post a Comment