From 339692f5f6e2f078b13926378ad5ad17f74b51cd Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Wed, 8 Mar 2023 17:13:08 +0000 Subject: [PATCH] Bug 1821011 - Vendor woff2 using `mach vendor` r=jfkthame Differential Revision: https://phabricator.services.mozilla.com/D171976 --- modules/woff2/LICENSE | 19 +++++++++++++++ modules/woff2/README.mozilla | 16 ------------- modules/woff2/moz.yaml | 42 +++++++++++++++++++++++++++++++++ modules/woff2/update.sh | 27 --------------------- modules/woff2/woff2-rlbox.patch | 6 ++--- 5 files changed, 64 insertions(+), 46 deletions(-) create mode 100644 modules/woff2/LICENSE delete mode 100644 modules/woff2/README.mozilla create mode 100644 modules/woff2/moz.yaml delete mode 100755 modules/woff2/update.sh diff --git a/modules/woff2/LICENSE b/modules/woff2/LICENSE new file mode 100644 index 000000000000..4f9441b6e1b9 --- /dev/null +++ b/modules/woff2/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2013-2017 by the WOFF2 Authors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/modules/woff2/README.mozilla b/modules/woff2/README.mozilla deleted file mode 100644 index eaa5a0ae7f63..000000000000 --- a/modules/woff2/README.mozilla +++ /dev/null @@ -1,16 +0,0 @@ -This is the woff2 library from -https://github.com/google/woff2. - -Upstream code can be viewed at - https://github.com/google/woff2/tree/master - -and cloned by - git clone https://github.com/google/woff2 - -The in-tree copy is updated by running - sh update.sh -from within the modules/woff2 directory. - -Current version: [commit 4721483ad780ee2b63cb787bfee4aa64b61a0446]. - -Additional patch: woff2-rlbox.patch (bug 1732201). diff --git a/modules/woff2/moz.yaml b/modules/woff2/moz.yaml new file mode 100644 index 000000000000..3a3b15661f4a --- /dev/null +++ b/modules/woff2/moz.yaml @@ -0,0 +1,42 @@ +schema: 1 + +bugzilla: + product: Toolkit + component: "General" + +origin: + name: woff2 + description: font compression + + url: https://github.com/google/woff2 + + release: 4721483ad780ee2b63cb787bfee4aa64b61a0446 (2022-03-30T15:59:13Z). + revision: 4721483ad780ee2b63cb787bfee4aa64b61a0446 + + license: MIT + +vendoring: + url: https://github.com/google/woff2 + source-hosting: github + tracking: commit + + exclude: + - ".*" + - CMakeLists.txt + - CONTRIBUTING.md + - Makefile + - brotli + - cmake + - README.md + + include: + - include/ + - src/ + + keep: + - "RLBoxWOFF2Sandbox.*" + - sources.mozbuild + + patches: + - woff2-rlbox.patch + diff --git a/modules/woff2/update.sh b/modules/woff2/update.sh deleted file mode 100755 index 1f3c34cd8e3b..000000000000 --- a/modules/woff2/update.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -# Script to update the mozilla in-tree copy of the woff2 library. -# Run this within the /modules/woff2 directory of the source tree. - -MY_TEMP_DIR=`mktemp -d -t woff2_update.XXXXXX` || exit 1 - -git clone https://github.com/google/woff2 ${MY_TEMP_DIR}/woff2 - -COMMIT=`(cd ${MY_TEMP_DIR}/woff2 && git log | head -n 1)` -perl -p -i -e "s/\[commit [0-9a-f]{40}\]/[${COMMIT}]/" README.mozilla; - -rm -rf src -rm -rf include -mv ${MY_TEMP_DIR}/woff2/src src -mv ${MY_TEMP_DIR}/woff2/include include -rm -rf ${MY_TEMP_DIR} -hg add src -hg add include - -echo "###" -echo "### Updated woff2 to $COMMIT." -echo "### Remember to verify and commit the changes to source control!" -echo "###" - -echo "Applying woff2-rlbox.patch..." -patch -p3 < woff2-rlbox.patch diff --git a/modules/woff2/woff2-rlbox.patch b/modules/woff2/woff2-rlbox.patch index 28fd86734527..00bd224fd0fb 100644 --- a/modules/woff2/woff2-rlbox.patch +++ b/modules/woff2/woff2-rlbox.patch @@ -1,6 +1,6 @@ -diff --git a/modules/woff2/src/woff2_dec.cc b/modules/woff2/src/woff2_dec.cc ---- a/modules/woff2/src/woff2_dec.cc -+++ b/modules/woff2/src/woff2_dec.cc +diff --git a/src/woff2_dec.cc b/src/woff2_dec.cc +--- a/src/woff2_dec.cc ++++ b/src/woff2_dec.cc @@ -19,7 +19,6 @@ #include #include