unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Alex Griffin <a@ajgrf.com>
To: Arun Isaac <arunisaac@systemreboot.net>
Cc: 27107@debbugs.gnu.org
Subject: bug#27107: [PATCH] gnu: font-comic-neue: Add fontconfig alias.
Date: Wed, 31 May 2017 12:01:12 -0500	[thread overview]
Message-ID: <1496250072.375362.994392200.179AAF09@webmail.messagingengine.com> (raw)
In-Reply-To: <971c125f.ADsAAg_HJlUAAAAAAAAAAAPFkxsAAAACwQwAAAAAAAW9WABZKv0R@mailjet.com>

[-- Attachment #1: Type: text/plain, Size: 278 bytes --]

On Sun, May 28, 2017, at 11:38 AM, Arun Isaac wrote:
> Finally, we should have two patches -- the first patch to re-indent and
> switch to the new font-build-system, the second patch to add the
> fontconfig alias.

Okay, attached are the changes you asked for.
-- 
Alex Griffin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-font-comic-neue-Use-font-build-system.patch --]
[-- Type: text/x-patch; name="0001-gnu-font-comic-neue-Use-font-build-system.patch", Size: 3167 bytes --]

From d64d948dabfde51dc982363168ac46ecddf84f10 Mon Sep 17 00:00:00 2001
From: Alex Griffin <a@ajgrf.com>
Date: Wed, 31 May 2017 11:41:52 -0500
Subject: [PATCH 1/2] gnu: font-comic-neue: Use 'font-build-system'.

* gnu/packages/fonts.scm (font-comic-neue): Switch to font-build-system.
Re-indent.
[source]: Use url-fetch/zipbomb.
[native-inputs]: Remove dependency on unzip.
---
 gnu/packages/fonts.scm | 53 ++++++++++++++++++++------------------------------
 1 file changed, 21 insertions(+), 32 deletions(-)

diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm
index ef0642f79..c2ce783c8 100644
--- a/gnu/packages/fonts.scm
+++ b/gnu/packages/fonts.scm
@@ -1166,39 +1166,28 @@ later hand-tweaked with the gbdfed(1) editor:
 
 (define-public font-comic-neue
   (package
-   (name "font-comic-neue")
-   (version "2.3")
-   (source (origin
-            (method url-fetch)
-            (uri (string-append
-                  "http://www.comicneue.com/comic-neue-" version ".zip"))
-            (sha256
-             (base32
-              "1695hkpd8kqnr2a88p8xs496slgzxjjkzpa9aa33ml3pnh7519zk"))))
-   (build-system trivial-build-system)
-   (arguments
-    `(#:modules ((guix build utils))
-      #:builder (begin
-                  (use-modules (guix build utils))
-                  (let ((font-dir (string-append %output
-                                                 "/share/fonts/truetype"))
-                        (source (assoc-ref %build-inputs "source"))
-                        (unzip  (string-append (assoc-ref %build-inputs "unzip")
-                                               "/bin/unzip")))
-                    (mkdir-p font-dir)
-                    (system* unzip source)
-                    (with-directory-excursion
-                     (string-append "Web")
-                     (for-each (lambda (ttf)
-                                 (install-file ttf font-dir))
-                               (find-files "." "\\.ttf$")))))))
-   (native-inputs `(("unzip" ,unzip)))
-   (home-page "http://www.comicneue.com/")
-   (synopsis "Font that fixes the shortcomings of Comic Sans")
-   (description
-    "Comic Neue is a font that attempts to create a respectable casual
+    (name "font-comic-neue")
+    (version "2.3")
+    (source (origin
+              (method url-fetch/zipbomb)
+              (uri (string-append
+                    "http://www.comicneue.com/comic-neue-" version ".zip"))
+              (sha256
+               (base32
+                "1695hkpd8kqnr2a88p8xs496slgzxjjkzpa9aa33ml3pnh7519zk"))))
+    (build-system font-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'install 'chdir
+           (lambda _
+             (chdir "Web"))))))
+    (home-page "http://www.comicneue.com/")
+    (synopsis "Font that fixes the shortcomings of Comic Sans")
+    (description
+     "Comic Neue is a font that attempts to create a respectable casual
 typeface, by mimicking Comic Sans while fixing its most obvious shortcomings.")
-   (license license:silofl1.1)))
+    (license license:silofl1.1)))
 
 (define-public font-iosevka
   (package
-- 
2.13.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-gnu-font-comic-neue-Add-fontconfig-alias.patch --]
[-- Type: text/x-patch; name="0002-gnu-font-comic-neue-Add-fontconfig-alias.patch", Size: 1714 bytes --]

From 5e7d72d7a23eefd862273a0c57dadd11117d5abf Mon Sep 17 00:00:00 2001
From: Alex Griffin <a@ajgrf.com>
Date: Wed, 31 May 2017 11:51:41 -0500
Subject: [PATCH 2/2] gnu: font-comic-neue: Add fontconfig alias.

* gnu/packages/fonts.scm (font-comic-neue): Add fontconfig alias for
Comic Sans.
[arguments]: Add new 'install-conf' phase.
---
 gnu/packages/fonts.scm | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm
index c2ce783c8..746981806 100644
--- a/gnu/packages/fonts.scm
+++ b/gnu/packages/fonts.scm
@@ -1181,7 +1181,26 @@ later hand-tweaked with the gbdfed(1) editor:
        (modify-phases %standard-phases
          (add-before 'install 'chdir
            (lambda _
-             (chdir "Web"))))))
+             (chdir "Web")))
+         (add-after 'install 'install-conf
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((conf-dir (string-append (assoc-ref outputs "out")
+                                            "/share/fontconfig/conf.avail")))
+               (mkdir-p conf-dir)
+               (call-with-output-file
+                   (string-append conf-dir "/30-comic-neue.conf")
+                 (lambda (port)
+                   (format port "<?xml version=\"1.0\"?>
+<!DOCTYPE fontconfig SYSTEM \"fonts.dtd\">
+<fontconfig>
+  <!-- If Comic Sans is missing, use Comic Neue instead. -->
+  <alias>
+    <family>Comic Sans MS</family>
+    <prefer>
+      <family>Comic Neue</family>
+    </prefer>
+  </alias>
+</fontconfig>\n")))))))))
     (home-page "http://www.comicneue.com/")
     (synopsis "Font that fixes the shortcomings of Comic Sans")
     (description
-- 
2.13.0


  parent reply	other threads:[~2017-05-31 17:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-27 18:54 bug#27107: [PATCH] gnu: font-comic-neue: Add fontconfig alias Alex Griffin
2017-05-28 16:38 ` Arun Isaac
     [not found] ` <971c125f.ADsAAg_HJlUAAAAAAAAAAAPFkxsAAAACwQwAAAAAAAW9WABZKv0R@mailjet.com>
2017-05-31 17:01   ` Alex Griffin [this message]
2017-06-01 13:50     ` Arun Isaac
     [not found]     ` <c757126b.AEEALPlfx1UAAAAAAAAAAAPFkxsAAAACwQwAAAAAAAW9WABZMBvE@mailjet.com>
2017-06-01 14:03       ` Alex Griffin
2017-06-01 15:12         ` Arun Isaac
     [not found]         ` <ed110519.AEUAKvsBN2MAAAAAAAAAAAPFkxsAAAACwQwAAAAAAAW9WABZMC7e@mailjet.com>
2017-06-01 15:34           ` Alex Griffin
2017-06-01 15:48             ` Alex Griffin
2017-06-01 16:01               ` Arun Isaac
2017-06-01 16:50               ` Arun Isaac
     [not found]               ` <59879525.AEMAK8sFRAAAAAAAAAAAAAPFkxsAAAACwQwAAAAAAAW9WABZMEXM@mailjet.com>
2017-06-01 18:11                 ` Alex Griffin
2017-06-01 18:46                   ` Arun Isaac
2017-05-31 19:56 ` Alex Griffin

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1496250072.375362.994392200.179AAF09@webmail.messagingengine.com \
    --to=a@ajgrf.com \
    --cc=27107@debbugs.gnu.org \
    --cc=arunisaac@systemreboot.net \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).