diff options
author | Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2020-01-05 04:05:28 +0000 |
---|---|---|
committer | Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2020-01-05 04:05:28 +0000 |
commit | 0d4e1292da1949000debc398f21c70c0cbea8d5e (patch) | |
tree | 89cdad7ce941cf989f920dfc5b3ab9a05789b329 /x11-fonts | |
parent | net/remmina: Fix build with NLS option disabled (diff) |
Add ots 8.0.0
The OpenType Sanitizer (OTS) parses and serializes OpenType files (OTF, TTF) and
WOFF and WOFF2 font files, validating them and sanitizing them as it goes.
The C library is integrated into Chromium and Firefox, and also simple command
line tools to check files offline in a Terminal.
The CSS font-face property is great for web typography. Having to use images in
order to get the correct typeface is a great sadness; one should be able to use
vectors.
WWW: https://github.com/khaledhosny/ots
Notes
Notes:
svn path=/head/; revision=522082
Diffstat (limited to 'x11-fonts')
-rw-r--r-- | x11-fonts/Makefile | 1 | ||||
-rw-r--r-- | x11-fonts/ots/Makefile | 40 | ||||
-rw-r--r-- | x11-fonts/ots/distinfo | 3 | ||||
-rw-r--r-- | x11-fonts/ots/files/patch-meson.build | 183 | ||||
-rw-r--r-- | x11-fonts/ots/pkg-descr | 11 | ||||
-rw-r--r-- | x11-fonts/ots/pkg-plist | 10 |
6 files changed, 248 insertions, 0 deletions
diff --git a/x11-fonts/Makefile b/x11-fonts/Makefile index af86b86cab1f..440b1a8f39ad 100644 --- a/x11-fonts/Makefile +++ b/x11-fonts/Makefile @@ -172,6 +172,7 @@ SUBDIR += oldschool-pc-fonts SUBDIR += open-sans SUBDIR += orbitron + SUBDIR += ots SUBDIR += oxygen-fonts SUBDIR += p5-Font-AFM SUBDIR += p5-Font-TTF diff --git a/x11-fonts/ots/Makefile b/x11-fonts/ots/Makefile new file mode 100644 index 000000000000..028fddfc47ec --- /dev/null +++ b/x11-fonts/ots/Makefile @@ -0,0 +1,40 @@ +# Created by: Po-Chuan Hsieh <sunpoet@FreeBSD.org> +# $FreeBSD$ + +PORTNAME= ots +PORTVERSION= 8.0.0 +DISTVERSIONPREFIX= v +CATEGORIES= x11-fonts + +MAINTAINER= sunpoet@FreeBSD.org +COMMENT= OpenType Sanitizer + +LICENSE= BSD3CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +LIB_DEPENDS= libbrotlidec.so:archivers/brotli \ + libfreetype.so:print/freetype2 \ + libgtest.so:devel/googletest \ + liblz4.so:archivers/liblz4 \ + libwoff2dec.so:devel/woff2 + +USES= compiler:c++11-lang meson pkgconfig shebangfix + +MESON_FALSE= debug +MESON_TRUE= graphite + +GH_ACCOUNT= khaledhosny +USE_GITHUB= yes + +SHEBANG_FILES= tests/*.sh +bash_CMD= ${SH} + +post-patch: + @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' ${WRKSRC}/meson.build + +do-test: + ${SETENV} top_builddir=${BUILD_WRKSRC} top_srcdir=${WRKSRC} ${SH} ${WRKSRC}/tests/test_bad_fonts.sh + ${SETENV} top_builddir=${BUILD_WRKSRC} top_srcdir=${WRKSRC} ${SH} ${WRKSRC}/tests/test_fuzzed_fonts.sh + ${SETENV} top_builddir=${BUILD_WRKSRC} top_srcdir=${WRKSRC} ${SH} ${WRKSRC}/tests/test_good_fonts.sh + +.include <bsd.port.mk> diff --git a/x11-fonts/ots/distinfo b/x11-fonts/ots/distinfo new file mode 100644 index 000000000000..de3cc7a7191b --- /dev/null +++ b/x11-fonts/ots/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1578125669 +SHA256 (khaledhosny-ots-v8.0.0_GH0.tar.gz) = ced587c1df08fe72d7d5080e3c43f07f80eabca7bde9b31d74a6158ee8be2690 +SIZE (khaledhosny-ots-v8.0.0_GH0.tar.gz) = 28644271 diff --git a/x11-fonts/ots/files/patch-meson.build b/x11-fonts/ots/files/patch-meson.build new file mode 100644 index 000000000000..9f5193683c84 --- /dev/null +++ b/x11-fonts/ots/files/patch-meson.build @@ -0,0 +1,183 @@ +--- meson.build.orig 2019-08-30 08:38:31 UTC ++++ meson.build +@@ -1,6 +1,6 @@ + project('ots', 'c', 'cpp', + version: '8.0.0', +- default_options : ['cpp_std=c++11', 'default_library=static'], ++ default_options : ['cpp_std=c++11', 'default_library=both'], + ) + + cxx = meson.get_compiler('cpp') +@@ -38,52 +38,52 @@ configure_file(output: 'config.h', + configuration: conf) + + +-brotli_includes = ['third_party/brotli/c/include'] +-libbrotli = library('brotli', +- 'third_party/brotli/c/common/constants.h', +- 'third_party/brotli/c/common/dictionary.c', +- 'third_party/brotli/c/common/dictionary.h', +- 'third_party/brotli/c/common/transform.c', +- 'third_party/brotli/c/common/transform.h', +- 'third_party/brotli/c/common/version.h', +- 'third_party/brotli/c/dec/bit_reader.c', +- 'third_party/brotli/c/dec/bit_reader.h', +- 'third_party/brotli/c/dec/decode.c', +- 'third_party/brotli/c/dec/huffman.c', +- 'third_party/brotli/c/dec/huffman.h', +- 'third_party/brotli/c/dec/prefix.h', +- 'third_party/brotli/c/dec/state.c', +- 'third_party/brotli/c/dec/state.h', +- 'third_party/brotli/c/include/brotli/decode.h', +- 'third_party/brotli/c/include/brotli/port.h', +- 'third_party/brotli/c/include/brotli/types.h', +- include_directories: include_directories(brotli_includes), +-) ++#brotli_includes = ['third_party/brotli/c/include'] ++#libbrotli = library('brotli', ++# 'third_party/brotli/c/common/constants.h', ++# 'third_party/brotli/c/common/dictionary.c', ++# 'third_party/brotli/c/common/dictionary.h', ++# 'third_party/brotli/c/common/transform.c', ++# 'third_party/brotli/c/common/transform.h', ++# 'third_party/brotli/c/common/version.h', ++# 'third_party/brotli/c/dec/bit_reader.c', ++# 'third_party/brotli/c/dec/bit_reader.h', ++# 'third_party/brotli/c/dec/decode.c', ++# 'third_party/brotli/c/dec/huffman.c', ++# 'third_party/brotli/c/dec/huffman.h', ++# 'third_party/brotli/c/dec/prefix.h', ++# 'third_party/brotli/c/dec/state.c', ++# 'third_party/brotli/c/dec/state.h', ++# 'third_party/brotli/c/include/brotli/decode.h', ++# 'third_party/brotli/c/include/brotli/port.h', ++# 'third_party/brotli/c/include/brotli/types.h', ++# include_directories: include_directories(brotli_includes), ++#) + + +-woff2_includes = ['third_party/brotli/c/include', 'third_party/woff2/include'] +-libwoff2 = library('woff2', +- 'third_party/woff2/include/woff2/decode.h', +- 'third_party/woff2/include/woff2/output.h', +- 'third_party/woff2/src/buffer.h', +- 'third_party/woff2/src/port.h', +- 'third_party/woff2/src/round.h', +- 'third_party/woff2/src/store_bytes.h', +- 'third_party/woff2/src/table_tags.cc', +- 'third_party/woff2/src/table_tags.h', +- 'third_party/woff2/src/variable_length.cc', +- 'third_party/woff2/src/variable_length.h', +- 'third_party/woff2/src/woff2_common.cc', +- 'third_party/woff2/src/woff2_common.h', +- 'third_party/woff2/src/woff2_dec.cc', +- 'third_party/woff2/src/woff2_out.cc', +- include_directories: include_directories(woff2_includes), +-) ++#woff2_includes = ['third_party/brotli/c/include', 'third_party/woff2/include'] ++#libwoff2 = library('woff2', ++# 'third_party/woff2/include/woff2/decode.h', ++# 'third_party/woff2/include/woff2/output.h', ++# 'third_party/woff2/src/buffer.h', ++# 'third_party/woff2/src/port.h', ++# 'third_party/woff2/src/round.h', ++# 'third_party/woff2/src/store_bytes.h', ++# 'third_party/woff2/src/table_tags.cc', ++# 'third_party/woff2/src/table_tags.h', ++# 'third_party/woff2/src/variable_length.cc', ++# 'third_party/woff2/src/variable_length.h', ++# 'third_party/woff2/src/woff2_common.cc', ++# 'third_party/woff2/src/woff2_common.h', ++# 'third_party/woff2/src/woff2_dec.cc', ++# 'third_party/woff2/src/woff2_out.cc', ++# include_directories: include_directories(woff2_includes), ++#) + + + ots_includes = [ + 'include', +- 'third_party/woff2/include', ++ '%%LOCALBASE%%/include/woff2', + ] + + ots_sources = [ +@@ -167,10 +167,10 @@ ots_sources = [ + 'src/vvar.h', + ] + +-ots_libs = [libbrotli, libwoff2] ++#ots_libs = [libbrotli, libwoff2] + + if get_option('graphite') +- ots_includes += ['third_party/lz4/lib'] ++ ots_includes += ['%%LOCALBASE%%/include'] + ots_sources += [ + 'src/feat.cc', + 'src/feat.h', +@@ -186,21 +186,27 @@ if get_option('graphite') + 'src/sill.h', + 'src/sill.cc', + ] +- liblz4 = library('lz4', +- 'third_party/lz4/lib/lz4.c', +- 'third_party/lz4/lib/lz4.h', +- ) +- ots_libs += [liblz4] ++# liblz4 = library('lz4', ++# 'third_party/lz4/lib/lz4.c', ++# 'third_party/lz4/lib/lz4.h', ++# ) ++# ots_libs += [liblz4] + endif + ++libbrotlicommon = dependency('libbrotlicommon') ++libbrotlidec = dependency('libbrotlidec') ++libwoff2common = dependency('libwoff2common') ++libwoff2dec = dependency('libwoff2dec') ++liblz4 = dependency('liblz4') + zlib = dependency('zlib', fallback : ['zlib', 'zlib_dep']) + + libots = library('ots', + ots_sources, + include_directories: include_directories(ots_includes), +- link_with: ots_libs, + cpp_args : '-DHAVE_CONFIG_H', +- dependencies: zlib, ++ dependencies: [libbrotlicommon, libbrotlidec, libwoff2common, libwoff2dec, liblz4, zlib], ++ version : meson.project_version(), ++ install: true, + ) + + +@@ -226,6 +232,7 @@ executable('ots-fuzzer', + cpp_args: fuzzer_defines, + link_with: libots, + link_args: fuzzer_ldflags, ++ install: true, + ) + + +@@ -291,12 +298,13 @@ endif + + + gtest = dependency('gtest', fallback: ['gtest', 'gtest_main_dep']) ++gtest_main = dependency('gtest_main') + + cff_charstring = executable('cff_charstring', + 'tests/cff_charstring_test.cc', + include_directories: include_directories(['include', 'src']), + link_with: libots, +- dependencies: gtest, ++ dependencies: [gtest, gtest_main], + ) + + test('cff_charstring', cff_charstring) +@@ -306,7 +314,7 @@ layout_common_table = executable('layout_common_table' + 'tests/layout_common_table_test.cc', + include_directories: include_directories(['include', 'src']), + link_with: libots, +- dependencies: gtest, ++ dependencies: [gtest, gtest_main], + ) + + test('layout_common_table', layout_common_table) diff --git a/x11-fonts/ots/pkg-descr b/x11-fonts/ots/pkg-descr new file mode 100644 index 000000000000..ceeabb9402b1 --- /dev/null +++ b/x11-fonts/ots/pkg-descr @@ -0,0 +1,11 @@ +The OpenType Sanitizer (OTS) parses and serializes OpenType files (OTF, TTF) and +WOFF and WOFF2 font files, validating them and sanitizing them as it goes. + +The C library is integrated into Chromium and Firefox, and also simple command +line tools to check files offline in a Terminal. + +The CSS font-face property is great for web typography. Having to use images in +order to get the correct typeface is a great sadness; one should be able to use +vectors. + +WWW: https://github.com/khaledhosny/ots diff --git a/x11-fonts/ots/pkg-plist b/x11-fonts/ots/pkg-plist new file mode 100644 index 000000000000..2e12f7e26301 --- /dev/null +++ b/x11-fonts/ots/pkg-plist @@ -0,0 +1,10 @@ +bin/ots-fuzzer +bin/ots-idempotent +bin/ots-perf +bin/ots-sanitize +bin/ots-side-by-side +bin/ots-validator-checker +lib/libots.a +lib/libots.so +lib/libots.so.8 +lib/libots.so.8.0.0 |