diff mbox

[1/3] gnu: Add utfcpp.

Message ID 1462646181.1130095.601018617.5F6ADC8F@webmail.messagingengine.com
State New
Headers show

Commit Message

Alex Griffin May 7, 2016, 6:36 p.m. UTC
This is a dependency of ledger. It's bundled in ledger's source but I
think it's better to unbundle it. It's a bit unusual in that the headers
contain the whole source.

Comments

Leo Famulari May 7, 2016, 10:19 p.m. UTC | #1
On Sat, May 07, 2016 at 01:36:21PM -0500, Alex Griffin wrote:
> This is a dependency of ledger. It's bundled in ledger's source but I
> think it's better to unbundle it. It's a bit unusual in that the headers
> contain the whole source.

> * gnu/packages/unicode.scm: New file.

Not a bad idea for a new module, but I wonder if you considered any of
the existing modules? Are none of them appropriate?

> +(define-public utfcpp

I'm curious — are there any significant differences between this and the
bundled library?

> +              (uri
> +               (string-append "mirror://sourceforge/project/utfcpp/utf8cpp_2x/Release%20"
> +                              version "/utf8_v"
> +                              (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version)
> +                              ".zip"))

Can you make sure these lines are < 80 characters?

Otherwise, LGTM!
diff mbox

Patch

From a476a987faa4aaae019836441021bb03241dde5d Mon Sep 17 00:00:00 2001
From: Alex Griffin <a@ajgrf.com>
Date: Sat, 7 May 2016 12:16:39 -0500
Subject: [PATCH 1/3] gnu: Add utfcpp.

* gnu/packages/unicode.scm: New file.
---
 gnu/packages/unicode.scm | 62 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)
 create mode 100644 gnu/packages/unicode.scm

diff --git a/gnu/packages/unicode.scm b/gnu/packages/unicode.scm
new file mode 100644
index 0000000..045d5a5
--- /dev/null
+++ b/gnu/packages/unicode.scm
@@ -0,0 +1,62 @@ 
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages unicode)
+ #:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix packages)
+ #:use-module (guix download)
+ #:use-module (guix build-system trivial)
+ #:use-module (gnu packages zip))
+
+(define-public utfcpp
+  (package
+    (name "utfcpp")
+    (version "2.3.4")
+    (source (origin
+              (method url-fetch)
+              (uri
+               (string-append "mirror://sourceforge/project/utfcpp/utf8cpp_2x/Release%20"
+                              version "/utf8_v"
+                              (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version)
+                              ".zip"))
+              (file-name (string-append name "-" version ".zip"))
+              (sha256
+               (base32
+                "1vqhs0aipcvvdrwcs7h3jsryg6mgbmc4s34n5cm6d36q4nxwwwrk"))))
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+       (begin
+         (use-modules (guix build utils))
+         (let ((source (assoc-ref %build-inputs "source"))
+               (out    (assoc-ref %outputs "out"))
+               (unzip  (string-append (assoc-ref %build-inputs "unzip")
+                                      "/bin/unzip")))
+           (mkdir-p out)
+           (with-directory-excursion out
+             (system* unzip source)
+             (mkdir-p "share/doc")
+             (rename-file "doc" "share/doc/utfcpp")
+             (rename-file "source" "include"))))))
+    (native-inputs `(("unzip" ,unzip)))
+    (home-page "https://github.com/nemtrif/utfcpp")
+    (synopsis "Portable C++ library for handling UTF-8")
+    (description "UTF8-CPP is a C++ library for handling UTF-8 encoded text
+                 in a portable way.")
+    (license license:boost1.0)))
-- 
2.7.4