Subject: [PATCH 2/6] gnu: Add libxlsxwriter.

From: Felix Gruber <[email-masked]>
Date: Sun, 28 Mar 2021 10:40:19 +0200

* gnu/packages/xml.scm (libxlsxwriter): New variable.
---
 gnu/packages/xml.scm | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index defc0323e6..a8b0d996cf 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -29,6 +29,7 @@
 ;;; Copyright © 2021 Michael Rohleder <[email-masked]>
 ;;; Copyright © 2021 Maxim Cournoyer <[email-masked]>
 ;;; Copyright © 2021 Julien Lepiller <[email-masked]>
+;;; Copyright © 2021 Felix Gruber <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -215,6 +216,47 @@ hierarchical form with variable field lengths.")
 project (but it is usable outside of the Gnome platform).")
     (license license:x11)))
 
+(define-public libxlsxwriter
+  (package
+    (name "libxlsxwriter")
+    (version "1.0.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+         (url "https://github.com/jmcnamara/libxlsxwriter")
+         (commit (string-append "RELEASE_" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+          "070pfqggia71z4ichr5yrwfndfz903z941ns72vy0lvb1mpp7g05"))
+       (modules '((guix build utils)))
+       (snippet
+        ;; Remove bundled minizip source
+        '(begin
+           (delete-file-recursively "third_party/minizip")
+           #t))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:tests? #f                       ; tests require unpackaged ctest
+       #:test-target "test"
+       #:make-flags
+       (list "CC=gcc"
+             (string-append "PREFIX=" (assoc-ref %outputs "out"))
+             "USE_STANDARD_TMPFILE=1"
+             "USE_SYSTEM_MINIZIP=1")
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure))))         ; no configure script
+    (inputs
+     `(("minizip" ,minizip)))
+    (home-page "https://github.com/jmcnamara/libxlsxwriter")
+    (synopsis "C library for creating Excel XLSX files")
+    (description
+     "Libxlsxwriter is a C library that can be used to write text, numbers,
+formulas and hyperlinks to multiple worksheets in an Excel 2007+ XLSX file.")
+    (license (list license:bsd-2))))
+
 ;; This is the latest stable release.
 (define-public libxmlplusplus
   (package
-- 
2.30.2