From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:33548) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isCL8-0002vB-AA for guix-patches@gnu.org; Thu, 16 Jan 2020 16:06:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1isCL4-0007qL-LT for guix-patches@gnu.org; Thu, 16 Jan 2020 16:06:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60693) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1isCL4-0007pl-4D for guix-patches@gnu.org; Thu, 16 Jan 2020 16:06:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1isCL3-0008EQ-Tx for guix-patches@gnu.org; Thu, 16 Jan 2020 16:06:01 -0500 Subject: [bug#39086] [PATCH 2/5] gnu: Add unicode-emoji. Resent-Message-ID: References: <20200111120829.29821-1-leo.prikler@student.tugraz.at> <20200111120829.29821-2-leo.prikler@student.tugraz.at> From: Ricardo Wurmus In-reply-to: <20200111120829.29821-2-leo.prikler@student.tugraz.at> Date: Thu, 16 Jan 2020 22:04:44 +0100 Message-ID: <87k15rxgcz.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Leo Prikler Cc: 39086@debbugs.gnu.org Hi Leo, > * gnu/packages/ibus.scm (unicode-emoji): New package. Thank you for these patches! > +(define-public unicode-emoji > + (package > + (name "unicode-emoji") > + (version "12.0") > + (source #f) It=E2=80=99s pretty unusual to not provide a source. This will also make = =E2=80=9Cguix build -S unicode-emoji=E2=80=9D turn up nothing. It may be a good idea to elevate at least one of the inputs to =E2=80=9Csource=E2=80=9D status. Ideally, all of the inputs would be considered sources like we=E2=80=99re d= oing it for texlive-* packages. It=E2=80=99s a pity that we can=E2=80=99t expre= ss multiple URLs for the url-fetch method. > + (build-system trivial-build-system) > + (arguments > + `(#:modules ((guix build utils)) > + #:builder > + (let ((out (string-append %output "/share/unicode/emoji"))) > + (use-modules (guix build utils)) > + (mkdir-p out) > + (for-each > + (lambda (input) > + (copy-file > + (cdr input) > + (string-append out "/" > + (substring (car input) 8) ; strip "unicode-" > + ".txt"))) We don=E2=80=99t like to use CAR and CDR, because they feel so 80s=E2=80=A6= :) We prefer to use MATCH instead, because that feels more like the 90s. You could also use MATCH-LAMBDA. Using a magical 8 also doesn=E2=80=99t feel right. You only need to strip = the =E2=80=9Cunicode-=E2=80=9D prefix because you chose to use it in the labels= of these inputs. I don=E2=80=99t know=E2=80=A6 I feel that there=E2=80=99s a pretti= er way to express this, but perhaps there=E2=80=99s no *shorter* way. > + (inputs > + `(("unicode-emoji-data" > + ,(origin > + (method url-fetch) > + (uri "https://www.unicode.org/Public/emoji/12.0/emoji-data.tx= t") > + (sha256 > + (base32 "03sf7h1d6kb9m5s02lif88jsi5kjszpkfvcymaqxj8ds70ar9pg= v")))) > + ("unicode-emoji-sequences" > + ,(origin > + (method url-fetch) > + (uri "https://www.unicode.org/Public/emoji/12.0/emoji-sequenc= es.txt") > + (sha256 > + (base32 "1hghki2rn3n7m4lwpwi2a5wrsf2nij4bxga9ldabx4g0g2k23sv= s")))) > + ("unicode-emoji-test" > + ,(origin > + (method url-fetch) > + (uri "https://www.unicode.org/Public/emoji/12.0/emoji-test.tx= t") > + (sha256 > + (base32 "1dqd0fh999mh6naj816ni113m9dimfy3ih9nffjq2lrv9mmlgdc= k")))) > + ("unicode-emoji-variation-sequences" > + ,(origin > + (method url-fetch) > + (uri "https://www.unicode.org/Public/emoji/12.0/emoji-variati= on-sequences.txt") > + (sha256 > + (base32 "1cccwx5bl79w4c19vi5dhjqxrph92s8hihp9y8s2cqvdzmgbln7= a")))) > + ("unicode-emoji-zwj-sequences" > + ,(origin > + (method url-fetch) > + (uri "https://www.unicode.org/Public/emoji/12.0/emoji-zwj-seq= uences.txt") > + (sha256 > + (base32 "1l791nbijmmhwa7kmvfn8gp26ban512l6mgqpz1mnbq3xm19181= n")))))) Please use the version string from above in the URLs here. It=E2=80=99s ju= st a little less to update when upgrading the package in the future. > + (description > + "Data files for the Unicode Technological Standard #51 > (Emoji).") Please use a complete sentence here. -- Ricardo