-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Add recipe for woff2 #30722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add recipe for woff2 #30722
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e8fea41
Add recipe for woff2
haecker-felix 262ca63
Don't depend on -D flag for install
haecker-felix 35d4939
Skip windows
haecker-felix 384ac37
Add test
haecker-felix f0071f1
Patch cmake configuration instead of installing binaries manually
haecker-felix 43f43a0
Also check for shared libraries
haecker-felix 69b2c9f
Add smoke test by converting ttf->woff2 and vice-versa
haecker-felix c3c8501
Remove unnecessary jinja usage
haecker-felix File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/include/woff2/output.h b/include/woff2/output.h | ||
index dc78ccf..24c5c5c 100644 | ||
--- a/include/woff2/output.h | ||
+++ b/include/woff2/output.h | ||
@@ -13,6 +13,7 @@ | ||
#include <cstring> | ||
#include <memory> | ||
#include <string> | ||
+#include <cstdint> | ||
|
||
namespace woff2 { | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index ecfbb83..29c45b9 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -260,12 +260,10 @@ generate_pkg_config ("${CMAKE_CURRENT_BINARY_DIR}/libwoff2enc.pc" | ||
LIBRARIES woff2enc) | ||
|
||
# Installation | ||
-if (NOT BUILD_SHARED_LIBS) | ||
- install( | ||
- TARGETS woff2_decompress woff2_compress woff2_info | ||
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" | ||
- ) | ||
-endif() | ||
+install( | ||
+ TARGETS woff2_decompress woff2_compress woff2_info | ||
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" | ||
+) | ||
|
||
install( | ||
TARGETS woff2common woff2dec woff2enc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
context: | ||
version: "1.0.2" | ||
|
||
package: | ||
name: woff2 | ||
version: ${{ version }} | ||
|
||
source: | ||
url: https://github.com/google/woff2/archive/refs/tags/v${{ version }}.tar.gz | ||
sha256: add272bb09e6384a4833ffca4896350fdb16e0ca22df68c0384773c67a175594 | ||
patches: | ||
- patches/001-include-cstdint.patch | ||
- patches/002-install-binaries.patch | ||
|
||
build: | ||
number: 0 | ||
skip: win | ||
script: | ||
- cmake ${CMAKE_ARGS} -S . -B build -GNinja | ||
- cmake --build build | ||
- cmake --install build | ||
requirements: | ||
build: | ||
- ${{ compiler('c') }} | ||
- ${{ compiler('cxx') }} | ||
- ${{ stdlib('c') }} | ||
- cmake <=3.31.6 | ||
- ninja | ||
- pkg-config | ||
host: | ||
- brotli | ||
|
||
tests: | ||
- package_contents: | ||
include: | ||
- woff2/decode.h | ||
- woff2/encode.h | ||
- woff2/output.h | ||
lib: | ||
- libwoff2common | ||
- libwoff2dec | ||
- libwoff2enc | ||
files: | ||
- bin/woff2_compress | ||
- bin/woff2_decompress | ||
- bin/woff2_info | ||
- script: | ||
- curl -LO https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxP.ttf | ||
- curl -LO https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu72xKKTU1Kvnz.woff2 | ||
# Convert TTF to WOFF2 | ||
- woff2_compress KFOmCnqEu92Fr1Mu4mxP.ttf | ||
- woff2_info KFOmCnqEu92Fr1Mu4mxP.woff2 | grep "WOFF2Header" | ||
# Convert WOFF2 to TTF | ||
- woff2_decompress KFOmCnqEu92Fr1Mu72xKKTU1Kvnz.woff2 | ||
- file --brief KFOmCnqEu92Fr1Mu72xKKTU1Kvnz.ttf | grep -i "TrueType font data" | ||
requirements: | ||
run: | ||
- file | ||
- curl | ||
|
||
danielnachun marked this conversation as resolved.
Show resolved
Hide resolved
|
||
about: | ||
homepage: https://github.com/google/woff2 | ||
summary: Web Open Font Format 2.0 library | ||
description: | | ||
Web Open Font Format (WOFF) 2.0 is an update to the existing WOFF | ||
1.0 with improved compression that is achieved by using the | ||
Brotli algorithm. The primary purpose of the WOFF2 format is to | ||
efficiently package fonts linked to Web documents by means of CSS | ||
@font-face rules. | ||
license: MIT | ||
license_file: LICENSE | ||
|
||
extra: | ||
recipe-maintainers: | ||
- haecker-felix | ||
- Hofer-Julian |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.