diff mbox series

[v2/next,1/4] brotli: new package

Message ID 20180323185942.60252-2-aperez@igalia.com
State Accepted
Commit 4f634160b2a106f7e34b4bb018b34e77c8dda2a9
Headers show
Series [v2/next,1/4] brotli: new package | expand

Commit Message

Adrian Perez de Castro March 23, 2018, 6:59 p.m. UTC
Add the brotli package to Buildroot. This is needed by woff2, which in
turn is needed by webkitgtk from version 2.20.0 onwards. WebKitGTK+ used
to bundle a copy of the library, but it stopped doing so now that the
upstream has started making releases.

Signed-off-by: Adrian Perez de Castro <aperez@igalia.com>
---
 DEVELOPERS                 |  1 +
 package/Config.in          |  1 +
 package/brotli/Config.in   | 12 ++++++++++++
 package/brotli/brotli.hash |  5 +++++
 package/brotli/brotli.mk   | 17 +++++++++++++++++
 5 files changed, 36 insertions(+)
 create mode 100644 package/brotli/Config.in
 create mode 100644 package/brotli/brotli.hash
 create mode 100644 package/brotli/brotli.mk

Comments

Peter Korsgaard March 24, 2018, 10:45 a.m. UTC | #1
>>>>> "Adrian" == Adrian Perez de Castro <aperez@igalia.com> writes:

 > Add the brotli package to Buildroot. This is needed by woff2, which in
 > turn is needed by webkitgtk from version 2.20.0 onwards. WebKitGTK+ used
 > to bundle a copy of the library, but it stopped doing so now that the
 > upstream has started making releases.

 > Signed-off-by: Adrian Perez de Castro <aperez@igalia.com>
 > +++ b/package/brotli/brotli.hash
 > @@ -0,0 +1,5 @@

 > +# Locally generated:
 > +sha512  93adcf437d730ac403e444285ac8aefbb2c8a6b5e1b064e8ee33684c067287a8159e0ee73d2217c167881e87da73fa494792d963a15508fd42b2ac4a5b52823c  v1.0.3.tar.gz
 > +
 > +# Hash for license files:
 > +sha512  16d7a62757f9854cd0ff9750eb0b374a1360deded0ba1646fde430f79a8f7c36a85f4884faaf1ea90db02537cd8d8c314cfcbcf492be25af24e1e77aa5919ebb  LICENSE

Odd, your license hash didn't match here:

ERROR: LICENSE has wrong sha512 hash:
ERROR: expected: 16d7a62757f9854cd0ff9750eb0b374a1360deded0ba1646fde430f79a8f7c36a85f4884faaf1ea90db02537cd8d8c314cfcbcf492be25af24e1e77aa5919ebb
ERROR: got     : bae78184c2f50f86d8c727826d3982c469454c42b9af81f4ef007e39036434fa894cf5be3bf5fc65b7de2301f0a72d067a8186e303327db8a96bd14867e0a3a8
ERROR: Incomplete download, or man-in-the-middle (MITM) attack
package/brotli/brotli.mk:17: recipe for target 'brotli-legal-info' failed

I've fixed that and committed, thanks.
Thomas Petazzoni April 2, 2018, 8:25 p.m. UTC | #2
Hello,

On Fri, 23 Mar 2018 20:59:39 +0200, Adrian Perez de Castro wrote:
> Add the brotli package to Buildroot. This is needed by woff2, which in
> turn is needed by webkitgtk from version 2.20.0 onwards. WebKitGTK+ used
> to bundle a copy of the library, but it stopped doing so now that the
> upstream has started making releases.
> 
> Signed-off-by: Adrian Perez de Castro <aperez@igalia.com>

Brotli is detected by libcurl, and it causes a build failure, at least
in some situations:

  http://autobuild.buildroot.net/results/64b/64bc0dfe284206390ae0680b94c0876863a3c0f3/build-end.log

Could you have a look ?

Thanks!

Thomas
Adrian Perez de Castro April 2, 2018, 10:07 p.m. UTC | #3
On Mon, 2 Apr 2018 22:25:09 +0200, Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:
> Hello,
> 
> On Fri, 23 Mar 2018 20:59:39 +0200, Adrian Perez de Castro wrote:
> > Add the brotli package to Buildroot. This is needed by woff2, which in
> > turn is needed by webkitgtk from version 2.20.0 onwards. WebKitGTK+ used
> > to bundle a copy of the library, but it stopped doing so now that the
> > upstream has started making releases.
> > 
> > Signed-off-by: Adrian Perez de Castro <aperez@igalia.com>
> 
> Brotli is detected by libcurl, and it causes a build failure, at least
> in some situations:
> 
>   http://autobuild.buildroot.net/results/64b/64bc0dfe284206390ae0680b94c0876863a3c0f3/build-end.log
> 
> Could you have a look ?

Sure, from the looks of it the curl config scripts are not adding
-lbrotlicommon when doing static builds, hence the missing symbols. I'll
see what I can come up with, likely this will end up with a patch sent to
curl upstream.

Now it's a bit late for me, so I'll continue with it tomorrow.

Thanks for the heads up!


--
 Adrián 🎩
Peter Korsgaard April 2, 2018, 10:30 p.m. UTC | #4
>>>>> "Adrian" == Adrian Perez de Castro <aperez@igalia.com> writes:

Hi,

 >> Brotli is detected by libcurl, and it causes a build failure, at least
 >> in some situations:
 >> 
 >> http://autobuild.buildroot.net/results/64b/64bc0dfe284206390ae0680b94c0876863a3c0f3/build-end.log
 >> 
 >> Could you have a look ?

 > Sure, from the looks of it the curl config scripts are not adding
 > -lbrotlicommon when doing static builds, hence the missing symbols. I'll
 > see what I can come up with, likely this will end up with a patch sent to
 > curl upstream.

 > Now it's a bit late for me, so I'll continue with it tomorrow.

I already committed Baruch' fix:

https://git.buildroot.net/buildroot/commit/?id=e7d658e0291b78553bf4eca704f0d0202bcf031f
Adrian Perez de Castro April 3, 2018, 5:15 p.m. UTC | #5
On Tue, 03 Apr 2018 00:30:16 +0200, Peter Korsgaard <peter@korsgaard.com> wrote:
> >>>>> "Adrian" == Adrian Perez de Castro <aperez@igalia.com> writes:
> 
> Hi,
> 
>  >> Brotli is detected by libcurl, and it causes a build failure, at least
>  >> in some situations:
>  >> 
>  >> http://autobuild.buildroot.net/results/64b/64bc0dfe284206390ae0680b94c0876863a3c0f3/build-end.log
>  >> 
>  >> Could you have a look ?
> 
>  > Sure, from the looks of it the curl config scripts are not adding
>  > -lbrotlicommon when doing static builds, hence the missing symbols. I'll
>  > see what I can come up with, likely this will end up with a patch sent to
>  > curl upstream.
> 
>  > Now it's a bit late for me, so I'll continue with it tomorrow.
> 
> I already committed Baruch' fix:
> 
> https://git.buildroot.net/buildroot/commit/?id=e7d658e0291b78553bf4eca704f0d0202bcf031f

Oh, that's lovely — thanks!

(Odd that the curl “configure” script only uses “pkg-config” when the flag
“--with-brotli” is passed explicitly... ¯\_(ツ)_/¯)


--
 Adrián 🎩
diff mbox series

Patch

diff --git a/DEVELOPERS b/DEVELOPERS
index 1faefc45fc..2d5f2108a8 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -62,6 +62,7 @@  F:	package/setools/
 F:	package/sngrep/
 
 N:	Adrian Perez de Castro <aperez@igalia.com>
+F:	package/brotli/
 F:	package/libepoxy/
 F:	package/webkitgtk/
 
diff --git a/package/Config.in b/package/Config.in
index 58dfd6306d..26ded5ebb2 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -63,6 +63,7 @@  menu "Audio and video applications"
 endmenu
 
 menu "Compressors and decompressors"
+	source "package/brotli/Config.in"
 	source "package/bzip2/Config.in"
 	source "package/gzip/Config.in"
 	source "package/lz4/Config.in"
diff --git a/package/brotli/Config.in b/package/brotli/Config.in
new file mode 100644
index 0000000000..e40f5b6b9f
--- /dev/null
+++ b/package/brotli/Config.in
@@ -0,0 +1,12 @@ 
+config BR2_PACKAGE_BROTLI
+	bool "brotli"
+	help
+	  Generic-purpose lossless compression library. The algorithm
+	  compresses data using a combination of a modern variant of
+	  the LZ77 algorithm, Huffman coding and 2nd order context
+	  modeling, with a compression ratio comparable to the best
+	  currently available general-purpose compression methods. It
+	  is similar in speed with deflate but offers more dense
+	  compression.
+
+	  https://github.com/google/brotli
diff --git a/package/brotli/brotli.hash b/package/brotli/brotli.hash
new file mode 100644
index 0000000000..7bdefcb7dd
--- /dev/null
+++ b/package/brotli/brotli.hash
@@ -0,0 +1,5 @@ 
+# Locally generated:
+sha512  93adcf437d730ac403e444285ac8aefbb2c8a6b5e1b064e8ee33684c067287a8159e0ee73d2217c167881e87da73fa494792d963a15508fd42b2ac4a5b52823c  v1.0.3.tar.gz
+
+# Hash for license files:
+sha512  16d7a62757f9854cd0ff9750eb0b374a1360deded0ba1646fde430f79a8f7c36a85f4884faaf1ea90db02537cd8d8c314cfcbcf492be25af24e1e77aa5919ebb  LICENSE
diff --git a/package/brotli/brotli.mk b/package/brotli/brotli.mk
new file mode 100644
index 0000000000..cf1e811543
--- /dev/null
+++ b/package/brotli/brotli.mk
@@ -0,0 +1,17 @@ 
+################################################################################
+#
+# brotli
+#
+################################################################################
+
+BROTLI_VERSION = 1.0.3
+BROTLI_SOURCE = v$(BROTLI_VERSION).tar.gz
+BROTLI_SITE = https://github.com/google/brotli/archive
+BROTLI_LICENSE = MIT
+BROTLI_LICENSE_FILES = LICENSE
+BROTLI_INSTALL_STAGING = YES
+BROTLI_CONF_OPTS = \
+	-DBROTLI_DISABLE_TESTS=ON \
+	-DBROTLI_BUNDLED_MODE=OFF
+
+$(eval $(cmake-package))