diff --git a/contrib/ci/Dockerfile-debian-experimental b/contrib/ci/Dockerfile-debian-experimental index 875d5dcc3..87ce9e9d6 100644 --- a/contrib/ci/Dockerfile-debian-experimental +++ b/contrib/ci/Dockerfile-debian-experimental @@ -5,15 +5,21 @@ RUN echo "deb-src http://deb.debian.org/debian/ experimental main" >> /etc/apt/s RUN apt-get update -qq RUN apt-get install -yq --no-install-recommends \ docbook-utils \ + fontconfig \ + fontconfig-config \ + fonts-dejavu \ gcab \ gettext \ gobject-introspection \ gtk-doc-tools \ libarchive-dev \ + libcairo-dev \ + libcairo-gobject2 \ libcolord-dev \ libcolorhug-dev \ libefivar-dev \ libelf-dev \ + libfreetype6-dev \ libfwup-dev \ libgcab-dev \ libgirepository1.0-dev \ @@ -21,6 +27,7 @@ RUN apt-get install -yq --no-install-recommends \ libgpgme11-dev \ libgudev-1.0-dev \ libgusb-dev \ + libpango1.0-dev \ libpolkit-gobject-1-dev \ libsmbios-dev \ libsoup2.4-dev \ @@ -29,6 +36,10 @@ RUN apt-get install -yq --no-install-recommends \ meson \ pkg-config \ policykit-1 \ + python3 \ + python3-cairo \ + python3-gi-cairo \ + python3-pil \ udev \ systemd #deps not yet in unstable: diff --git a/contrib/ci/Dockerfile-debian-unstable b/contrib/ci/Dockerfile-debian-unstable index b32a2cf29..096eb25b9 100644 --- a/contrib/ci/Dockerfile-debian-unstable +++ b/contrib/ci/Dockerfile-debian-unstable @@ -4,6 +4,9 @@ RUN echo "deb-src http://deb.debian.org/debian/ unstable main" >> /etc/apt/sourc RUN apt-get update -qq RUN apt-get install -yq --no-install-recommends \ docbook-utils \ + fontconfig \ + fontconfig-config \ + fonts-dejavu \ gcab \ gettext \ gir1.2-appstreamglib-1.0 \ @@ -11,10 +14,13 @@ RUN apt-get install -yq --no-install-recommends \ gtk-doc-tools \ libappstream-glib-dev \ libarchive-dev \ + libcairo-dev \ + libcairo-gobject2 \ libcolord-dev \ libcolorhug-dev \ libefivar-dev \ libelf-dev \ + libfreetype6-dev \ libfwup-dev \ libgcab-dev \ libgirepository1.0-dev \ @@ -22,6 +28,7 @@ RUN apt-get install -yq --no-install-recommends \ libgpgme11-dev \ libgudev-1.0-dev \ libgusb-dev \ + libpango1.0-dev \ libpolkit-gobject-1-dev \ libsmbios-dev \ libsoup2.4-dev \ @@ -30,6 +37,10 @@ RUN apt-get install -yq --no-install-recommends \ meson \ pkg-config \ policykit-1 \ + python3 \ + python3-cairo \ + python3-gi-cairo \ + python3-pil \ udev \ systemd RUN mkdir /build diff --git a/contrib/ci/Dockerfile-fedora-25 b/contrib/ci/Dockerfile-fedora-25 index 0e7aca99a..8ac0220ef 100644 --- a/contrib/ci/Dockerfile-fedora-25 +++ b/contrib/ci/Dockerfile-fedora-25 @@ -2,9 +2,15 @@ FROM fedora:25 RUN dnf --enablerepo=updates-testing -y update RUN dnf --enablerepo=updates-testing -y install \ + adobe-source-han-sans-cn-fonts \ + cairo-devel \ + cairo-gobject-devel \ colord-devel \ + dejavu-sans-fonts \ docbook-utils \ elfutils-libelf-devel \ + freetype \ + fontconfig \ fwupdate-devel \ gcab \ gettext \ @@ -19,7 +25,12 @@ RUN dnf --enablerepo=updates-testing -y install \ libsmbios-devel \ libsoup-devel \ meson \ + pango-devel \ polkit-devel \ + python3 \ + python3-cairo \ + python3-gobject \ + python3-pillow \ redhat-rpm-config \ sqlite-devel \ systemd \ diff --git a/contrib/fwupd.spec.in b/contrib/fwupd.spec.in index 63963f831..b100fdc20 100644 --- a/contrib/fwupd.spec.in +++ b/contrib/fwupd.spec.in @@ -43,6 +43,13 @@ BuildRequires: valgrind-devel BuildRequires: elfutils-libelf-devel BuildRequires: gtk-doc BuildRequires: meson +BuildRequires: python3 python3-cairo python3-gobject python3-pillow +BuildRequires: pango-devel +BuildRequires: cairo-devel cairo-gobject-devel +BuildRequires: freetype +BuildRequires: fontconfig +BuildRequires: dejavu-sans-fonts +BuildRequires: adobe-source-han-sans-cn-fonts %if 0%{?have_smbios} BuildRequires: libsmbios-devel >= 2.3.0 @@ -61,6 +68,7 @@ Requires: glib2%{?_isa} >= %{glib2_version} Requires: libappstream-glib%{?_isa} >= %{libappstream_version} Requires: libgusb%{?_isa} >= %{libgusb_version} Requires: libsoup%{?_isa} >= %{libsoup_version} +Requires: fwupd-labels = %{version}-%{release} Obsoletes: fwupd-sign < 0.1.6 Obsoletes: libebitdo < 0.7.5-3 @@ -89,6 +97,13 @@ Requires: libdfu%{?_isa} = %{version}-%{release} %description -n libdfu-devel Files for development with libdfu. +%package labels +Summary: Rendered labels for display during system firmware updates. +BuildArch: noarch + +%description labels +Rendered labels for display during system firmware updates. + %prep %setup -q @@ -208,6 +223,9 @@ mkdir -p --mode=0700 $RPM_BUILD_ROOT%{_localstatedir}/lib/fwupd/gnupg %{_libdir}/libdfu*.so %{_libdir}/pkgconfig/dfu.pc +%files labels +%{_datadir}/locale/*/LC_IMAGES/fwupd* + %changelog * #LONGDATE# Richard Hughes #VERSION#-0.#BUILD##ALPHATAG# - Update from git diff --git a/meson.build b/meson.build index bc2a15940..41296bde0 100644 --- a/meson.build +++ b/meson.build @@ -128,6 +128,11 @@ gpgerror = cc.find_library('gpg-error') libm = cc.find_library('m', required: false) udev = dependency('udev') +cairo = dependency('cairo') +pango = dependency('pango') +fontconfig = cc.find_library('fontconfig') +freetype = cc.find_library('freetype') + if valgrind.found() conf.set('HAVE_VALGRIND', '1') endif diff --git a/po/make-images b/po/make-images new file mode 100755 index 000000000..894ad77ee --- /dev/null +++ b/po/make-images @@ -0,0 +1,194 @@ +#!/usr/bin/env python3 +""" This thing rasterizes text for use later """ + +# pylint: disable=wrong-import-position,too-many-locals,unused-argument +# pylint: disable=invalid-name,too-many-instance-attributes + +""" + Licensed under the GNU General Public License Version 2 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see . + +""" + + +import os +import sys +import gettext +import math +import cairo +import gi +gi.require_version('Pango', '1.0') +gi.require_version('PangoCairo', '1.0') +from gi.repository import Pango, PangoCairo +from PIL import Image + +def usage(return_code): + """ print usage and exit with the supplied return code """ + if return_code == 0: + out = sys.stdout + else: + out = sys.stderr + out.write("usage: make-images