Subject: [bug#28954] [PATCH] Update Scribus to 1.5.3. Re-vamp package.

From: Eric Bavier <[email-masked]>
Date: Wed, 25 Oct 2017 18:23:56 -0500

Hello Nicolas,

Thanks for the quick fixes.

On Tue, 24 Oct 2017 17:34:18 +0200
Nicolas Goaziou <[email-masked]> wrote:

> Hello,
> 
> Eric Bavier <[email-masked]> writes:
> 
> > Could you include a url where these patches came from in the patches
> > themselves?  You mention in the package definition that they came from
> > upstream's trunk.
> >
> > Or, for large patches, some have experimented with using an origin that
> > fetches the patch from upstream rather than pulling the patch into
> > Guix.  
> 
> I cloned project's git mirror and picked two specific commits. There is
> no proper URL that I know of.
> 
> You can see them at
> 
>   https://www.scribus.net/websvn/listing.php?repname=Scribus&peg=22197&rev=22154
> 
> and
> 
>   https://www.scribus.net/websvn/listing.php?repname=Scribus&peg=22197&rev=22155
> 
> although not as patch files.

The scribus team has a "mirror" on github that tracks the svn
repository.  I was able to find the patches there.  What do you think
of this version of your patch?

'guix lint scribus' complains about the patch file names, but that
should probably get a bug.

`~Eric
From a69f37e8dc715cc3fd6008ffc360dc8a3f84e3c9 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <[email-masked]>
Date: Mon, 23 Oct 2017 12:25:13 +0200
Subject: [PATCH] gnu: scribus: Update to 1.5.3.  Add inputs.

* gnu/packages/scribus.scm (scribus): Update to 1.5.3.
[input]: Add fontconfig, harfbuzz, hunspell, icu4c, libcdr, libfreehand,
libmspub, librevenge, libvisio, openssl, podofo, poppler, and boost.  Move
qttools to ...
[native-input]: ... here.
[home-page]: Fix URL.

Co-authored-by: Eric Bavier <[email-masked]>
---
 gnu/packages/scribus.scm | 79 +++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 61 insertions(+), 18 deletions(-)

diff --git a/gnu/packages/scribus.scm b/gnu/packages/scribus.scm
index d48051ee3..6230195ed 100644
--- a/gnu/packages/scribus.scm
+++ b/gnu/packages/scribus.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Ricardo Wurmus <[email-masked]>
 ;;; Copyright © 2016 Efraim Flashner <[email-masked]>
+;;; Copyright © 2017 Nicolas Goaziou <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -24,53 +25,95 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix build-system cmake)
   #:use-module (gnu packages)
+  #:use-module (gnu packages boost)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cups)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages imagemagick)
+  #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages pdf)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages qt)
-  #:use-module (gnu packages imagemagick)
+  #:use-module (gnu packages tls)
   #:use-module (gnu packages xml))
 
 (define-public scribus
   (package
     (name "scribus")
-    (version "1.5.2")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append "mirror://sourceforge/scribus/scribus-devel/"
-                                  version "/scribus-" version ".tar.xz"))
-              (sha256
-               (base32
-                "1xbl7h4x32y2nfhn57ivjziyvlnwadcbizqwfqx5srfsmqiyqppc"))))
+    (version "1.5.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://sourceforge/scribus/scribus-devel/"
+                           version "/scribus-" version ".tar.xz"))
+       (sha256
+        (base32
+         "0kyp45vidxa3v35ic9592db4zk3m8al26vck38q5v7z14x3hp8vk"))
+       (patches
+        (list
+         (origin
+           (method url-fetch)
+           (uri (string-append "https://github.com/scribusproject/scribus/commit/"
+                               "61186c7ef083046b7e0c908952e8a773e2787d82.patch"))
+           (file-name "scribus-fix-poppler-0.58-breakage.patch")
+           (sha256
+            (base32 "189qw9xmgz01xz1w1bi9lzrp399zk1j1iz5qdhchdrhgnd69b7ly")))
+         (origin
+           (method url-fetch)
+           (uri (string-append "https://github.com/scribusproject/scribus/commit/"
+                               "d82b1c989bd0e79b5611521f671adbfb94996e5e.patch"))
+           (file-name "scribus-fix-poppler-packaging.patch")
+           (sha256
+            (base32 "1p9s18jjvj2h0ba1xvk1zhmnn4f4n3ykrgb56mjd6in30h0vrykx")))))
+       (modules '((guix build utils)))
+       (snippet
+        ;; Fix typo.  Equivalent to patch at
+        ;; https://bugs.scribus.net/view.php?id=14850
+        '(substitute* "cmake/modules/FindLIBPODOFO.cmake"
+           (("find_package\\(OPENSSL\\)") "find_package(OpenSSL)")))))
     (build-system cmake-build-system)
     (arguments
-     `(#:tests? #f ; no test target
+     `(#:tests? #f                      ;no test target
        #:configure-flags
-       '("-DCMAKE_CXX_FLAGS=-std=gnu++11")))
+       '("-DWANT_GRAPHICSMAGICK=1")))
     (inputs
-     `(("cairo" ,cairo)
+     `(("boost" ,boost)
+       ("cairo" ,cairo)
        ("cups" ,cups)
+       ("fontconfig" ,fontconfig)
+       ("freetype" ,freetype)
        ("graphicsmagick" ,graphicsmagick)
+       ("harfbuzz" ,harfbuzz)
+       ("hunspell" ,hunspell)
+       ("icu4c" ,icu4c)
        ("lcms" ,lcms)
+       ("libcdr" ,libcdr)
+       ("libfreehand" ,libfreehand)
        ("libjpeg" ,libjpeg)
+       ("libmspub" ,libmspub)
+       ("libpagemaker" ,libpagemaker)
+       ("librevenge" ,librevenge)
        ("libtiff" ,libtiff)
+       ("libvisio" ,libvisio)
        ("libxml2" ,libxml2)
-       ("python" ,python-2)
-       ("freetype" ,freetype)
+       ("openssl" ,openssl)
+       ("podofo" ,podofo)
+       ("poppler" ,poppler)
+       ("python" ,python-2)             ;need Python library
        ("qtbase" ,qtbase)
        ("qtdeclarative" ,qtdeclarative)
-       ("qttools" ,qttools)
        ("zlib" ,zlib)))
     (native-inputs
-     `(("util-linux" ,util-linux)
-       ("pkg-config" ,pkg-config)))
-    (home-page "http://scribus.net")
+     `(("pkg-config" ,pkg-config)
+       ("qttools" ,qttools)
+       ("util-linux" ,util-linux)))
+    (home-page "https://www.scribus.net")
     (synopsis "Desktop publishing and page layout program")
     (description
      "Scribus is a @dfn{desktop publishing} (DTP) application and can be used
-- 
2.14.2