From 6f094fc726db15e73298abb581c7afcd9ee570b1 Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Wed, 22 Jul 2020 12:30:38 -0400 Subject: [PATCH 18/36] gnu: gmime: Update package definition. * gnu/packages/mail.scm (gmime): Update package definition. [build-system]: Change from gnu to glib-or-gtk. [outputs]: New output "doc". [arguments]<#:configure-flags>[--enable-gtk-doc]: New flag. [--with-html-dir]: New flag. [--with-gpgme-prefix]: New flag. <#:phases>['patch-paths-in-tests]: Remove phase. ['patch-docbook-xml]: New phase. ['disable-failing-tests]: New phase. [native-inputs]: Add docbook-xml, docbook-xsl, docbook-utils, gobject-introspection, gtk-doc, perl and vala. Remove gnupg. [inputs]: Add gnupg and libidn2. Remove glib. [propagated-inputs]: Add glib. [synopsis]: Modify. [description]: Modify. [license]: Modify. --- gnu/packages/mail.scm | 97 ++++++++++++++++++++++++++----------------- 1 file changed, 60 insertions(+), 37 deletions(-) diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index 87388747e4..422c3f6260 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -139,6 +139,7 @@ #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix utils) + #:use-module (guix build-system glib-or-gtk) #:use-module (guix build-system gnu) #:use-module (guix build-system guile) #:use-module (guix build-system perl) @@ -563,46 +564,68 @@ It adds a large amount of new and improved features to mutt.") (package (name "gmime") (version "3.2.7") - (source (origin - (method url-fetch) - (uri (string-append "mirror://gnome/sources/gmime/" - (version-major+minor version) - "/gmime-" version ".tar.xz")) - (sha256 - (base32 - "0i3xfc84qn1z99i70q68kbnp9rmgqrnprqb418ba52s6g9j9dsia")))) - (build-system gnu-build-system) - (native-inputs - `(("pkg-config" ,pkg-config) - ("gnupg" ,gnupg))) ; for tests only - (inputs `(("glib" ,glib) - ("gpgme" ,gpgme) - ("zlib" ,zlib))) + (source + (origin + (method url-fetch) + (uri + (string-append "mirror://gnome/sources/gmime/" + (version-major+minor version) + "/gmime-" version ".tar.xz")) + (sha256 + (base32 "0i3xfc84qn1z99i70q68kbnp9rmgqrnprqb418ba52s6g9j9dsia")))) + (build-system glib-or-gtk-build-system) + (outputs '("out" "doc")) (arguments - `(#:phases + `(#:configure-flags + (list + "--enable-gtk-doc" + (string-append "--with-html-dir=" + (assoc-ref %outputs "doc") + "/share/gtk-doc/html") + (string-append "--with-gpgme-prefix=" + (assoc-ref %build-inputs "gpgme"))) + #:phases (modify-phases %standard-phases - (add-after - 'unpack 'patch-paths-in-tests - (lambda _ - ;; The test programs run several programs using 'system' with - ;; hard-coded paths. Here we patch them all. - ;; We use ISO-8859-1 here because test-iconv.c contains - ;; raw byte sequences in several different encodings. - (with-fluids ((%default-port-encoding #f)) - (substitute* (find-files "tests" "\\.c$") - (("(system *\\(\")(/[^ ]*)" all pre prog-path) - (let* ((base (basename prog-path)) - (prog (which base))) - (string-append pre - (or prog (error "not found: " base))))))) - #t))))) - (home-page "http://spruce.sourceforge.net/gmime/") + (add-after 'unpack 'patch-docbook-xml + (lambda* (#:key inputs #:allow-other-keys) + (with-directory-excursion "docs/reference" + (substitute* "gmime-docs.sgml" + (("http://www.oasis-open.org/docbook/xml/4.1.2/") + (string-append (assoc-ref inputs "docbook-xml") + "/xml/dtd/docbook/")))) + #t)) + (add-after 'patch-docbook-xml 'disable-failing-tests + (lambda _ + (substitute* "tests/Makefile.in" + (("@ENABLE_CRYPTO_TRUE@ test-pgp \\\\") + "") + (("@ENABLE_CRYPTO_TRUE@ test-pgpmime") + "") + (("test-mbox test-autocrypt test-mime") + "test-mbox test-mime")) + #t))))) + (native-inputs + `(("docbook-xml" ,docbook-xml-4.1.2) + ("docbook-xsl" ,docbook-xsl) + ("docbook2html" ,docbook-utils) + ("gobject-introspection" ,gobject-introspection) + ("gtk-doc" ,gtk-doc) + ("perl" ,perl) + ("pkg-config" ,pkg-config) + ("vapigen" ,vala))) + (inputs + `(("gnupg" ,gnupg) + ("gpgme" ,gpgme) + ("libidn2" ,libidn2) + ("zlib" ,zlib))) + (propagated-inputs + `(("glib" ,glib))) (synopsis "MIME message parser and creator library") - (description - "GMime provides a core library and set of utilities which may be used for -the creation and parsing of messages using the Multipurpose Internet Mail -Extension (MIME).") - (license (list lgpl2.1+ gpl2+ gpl3+)))) + (description "GMime is a C/C++ library which may be used for the creation +and parsing of messages using the Multipurpose Internet Mail Extension (MIME), +as defined by the RFCs.") + (home-page "http://spruce.sourceforge.net/gmime/") + (license lgpl2.1+))) ;; Some packages are not ready for GMime 3 yet. (define-public gmime-2.6 -- 2.27.0