From ebbb13c2b47f9184e3c25d5f67edb30c0b2d10e1 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Mon, 25 Jun 2018 16:21:35 +0100 Subject: [PATCH] Remove the libfwup dependency from fwupd In Fedora the only user of libfwupdate is fwupd and the fwupdate command line tool. It makes sense to absorb the libfwupdate library interface into the uefi plugin in fwupd. Benefits I can see include: * fwupd and fwupdate are very similar names; a lot of OEMs are confused * fwupd already depends on efivar for other things * We are maintaining an artificial library interface * The CI and translation hooks are already in place for fwupd * We don't need to check for features or versions in fwupd, we can just develop the feature (e.g. BGRT) all in one place. --- contrib/PKGBUILD | 2 +- contrib/ci/dependencies.xml | 63 +++++++++++++++--------------- contrib/debian/control.in | 3 +- contrib/debian/rules | 11 +++--- contrib/fwupd.spec.in | 11 ++---- contrib/org.freedesktop.fwupd.json | 17 -------- contrib/snap/snapcraft-master.yaml | 27 +------------ contrib/snap/snapcraft-stable.yaml | 28 +------------ meson.build | 12 +----- src/fu-util.c | 4 -- 10 files changed, 47 insertions(+), 131 deletions(-) diff --git a/contrib/PKGBUILD b/contrib/PKGBUILD index 8980cfa11..609b6525f 100644 --- a/contrib/PKGBUILD +++ b/contrib/PKGBUILD @@ -8,7 +8,7 @@ pkgdesc='A simple daemon to allow session software to update firmware' arch=('i686' 'x86_64') url='https://github.com/hughsie/fwupd' license=('GPL2') -depends=('appstream-glib' 'fwupdate') +depends=('appstream-glib') makedepends=('meson' 'valgrind' 'gobject-introspection' 'gtk-doc' 'python-pillow' 'git' 'python-cairo' 'ttf-dejavu' 'adobe-source-han-sans-cn-fonts' 'python-gobject' 'vala') diff --git a/contrib/ci/dependencies.xml b/contrib/ci/dependencies.xml index 2f5af832b..dc2ada8fb 100644 --- a/contrib/ci/dependencies.xml +++ b/contrib/ci/dependencies.xml @@ -260,37 +260,6 @@ - - - fwupdate - - - fwupdate-devel - - - fwupdate-devel - - - - (>= 10-3) - amd64 - arm64 - armhf - i386 - - - - - - - amd64 - arm64 - armhf - i386 - - - - @@ -586,6 +555,38 @@ + + efivar + + + efivar-devel + + + efivar-devel + + + + amd64 + arm64 + armhf + armel + i386 + + + + + + + amd64 + arm64 + armhf + armel + i386 + + + + + amd64 diff --git a/contrib/debian/control.in b/contrib/debian/control.in index 268f9d6fd..80f7c057b 100644 --- a/contrib/debian/control.in +++ b/contrib/debian/control.in @@ -32,8 +32,7 @@ Package: fwupd Architecture: linux-any Depends: ${misc:Depends}, ${shlibs:Depends} -Recommends: fwupdate, - python3 +Recommends: python3 Breaks: gir1.2-dfu-1.0 (<< 0.9.7-1), libdfu1 (<< 0.9.7-1), libdfu-dev (<< 0.9.7-1) diff --git a/contrib/debian/rules b/contrib/debian/rules index d5b114207..24a96235c 100755 --- a/contrib/debian/rules +++ b/contrib/debian/rules @@ -13,6 +13,12 @@ ifneq ($(CI),) export CI=--werror endif +export UEFI=-Dplugin_uefi=false +DEB_TARGET_ARCH ?= $(shell dpkg-architecture -qDEB_TARGET_ARCH) +ifeq ($(DEB_TARGET_ARCH),$(filter $(DEB_TARGET_ARCH),amd64 i386 armhf arm64)) + export UEFI=-Dplugin_uefi=true +endif + %: dh $@ --with gir,systemd @@ -20,11 +26,6 @@ override_dh_auto_clean: rm -fr debian/build override_dh_auto_configure: - if pkg-config --exists fwup; then \ - export UEFI="-Dplugin_uefi=true"; \ - else \ - export UEFI="-Dplugin_uefi=false"; \ - fi; \ if pkg-config --exists libsmbios_c; then \ export DELL="-Dplugin_dell=true -Dplugin_synaptics=true"; \ else \ diff --git a/contrib/fwupd.spec.in b/contrib/fwupd.spec.in index 665a4f711..a061dce45 100644 --- a/contrib/fwupd.spec.in +++ b/contrib/fwupd.spec.in @@ -11,12 +11,12 @@ %global enable_tests 1 %global enable_dummy 1 -# fwupdate is only available on these arches +# fwup.efi is only available on these arches %ifarch x86_64 aarch64 %global have_uefi 1 %endif -# libsmbios is only available on x86, and fwupdate is available on just x86_64 +# libsmbios is only available on x86 %ifarch x86_64 %global have_dell 1 %endif @@ -56,6 +56,7 @@ BuildRequires: vala BuildRequires: bash-completion %if 0%{?have_uefi} +BuildRequires: efivar-devel >= 33 BuildRequires: python3 python3-cairo python3-gobject python3-pillow BuildRequires: pango-devel BuildRequires: cairo-devel cairo-gobject-devel @@ -67,14 +68,10 @@ BuildRequires: gnu-efi-devel %endif %if 0%{?have_dell} -BuildRequires: efivar-devel +BuildRequires: efivar-devel >= 33 BuildRequires: libsmbios-devel >= 2.3.0 %endif -%if 0%{?have_uefi} -BuildRequires: fwupdate-devel >= 7 -%endif - Requires(post): systemd Requires(preun): systemd Requires(postun): systemd diff --git a/contrib/org.freedesktop.fwupd.json b/contrib/org.freedesktop.fwupd.json index 4adfba8d6..d588aac57 100644 --- a/contrib/org.freedesktop.fwupd.json +++ b/contrib/org.freedesktop.fwupd.json @@ -110,23 +110,6 @@ } ] }, - { - "name": "fwupdate", - "buildsystem": "simple", - "build-commands": ["make -C linux prefix=/app libdir=/app/lib", "EFIDIR=/boot/efi make -C linux install prefix=/app libdir=/app/lib"], - "cleanup": [ - "/bin/fwupdate", - "/lib/systemd/system/fwupdate-cleanup.service", - "/libexec/fwupdate/cleanup" - ], - "sources": [ - { - "type": "archive", - "url": "https://github.com/rhboot/fwupdate/releases/download/11/fwupdate-11.tar.bz2", - "sha256": "d350eae66215c90fdc70f46ea734dedbfe6006ec21b7e764114b7d9e283e4abe" - } - ] - }, { "name": "libsmbios_c", "config-opts": ["--disable-doxygen", diff --git a/contrib/snap/snapcraft-master.yaml b/contrib/snap/snapcraft-master.yaml index 46bed2e2a..59266a3a7 100644 --- a/contrib/snap/snapcraft-master.yaml +++ b/contrib/snap/snapcraft-master.yaml @@ -63,31 +63,6 @@ parts: - -share/ - -etc/ - -lib/*.a - libfwup-dev: - plugin: make - source: https://github.com/rhboot/fwupdate.git - source-type: git - make-parameters: - - EFIDIR=ubuntu - - GNUEFIDIR=/usr/lib - - LIBDIR=$SNAPCRAFT_STAGE/usr/lib/x86_64-linux-gnu - - libdir=/usr/lib/x86_64-linux-gnu - - PKG_CONFIG_PATH=$SNAPCRAFT_STAGE/usr/lib/x86_64-linux-gnu/pkgconfig - - --eval=export PKG_CONFIG_PATH - build-packages: - - elfutils - - gnu-efi - - libasm1 - - libdw1 - prime: - - -usr/lib/debug - - -usr/lib/systemd - - -usr/src - - -usr/share - - -usr/lib/*/pkgconfig - - -usr/include - - -usr/bin - after: [libsmbios, libefivar-fixpkgconfig] meson: plugin: python source: https://github.com/mesonbuild/meson.git @@ -275,7 +250,7 @@ parts: - -usr/share/upstart - -usr/lib/*/glib-2.0 - -usr/lib/*/pkgconfig - after: [appstream-glib-dev, libfwup-dev, gudev, gusb, gnu-efi, libsmbios, libefivar-fixpkgconfig] + after: [appstream-glib-dev, gudev, gusb, gnu-efi, libsmbios, libefivar-fixpkgconfig] fix-bash-completion: plugin: make source: contrib/snap/fix-bash-completion diff --git a/contrib/snap/snapcraft-stable.yaml b/contrib/snap/snapcraft-stable.yaml index a08c37747..c2a1d1e0e 100644 --- a/contrib/snap/snapcraft-stable.yaml +++ b/contrib/snap/snapcraft-stable.yaml @@ -61,32 +61,6 @@ parts: - -share/ - -etc/ - -lib/*.a - libfwup-dev: - plugin: make - #fwupdate 11 FTBFS: see https://github.com/rhboot/fwupdate/pull/113 - source: https://github.com/rhboot/fwupdate.git - source-type: git - make-parameters: - - EFIDIR=ubuntu - - GNUEFIDIR=/usr/lib - - LIBDIR=$SNAPCRAFT_STAGE/usr/lib/x86_64-linux-gnu - - libdir=/usr/lib/x86_64-linux-gnu - - PKG_CONFIG_PATH=$SNAPCRAFT_STAGE/usr/lib/x86_64-linux-gnu/pkgconfig - - --eval=export PKG_CONFIG_PATH - build-packages: - - elfutils - - gnu-efi - - libasm1 - - libdw1 - prime: - - -usr/lib/debug - - -usr/lib/systemd - - -usr/src - - -usr/share - - -usr/lib/*/pkgconfig - - -usr/include - - -usr/bin - after: [libsmbios, libefivar-fixpkgconfig] meson: plugin: python source: https://github.com/mesonbuild/meson/releases/download/0.46.1/meson-0.46.1.tar.gz @@ -276,7 +250,7 @@ parts: - -usr/share/upstart - -usr/lib/*/glib-2.0 - -usr/lib/*/pkgconfig - after: [appstream-glib-dev, libfwup-dev, gudev, gusb, gnu-efi, libefivar-fixpkgconfig, libsmbios] + after: [appstream-glib-dev, gudev, gusb, gnu-efi, libefivar-fixpkgconfig, libsmbios] fix-bash-completion: plugin: make source: contrib/snap/fix-bash-completion diff --git a/meson.build b/meson.build index 03e557584..6cf978afd 100644 --- a/meson.build +++ b/meson.build @@ -210,16 +210,7 @@ if get_option('plugin_altos') endif if get_option('plugin_uefi') - fwup = dependency('fwup', version : '>= 10') - if fwup.version().version_compare('>= 11') - conf.set('HAVE_FWUP_GET_ESP_MOUNTPOINT', '1') - endif - if fwup.version().version_compare('>= 12') - conf.set('HAVE_FWUP_VERSION', '1') - endif - conf.set_quoted('LIBFWUP_LIBRARY_VERSION', fwup.version()) - - efivar = dependency('efivar') + efivar = dependency('efivar', version : '>= 33') conf.set_quoted('EFIVAR_LIBRARY_VERSION', efivar.version()) efiboot = dependency('efiboot') objcopy = find_program ('objcopy') @@ -251,7 +242,6 @@ endif if get_option('plugin_dell') libsmbios_c = dependency('libsmbios_c', version : '>= 2.4.0') efivar = dependency('efivar') - fwup = dependency('fwup', version : '>= 5') conf.set('HAVE_DELL', '1') if not get_option('plugin_uefi') error('plugin_dell also needs plugin_uefi to work') diff --git a/src/fu-util.c b/src/fu-util.c index 61519056e..441a9e845 100644 --- a/src/fu-util.c +++ b/src/fu-util.c @@ -2491,10 +2491,6 @@ main (int argc, char *argv[]) G_USB_MAJOR_VERSION, G_USB_MINOR_VERSION, G_USB_MICRO_VERSION); -#ifdef LIBFWUP_LIBRARY_VERSION - g_print ("\tfwupdate:\t%s\n", - LIBFWUP_LIBRARY_VERSION); -#endif #ifdef EFIVAR_LIBRARY_VERSION g_print ("\tefivar:\t%s\n", EFIVAR_LIBRARY_VERSION);