fwupd: fix cross build

This commit is contained in:
Đoàn Trần Công Danh 2021-01-23 11:21:53 +07:00
parent b6af73b66e
commit 24ce263ea4
2 changed files with 21 additions and 60 deletions

View File

@ -1,37 +0,0 @@
diff --git meson.build meson.build
index c0463ef..c7d1567 100644
--- meson.build
+++ meson.build
@@ -241,6 +241,13 @@ if get_option('plugin_uefi')
endif
conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
r = run_command([python3, 'po/test-deps'])
+ if meson.is_cross_build()
+ qemu = '/usr/bin/qemu-' + gnu_efi_arch + '-static'
+ qemu_python3_cmd = qemu + ' -L @XBPS_CROSS_BASE@ @XBPS_CROSS_BASE@/bin/python3'
+ r = run_command('sh', '-c', qemu_python3_cmd + ' po/test-deps')
+ else
+ r = run_command([python3, 'po/test-deps'])
+ endif
if r.returncode() != 0
error(r.stderr())
endif
diff --git po/meson.build po/meson.build
index 6e78d2e..3fdedb7 100644
--- po/meson.build
+++ po/meson.build
@@ -5,6 +5,12 @@ i18n.gettext(meson.project_name(),
]
)
+if meson.is_cross_build()
+ python3_cmd = qemu_python3_cmd
+else
+ python3_cmd = python3.path()
+endif
+
if get_option('plugin_uefi')
-meson.add_install_script('make-images.sh', localedir, python3.path())
+meson.add_install_script('make-images.sh', localedir, python3_cmd)
endif

View File

@ -9,16 +9,15 @@ configure_args="-Dsupported_build=true
-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-objcopy=${XBPS_CROSS_BASE}/usr/bin/objcopy
-Defi-ldsdir=${XBPS_CROSS_BASE}/usr/lib -Defi-ld=${XBPS_CROSS_BASE}/bin/ld
-Defi-objcopy=${XBPS_CROSS_BASE}/bin/objcopy
-Defi-libdir=${XBPS_CROSS_BASE}/usr/lib -Delogind=true"
hostmakedepends="dejavu-fonts-ttf gnutls-tools help2man pkg-config gcab
vala glib-devel polkit gettext gtk-doc"
vala glib-devel polkit gettext gtk-doc pango python3-gobject python3-Pillow"
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
libcurl-devel"
sqlite-devel libsoup-devel gcab-devel pango-devel elogind-devel
tpm2-tss-devel libjcat-devel libcurl-devel"
depends="udisks2"
conf_files="
/etc/fwupd/*.conf
@ -32,24 +31,30 @@ checksum=bc7a1eb5e494810e2622442c2942b1a06d926c906db3b2612c3e8c892806ff56
replaces="fwupdate>=0"
case "$XBPS_TARGET_MACHINE" in
x86_64*|i686*|arm*|aarch64*) _have_uefi=yes;;
x86_64*|i686*)
_have_uefi=yes
_plugin_msr=yes
_plugin_dell=yes
;;
arm*|aarch64*)
_have_uefi=yes;;
esac
case "$XBPS_TARGET_MACHINE" in
x86_64*|i686*) ;;
*) configure_args+=" -Dplugin_msr=false";;
esac
if [ -z "$_plugin_msr" ]; then
configure_args+=" -Dplugin_msr=false"
fi
if [ "$_plugin_dell" ]; then
makedepends+=" libsmbios-devel"
else
configure_args+=" -Dplugin_dell=false"
fi
if [ -n "$_have_uefi" ]; then
hostmakedepends+=" efivar"
makedepends+=" libefivar-devel gnu-efi-libs"
case "$XBPS_TARGET_MACHINE" in
x86_64*|i686*) makedepends+=" libsmbios-devel";;
*) configure_args+=" -Dplugin_dell=false";;
esac
else
configure_args+=" -Dplugin_uefi=false -Dplugin_redfish=false"
configure_args+=" -Dplugin_dell=false"
fi
if [ "$CROSS_BUILD" ]; then
@ -58,15 +63,8 @@ if [ "$CROSS_BUILD" ]; then
configure_args+=" -Dman=false"
# steal man pages from native package
hostmakedepends+=" fwupd"
else
configure_args+=" -Dman=true"
fi
pre_configure() {
# Replace the values from our patch into the system itself
vsed -i -e "s|@XBPS_CROSS_BASE@|${XBPS_CROSS_BASE}|g" meson.build
}
post_install() {
if [ "$CROSS_BUILD" ]; then
for _page in dbxtool dfu-tool fwupdagent fwupdate fwupdmgr fwupdtool fwupdtpmevlog