twemoji-fonts/twemoji-fonts.spec

99 lines
3.4 KiB
Plaintext

%global commit0 ac1703e9d7feebbf5443a986e08332b1e1c5afcf
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
%global fontname twemoji
%global Fontname Twemoji
Name: %{fontname}-fonts
Version: 15.1.0
Release: %autorelease
Summary: Emoji for everyone
License: CC-BY-4.0
URL: https://github.com/jdecked/twemoji
Source0: https://github.com/googlei18n/noto-emoji/archive/%{commit0}.tar.gz#/noto-emoji-%{shortcommit0}.tar.gz
Source1: 61-%{name}.conf
Source2: %{fontname}.metainfo.xml
Source4: https://github.com/jdecked/%{fontname}/archive/v%{version}.tar.gz#/%{fontname}-%{version}.tar.gz
Patch0: noto-emoji-use-system-pngquant.patch
Patch1: noto-emoji-build-all-flags.patch
Patch2: noto-emoji-use-gm.patch
BuildArch: noarch
BuildRequires: make
BuildRequires: GraphicsMagick
BuildRequires: cairo-devel
BuildRequires: fontpackages-devel
BuildRequires: fonttools
BuildRequires: libappstream-glib
BuildRequires: nototools
BuildRequires: pngquant
BuildRequires: python3-devel
BuildRequires: python3dist(fonttools)
BuildRequires: zopfli
Requires: fontpackages-filesystem
# Reminder: drop the Provides from Fedora 43 onwards.
Provides: twitter-twemoji-fonts = %{version}-%{release}
Obsoletes: twitter-twemoji-fonts < 14.1.0
%description
A color emoji font with a flat visual style, originally designed and
used by Twitter.
%prep
# Twemoji currently lacks its own build system, so let's borrow the one
# from Noto Emoji.
%autosetup -p1 -n noto-emoji-%{commit0}
rm -rf third_party/pngquant
mv LICENSE LICENSE-BUILD
tar -xf %{SOURCE4}
sed 's/Noto Color Emoji/Twemoji/; s/NotoColorEmoji/Twemoji/; s/Copyright .* Google Inc\./Twitter, Inc and other contributors./; s/ Version .*/ %{version}/; s/.*is a trademark.*//; s/Google, Inc\./Twitter, Inc and other contributors/; s,http://www.google.com/get/noto/,https://github.com/jdecked/twemoji/,; s/.*is licensed under.*/ Creative Commons Attribution 4.0 International/; s,http://scripts.sil.org/OFL,http://creativecommons.org/licenses/by/4.0/,' NotoColorEmoji.tmpl.ttx.tmpl > Twemoji.tmpl.ttx.tmpl
pushd %{fontname}-%{version}/assets/72x72/
for png in *.png; do
mv $png emoji_u${png//-/_}
done
popd
%build
make %{?_smp_mflags} OPT_CFLAGS="$RPM_OPT_FLAGS" EMOJI=%{Fontname} EMOJI_SRC_DIR=%{fontname}-%{version}/assets/72x72 FLAGS= BODY_DIMENSIONS=76x72
%install
install -m 0755 -d %{buildroot}%{_fontdir}
install -m 0644 -p %{Fontname}.ttf %{buildroot}%{_fontdir}
mkdir -p %{buildroot}%{_datadir}/fontconfig/conf.avail \
%{buildroot}%{_sysconfdir}/fonts/conf.d
install -m 0644 -p %{SOURCE1} %{buildroot}%{_datadir}/fontconfig/conf.avail
ln -s ../../..%{_datadir}/fontconfig/conf.avail/61-%{name}.conf \
%{buildroot}%{_sysconfdir}/fonts/conf.d/61-%{name}.conf
mkdir -p %{buildroot}%{_datadir}/metainfo
install -m 0644 -p %{SOURCE2} %{buildroot}%{_datadir}/metainfo
%check
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/%{fontname}.metainfo.xml
%_font_pkg %{Fontname}.ttf
%license LICENSE-BUILD
%license %{fontname}-%{version}/LICENSE
%license %{fontname}-%{version}/LICENSE-GRAPHICS
%doc %{fontname}-%{version}/CONTRIBUTING.md
%doc %{fontname}-%{version}/README.md
%{_datadir}/fontconfig/conf.avail/61-%{name}.conf
%{_datadir}/metainfo/%{fontname}.metainfo.xml
%{_sysconfdir}/fonts/conf.d/61-%{name}.conf
%changelog
%autochangelog