From 33291935bebd4e5d77ee09fc85f9f4771666acfc Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Feb 28 2023 16:50:51 +0000 Subject: Add fontconfig entries to ensure color emoji gets used by Qt applications (#2173935) Also, misc packaging fixes: - Use metainfodir macro for metainfo files - Fix buildfont conditional --- diff --git a/60-google-noto-emoji-color.conf b/60-google-noto-emoji-color.conf new file mode 100644 index 0000000..a3ca748 --- /dev/null +++ b/60-google-noto-emoji-color.conf @@ -0,0 +1,22 @@ + + + + + serif + + Noto Color Emoji + + + + sans-serif + + Noto Color Emoji + + + + monospace + + Noto Color Emoji + + + diff --git a/60-google-noto-emoji.conf b/60-google-noto-emoji.conf new file mode 100644 index 0000000..31fffac --- /dev/null +++ b/60-google-noto-emoji.conf @@ -0,0 +1,22 @@ + + + + + serif + + Noto Emoji + + + + sans-serif + + Noto Emoji + + + + monospace + + Noto Emoji + + + diff --git a/google-noto-emoji-fonts.spec b/google-noto-emoji-fonts.spec index f636479..3bb0ade 100644 --- a/google-noto-emoji-fonts.spec +++ b/google-noto-emoji-fonts.spec @@ -3,16 +3,16 @@ %global fontname google-noto-emoji -%if (0%{?fedora} > 25) -%global buildfont 1 -%else +%if 0%{?rhel} %global buildfont 0 +%else +%global buildfont 1 %endif Name: %{fontname}-fonts Version: 20220916 -Release: 3%{?dist} +Release: 3%{?dist}.1 Summary: Google “Noto Emoji” Black-and-White emoji font # In noto-emoji-fonts source @@ -25,10 +25,12 @@ Summary: Google “Noto Emoji” Black-and-White emoji font ### third_party ucd code is in Unicode license License: OFL and ASL 2.0 URL: https://github.com/googlefonts/noto-emoji -Source0: https://github.com/googlefonts/noto-emoji/archive/%{commit0}.tar.gz#/noto-emoji-%{shortcommit0}.tar.gz +Source0: https://github.com/googlefonts/noto-emoji/archive/%{commit0}/noto-emoji-%{shortcommit0}.tar.gz Source2: %{fontname}.metainfo.xml Source3: %{fontname}-color.metainfo.xml -Source4: Noto_Emoji.zip +Source4: 60-%{fontname}.conf +Source5: 60-%{fontname}-color.conf +Source6: Noto_Emoji.zip Patch0: noto-emoji-build-all-flags.patch Patch1: noto-emoji-use-gm.patch @@ -37,7 +39,7 @@ Patch2: noto-emoji-use-system-pngquant.patch BuildArch: noarch BuildRequires: gcc BuildRequires: fontpackages-devel -%if %buildfont +%if 0%{?buildfont} BuildRequires: fonttools BuildRequires: python3-fonttools BuildRequires: nototools @@ -68,7 +70,7 @@ Provides: google-noto-color-emoji-fonts = 20150617 This package provides the Google “Noto Color Emoji” colored emoji font. %prep -%setup -a 4 -n noto-emoji-%{commit0} +%setup -q -a 6 -n noto-emoji-%{commit0} %patch0 -p1 -b .noto-emoji-build-all-flags %patch1 -p1 -b .noto-emoji-use-gm.patch %patch2 -p1 -b .noto-emoji-use-system-pngquant @@ -76,7 +78,7 @@ This package provides the Google “Noto Color Emoji” colored emoji font. rm -rf third_party/pngquant %build -%if %buildfont +%if 0%{?buildfont} # Work around UTF-8 export LANG=C.UTF-8 @@ -86,7 +88,7 @@ export LANG=C.UTF-8 %install install -m 0755 -d %{buildroot}%{_fontdir} -%if %buildfont +%if 0%{?buildfont} # Built by us from the supplied pngs: install -m 0644 -p NotoColorEmoji.ttf %{buildroot}%{_fontdir} %else @@ -97,22 +99,37 @@ install -m 0644 -p fonts/NotoColorEmoji.ttf %{buildroot}%{_fontdir} # Pre-built, and included with the source: install -m 0644 -p static/NotoEmoji-Regular.ttf %{buildroot}%{_fontdir} -mkdir -p %{buildroot}%{_datadir}/appdata -install -m 0644 -p %{SOURCE2} %{buildroot}%{_datadir}/appdata -install -m 0644 -p %{SOURCE3} %{buildroot}%{_datadir}/appdata +mkdir -p %{buildroot}%{_metainfodir} +install -m 0644 -p %{SOURCE2} %{buildroot}%{_metainfodir} +install -m 0644 -p %{SOURCE3} %{buildroot}%{_metainfodir} +mkdir -p %{buildroot}%{_fontconfig_templatedir} +mkdir -p %{buildroot}%{_fontconfig_confdir} +install -m 0644 -p %{SOURCE4} %{buildroot}%{_fontconfig_templatedir} +install -m 0644 -p %{SOURCE5} %{buildroot}%{_fontconfig_templatedir} -%_font_pkg NotoEmoji-Regular.ttf +for fconf in 60-%{fontname}.conf 60-%{fontname}-color.conf; do + ln -sr %{buildroot}%{_fontconfig_templatedir}/$fconf %{buildroot}%{_fontconfig_confdir}/$fconf +done + + +%_font_pkg -f 60-%{fontname}.conf NotoEmoji-Regular.ttf %license LICENSE OFL.txt %doc AUTHORS CONTRIBUTING.md CONTRIBUTORS README.md README.txt -%{_datadir}/appdata/google-noto-emoji.metainfo.xml +%{_metainfodir}/google-noto-emoji.metainfo.xml -%_font_pkg -n color NotoColorEmoji.ttf +%_font_pkg -n color -f 60-%{fontname}-color.conf NotoColorEmoji.ttf %license LICENSE OFL.txt %doc AUTHORS CONTRIBUTING.md CONTRIBUTORS README.md README.txt -%{_datadir}/appdata/google-noto-emoji-color.metainfo.xml +%{_metainfodir}/google-noto-emoji-color.metainfo.xml %changelog +* Tue Feb 28 2023 Neal Gompa - 20220916-4 +- Add fontconfig entries to ensure color emoji gets used by Qt applications + Resolves: rhbz#2173935 +- Use metainfodir macro for metainfo files +- Fix buildfont conditional + * Thu Jan 19 2023 Fedora Release Engineering - 20220916-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild