From: Andreas Enge <andreas@enge.fr>
To: 宋文武 <iyzsong@gmail.com>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: [PATCH] gnu: Add font-adobe-source-han-sans.
Date: Fri, 27 Feb 2015 11:14:05 +0100 [thread overview]
Message-ID: <20150227101405.GA5686@debian.eduroam.u-bordeaux.fr> (raw)
In-Reply-To: <CAHZE2pdJ_P+4wpBha7Em8HcLRrPDRo_iE1R6+NpzCdgnvzxtkw@mail.gmail.com>
Great, thanks for your work!
On Fri, Feb 27, 2015 at 02:02:56PM +0800, 宋文武 wrote:
> + (outputs '("out" "cn" "jp" "kr" "tw"))
I wondered if that was needed, but after downloading the source, I agree it
is the right thing to do!
> + (build-system gnu-build-system)
I would go for trivial-build-system here. Or the unpack-build-system
that has not yet been written :-)
> + (lambda* (#:key outputs #:allow-other-keys)
> + (define (install-opentype-font font out)
> + (let* ((font-dir (string-append out "/share/fonts/opentype"))
> + (newfont (string-append font-dir "/" (basename font))))
> + (mkdir-p font-dir)
> + (copy-file font newfont)))
I think it would be more elegant to use
(let ((install-opentype-font (lambda (font out) ...
here; it defines a variable install-opentype-font for the expression inside
the body of "let", and this variable contains a function.
> + ;; Install OpenType/CFF collection (OTC).
> + (for-each (cut install-opentype-font <> (assoc-ref outputs "out"))
> + (find-files "OTC" "\\.ttc"))
If I see correctly, this copies each file separately, but also calls
"(mkdir-p font-dir)" each time, right? The output directories should be
created only once. You can use "copy-recursively" from (guix build utils),
see a few examples in the distribution.
Maybe add a comment what is in "out" (truetype fonts?) and in the other
outputs (open type fonts?).
Andreas
next prev parent reply other threads:[~2015-02-27 10:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-27 6:02 [PATCH] gnu: Add font-adobe-source-han-sans 宋文武
2015-02-27 10:14 ` Andreas Enge [this message]
2015-02-27 10:16 ` Andreas Enge
2015-02-28 3:23 ` 宋文武
2015-02-28 9:46 ` Andreas Enge
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150227101405.GA5686@debian.eduroam.u-bordeaux.fr \
--to=andreas@enge.fr \
--cc=guix-devel@gnu.org \
--cc=iyzsong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.