From 31ddb9706662f1b7979cbf8fef9d9e200063480b Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Mon, 16 Mar 2015 11:38:03 +0000 Subject: [PATCH] trivial: Relax the BRs so we can build in Fedora 22 --- configure.ac | 2 +- contrib/fwupd.spec.in | 11 ++++++++--- src/fu-provider-chug.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 4f062d048..3969e7bbd 100644 --- a/configure.ac +++ b/configure.ac @@ -89,7 +89,7 @@ PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.36.0 gobject-2.0 gthread-2.0 gio-2.0 >= 2. PKG_CHECK_MODULES(GUDEV, gudev-1.0) PKG_CHECK_MODULES(POLKIT, polkit-gobject-1 >= 0.103) PKG_CHECK_MODULES(GCAB, libgcab-1.0) -PKG_CHECK_MODULES(APPSTREAM_GLIB, appstream-glib >= 0.3.6) +PKG_CHECK_MODULES(APPSTREAM_GLIB, appstream-glib >= 0.3.5) PKG_CHECK_MODULES(SQLITE, sqlite3) AC_PATH_PROG(DOCBOOK2MAN, docbook2man) diff --git a/contrib/fwupd.spec.in b/contrib/fwupd.spec.in index c6f75807f..68cddb475 100644 --- a/contrib/fwupd.spec.in +++ b/contrib/fwupd.spec.in @@ -16,10 +16,15 @@ BuildRequires: libgudev1-devel BuildRequires: colord-devel >= 1.0.0 BuildRequires: polkit-devel >= 0.103 BuildRequires: libgcab1-devel -BuildRequires: libappstream-glib-devel BuildRequires: sqlite-devel -BuildRequires: fwupdate-devel >= 0.1 -Requires: efibootmgr + +# this really needs to be >= 0.3.6 (git master) to get the self-tests to pass +# and will be added for the next upstream release of appstream-glib +BuildRequires: libappstream-glib-devel + +# we'll fix this when Peter has the latest code in a Fedora package +# BuildRequires: fwupdate-devel >= 0.1 +# Requires: efibootmgr %description fwupd is a daemon to allow session software to update UEFI firmware. diff --git a/src/fu-provider-chug.c b/src/fu-provider-chug.c index c6a873029..9b74ca64c 100644 --- a/src/fu-provider-chug.c +++ b/src/fu-provider-chug.c @@ -21,6 +21,7 @@ #include "config.h" +#include #include #include #include @@ -385,6 +386,33 @@ fu_provider_chug_open_cb (gpointer user_data) return TRUE; } +#if !CD_CHECK_VERSION(1,2,10) +#define CH_DEVICE_GUID_COLORHUG "40338ceb-b966-4eae-adae-9c32edfcc484" +#define CH_DEVICE_GUID_COLORHUG2 "2082b5e0-7a64-478a-b1b2-e3404fab6dad" +#define CH_DEVICE_GUID_COLORHUG_ALS "84f40464-9272-4ef7-9399-cd95f12da696" +#define CH_DEVICE_GUID_COLORHUG_PLUS "6d6f05a9-3ecb-43a2-bcbb-3844f1825366" + +static const gchar * +ch_device_get_guid (GUsbDevice *device) +{ + ChDeviceMode mode = ch_device_get_mode (device); + if (mode == CH_DEVICE_MODE_LEGACY || + mode == CH_DEVICE_MODE_FIRMWARE || + mode == CH_DEVICE_MODE_BOOTLOADER) + return CH_DEVICE_GUID_COLORHUG; + if (mode == CH_DEVICE_MODE_FIRMWARE2 || + mode == CH_DEVICE_MODE_BOOTLOADER2) + return CH_DEVICE_GUID_COLORHUG2; + if (mode == CH_DEVICE_MODE_FIRMWARE_PLUS || + mode == CH_DEVICE_MODE_BOOTLOADER_PLUS) + return CH_DEVICE_GUID_COLORHUG_PLUS; + if (mode == CH_DEVICE_MODE_FIRMWARE_ALS || + mode == CH_DEVICE_MODE_BOOTLOADER_ALS) + return CH_DEVICE_GUID_COLORHUG_ALS; + return NULL; +} +#endif + /** * fu_provider_chug_device_added_cb: **/