Subject: [PATCH] testing/scribus new aport

From: Bruno d'Arcangeli <[email-masked]>
Date: Tue, 17 Nov 2020 10:17:34 +0100

From 9697d6773cc2aff82fc9435022ca231e32d79857 Mon Sep 17 00:00:00 2001
From: Bruno d'Arcangeli <[email-masked]>
Date: Tue, 17 Nov 2020 09:43:00 +0100
Subject: [PATCH] testing/scribus

https://scribus.net
Desktop publishing software (DTP)
---
 testing/scribus/APKBUILD       | 48 ++++++++++++++++++++++++++++++++++
 testing/scribus/fix-musl.patch | 20 ++++++++++++++
 2 files changed, 68 insertions(+)
 create mode 100644 testing/scribus/APKBUILD
 create mode 100644 testing/scribus/fix-musl.patch

diff --git a/testing/scribus/APKBUILD b/testing/scribus/APKBUILD
new file mode 100644
index 0000000000..ef29113ece
--- /dev/null
+++ b/testing/scribus/APKBUILD
@@ -0,0 +1,48 @@
+# Contributor:
+# Maintainer: Bruno d Arcangeli <[email-masked]>
+pkgname=scribus
+pkgver=1.5.6.1
+pkgrel=1
+pkgdesc="Desktop publishing software"
+url="https://www.scribus.net/"
+arch="all"
+license="GPL"
+depends="boost-libs cairo fontconfig freetype harfbuzz-icu hunspell lcms2
+         libcdr cups-libs libfreehand libjpeg libmspub libpagemaker libpng libqxp
+         librevenge tiff libvisio libxml2 libzmf openscenegraph openssl
+         podofo poppler python3 qt5-qtbase zlib"
+makedepends="cmake boost cairo-dev cups-dev hunspell-dev lcms2-dev mesa libcdr-dev libfreehand-dev libmspub-dev libpagemaker-dev libqxp-dev libvisio-dev libzmf-dev poppler-dev qt5-qttools qt5-qttools-dev qt5-qtbase-dev"
+options="!check"
+subpackages="$pkgname-doc"
+source="https://downloads.sourceforge.net/scribus/scribus-$pkgver.tar.xz"
+builddir="$srcdir/"
+
+build() {
+  #mkdir build && cd build
+	cmake -B build -S $pkgname-$pkgver \
+        -DCMAKE_INSTALL_PREFIX=/usr \
+        -DCMAKE_BUILD_TYPE=None \
+        -DCMAKE_SKIP_RPATH=ON
+        # FS#59800
+        #-DWANT_GRAPHICSMAGICK=1
+  make -C build
+}
+
+package() {
+  make -C build DESTDIR="$pkgdir" install
+
+  cd $pkgname-$pkgver
+
+  install -Dm644 scribus.desktop -t "$pkgdir"/usr/share/applications
+
+  for i in 16x16 32x32 128x128 256x256 512x512 1024x1024
+    do
+      install -Dm644 resources/iconsets/artwork/icon_$i.png "$pkgdir"/usr/share/icons/hicolor/$i/apps/scribus.png
+  done
+
+  # Use system hyphen
+  rm -rf "$pkgdir"/usr/share/scribus/dicts/hyph
+  ln -sf /usr/share/hyphen "$pkgdir"/usr/share/scribus/dicts/hyph
+}
+
+sha512sums="eb9562a28eba96a2c89d0e8b3b997508c54ffce99aa104458a4233d606acdee399ccdba4f064bd6cca240774ddfe3e4308b7b9b67106938eb692b12b4e6d24cb  scribus-1.5.6.1.tar.xz"
diff --git a/testing/scribus/fix-musl.patch b/testing/scribus/fix-musl.patch
new file mode 100644
index 0000000000..6df9a2da2b
--- /dev/null
+++ b/testing/scribus/fix-musl.patch
@@ -0,0 +1,20 @@
+--- scribus/util.cpp.orig	2016-01-11 15:35:18.171968184 +0100
++++ scribus/util.cpp	2016-01-11 15:35:53.600967308 +0100
+@@ -37,7 +37,7 @@ for which a new license (GPL+exception)
+ 
+ #include <signal.h>
+ 
+-#if !defined(_WIN32) && !defined(Q_OS_MAC) && !defined(Q_OS_HAIKU) 
++#ifdef __GLIBC__
+ #include <execinfo.h>
+ #include <cxxabi.h>
+ #endif
+@@ -947,7 +947,7 @@ void getDashArray(int dashtype, double l
+  */
+ void printBacktrace ( int nFrames )
+ {
+-#if !defined(_WIN32) && !defined(Q_OS_MAC) && !defined(Q_OS_OPENBSD)  && !defined(Q_OS_FREEBSD) && !defined(Q_OS_HAIKU)
++#ifdef __GLIBC__
+ 	void ** trace = new void*[nFrames + 1];
+ 	char **messages = ( char ** ) NULL;
+ 	int i, trace_size = 0;
-- 
2.29.2

---

From: Milan P. Stanić <[email-masked]>
Date: Tue, 17 Nov 2020 11:37:39 +0100

Hi,

For some reason patch didn't worked with 'git am ...'.

Also after fixing it and apply to my current branch (edge x86_64) build
failed.
I'm attaching build log.

Also, it would easier for adding packages by using
https://gitlab.alpinelinux.org
where we can review it and packages can be built for test on most of
architecture alpine supports.

Thank you for working on adding scribus (you saved me from this because
I thought to make aport of it)
-- 
Kind regards

---

From: Milan P. Stanić <[email-masked]>
Date: Thu, 24 Dec 2020 10:56:18 +0100

Hi,

I created merge request with your patch here:
https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/16093

and I fixed some things in it to the point it builds on Alpine CI, but
it need more fixes which can be seen in above merge request log and
comments.

If you intend to maintain (seriously) scribus in Alpine please look at
it and fix what is needed. Else please tell us if you do not intend to
do this work so we can 'make it proper' for Alpine.

TIA

On Tue, 2020-11-17 at 10:17, Bruno d'Arcangeli wrote: