gnu: datefudge: Update to 1.23.
[jackhill/guix/guix.git] / gnu / packages / patches / woff2-libbrotli.patch
1 From: Eric Bavier <bavier@member.fsf.org>
2 Date: Sat, 2 Apr 2016 01:31:03 -0500
3 Subject: [PATCH] Build against external libbrotli.
4
5 ---
6 Makefile | 20 ++++----------------
7 src/woff2_dec.cc | 2 +-
8 src/woff2_enc.cc | 2 +-
9 3 files changed, 6 insertions(+), 18 deletions(-)
10
11 diff --git a/Makefile b/Makefile
12 index 92b8d54..618a751 100644
13 --- a/Makefile
14 +++ b/Makefile
15 @@ -1,6 +1,6 @@
16 OS := $(shell uname)
17
18 -CPPFLAGS = -I./brotli/dec/ -I./brotli/enc/ -I./src
19 +CPPFLAGS := -I./src $(shell pkg-config --cflags libbrotlienc libbrotlidec)
20
21 CC ?= gcc
22 CXX ?= g++
23 @@ -22,29 +22,17 @@ OUROBJ = font.o glyph.o normalize.o table_tags.o transform.o \
24 woff2_dec.o woff2_enc.o woff2_common.o woff2_out.o \
25 variable_length.o
26
27 -BROTLI = brotli
28 -ENCOBJ = $(BROTLI)/enc/*.o
29 -DECOBJ = $(BROTLI)/dec/*.o
30 +BROTLI_LIBS := $(shell pkg-config --libs libbrotlienc libbrotlidec)
31
32 OBJS = $(patsubst %, $(SRCDIR)/%, $(OUROBJ))
33 EXECUTABLES=woff2_compress woff2_decompress
34
35 EXE_OBJS=$(patsubst %, $(SRCDIR)/%.o, $(EXECUTABLES))
36
37 -ifeq (,$(wildcard $(BROTLI)/*))
38 - $(error Brotli dependency not found : you must initialize the Git submodule)
39 -endif
40 -
41 all : $(OBJS) $(EXECUTABLES)
42
43 -$(EXECUTABLES) : $(EXE_OBJS) deps
44 - $(CXX) $(LFLAGS) $(OBJS) $(ENCOBJ) $(DECOBJ) $(SRCDIR)/$@.o -o $@
45 -
46 -deps :
47 - $(MAKE) -C $(BROTLI)/dec
48 - $(MAKE) -C $(BROTLI)/enc
49 +$(EXECUTABLES) : $(EXE_OBJS) $(OBJS)
50 + $(CXX) $(LDFLAGS) $(OBJS) $(SRCDIR)/$@.o -o $@ $(BROTLI_LIBS) $(LIBS)
51
52 clean :
53 rm -f $(OBJS) $(EXE_OBJS) $(EXECUTABLES)
54 - $(MAKE) -C $(BROTLI)/dec clean
55 - $(MAKE) -C $(BROTLI)/enc clean
56 diff --git a/src/woff2_dec.cc b/src/woff2_dec.cc
57 index 837eede..98c01ce 100644
58 --- a/src/woff2_dec.cc
59 +++ b/src/woff2_dec.cc
60 @@ -27,7 +27,7 @@
61 #include <memory>
62 #include <utility>
63
64 -#include "./decode.h"
65 +#include "brotli/dec/decode.h"
66 #include "./buffer.h"
67 #include "./port.h"
68 #include "./round.h"
69 diff --git a/src/woff2_enc.cc b/src/woff2_enc.cc
70 index 920c614..00d74da 100644
71 --- a/src/woff2_enc.cc
72 +++ b/src/woff2_enc.cc
73 @@ -23,7 +23,7 @@
74 #include <string>
75 #include <vector>
76
77 -#include "./encode.h"
78 +#include "brotli/enc/encode.h"
79 #include "./buffer.h"
80 #include "./font.h"
81 #include "./normalize.h"
82 --
83 2.7.3
84