From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Enge Subject: Re: [PATCH] gnu: Add font-adobe-source-han-sans. Date: Fri, 27 Feb 2015 11:14:05 +0100 Message-ID: <20150227101405.GA5686@debian.eduroam.u-bordeaux.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRHw0-0005tL-S7 for guix-devel@gnu.org; Fri, 27 Feb 2015 05:14:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YRHvw-0005uV-O5 for guix-devel@gnu.org; Fri, 27 Feb 2015 05:14:16 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:57768) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRHvw-0005uP-FE for guix-devel@gnu.org; Fri, 27 Feb 2015 05:14:12 -0500 Content-Disposition: inline In-Reply-To: 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: =?utf-8?B?5a6L5paH5q2m?= Cc: Guix-devel 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