From f94a17387c57abb1a32c09812328d1655e98b785 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 17 Dec 2017 09:08:05 +0100 Subject: [PATCH 01/12] =?UTF-8?q?efivar:=2030=20=E2=86=92=2034?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/os-specific/linux/firmware/fwupd/default.nix | 4 ++-- pkgs/tools/system/efivar/default.nix | 14 ++++---------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/pkgs/os-specific/linux/firmware/fwupd/default.nix b/pkgs/os-specific/linux/firmware/fwupd/default.nix index 988f4efb9cdb..9deca1faa6a0 100644 --- a/pkgs/os-specific/linux/firmware/fwupd/default.nix +++ b/pkgs/os-specific/linux/firmware/fwupd/default.nix @@ -5,12 +5,12 @@ , pillow, ninja, gcab, gnutls, python3Packages, wrapGAppsHook }: let - version = "1.0.1"; + version = "1.0.2"; in stdenv.mkDerivation { name = "fwupd-${version}"; src = fetchurl { url = "https://people.freedesktop.org/~hughsient/releases/fwupd-${version}.tar.xz"; - sha256 = "1k627rja7df51dkzqvkzgbwrrj4049k6408d01m34n66zwr2fp59"; + sha256 = "15hrl6jq2kyvbxgjkv3qafqj2962il27gryakm39kvz2p2l1bacj"; }; nativeBuildInputs = [ diff --git a/pkgs/tools/system/efivar/default.nix b/pkgs/tools/system/efivar/default.nix index 6b062513483d..7f20e8135011 100644 --- a/pkgs/tools/system/efivar/default.nix +++ b/pkgs/tools/system/efivar/default.nix @@ -2,27 +2,21 @@ stdenv.mkDerivation rec { name = "efivar-${version}"; - version = "30"; + version = "34"; src = fetchFromGitHub { owner = "rhinstaller"; repo = "efivar"; rev = version; - sha256 = "1pghj019qr7qpqd9rxfhsr1hm3s0w1hd5cdndpl07vhys8hy4a8a"; + sha256 = "0ycrdaz0ijkm3xb9fnwzhwi0pdj5c6s636wj4i6lbjbrijbzn4x5"; }; nativeBuildInputs = [ pkgconfig ]; buildInputs = [ popt ]; - postPatch = '' - substituteInPlace src/Makefile --replace "-static" "" - ''; - - installFlags = [ + makeFlags = [ + "prefix=$(out)" "libdir=$(out)/lib" - "mandir=$(out)/share/man" - "includedir=$(out)/include" - "bindir=$(out)/bin" ]; meta = with stdenv.lib; { From fb29a093f1e5b2a44fd044087dbfe653a271c631 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 17 Dec 2017 09:16:38 +0100 Subject: [PATCH 02/12] =?UTF-8?q?fwupd:=201.0.1=20=E2=86=92=201.0.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../linux/firmware/fwupd/default.nix | 26 +++++++------------ .../firmware/fwupd/fix-missing-deps.patch | 22 ++++++++-------- 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/pkgs/os-specific/linux/firmware/fwupd/default.nix b/pkgs/os-specific/linux/firmware/fwupd/default.nix index 9deca1faa6a0..a67a052e5fee 100644 --- a/pkgs/os-specific/linux/firmware/fwupd/default.nix +++ b/pkgs/os-specific/linux/firmware/fwupd/default.nix @@ -2,15 +2,15 @@ , libgudev, polkit, appstream-glib, gusb, sqlite, libarchive, glib_networking , libsoup, docbook2x, gpgme, libxslt, libelf, libsmbios, efivar, glibcLocales , fwupdate, libyaml, valgrind, meson, libuuid, pygobject3, colord -, pillow, ninja, gcab, gnutls, python3Packages, wrapGAppsHook +, pillow, ninja, gcab, gnutls, python3Packages, wrapGAppsHook, json_glib }: let - version = "1.0.2"; + version = "1.0.4"; in stdenv.mkDerivation { name = "fwupd-${version}"; src = fetchurl { url = "https://people.freedesktop.org/~hughsient/releases/fwupd-${version}.tar.xz"; - sha256 = "15hrl6jq2kyvbxgjkv3qafqj2962il27gryakm39kvz2p2l1bacj"; + sha256 = "1n4d6fw3ffg051072hbxn106s52x2wlh5dh2kxwdfjsb5kh03ra3"; }; nativeBuildInputs = [ @@ -19,17 +19,11 @@ in stdenv.mkDerivation { ]; buildInputs = [ polkit appstream-glib gusb sqlite libarchive libsoup libelf libsmbios fwupdate libyaml - libgudev colord gpgme libuuid pillow gnutls glib_networking + libgudev colord gpgme libuuid pillow gnutls glib_networking efivar json_glib ]; LC_ALL = "en_US.UTF-8"; # For po/make-images - NIX_CFLAGS_COMPILE = [ - "-I${efivar}/include/efivar" - # warning: "__LIBELF_INTERNAL__" is not defined - "-Wno-error=undef" - ]; - patches = [ ./fix-missing-deps.patch ]; @@ -38,12 +32,12 @@ in stdenv.mkDerivation { ''; mesonFlags = [ - "-Denable-man=false" - "-Denable-tests=false" - "-Denable-doc=false" - "-Dwith-bootdir=/boot" - "-Dwith-udevdir=lib/udev" - "-Dwith-systemdunitdir=lib/systemd/system" + "-Dman=false" + "-Dtests=false" + "-Dgtkdoc=false" + "-Dbootdir=/boot" + "-Dudevdir=lib/udev" + "-Dsystemdunitdir=lib/systemd/system" "--localstatedir=/var" ]; diff --git a/pkgs/os-specific/linux/firmware/fwupd/fix-missing-deps.patch b/pkgs/os-specific/linux/firmware/fwupd/fix-missing-deps.patch index 46e11952afe0..d1d7c06027f9 100644 --- a/pkgs/os-specific/linux/firmware/fwupd/fix-missing-deps.patch +++ b/pkgs/os-specific/linux/firmware/fwupd/fix-missing-deps.patch @@ -2,7 +2,7 @@ +++ b/data/builder/meson.build @@ -1,3 +0,0 @@ -install_data('README.md', -- install_dir : join_paths(get_option('localstatedir'), 'lib', 'fwupd', 'builder') +- install_dir : join_paths(localstatedir, 'lib', 'fwupd', 'builder') -) --- a/data/meson.build +++ b/data/meson.build @@ -11,15 +11,15 @@ endif -install_data(['daemon.conf'], -- install_dir : join_paths(get_option('sysconfdir'), 'fwupd') +- install_dir : join_paths(sysconfdir, 'fwupd') -) - install_data(['org.freedesktop.fwupd.metainfo.xml'], - install_dir: join_paths(get_option('datadir'), 'metainfo') + install_dir: join_paths(datadir, 'metainfo') ) install_data(['org.freedesktop.fwupd.conf'], -- install_dir : join_paths(get_option('sysconfdir'), 'dbus-1', 'system.d') +- install_dir : join_paths(sysconfdir, 'dbus-1', 'system.d') + install_dir : join_paths(get_option('prefix'), 'etc', 'dbus-1', 'system.d') ) @@ -30,14 +30,14 @@ 'GPG-KEY-Hughski-Limited', 'GPG-KEY-Linux-Vendor-Firmware-Service', ], -- install_dir : join_paths(get_option('sysconfdir'), 'pki', 'fwupd') +- install_dir : join_paths(sysconfdir, 'pki', 'fwupd') + install_dir : join_paths(get_option('prefix'), 'etc', 'pki', 'fwupd') ) install_data([ 'GPG-KEY-Linux-Vendor-Firmware-Service', ], -- install_dir : join_paths(get_option('sysconfdir'), 'pki', 'fwupd-metadata') +- install_dir : join_paths(sysconfdir, 'pki', 'fwupd-metadata') + install_dir : join_paths(get_option('prefix'), 'etc', 'pki', 'fwupd-metadata') ) endif @@ -46,13 +46,13 @@ install_data([ 'LVFS-CA.pem', ], -- install_dir : join_paths(get_option('sysconfdir'), 'pki', 'fwupd') +- install_dir : join_paths(sysconfdir, 'pki', 'fwupd') + install_dir : join_paths(get_option('prefix'), 'etc', 'pki', 'fwupd') ) install_data([ 'LVFS-CA.pem', ], -- install_dir : join_paths(get_option('sysconfdir'), 'pki', 'fwupd-metadata') +- install_dir : join_paths(sysconfdir, 'pki', 'fwupd-metadata') + install_dir : join_paths(get_option('prefix'), 'etc', 'pki', 'fwupd-metadata') ) endif @@ -63,7 +63,7 @@ 'lvfs.conf', 'lvfs-testing.conf', ], -- install_dir : join_paths(get_option('sysconfdir'), 'fwupd', 'remotes.d') +- install_dir : join_paths(sysconfdir, 'fwupd', 'remotes.d') + install_dir : join_paths(get_option('prefix'), 'etc', 'fwupd', 'remotes.d') ) endif @@ -72,7 +72,7 @@ output : 'fwupd.conf', configuration : con2, install: true, -- install_dir: join_paths(get_option('sysconfdir'), 'fwupd', 'remotes.d'), +- install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'), + install_dir: join_paths(get_option('prefix'), 'etc', 'fwupd', 'remotes.d'), ) configure_file( @@ -80,7 +80,7 @@ output : 'vendor.conf', configuration : con2, install: true, -- install_dir: join_paths(get_option('sysconfdir'), 'fwupd', 'remotes.d'), +- install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'), + install_dir: join_paths(get_option('prefix'), 'etc', 'fwupd', 'remotes.d'), ) --- a/meson_post_install.sh From 88e977df81e0424ee8f64bd80267e7985c20120c Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Fri, 9 Feb 2018 14:58:56 -0600 Subject: [PATCH 03/12] gcab: 0.7 -> 1.1 --- pkgs/development/libraries/gcab/default.nix | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/gcab/default.nix b/pkgs/development/libraries/gcab/default.nix index 38a36fc4e546..0758d1252274 100644 --- a/pkgs/development/libraries/gcab/default.nix +++ b/pkgs/development/libraries/gcab/default.nix @@ -1,16 +1,24 @@ -{ stdenv, fetchurl, intltool, gobjectIntrospection, pkgconfig }: +{ stdenv, fetchurl, gettext, gobjectIntrospection, pkgconfig, meson, ninja, glibcLocales, git, vala, glib, zlib }: stdenv.mkDerivation rec { name = "gcab-${version}"; - version = "0.7"; + version = "1.1"; + + LC_ALL = "en_US.UTF-8"; src = fetchurl { url = "mirror://gnome/sources/gcab/${version}/${name}.tar.xz"; - sha256 = "1vxdsiky3492zlyrym02sdwf09y19rl2z5h5iin7qm0wizw5wvm1"; + sha256 = "0l19sr6pg0cfcddmi5n79d08mjjbhn427ip5jlsy9zddq9r24aqr"; }; - nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ intltool gobjectIntrospection ]; + nativeBuildInputs = [ meson ninja glibcLocales git pkgconfig vala gettext gobjectIntrospection ]; + + buildInputs = [ glib zlib ]; + + mesonFlags = [ + "-Ddocs=false" + "-Dtests=false" + ]; meta = with stdenv.lib; { platforms = platforms.linux; From 8340cc5c6a3727fc5bbcaab9b9a2d1995a59a8e0 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Fri, 9 Feb 2018 22:23:17 -0600 Subject: [PATCH 04/12] fwupd: shared_mime_info is needed! --- pkgs/os-specific/linux/firmware/fwupd/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/os-specific/linux/firmware/fwupd/default.nix b/pkgs/os-specific/linux/firmware/fwupd/default.nix index a67a052e5fee..308260f7932d 100644 --- a/pkgs/os-specific/linux/firmware/fwupd/default.nix +++ b/pkgs/os-specific/linux/firmware/fwupd/default.nix @@ -3,6 +3,7 @@ , libsoup, docbook2x, gpgme, libxslt, libelf, libsmbios, efivar, glibcLocales , fwupdate, libyaml, valgrind, meson, libuuid, pygobject3, colord , pillow, ninja, gcab, gnutls, python3Packages, wrapGAppsHook, json_glib +, shared_mime_info }: let version = "1.0.4"; @@ -31,6 +32,10 @@ in stdenv.mkDerivation { patchShebangs . ''; + preFixup = '' + gappsWrapperArgs+=(--prefix XDG_DATA_DIRS : "${shared_mime_info}/share") + ''; + mesonFlags = [ "-Dman=false" "-Dtests=false" From 6665d4faa97784200f4eacdf2b947641a0866e6b Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 20 Dec 2017 06:32:16 +0100 Subject: [PATCH 05/12] =?UTF-8?q?appstream-glib:=200.7.2=20=E2=86=92=200.7?= =?UTF-8?q?.6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../libraries/appstream-glib/default.nix | 45 +++++++++++++------ .../libraries/appstream-glib/paths.patch | 11 +++++ 2 files changed, 43 insertions(+), 13 deletions(-) create mode 100644 pkgs/development/libraries/appstream-glib/paths.patch diff --git a/pkgs/development/libraries/appstream-glib/default.nix b/pkgs/development/libraries/appstream-glib/default.nix index d177c3acfa71..dc5de2b382a1 100644 --- a/pkgs/development/libraries/appstream-glib/default.nix +++ b/pkgs/development/libraries/appstream-glib/default.nix @@ -1,30 +1,49 @@ -{ stdenv, fetchFromGitHub, pkgconfig, gettext, gtk3, glib -, gtk_doc, libarchive, gobjectIntrospection -, sqlite, libsoup, gcab, attr, acl, docbook_xsl +{ stdenv, fetchFromGitHub, substituteAll, pkgconfig, gettext, gtk3, glib +, gtk_doc, libarchive, gobjectIntrospection, libxslt, pngquant +, sqlite, libsoup, gcab, attr, acl, docbook_xsl, docbook_xml_dtd_42 , libuuid, json_glib, meson, gperf, ninja }: stdenv.mkDerivation rec { - name = "appstream-glib-0.7.2"; + name = "appstream-glib-0.7.6"; + + outputs = [ "out" "dev" "man" ]; + outputBin = "dev"; src = fetchFromGitHub { owner = "hughsie"; repo = "appstream-glib"; rev = stdenv.lib.replaceStrings ["." "-"] ["_" "_"] name; - sha256 = "1jvwfida12d2snc8p9lpbpqzrixw2naaiwfmsrldwkrxsj3i19pl"; + sha256 = "1nzm6w9n7fb2m06w88gwszaqf74bnip87ay0ca59wajq6y4mpfgv"; }; - nativeBuildInputs = [ meson pkgconfig ninja ]; - buildInputs = [ glib gtk_doc gettext sqlite libsoup - gcab attr acl docbook_xsl libuuid json_glib - libarchive gobjectIntrospection gperf ]; + nativeBuildInputs = [ + meson pkgconfig ninja gtk_doc libxslt docbook_xsl docbook_xml_dtd_42 + ]; + buildInputs = [ + glib gettext sqlite libsoup + gcab attr acl libuuid json_glib + libarchive gobjectIntrospection gperf + ]; propagatedBuildInputs = [ gtk3 ]; - mesonFlags = [ "-Denable-rpm=false" "-Denable-stemmer=false" "-Denable-dep11=false" ]; + + patches = [ + (substituteAll { + src = ./paths.patch; + pngquant= "${pngquant}/bin/pngquant"; + }) + ]; + + mesonFlags = [ + "-Drpm=false" + "-Dstemmer=false" + "-Ddep11=false" + ]; meta = with stdenv.lib; { description = "Objects and helper methods to read and write AppStream metadata"; - homepage = https://github.com/hughsie/appstream-glib; - license = licenses.lgpl21Plus; - platforms = platforms.linux; + homepage = https://people.freedesktop.org/~hughsient/appstream-glib/; + license = licenses.lgpl2Plus; + platforms = platforms.linux; maintainers = with maintainers; [ lethalman matthewbauer ]; }; } diff --git a/pkgs/development/libraries/appstream-glib/paths.patch b/pkgs/development/libraries/appstream-glib/paths.patch new file mode 100644 index 000000000000..5c6396988a17 --- /dev/null +++ b/pkgs/development/libraries/appstream-glib/paths.patch @@ -0,0 +1,11 @@ +--- a/libappstream-builder/asb-utils.c ++++ b/libappstream-builder/asb-utils.c +@@ -294,7 +294,7 @@ + { + g_autofree gchar *standard_error = NULL; + gint exit_status = 0; +- const gchar *argv[] = { "/usr/bin/pngquant", "--skip-if-larger", ++ const gchar *argv[] = { "@pngquant@", "--skip-if-larger", + "--strip", "--ext", ".png", + "--force", "--speed", "1", filename, NULL }; + if (!g_file_test (argv[0], G_FILE_TEST_IS_EXECUTABLE)) From 2ea6f25ebc884db8ec85726042baec285b81c179 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 14 Feb 2018 02:08:53 +0100 Subject: [PATCH 06/12] fwupd: use correct libelf --- pkgs/os-specific/linux/firmware/fwupd/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/firmware/fwupd/default.nix b/pkgs/os-specific/linux/firmware/fwupd/default.nix index 308260f7932d..99cdcde5bdf3 100644 --- a/pkgs/os-specific/linux/firmware/fwupd/default.nix +++ b/pkgs/os-specific/linux/firmware/fwupd/default.nix @@ -1,6 +1,6 @@ { stdenv, fetchurl, gtk_doc, pkgconfig, gobjectIntrospection, intltool , libgudev, polkit, appstream-glib, gusb, sqlite, libarchive, glib_networking -, libsoup, docbook2x, gpgme, libxslt, libelf, libsmbios, efivar, glibcLocales +, libsoup, docbook2x, gpgme, libxslt, elfutils, libsmbios, efivar, glibcLocales , fwupdate, libyaml, valgrind, meson, libuuid, pygobject3, colord , pillow, ninja, gcab, gnutls, python3Packages, wrapGAppsHook, json_glib , shared_mime_info @@ -19,7 +19,7 @@ in stdenv.mkDerivation { valgrind gcab docbook2x libxslt pygobject3 python3Packages.pycairo wrapGAppsHook ]; buildInputs = [ - polkit appstream-glib gusb sqlite libarchive libsoup libelf libsmbios fwupdate libyaml + polkit appstream-glib gusb sqlite libarchive libsoup elfutils libsmbios fwupdate libyaml libgudev colord gpgme libuuid pillow gnutls glib_networking efivar json_glib ]; From 640916d55d93f2a0c0206f6384217d50aaab369b Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 14 Feb 2018 02:10:12 +0100 Subject: [PATCH 07/12] nixos/fwupd: add maintainers --- nixos/modules/services/hardware/fwupd.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nixos/modules/services/hardware/fwupd.nix b/nixos/modules/services/hardware/fwupd.nix index 14113fe01bb4..1f4acd21eccf 100644 --- a/nixos/modules/services/hardware/fwupd.nix +++ b/nixos/modules/services/hardware/fwupd.nix @@ -87,4 +87,8 @@ in { "d /var/lib/fwupd 0755 root root -" ]; }; + + meta = { + maintainers = pkgs.fwupd.maintainers; + }; } From be54e4b07e11bafd2ee91e91c781b7b06542d5e0 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 14 Feb 2018 03:06:38 +0100 Subject: [PATCH 08/12] fwupd: enable tests --- .../linux/firmware/fwupd/default.nix | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/pkgs/os-specific/linux/firmware/fwupd/default.nix b/pkgs/os-specific/linux/firmware/fwupd/default.nix index 99cdcde5bdf3..8e5342e5e11d 100644 --- a/pkgs/os-specific/linux/firmware/fwupd/default.nix +++ b/pkgs/os-specific/linux/firmware/fwupd/default.nix @@ -1,9 +1,9 @@ -{ stdenv, fetchurl, gtk_doc, pkgconfig, gobjectIntrospection, intltool +{ stdenv, fetchurl, fetchpatch, gtk_doc, pkgconfig, gobjectIntrospection, intltool , libgudev, polkit, appstream-glib, gusb, sqlite, libarchive, glib_networking , libsoup, docbook2x, gpgme, libxslt, elfutils, libsmbios, efivar, glibcLocales , fwupdate, libyaml, valgrind, meson, libuuid, pygobject3, colord , pillow, ninja, gcab, gnutls, python3Packages, wrapGAppsHook, json_glib -, shared_mime_info +, shared_mime_info, umockdev }: let version = "1.0.4"; @@ -14,31 +14,40 @@ in stdenv.mkDerivation { sha256 = "1n4d6fw3ffg051072hbxn106s52x2wlh5dh2kxwdfjsb5kh03ra3"; }; + outputs = [ "out" "installedTests" ]; + nativeBuildInputs = [ - meson ninja gtk_doc pkgconfig gobjectIntrospection intltool glibcLocales + meson ninja gtk_doc pkgconfig gobjectIntrospection intltool glibcLocales shared_mime_info valgrind gcab docbook2x libxslt pygobject3 python3Packages.pycairo wrapGAppsHook ]; buildInputs = [ polkit appstream-glib gusb sqlite libarchive libsoup elfutils libsmbios fwupdate libyaml - libgudev colord gpgme libuuid pillow gnutls glib_networking efivar json_glib + libgudev colord gpgme libuuid pillow gnutls glib_networking efivar json_glib umockdev ]; LC_ALL = "en_US.UTF-8"; # For po/make-images patches = [ ./fix-missing-deps.patch + # https://github.com/hughsie/fwupd/issues/403 + (fetchpatch { + url = https://github.com/hughsie/fwupd/commit/bd6082574989e4f48b66c7270bb408d439b77a06.patch; + sha256 = "17pixyizkmn6wlsjmr1wwya17ivn770hdv9mp769vifxinya8w9y"; + }) ]; postPatch = '' patchShebangs . + substituteInPlace data/installed-tests/fwupdmgr.test.in --subst-var-by installedtestsdir "$installedTests/share/installed-tests/fwupd" ''; + doCheck = true; + preFixup = '' gappsWrapperArgs+=(--prefix XDG_DATA_DIRS : "${shared_mime_info}/share") ''; mesonFlags = [ "-Dman=false" - "-Dtests=false" "-Dgtkdoc=false" "-Dbootdir=/boot" "-Dudevdir=lib/udev" @@ -46,10 +55,15 @@ in stdenv.mkDerivation { "--localstatedir=/var" ]; + postInstall = '' + moveToOutput share/installed-tests "$installedTests" + ''; + enableParallelBuilding = true; - meta = { + meta = with stdenv.lib; { homepage = https://fwupd.org/; - license = [ stdenv.lib.licenses.gpl2 ]; - platforms = stdenv.lib.platforms.linux; + maintainers = with maintainers; []; + license = [ licenses.gpl2 ]; + platforms = platforms.linux; }; } From 201cc158cb88b989eda48a5b4da12e187798b7b2 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 14 Feb 2018 05:03:20 +0100 Subject: [PATCH 09/12] nixos/fwupd: add test --- nixos/release.nix | 1 + nixos/tests/fwupd.nix | 19 +++++++++++++++ .../linux/firmware/fwupd/default.nix | 23 +++++++++++++++---- pkgs/top-level/all-packages.nix | 2 +- 4 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 nixos/tests/fwupd.nix diff --git a/nixos/release.nix b/nixos/release.nix index 4cae07dd99ac..f3d6eee1747f 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -258,6 +258,7 @@ in rec { tests.firefox = callTest tests/firefox.nix {}; tests.firewall = callTest tests/firewall.nix {}; tests.fleet = callTestOnTheseSystems ["x86_64-linux"] tests/fleet.nix {}; + tests.fwupd = callTest tests/fwupd.nix {}; #tests.gitlab = callTest tests/gitlab.nix {}; tests.gitolite = callTest tests/gitolite.nix {}; tests.gocd-agent = callTest tests/gocd-agent.nix {}; diff --git a/nixos/tests/fwupd.nix b/nixos/tests/fwupd.nix new file mode 100644 index 000000000000..bf4ef25130b3 --- /dev/null +++ b/nixos/tests/fwupd.nix @@ -0,0 +1,19 @@ +# run installed tests +import ./make-test.nix ({ pkgs, ... }: { + name = "fwupd"; + + meta = { + maintainers = pkgs.fwupd.meta.maintainers; + }; + + machine = { config, pkgs, ... }: { + services.fwupd.enable = true; + environment.systemPackages = with pkgs; [ gnome-desktop-testing ]; + environment.variables.XDG_DATA_DIRS = [ "${pkgs.fwupd.installedTests}/share" ]; + virtualisation.memorySize = 768; + }; + + testScript = '' + $machine->succeed("gnome-desktop-testing-runner"); + ''; +}) diff --git a/pkgs/os-specific/linux/firmware/fwupd/default.nix b/pkgs/os-specific/linux/firmware/fwupd/default.nix index 8e5342e5e11d..24cca3596c40 100644 --- a/pkgs/os-specific/linux/firmware/fwupd/default.nix +++ b/pkgs/os-specific/linux/firmware/fwupd/default.nix @@ -1,12 +1,14 @@ { stdenv, fetchurl, fetchpatch, gtk_doc, pkgconfig, gobjectIntrospection, intltool , libgudev, polkit, appstream-glib, gusb, sqlite, libarchive, glib_networking , libsoup, docbook2x, gpgme, libxslt, elfutils, libsmbios, efivar, glibcLocales -, fwupdate, libyaml, valgrind, meson, libuuid, pygobject3, colord -, pillow, ninja, gcab, gnutls, python3Packages, wrapGAppsHook, json_glib +, fwupdate, libyaml, valgrind, meson, libuuid, colord +, ninja, gcab, gnutls, python3, wrapGAppsHook, json_glib , shared_mime_info, umockdev }: let version = "1.0.4"; + python = python3.withPackages (p: with p; [ pygobject3 pycairo pillow ]); + installedTestsPython = python3.withPackages (p: with p; [ pygobject3 requests ]); in stdenv.mkDerivation { name = "fwupd-${version}"; src = fetchurl { @@ -18,11 +20,11 @@ in stdenv.mkDerivation { nativeBuildInputs = [ meson ninja gtk_doc pkgconfig gobjectIntrospection intltool glibcLocales shared_mime_info - valgrind gcab docbook2x libxslt pygobject3 python3Packages.pycairo wrapGAppsHook + valgrind gcab docbook2x libxslt python wrapGAppsHook ]; buildInputs = [ polkit appstream-glib gusb sqlite libarchive libsoup elfutils libsmbios fwupdate libyaml - libgudev colord gpgme libuuid pillow gnutls glib_networking efivar json_glib umockdev + libgudev colord gpgme libuuid gnutls glib_networking efivar json_glib umockdev ]; LC_ALL = "en_US.UTF-8"; # For po/make-images @@ -34,8 +36,18 @@ in stdenv.mkDerivation { url = https://github.com/hughsie/fwupd/commit/bd6082574989e4f48b66c7270bb408d439b77a06.patch; sha256 = "17pixyizkmn6wlsjmr1wwya17ivn770hdv9mp769vifxinya8w9y"; }) + # https://github.com/hughsie/fwupd/issues/405 + (fetchpatch { + url = https://github.com/hughsie/fwupd/pull/407.patch; + sha256 = "1dxhqps12x7bz0s974xk5hfpk4nwn1gs29vl0dfi9j54wy18f688"; + }) ]; + postPatch = '' + # needs a different set of modules than po/make-images + escapedInterpreterLine=$(echo "${installedTestsPython}/bin/python3" | sed 's|\\|\\\\|g') + sed -i -e "1 s|.*|#\!$escapedInterpreterLine|" data/installed-tests/hardware.py + patchShebangs . substituteInPlace data/installed-tests/fwupdmgr.test.in --subst-var-by installedtestsdir "$installedTests/share/installed-tests/fwupd" ''; @@ -48,6 +60,7 @@ in stdenv.mkDerivation { mesonFlags = [ "-Dman=false" + "-Dplugin_dummy=true" "-Dgtkdoc=false" "-Dbootdir=/boot" "-Dudevdir=lib/udev" @@ -57,6 +70,8 @@ in stdenv.mkDerivation { postInstall = '' moveToOutput share/installed-tests "$installedTests" + wrapProgram $installedTests/share/installed-tests/fwupd/hardware.py \ + --prefix GI_TYPELIB_PATH : "$out/lib/girepository-1.0:${libsoup}/lib/girepository-1.0" ''; enableParallelBuilding = true; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4d322bc7672e..ad4c3358a26e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12728,7 +12728,7 @@ with pkgs; fscrypt-experimental = callPackage ../os-specific/linux/fscrypt { }; fscryptctl-experimental = callPackage ../os-specific/linux/fscryptctl { }; - fwupd = callPackage ../os-specific/linux/firmware/fwupd { inherit (gnome2) gtk_doc; inherit (python3Packages) pygobject3 pillow; }; + fwupd = callPackage ../os-specific/linux/firmware/fwupd { inherit (gnome2) gtk_doc; }; fwupdate = callPackage ../os-specific/linux/firmware/fwupdate { }; From a5e46588ab4b212c719c8c72f66f7376aeec49c6 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 14 Feb 2018 16:18:23 +0100 Subject: [PATCH 10/12] fwupd: add devdoc --- pkgs/os-specific/linux/firmware/fwupd/default.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/os-specific/linux/firmware/fwupd/default.nix b/pkgs/os-specific/linux/firmware/fwupd/default.nix index 24cca3596c40..cf43cc88e0b7 100644 --- a/pkgs/os-specific/linux/firmware/fwupd/default.nix +++ b/pkgs/os-specific/linux/firmware/fwupd/default.nix @@ -1,7 +1,7 @@ { stdenv, fetchurl, fetchpatch, gtk_doc, pkgconfig, gobjectIntrospection, intltool , libgudev, polkit, appstream-glib, gusb, sqlite, libarchive, glib_networking , libsoup, docbook2x, gpgme, libxslt, elfutils, libsmbios, efivar, glibcLocales -, fwupdate, libyaml, valgrind, meson, libuuid, colord +, fwupdate, libyaml, valgrind, meson, libuuid, colord, docbook_xml_dtd_43, docbook_xsl , ninja, gcab, gnutls, python3, wrapGAppsHook, json_glib , shared_mime_info, umockdev }: @@ -16,11 +16,11 @@ in stdenv.mkDerivation { sha256 = "1n4d6fw3ffg051072hbxn106s52x2wlh5dh2kxwdfjsb5kh03ra3"; }; - outputs = [ "out" "installedTests" ]; + outputs = [ "out" "devdoc" "installedTests" ]; nativeBuildInputs = [ meson ninja gtk_doc pkgconfig gobjectIntrospection intltool glibcLocales shared_mime_info - valgrind gcab docbook2x libxslt python wrapGAppsHook + valgrind gcab docbook_xml_dtd_43 docbook_xsl docbook2x libxslt python wrapGAppsHook ]; buildInputs = [ polkit appstream-glib gusb sqlite libarchive libsoup elfutils libsmbios fwupdate libyaml @@ -61,7 +61,6 @@ in stdenv.mkDerivation { mesonFlags = [ "-Dman=false" "-Dplugin_dummy=true" - "-Dgtkdoc=false" "-Dbootdir=/boot" "-Dudevdir=lib/udev" "-Dsystemdunitdir=lib/systemd/system" From 200a08e649a118a5dda51fd8bb495cffdc800f5a Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 14 Feb 2018 16:39:07 +0100 Subject: [PATCH 11/12] fwupd: add manpage --- pkgs/os-specific/linux/firmware/fwupd/default.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/os-specific/linux/firmware/fwupd/default.nix b/pkgs/os-specific/linux/firmware/fwupd/default.nix index cf43cc88e0b7..858f1448dfac 100644 --- a/pkgs/os-specific/linux/firmware/fwupd/default.nix +++ b/pkgs/os-specific/linux/firmware/fwupd/default.nix @@ -1,6 +1,6 @@ { stdenv, fetchurl, fetchpatch, gtk_doc, pkgconfig, gobjectIntrospection, intltool , libgudev, polkit, appstream-glib, gusb, sqlite, libarchive, glib_networking -, libsoup, docbook2x, gpgme, libxslt, elfutils, libsmbios, efivar, glibcLocales +, libsoup, help2man, gpgme, libxslt, elfutils, libsmbios, efivar, glibcLocales , fwupdate, libyaml, valgrind, meson, libuuid, colord, docbook_xml_dtd_43, docbook_xsl , ninja, gcab, gnutls, python3, wrapGAppsHook, json_glib , shared_mime_info, umockdev @@ -16,11 +16,11 @@ in stdenv.mkDerivation { sha256 = "1n4d6fw3ffg051072hbxn106s52x2wlh5dh2kxwdfjsb5kh03ra3"; }; - outputs = [ "out" "devdoc" "installedTests" ]; + outputs = [ "out" "devdoc" "man" "installedTests" ]; nativeBuildInputs = [ meson ninja gtk_doc pkgconfig gobjectIntrospection intltool glibcLocales shared_mime_info - valgrind gcab docbook_xml_dtd_43 docbook_xsl docbook2x libxslt python wrapGAppsHook + valgrind gcab docbook_xml_dtd_43 docbook_xsl help2man libxslt python wrapGAppsHook ]; buildInputs = [ polkit appstream-glib gusb sqlite libarchive libsoup elfutils libsmbios fwupdate libyaml @@ -36,6 +36,11 @@ in stdenv.mkDerivation { url = https://github.com/hughsie/fwupd/commit/bd6082574989e4f48b66c7270bb408d439b77a06.patch; sha256 = "17pixyizkmn6wlsjmr1wwya17ivn770hdv9mp769vifxinya8w9y"; }) + # drop docbook2man + (fetchpatch { + url = https://github.com/hughsie/fwupd/commit/2c43d3e6e65868b66a9a64a76123697e259ec7c2.patch; + sha256 = "0vjv7jnai0g96frlipk2sc59pj3mhq9di01hajycjv7y5v6qqrmc"; + }) # https://github.com/hughsie/fwupd/issues/405 (fetchpatch { url = https://github.com/hughsie/fwupd/pull/407.patch; @@ -59,7 +64,6 @@ in stdenv.mkDerivation { ''; mesonFlags = [ - "-Dman=false" "-Dplugin_dummy=true" "-Dbootdir=/boot" "-Dudevdir=lib/udev" From f118d2be67c608fa4289cae800aefdb65af7e259 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 14 Feb 2018 16:45:20 +0100 Subject: [PATCH 12/12] fwupd: clean up --- pkgs/top-level/all-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ad4c3358a26e..9cd275c84bf3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12728,7 +12728,7 @@ with pkgs; fscrypt-experimental = callPackage ../os-specific/linux/fscrypt { }; fscryptctl-experimental = callPackage ../os-specific/linux/fscryptctl { }; - fwupd = callPackage ../os-specific/linux/firmware/fwupd { inherit (gnome2) gtk_doc; }; + fwupd = callPackage ../os-specific/linux/firmware/fwupd { }; fwupdate = callPackage ../os-specific/linux/firmware/fwupdate { };