From 7e4a2244ba253f45d468764d4f6caaf57dd65d4a Mon Sep 17 00:00:00 2001 From: Alexander Tratsevskiy Date: Sat, 10 Jul 2021 00:05:55 +0300 Subject: [PATCH] =?UTF-8?q?media-fonts/noto-emoji:=20=D0=BF=D0=B5=D1=80?= =?UTF-8?q?=D0=B5=D0=BD=D0=B5=D1=81=D0=B5=D0=BD=D0=B0=20=D1=83=D0=B4=D0=B0?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=BD=D0=B0=D1=8F=20=D0=B2=D0=B5=D1=80=D1=81?= =?UTF-8?q?=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- media-fonts/noto-emoji/Manifest | 1 + .../noto-emoji-20180823-build-path.patch | 11 ++ .../files/noto-emoji-20190328-use-gm.patch | 27 +++++ .../files/noto-emoji-build-all-flags.patch | 11 ++ .../files/noto-emoji-pngquant-verbose.patch | 11 ++ .../files/noto-emoji-zopflipng-verbose.patch | 11 ++ .../noto-emoji/noto-emoji-20200317-r1.ebuild | 101 ++++++++++++++++++ profiles/default/package.mask | 3 + 8 files changed, 176 insertions(+) create mode 100644 media-fonts/noto-emoji/Manifest create mode 100644 media-fonts/noto-emoji/files/noto-emoji-20180823-build-path.patch create mode 100644 media-fonts/noto-emoji/files/noto-emoji-20190328-use-gm.patch create mode 100644 media-fonts/noto-emoji/files/noto-emoji-build-all-flags.patch create mode 100644 media-fonts/noto-emoji/files/noto-emoji-pngquant-verbose.patch create mode 100644 media-fonts/noto-emoji/files/noto-emoji-zopflipng-verbose.patch create mode 100644 media-fonts/noto-emoji/noto-emoji-20200317-r1.ebuild diff --git a/media-fonts/noto-emoji/Manifest b/media-fonts/noto-emoji/Manifest new file mode 100644 index 000000000..86fe6fa49 --- /dev/null +++ b/media-fonts/noto-emoji/Manifest @@ -0,0 +1 @@ +DIST noto-emoji-20200317.tar.gz 60841240 BLAKE2B aab99a5cbab6943b9e282b33dc113601489c7d02a3670db8675e6c90be615ceaf0f2900bdbc68ffaca6130f4e724b2ec1001cfccce80a181208ace0638492b7e SHA512 958a589ef7d7a0b9e4fa3eb1caa20284fa7463419a740d0ca05f850618324883c13498f92839476042cfd1daffa7eff925b2f22ec318c0726391f69c04911bfb diff --git a/media-fonts/noto-emoji/files/noto-emoji-20180823-build-path.patch b/media-fonts/noto-emoji/files/noto-emoji-20180823-build-path.patch new file mode 100644 index 000000000..151f88251 --- /dev/null +++ b/media-fonts/noto-emoji/files/noto-emoji-20180823-build-path.patch @@ -0,0 +1,11 @@ +--- a/add_glyphs.py.old 2018-11-18 11:11:56.387323302 +0100 ++++ b/add_glyphs.py 2018-11-18 11:12:18.203529159 +0100 +@@ -22,7 +22,7 @@ + import add_emoji_gsub + import add_aliases + +-sys.path.append( ++sys.path.insert(0, + path.join(os.path.dirname(__file__), 'third_party', 'color_emoji')) + from png import PNG + diff --git a/media-fonts/noto-emoji/files/noto-emoji-20190328-use-gm.patch b/media-fonts/noto-emoji/files/noto-emoji-20190328-use-gm.patch new file mode 100644 index 000000000..6b51d0f52 --- /dev/null +++ b/media-fonts/noto-emoji/files/noto-emoji-20190328-use-gm.patch @@ -0,0 +1,27 @@ +--- a/Makefile~ 2019-03-28 17:45:53.000000000 +0100 ++++ b/Makefile 2019-06-02 10:36:55.587055453 +0200 +@@ -21,7 +21,7 @@ + PNGQUANT = pngquant + PNGQUANTFLAGS = --speed 1 --skip-if-larger --quality 85-95 --force + BODY_DIMENSIONS = 136x128 +-IMOPS := -size $(BODY_DIMENSIONS) canvas:none -compose copy -gravity center ++IMOPS = -size 136x128 -background none -gravity center -extent 136x128 -compose copy + + # zopflipng is better (about 5-10%) but much slower. it will be used if + # present. pass ZOPFLIPNG= as an arg to make to use optipng instead. +@@ -165,13 +165,13 @@ + # imagemagick packaged with ubuntu trusty (6.7.7-10) by using -composite. + + $(EMOJI_DIR)/%.png: $(EMOJI_SRC_DIR)/%.png | $(EMOJI_DIR) +- @convert $(IMOPS) "$<" -composite "PNG32:$@" ++ @gm convert $(IMOPS) "$<" "PNG32:$@" + + $(FLAGS_DIR)/%.png: $(FLAGS_SRC_DIR)/%.png ./waveflag | $(FLAGS_DIR) + @./waveflag $(FLAGS_DIR)/ "$<" + + $(RESIZED_FLAGS_DIR)/%.png: $(FLAGS_DIR)/%.png | $(RESIZED_FLAGS_DIR) +- @convert $(IMOPS) "$<" -composite "PNG32:$@" ++ @gm convert $(IMOPS) "$<" "PNG32:$@" + + flag-symlinks: $(RESIZED_FLAG_FILES) | $(RENAMED_FLAGS_DIR) + @$(subst ^, , \ diff --git a/media-fonts/noto-emoji/files/noto-emoji-build-all-flags.patch b/media-fonts/noto-emoji/files/noto-emoji-build-all-flags.patch new file mode 100644 index 000000000..564b08a59 --- /dev/null +++ b/media-fonts/noto-emoji/files/noto-emoji-build-all-flags.patch @@ -0,0 +1,11 @@ +--- old/Makefile 2018-05-03 20:32:14.000000000 +0200 ++++ new/Makefile 2018-05-08 11:48:20.811073447 +0200 +@@ -78,7 +78,7 @@ + + ALL_FLAGS = $(basename $(notdir $(wildcard $(FLAGS_SRC_DIR)/*.png))) + +-FLAGS = $(SELECTED_FLAGS) ++FLAGS = $(ALL_FLAGS) + + FLAG_NAMES = $(FLAGS:%=%.png) + FLAG_FILES = $(addprefix $(FLAGS_DIR)/, $(FLAG_NAMES)) diff --git a/media-fonts/noto-emoji/files/noto-emoji-pngquant-verbose.patch b/media-fonts/noto-emoji/files/noto-emoji-pngquant-verbose.patch new file mode 100644 index 000000000..8a152bea2 --- /dev/null +++ b/media-fonts/noto-emoji/files/noto-emoji-pngquant-verbose.patch @@ -0,0 +1,11 @@ +--- a/Makefile~ 2020-04-22 23:04:44.000000000 +0200 ++++ b/Makefile 2020-04-22 23:06:42.069275340 +0200 +@@ -20,7 +20,7 @@ + + PNGQUANT = pngquant + PYTHON = python3 +-PNGQUANTFLAGS = --speed 1 --skip-if-larger --quality 85-95 --force ++PNGQUANTFLAGS = --speed 1 --skip-if-larger --quality 85-95 --force -v + BODY_DIMENSIONS = 136x128 + IMOPS := -size $(BODY_DIMENSIONS) canvas:none -compose copy -gravity center + diff --git a/media-fonts/noto-emoji/files/noto-emoji-zopflipng-verbose.patch b/media-fonts/noto-emoji/files/noto-emoji-zopflipng-verbose.patch new file mode 100644 index 000000000..0cb272994 --- /dev/null +++ b/media-fonts/noto-emoji/files/noto-emoji-zopflipng-verbose.patch @@ -0,0 +1,11 @@ +--- a/Makefile~ 2020-04-22 23:07:33.000000000 +0200 ++++ b/Makefile 2020-04-22 23:11:46.356767595 +0200 +@@ -194,7 +194,7 @@ + ifdef MISSING_ZOPFLI + @$(OPTIPNG) -quiet -o7 -clobber -force -out "$@" "$<" + else +- @$(ZOPFLIPNG) -y "$<" "$@" 1> /dev/null 2>&1 ++ @$(ZOPFLIPNG) -y "$<" "$@" 2>&1 + endif + + diff --git a/media-fonts/noto-emoji/noto-emoji-20200317-r1.ebuild b/media-fonts/noto-emoji/noto-emoji-20200317-r1.ebuild new file mode 100644 index 000000000..84b1ddb07 --- /dev/null +++ b/media-fonts/noto-emoji/noto-emoji-20200317-r1.ebuild @@ -0,0 +1,101 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +PYTHON_COMPAT=( python3_{7,8} ) + +inherit font python-any-r1 + +DESCRIPTION="Google Noto Emoji fonts" +HOMEPAGE="https://www.google.com/get/noto/ https://github.com/googlefonts/noto-emoji" + +COMMIT="ac1703e9d7feebbf5443a986e08332b1e1c5afcf" +SRC_URI="https://github.com/googlefonts/noto-emoji/archive/${COMMIT}.tar.gz -> ${P}.tar.gz" + +LICENSE="Apache-2.0 OFL-1.1" +SLOT="0" +KEYWORDS="amd64 ~arm arm64 ~ppc64 x86" +IUSE="buildfont" + +BDEPEND=" + buildfont? ( + ${PYTHON_DEPS} + app-arch/zopfli + $(python_gen_any_dep ' + dev-python/fonttools[${PYTHON_USEDEP}] + dev-python/nototools[${PYTHON_USEDEP}] + ') + media-gfx/pngquant + x11-libs/cairo + || ( media-gfx/imagemagick[png] media-gfx/graphicsmagick[png] ) + ) +" + +RESTRICT="binchecks strip" + +S="${WORKDIR}/${PN}-${COMMIT}" + +python_check_deps() { + has_version -b "dev-python/fonttools[${PYTHON_USEDEP}]" && + has_version -b "dev-python/nototools[${PYTHON_USEDEP}]" +} + +pkg_setup() { + font_pkg_setup +} + +src_prepare() { + default + + if use buildfont; then + # From Fedora + eapply "${FILESDIR}/${PN}-build-all-flags.patch" + + # https://github.com/googlei18n/noto-emoji/issues/240 + eapply "${FILESDIR}/${PN}-20180823-build-path.patch" + + # Be more verbose, bug #717654 + eapply "${FILESDIR}"/${PN}-pngquant-verbose.patch + eapply "${FILESDIR}"/${PN}-zopflipng-verbose.patch + + # Based on Fedora patch to allow graphicsmagick usage + if has_version -b media-gfx/graphicsmagick; then + eapply "${FILESDIR}/${PN}-20190328-use-gm.patch" + fi + fi +} + +src_compile() { + if ! use buildfont; then + einfo "Installing pre-built fonts provided by upstream." + einfo "They could be not fully updated or miss some items." + einfo "To build fonts based on latest images enable 'buildfont'" + einfo "USE (that will require more time and resources too)." + else + python_setup + einfo "Building fonts..." + default + fi +} + +src_install() { + if ! use buildfont; then + FONT_S="${S}/fonts" + else + mv -i fonts/NotoEmoji-Regular.ttf "${S}" || die + # Built font and Regular font + FONT_S="${S}" + + # Don't lose fancy emoji icons + insinto /usr/share/icons/"${PN}"/128x128/emotes/ + doins png/128/*.png + + insinto /usr/share/icons/"${PN}"/scalable/emotes/ + doins svg/*.svg + fi + + FONT_SUFFIX="ttf" + font_src_install + + dodoc README.md +} diff --git a/profiles/default/package.mask b/profiles/default/package.mask index 64c0978f2..1eccbb579 100644 --- a/profiles/default/package.mask +++ b/profiles/default/package.mask @@ -8,6 +8,9 @@ sys-libs/db:6.0 =media-libs/allegro-4.4.3.1 =sci-libs/cifparse-obj-7.105 +# removed cool emoji +=media-fonts/noto-emoji-20201214 + # no support in CDS yet =net-dns/bind-9.16.12