fwupd: fix cross build, use build options.

- Introduce uefi and dell build options to simplify the template.
- Add gtk-doc and man page generation (man pages are currently using the
  ones from the native package, should be fixed).
This commit is contained in:
Érico Rolim 2020-10-08 15:34:41 -03:00 committed by Érico Nogueira Rolim
parent 87885d1f43
commit 788cb6d18a

View file

@ -1,23 +1,28 @@
# Template file for 'fwupd'
pkgname=fwupd
version=1.4.6
revision=1
revision=2
build_style=meson
build_helper="gir"
# manpages fail to build
# tests require unpackaged umockdev
configure_args="-Dconsolekit=false -Dgtkdoc=false -Dintrospection=true
-Dsystemd=false -Dplugin_altos=false -Dtests=false -Dman=false
configure_args="-Dconsolekit=false -Dgtkdoc=true -Dintrospection=true
-Dsystemd=false -Dplugin_altos=false -Dtests=false
-Dpkcs7=false -Db_lto=false -Defi-includedir=${XBPS_CROSS_BASE}/usr/include/efi
-Defi-ldsdir=${XBPS_CROSS_BASE}/usr/lib -Defi-ld=${XBPS_CROSS_BASE}/usr/bin/ld
-Defi-libdir=${XBPS_CROSS_BASE}/usr/lib -Delogind=true"
-Defi-libdir=${XBPS_CROSS_BASE}/usr/lib -Delogind=true
$(vopt_bool uefi plugin_uefi) $(vopt_bool uefi plugin_redfish)
$(vopt_bool dell plugin_dell)"
hostmakedepends="dejavu-fonts-ttf gnutls-tools help2man pkg-config gcab
vala glib-devel polkit gettext"
vala glib-devel polkit gettext gtk-doc $(vopt_if uefi efivar)"
makedepends="libxmlb-devel cairo-devel colord-devel libarchive-devel
gnutls-devel gpgme-devel json-glib-devel libgusb-devel polkit-devel
sqlite-devel libsoup-devel gcab-devel pango-devel python3-gobject
python3-Pillow elogind-devel tpm2-tss-devel libjcat-devel"
python3-Pillow elogind-devel tpm2-tss-devel libjcat-devel
$(vopt_if uefi 'libefivar-devel gnu-efi-libs') $(vopt_if dell libsmbios-devel)"
depends="udisks2"
conf_files="
/etc/fwupd/daemon.conf
/etc/fwupd/remotes.d/*.conf"
short_desc="Daemon to allow session software to update firmware"
maintainer="Érico Nogueira <ericonr@disroot.org>"
license="LGPL-2.1-or-later"
@ -26,49 +31,44 @@ distfiles="https://github.com/hughsie/fwupd/archive/${version}.tar.gz"
checksum=2e70a4221e6ca09dae768af25f19fddcdbdafb9f7d7984d19e8686846fa4420a
replaces="fwupdate>=0"
build_options="uefi dell"
desc_option_uefi="Enable support for UEFI firmware update"
desc_option_dell="Enable support for Dell specific firmware update"
# no efi on non-efi platforms
case "$XBPS_TARGET_MACHINE" in
x86_64*|i686*|aarch64*|arm*) _have_efi=yes;;
x86_64*|i686*)
build_options_default="uefi dell"
;;
aarch64*|arm*)
build_options_default="uefi"
;;
esac
if [ -n "$_have_efi" ]; then
hostmakedepends+=" efivar gnu-efi-libs"
makedepends+=" libefivar-devel gnu-efi-libs"
fi
conf_files="
/etc/fwupd/daemon.conf
/etc/fwupd/remotes.d/*.conf"
if [ "$CROSS_BUILD" ]; then
case "$XBPS_TARGET_MACHINE" in
arm*) # Segfaults under qemu trying to gzip non-existing files
broken="https://build.voidlinux.org/builders/armv7l_builder/builds/17377/steps/shell_3/logs/stdio";;
aarch64*) broken="https://travis-ci.org/void-linux/void-packages/jobs/618827513";;
esac
configure_args+=" -Defi-cc=/usr/bin/${XBPS_CROSS_TRIPLET}-gcc"
if [ -n "$_have_efi" ]; then
configure_args+=" -Defi-cc=/usr/bin/${XBPS_CROSS_TRIPLET}-gcc"
fi
configure_args+=" -Dman=false"
# steal man pages from native package
hostmakedepends+=" fwupd"
else
configure_args+=" -Dman=true"
fi
case "$XBPS_TARGET_MACHINE" in
x86_64*|i686*)
makedepends+=" libsmbios-devel"
configure_args+=" -Dplugin_dell=true"
;;
*)
configure_args+=" -Dplugin_dell=false"
if [ -z "$_have_efi" ]; then
configure_args+=" -Dplugin_uefi=false"
configure_args+=" -Dplugin_redfish=false"
fi
;;
esac
pre_configure() {
# Replace the values from our patch into the system itself
sed -i -e "s|@XBPS_CROSS_BASE@|${XBPS_CROSS_BASE}|g" meson.build
vsed -i -e "s|@XBPS_CROSS_BASE@|${XBPS_CROSS_BASE}|g" meson.build
# Replace host objcopy with the cross one
vsed -i -e "s|command -v objcopy|command -v ${XBPS_CROSS_BASE}/usr/bin/objcopy|" plugins/uefi/efi/generate_binary.sh
}
post_install() {
if [ "$CROSS_BUILD" ]; then
for _page in dbxtool dfu-tool fwupdagent fwupdate fwupdmgr fwupdtool fwupdtpmevlog
do
vman /usr/share/man/man1/$_page.1
done
fi
}
fwupd-devel_package() {
@ -80,5 +80,6 @@ fwupd-devel_package() {
vmove "usr/lib/*.so"
vmove usr/share/gir-1.0
vmove usr/share/vala
vmove usr/share/gtk-doc
}
}