From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: [PATCH 1/3] gnu: Add utfcpp. Date: Sun, 08 May 2016 11:13:35 +0300 Message-ID: <87h9e9ge6o.fsf@gmail.com> References: <1462646181.1130095.601018617.5F6ADC8F@webmail.messagingengine.com> <20160507221923.GA16050@jasmine> <1462673439.1215291.601202577.5D6E31AB@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azJqV-0005Lq-Ps for guix-devel@gnu.org; Sun, 08 May 2016 04:13:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1azJqR-0004Q5-Fm for guix-devel@gnu.org; Sun, 08 May 2016 04:13:46 -0400 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]:35402) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azJqR-0004Q1-41 for guix-devel@gnu.org; Sun, 08 May 2016 04:13:43 -0400 Received: by mail-lf0-x241.google.com with SMTP id u64so17872133lff.2 for ; Sun, 08 May 2016 01:13:42 -0700 (PDT) In-Reply-To: <1462673439.1215291.601202577.5D6E31AB@webmail.messagingengine.com> (Alex Griffin's message of "Sat, 07 May 2016 21:10:39 -0500") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Alex Griffin Cc: guix-devel@gnu.org Alex Griffin (2016-05-08 05:10 +0300) wrote: > On Sat, May 7, 2016, at 05:19 PM, Leo Famulari wrote: >> Not a bad idea for a new module, but I wonder if you considered any of >> the existing modules? Are none of them appropriate? > > Nothing else seemed to fit, but I'm open to suggestions. I suggest (gnu packages textutils); I see 'utf8proc' is placed there. I think this is also a suitable module for 'libunistring' (currently it is placed in its own file), but it's a separate question. > From b91d9f45339b78965af46a951a0922c29cd1de95 Mon Sep 17 00:00:00 2001 > From: Alex Griffin > 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 | 63 ++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 63 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..e386b0b > --- /dev/null > +++ b/gnu/packages/unicode.scm > @@ -0,0 +1,63 @@ > +;;; GNU Guix --- Functional package management for GNU > +;;; Copyright © 2016 Alex Griffin > +;;; > +;;; 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 . > + > +(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)) Not a big thing but we indent '#:use-module' by 2 spaces. Out of curiosity: what editor do you use? > + > +(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")))) I don't know whether we have an idiomatic way to convert "2.3.4" into "2_3_4", but I would just use a tarball from github: (source (origin (method url-fetch) (uri (string-append "https://github.com/nemtrif/utfcpp/archive/v" version ".tar.gz")) (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 "1x36184rsxiskwdkkz7hnpp6qvqckl04bxj5db9dnwyii1zx09hs")))) But let's wait for other opinions. > + (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.") Please don't add leading spaces in descriptions :-) > + (license license:boost1.0))) -- Alex