all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ericbavier@openmailbox.org
To: guix-devel@gnu.org
Cc: Eric Bavier <bavier@member.fsf.org>
Subject: [PATCH 5/9] gnu: Add woff2.
Date: Tue,  5 Apr 2016 23:32:57 -0500	[thread overview]
Message-ID: <1459917181-19626-5-git-send-email-ericbavier@openmailbox.org> (raw)
In-Reply-To: <1459917181-19626-1-git-send-email-ericbavier@openmailbox.org>

From: Eric Bavier <bavier@member.fsf.org>

* gnu/packages/fontutils.scm (woff2): New variable.
* gnu/packages/patches/woff2-libbrotli.patch: New patch.
* gnu-system.am (dist_patch_DATA): Add it.
---
 gnu-system.am                              |  1 +
 gnu/packages/fontutils.scm                 | 39 ++++++++++++++
 gnu/packages/patches/woff2-libbrotli.patch | 84 ++++++++++++++++++++++++++++++
 3 files changed, 124 insertions(+)
 create mode 100644 gnu/packages/patches/woff2-libbrotli.patch

diff --git a/gnu-system.am b/gnu-system.am
index d3d08da..977a898 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -785,6 +785,7 @@ dist_patch_DATA =						\
   gnu/packages/patches/wicd-urwid-1.3.patch			\
   gnu/packages/patches/wicd-wpa2-ttls.patch			\
   gnu/packages/patches/wmctrl-64-fix.patch			\
+  gnu/packages/patches/woff2-libbrotli.patch			\
   gnu/packages/patches/wpa-supplicant-CVE-2015-5310.patch	\
   gnu/packages/patches/wpa-supplicant-CVE-2015-5314.patch	\
   gnu/packages/patches/wpa-supplicant-CVE-2015-5315.patch	\
diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm
index 1e2424b..75edd55 100644
--- a/gnu/packages/fontutils.scm
+++ b/gnu/packages/fontutils.scm
@@ -39,6 +39,7 @@
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix svn-download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu))
 
@@ -179,6 +180,44 @@ TTF (TrueType/OpenType Font) files.")
     (license license:bsd-2)
     (home-page "https://code.google.com/archive/p/ttf2eot/")))
 
+(define-public woff2
+  (let ((commit "4e698b8c6c5e070d53c340db9ddf160e21070ede"))
+    (package
+      (name "woff2")
+      (version (string-append "20160306." (string-take commit 7)))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/google/woff2.git")
+                      (commit commit)))
+                (file-name (string-append name "-" version ".tar.xz"))
+                (sha256
+                 (base32
+                  "0wka0yhf0cjmd4rv2jckxpyv6lb5ckj4nj0k1ajq5hrjy7f30lcp"))
+                (patches (map search-patch '("woff2-libbrotli.patch")))))
+      (build-system gnu-build-system)
+      (native-inputs
+       `(("pkg-config" ,pkg-config)))
+      (inputs
+       `(("brotli" ,brotli)))
+      (arguments
+       `(#:tests? #f                    ;no tests
+         #:phases (modify-phases %standard-phases
+                    (delete 'configure)
+                    (replace 'install
+                      (lambda* (#:key outputs #:allow-other-keys)
+                        (let* ((out (assoc-ref outputs "out"))
+                               (bin (string-append out "/bin")))
+                          (install-file "woff2_compress" bin)
+                          (install-file "woff2_decompress" bin)
+                          #t))))))
+      (synopsis "Compress TrueType fonts to WOFF2")
+      (description
+       "This package provides utilities for compressing/decompressing TrueType
+fonts to/from the WOFF2 format.")
+      (license license:asl2.0)
+      (home-page "https://github.com/google/woff2"))))
+
 (define-public fontconfig
   (package
    (name "fontconfig")
diff --git a/gnu/packages/patches/woff2-libbrotli.patch b/gnu/packages/patches/woff2-libbrotli.patch
new file mode 100644
index 0000000..47539c8
--- /dev/null
+++ b/gnu/packages/patches/woff2-libbrotli.patch
@@ -0,0 +1,84 @@
+From: Eric Bavier <bavier@member.fsf.org>
+Date: Sat, 2 Apr 2016 01:31:03 -0500
+Subject: [PATCH] Build against external libbrotli.
+
+---
+ Makefile         | 20 ++++----------------
+ src/woff2_dec.cc |  2 +-
+ src/woff2_enc.cc |  2 +-
+ 3 files changed, 6 insertions(+), 18 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 92b8d54..618a751 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,6 +1,6 @@
+ OS := $(shell uname)
+ 
+-CPPFLAGS = -I./brotli/dec/ -I./brotli/enc/ -I./src
++CPPFLAGS := -I./src $(shell pkg-config --cflags libbrotlienc libbrotlidec)
+ 
+ CC ?= gcc
+ CXX ?= g++
+@@ -22,29 +22,17 @@ OUROBJ = font.o glyph.o normalize.o table_tags.o transform.o \
+          woff2_dec.o woff2_enc.o woff2_common.o woff2_out.o \
+          variable_length.o
+ 
+-BROTLI = brotli
+-ENCOBJ = $(BROTLI)/enc/*.o
+-DECOBJ = $(BROTLI)/dec/*.o
++BROTLI_LIBS := $(shell pkg-config --libs libbrotlienc libbrotlidec)
+ 
+ OBJS = $(patsubst %, $(SRCDIR)/%, $(OUROBJ))
+ EXECUTABLES=woff2_compress woff2_decompress
+ 
+ EXE_OBJS=$(patsubst %, $(SRCDIR)/%.o, $(EXECUTABLES))
+ 
+-ifeq (,$(wildcard $(BROTLI)/*))
+-  $(error Brotli dependency not found : you must initialize the Git submodule)
+-endif
+-
+ all : $(OBJS) $(EXECUTABLES)
+ 
+-$(EXECUTABLES) : $(EXE_OBJS) deps
+-	$(CXX) $(LFLAGS) $(OBJS) $(ENCOBJ) $(DECOBJ) $(SRCDIR)/$@.o -o $@
+-
+-deps :
+-	$(MAKE) -C $(BROTLI)/dec
+-	$(MAKE) -C $(BROTLI)/enc
++$(EXECUTABLES) : $(EXE_OBJS)
++	$(CXX) $(LDFLAGS) $(OBJS) $(SRCDIR)/$@.o -o $@ $(BROTLI_LIBS) $(LIBS)
+ 
+ clean :
+ 	rm -f $(OBJS) $(EXE_OBJS) $(EXECUTABLES)
+-	$(MAKE) -C $(BROTLI)/dec clean
+-	$(MAKE) -C $(BROTLI)/enc clean
+diff --git a/src/woff2_dec.cc b/src/woff2_dec.cc
+index 837eede..98c01ce 100644
+--- a/src/woff2_dec.cc
++++ b/src/woff2_dec.cc
+@@ -27,7 +27,7 @@
+ #include <memory>
+ #include <utility>
+ 
+-#include "./decode.h"
++#include "brotli/dec/decode.h"
+ #include "./buffer.h"
+ #include "./port.h"
+ #include "./round.h"
+diff --git a/src/woff2_enc.cc b/src/woff2_enc.cc
+index 920c614..00d74da 100644
+--- a/src/woff2_enc.cc
++++ b/src/woff2_enc.cc
+@@ -23,7 +23,7 @@
+ #include <string>
+ #include <vector>
+ 
+-#include "./encode.h"
++#include "brotli/enc/encode.h"
+ #include "./buffer.h"
+ #include "./font.h"
+ #include "./normalize.h"
+-- 
+2.7.3
+
-- 
2.7.3

  parent reply	other threads:[~2016-04-06  4:33 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-06  4:32 [PATCH 1/9] gnu: Add ttfautohint ericbavier
2016-04-06  4:32 ` [PATCH 2/9] gnu: Add woff-tools ericbavier
2016-04-07  6:18   ` Efraim Flashner
2016-04-07 14:25     ` Eric Bavier
2016-04-13 21:37     ` Ludovic Courtès
2016-04-06  4:32 ` [PATCH 3/9] gnu: Add ttf2eot ericbavier
2016-04-07  6:24   ` Efraim Flashner
2016-04-07 14:30     ` Eric Bavier
2016-04-08  3:49     ` Eric Bavier
2016-04-13 21:39       ` Ludovic Courtès
2016-04-06  4:32 ` [PATCH 4/9] gnu: Add brotli ericbavier
2016-04-13 21:44   ` Ludovic Courtès
2016-04-06  4:32 ` ericbavier [this message]
2016-04-06  4:32 ` [PATCH 6/9] gnu: fontforge: Make SVG builds reproducible ericbavier
2016-04-06 17:36   ` Leo Famulari
2016-04-06 17:44     ` Eric Bavier
2016-04-06 17:56       ` Leo Famulari
2016-04-06  4:32 ` [PATCH 7/9] gnu: Add font-fantasque-sans ericbavier
2016-04-06  4:33 ` [PATCH 8/9] gnu: fontforge: Use modify-phases ericbavier
2016-04-06  4:33 ` [PATCH 9/9] gnu: fontforge: Install 'showttf' tool ericbavier
2016-04-06 12:13 ` [PATCH 1/9] gnu: Add ttfautohint Alex Kost
2016-04-06 14:57   ` Eric Bavier
2016-04-07  9:52     ` Specifying package patches in a more convenient form Alex Kost
2016-04-07 10:08       ` Andy Wingo
2016-04-07 14:41         ` Eric Bavier
2016-04-08  8:05         ` Alex Kost
2016-04-09 14:43           ` Ludovic Courtès
2016-04-07 21:54       ` Ludovic Courtès
2016-04-09  8:22         ` Alex Kost
2016-04-09 11:42         ` Andreas Enge
2016-04-09 16:40           ` Alex Kost
2016-04-13 21:40     ` [PATCH 1/9] gnu: Add ttfautohint Ludovic Courtès
2016-04-13 21:36 ` Ludovic Courtès
2016-04-14 14:43   ` Eric Bavier

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=1459917181-19626-5-git-send-email-ericbavier@openmailbox.org \
    --to=ericbavier@openmailbox.org \
    --cc=bavier@member.fsf.org \
    --cc=guix-devel@gnu.org \
    /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.