From 697c065a866bab28d200f0ac510dec78a8933984 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Fri, 22 Apr 2016 15:20:53 +0800 Subject: [PATCH] initial import --- .gitignore | 2 + google-noto-emoji-fonts.spec | 80 ++++++++++++++++++++++++++++ noto-emoji-use-system-pngquant.patch | 59 ++++++++++++++++++++ sources | 2 + 4 files changed, 143 insertions(+) create mode 100644 google-noto-emoji-fonts.spec create mode 100644 noto-emoji-use-system-pngquant.patch diff --git a/.gitignore b/.gitignore index e69de29..390dcab 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,2 @@ +/noto-emoji-e7a7241.tar.gz +/nototools-c1f2cff.tar.gz diff --git a/google-noto-emoji-fonts.spec b/google-noto-emoji-fonts.spec new file mode 100644 index 0000000..0a08862 --- /dev/null +++ b/google-noto-emoji-fonts.spec @@ -0,0 +1,80 @@ +%global commit0 e7a7241a929625feb16920a40bfa29e4a302b82b +%global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) + +%global commit1 c1f2cffbba35d08c9558006bc7860492ce322b87 +%global shortcommit1 %(c=%{commit1}; echo ${c:0:7}) + +%global fontname google-noto-emoji + + +Name: google-noto-emoji-fonts +Version: 20160406 +Release: 2%{?dist} +Summary: Google Noto Emoji Fonts + +# In noto-emoji-fonts source +## noto-emoji code is in ASL 2.0 license +## Emoji fonts are under OFL license +### third_party color-emoji code is in BSD license +### third_party region-flags code is in Public Domain license +# In nototools source +## nototools code is in ASL 2.0 license +### third_party ucd code is in Unicode license +License: OFL and ASL 2.0 +URL: https://github.com/googlei18n/noto-emoji +Source0: https://github.com/googlei18n/noto-emoji/archive/%{commit0}.tar.gz#/noto-emoji-%{shortcommit0}.tar.gz +Source1: https://github.com/googlei18n/nototools/archive/%{commit1}.tar.gz#/nototools-%{shortcommit1}.tar.gz + +Patch0: noto-emoji-use-system-pngquant.patch + +BuildArch: noarch +BuildRequires: python2-fonttools +BuildRequires: python-devel +BuildRequires: fontpackages-devel +BuildRequires: ImageMagick +BuildRequires: pngquant +BuildRequires: optipng +BuildRequires: cairo-devel + +Requires: fontpackages-filesystem + +%description +Color and Black-and-White Noto emoji fonts, and tools for working with them. + + +%prep +%autosetup -n noto-emoji-%{commit0} + +rm -rf third_party/pngquant +tar zxf %{SOURCE1} +rm -rf nototools-%{commit1}/third_party/{cldr,dspl,fontcrunch,ohchr,spiro,udhr,unicode} + +%build +# Work around UTF-8 +export LANG=zh_CN.UTF-8 + +pushd nototools-%{commit1} +%{__python2} setup.py develop --user +popd + +export PATH=$PATH:$HOME/.local/bin + +make %{?_smp_mflags} OPT_CFLAGS="$RPM_OPT_FLAGS" + +%install +install -m 0755 -d %{buildroot}%{_fontdir} +install -m 0644 -p *Emoji.ttf %{buildroot}%{_fontdir} +install -m 0644 -p fonts/*.ttf %{buildroot}%{_fontdir} + + +%_font_pkg *.ttf +%license LICENSE +%doc AUTHORS CONTRIBUTING.md CONTRIBUTORS README.md + + +%changelog +* Wed Apr 20 2016 Peng Wu - 20160406-2 +- Use system pngquant + +* Wed Apr 20 2016 Peng Wu - 20160406-1 +- Initial packaging diff --git a/noto-emoji-use-system-pngquant.patch b/noto-emoji-use-system-pngquant.patch new file mode 100644 index 0000000..cd9b0d9 --- /dev/null +++ b/noto-emoji-use-system-pngquant.patch @@ -0,0 +1,59 @@ +Index: noto-emoji-e7a7241a929625feb16920a40bfa29e4a302b82b/Makefile +=================================================================== +--- noto-emoji-e7a7241a929625feb16920a40bfa29e4a302b82b.orig/Makefile ++++ noto-emoji-e7a7241a929625feb16920a40bfa29e4a302b82b/Makefile +@@ -15,10 +15,9 @@ + EMOJI = NotoColorEmoji + font: $(EMOJI).ttf + +-CFLAGS = -std=c99 -Wall -Wextra `pkg-config --cflags --libs cairo` ++CFLAGS = $(OPT_CFLAGS) `pkg-config --cflags --libs cairo` + LDFLAGS = `pkg-config --libs cairo` +-PNGQUANTDIR := third_party/pngquant +-PNGQUANT := $(PNGQUANTDIR)/pngquant ++PNGQUANT = pngquant + PNGQUANTFLAGS = --speed 1 --skip-if-larger --force + + # zopflipng is better (about 5-10%) but much slower. it will be used if +@@ -92,6 +91,12 @@ ALL_QUANTIZED_FILES = $(addprefix $(QUAN + ALL_COMPRESSED_FILES = $(addprefix $(COMPRESSED_DIR)/, $(ALL_NAMES)) + + # tool checks ++ifeq (,$(shell which $(PNGQUANT))) ++ ifeq (,$(wildcard $(PNGQUANT))) ++ MISSING_PNGQUANT = fail ++ endif ++endif ++ + ifeq (,$(shell which $(ZOPFLIPNG))) + ifeq (,$(wildcard $(ZOPFLIPNG))) + MISSING_ZOPFLI = fail +@@ -121,6 +126,11 @@ quantized: $(ALL_QUANTIZED_FILES) + + compressed: $(ALL_COMPRESSED_FILES) + ++check_quantization_tool: ++ifdef MISSING_PNGQUANT ++ $(error "$(PNGQUANT) is not available") ++endif ++ + check_compress_tool: + ifdef MISSING_ZOPFLI + ifdef MISSING_OPTIPNG +@@ -141,8 +151,7 @@ endif + $(EMOJI_DIR) $(FLAGS_DIR) $(RESIZED_FLAGS_DIR) $(RENAMED_FLAGS_DIR) $(QUANTIZED_DIR) $(COMPRESSED_DIR): + mkdir -p "$@" + +-$(PNGQUANT): +- $(MAKE) -C $(PNGQUANTDIR) ++$(PNGQUANT): check_quantization_tool + + waveflag: waveflag.c + $(CC) $< -o $@ $(CFLAGS) $(LDFLAGS) +@@ -213,5 +222,5 @@ clean: + .SECONDARY: $(EMOJI_FILES) $(FLAG_FILES) $(RESIZED_FLAG_FILES) $(RENAMED_FLAG_FILES) \ + $(ALL_QUANTIZED_FILES) $(ALL_COMPRESSED_FILES) + +-.PHONY: clean flags emoji renamed_flags quantized compressed check_compress_tool ++.PHONY: clean flags emoji renamed_flags quantized compressed check_compress_tool check_quantization_tool + diff --git a/sources b/sources index e69de29..d8a4c16 100644 --- a/sources +++ b/sources @@ -0,0 +1,2 @@ +81d49583099229ee568e3dad9da6c17a noto-emoji-e7a7241.tar.gz +4b27c82986d6c9ec42c976341cbe85d3 nototools-c1f2cff.tar.gz