diff options
author | Alyssa Ross <hi@alyssa.is> | 2021-08-04 10:43:07 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2021-08-04 10:43:07 +0000 |
commit | 62614cbef7da005c1eda8c9400160f6bcd6546b8 (patch) | |
tree | c2630f69080637987b68acb1ee8676d2681fe304 /pkgs/os-specific/linux/firmware/fwupd | |
parent | d9c82ed3044c72cecf01c6ea042489d30914577c (diff) | |
parent | e24069138dfec3ef94f211f1da005bb5395adc11 (diff) | |
download | nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.gz nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.bz2 nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.lz nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.xz nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.zst nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.zip |
Merge branch 'nixpkgs-update' into master
Diffstat (limited to 'pkgs/os-specific/linux/firmware/fwupd')
3 files changed, 175 insertions, 133 deletions
diff --git a/pkgs/os-specific/linux/firmware/fwupd/add-option-for-installation-sysconfdir.patch b/pkgs/os-specific/linux/firmware/fwupd/add-option-for-installation-sysconfdir.patch index a727e5f4a85..cd42f2f44e2 100644 --- a/pkgs/os-specific/linux/firmware/fwupd/add-option-for-installation-sysconfdir.patch +++ b/pkgs/os-specific/linux/firmware/fwupd/add-option-for-installation-sysconfdir.patch @@ -1,5 +1,5 @@ diff --git a/data/meson.build b/data/meson.build -index bb749fd4..b611875b 100644 +index 50154569..f8058a8e 100644 --- a/data/meson.build +++ b/data/meson.build @@ -17,7 +17,7 @@ endif @@ -73,10 +73,10 @@ index 826a3c1d..b78db663 100644 + install_dir: join_paths(sysconfdir_install, 'fwupd', 'remotes.d'), ) diff --git a/meson.build b/meson.build -index 87ea67e5..3a4374db 100644 +index b075ca89..8d504d3c 100644 --- a/meson.build +++ b/meson.build -@@ -175,6 +175,12 @@ endif +@@ -194,6 +194,12 @@ endif mandir = join_paths(prefix, get_option('mandir')) localedir = join_paths(prefix, get_option('localedir')) @@ -90,30 +90,14 @@ index 87ea67e5..3a4374db 100644 gio = dependency('gio-2.0', version : '>= 2.45.8') giounix = dependency('gio-unix-2.0', version : '>= 2.45.8', required: false) diff --git a/meson_options.txt b/meson_options.txt -index 3da9b6c4..6c80275b 100644 +index bc76c0ab..8a67d012 100644 --- a/meson_options.txt +++ b/meson_options.txt -@@ -24,6 +24,7 @@ option('plugin_coreboot', type : 'boolean', value : true, description : 'enable - option('systemd', type : 'boolean', value : true, description : 'enable systemd support') - option('systemdunitdir', type: 'string', value: '', description: 'Directory for systemd units') - option('elogind', type : 'boolean', value : false, description : 'enable elogind support') +@@ -1,3 +1,4 @@ +option('sysconfdir_install', type: 'string', value: '', description: 'sysconfdir to use during installation') - option('tests', type : 'boolean', value : true, description : 'enable tests') - option('udevdir', type: 'string', value: '', description: 'Directory for udev rules') - option('efi-cc', type : 'string', value : 'gcc', description : 'the compiler to use for EFI modules') -diff --git a/plugins/ata/meson.build b/plugins/ata/meson.build -index 8444bb8a..fa4a8ad1 100644 ---- a/plugins/ata/meson.build -+++ b/plugins/ata/meson.build -@@ -7,7 +7,7 @@ install_data([ - ) - - install_data(['ata.conf'], -- install_dir: join_paths(sysconfdir, 'fwupd') -+ install_dir: join_paths(sysconfdir_install, 'fwupd') - ) - - shared_module('fu_plugin_ata', + option('build', type : 'combo', choices : ['all', 'standalone', 'library'], value : 'all', description : 'build type') + option('agent', type : 'boolean', value : true, description : 'enable the fwupd agent') + option('consolekit', type : 'boolean', value : true, description : 'enable ConsoleKit support') diff --git a/plugins/dell-esrt/meson.build b/plugins/dell-esrt/meson.build index ed4eee70..76dbdb1d 100644 --- a/plugins/dell-esrt/meson.build @@ -126,7 +110,7 @@ index ed4eee70..76dbdb1d 100644 + install_dir: join_paths(sysconfdir_install, 'fwupd', 'remotes.d'), ) diff --git a/plugins/redfish/meson.build b/plugins/redfish/meson.build -index 25fc5c7d..77eb9a83 100644 +index 205d1394..3223f404 100644 --- a/plugins/redfish/meson.build +++ b/plugins/redfish/meson.build @@ -27,7 +27,7 @@ shared_module('fu_plugin_redfish', @@ -139,10 +123,10 @@ index 25fc5c7d..77eb9a83 100644 if get_option('tests') diff --git a/plugins/thunderbolt/meson.build b/plugins/thunderbolt/meson.build -index 06ab34ee..297a9182 100644 +index 6b2368fb..2bd06fed 100644 --- a/plugins/thunderbolt/meson.build +++ b/plugins/thunderbolt/meson.build -@@ -46,7 +46,7 @@ executable('tbtfwucli', +@@ -31,7 +31,7 @@ fu_plugin_thunderbolt = shared_module('fu_plugin_thunderbolt', ) install_data(['thunderbolt.conf'], @@ -151,14 +135,14 @@ index 06ab34ee..297a9182 100644 ) # we use functions from 2.52 in the tests if get_option('tests') and umockdev.found() and gio.version().version_compare('>= 2.52') -diff --git a/plugins/uefi/meson.build b/plugins/uefi/meson.build -index 5838cecc..9ba3d5cd 100644 ---- a/plugins/uefi/meson.build -+++ b/plugins/uefi/meson.build -@@ -101,7 +101,7 @@ if get_option('man') +diff --git a/plugins/uefi-capsule/meson.build b/plugins/uefi-capsule/meson.build +index 0b793a07..ebd3e5ea 100644 +--- a/plugins/uefi-capsule/meson.build ++++ b/plugins/uefi-capsule/meson.build +@@ -97,7 +97,7 @@ if get_option('man') endif - install_data(['uefi.conf'], + install_data(['uefi_capsule.conf'], - install_dir: join_paths(sysconfdir, 'fwupd') + install_dir: join_paths(sysconfdir_install, 'fwupd') ) diff --git a/pkgs/os-specific/linux/firmware/fwupd/default.nix b/pkgs/os-specific/linux/firmware/fwupd/default.nix index 0783fb79296..24e23f2b7e9 100644 --- a/pkgs/os-specific/linux/firmware/fwupd/default.nix +++ b/pkgs/os-specific/linux/firmware/fwupd/default.nix @@ -1,21 +1,20 @@ # Updating? Keep $out/etc synchronized with passthru keys -{ stdenv +{ lib, stdenv , fetchurl -, fetchpatch +, fetchFromGitHub , substituteAll , gtk-doc -, pkgconfig +, pkg-config , gobject-introspection -, intltool +, gettext , libgudev , polkit , libxmlb , gusb , sqlite , libarchive -, glib-networking -, libsoup +, curl , help2man , libjcat , libxslt @@ -23,15 +22,15 @@ , libsmbios , efivar , gnu-efi -, libyaml , valgrind , meson , libuuid , colord , docbook_xml_dtd_43 -, docbook_xsl +, docbook-xsl-nons , ninja , gcab +, gnutls , python3 , wrapGAppsHook , json-glib @@ -67,10 +66,6 @@ let requests ]); - fontsConf = makeFontsConf { - fontDirectories = [ freefont_ttf ]; - }; - isx86 = stdenv.isx86_64 || stdenv.isi686; # Dell isn't supported on Aarch64 @@ -79,6 +74,9 @@ let # only redfish for x86_64 haveRedfish = stdenv.isx86_64; + # only use msr if x86 (requires cpuid) + haveMSR = isx86; + # # Currently broken on Aarch64 # haveFlashrom = isx86; # Experimental @@ -93,30 +91,51 @@ let self = stdenv.mkDerivation rec { pname = "fwupd"; - version = "1.4.5"; - - src = fetchurl { - url = "https://people.freedesktop.org/~hughsient/releases/fwupd-${version}.tar.xz"; - sha256 = "0hpqxwqbbqn440c2swpnc06z8dskisrli4ynsxrzzqyp0dan46xw"; - }; + version = "1.5.7"; # libfwupd goes to lib # daemon, plug-ins and libfwupdplugin go to out # CLI programs go to out outputs = [ "out" "lib" "dev" "devdoc" "man" "installedTests" ]; + src = fetchurl { + url = "https://people.freedesktop.org/~hughsient/releases/fwupd-${version}.tar.xz"; + sha256 = "16isrrv6zhdgccbfnz7km5g1cnvfnip7aiidkfhf5dlnrnyb2sxh"; + }; + + patches = [ + # Do not try to create useless paths in /var. + ./fix-paths.patch + + # Allow installing + ./add-option-for-installation-sysconfdir.patch + + # Install plug-ins and libfwupdplugin to out, + # they are not really part of the library. + ./install-fwupdplugin-to-out.patch + + # Installed tests are installed to different output + # we also cannot have fwupd-tests.conf in $out/etc since it would form a cycle. + (substituteAll { + src = ./installed-tests-path.patch; + # Needs a different set of modules than po/make-images. + inherit installedTestsPython; + }) + ]; + nativeBuildInputs = [ meson ninja gtk-doc - pkgconfig + pkg-config gobject-introspection - intltool + gettext shared-mime-info valgrind gcab + gnutls docbook_xml_dtd_43 - docbook_xsl + docbook-xsl-nons help2man libxslt python @@ -130,15 +149,13 @@ let gusb sqlite libarchive - libsoup + curl elfutils gnu-efi - libyaml libgudev colord libjcat libuuid - glib-networking json-glib umockdev bash-completion @@ -148,63 +165,29 @@ let pango tpm2-tss efivar - ] ++ stdenv.lib.optionals haveDell [ + ] ++ lib.optionals haveDell [ libsmbios ]; - patches = [ - ./fix-paths.patch - ./add-option-for-installation-sysconfdir.patch - - # Install plug-ins and libfwupdplugin to out, - # they are not really part of the library. - ./install-fwupdplugin-to-out.patch - - # Installed tests are installed to different output - # we also cannot have fwupd-tests.conf in $out/etc since it would form a cycle. - (substituteAll { - src = ./installed-tests-path.patch; - # Needs a different set of modules than po/make-images. - inherit installedTestsPython; - }) - ]; - - postPatch = '' - patchShebangs \ - contrib/get-version.py \ - contrib/generate-version-script.py \ - meson_post_install.sh \ - po/make-images \ - po/make-images.sh \ - po/test-deps - ''; - - # /etc/os-release not available in sandbox - # doCheck = true; - - preFixup = let - binPath = [ - efibootmgr - bubblewrap - tpm2-tools - ] ++ stdenv.lib.optional haveFlashrom flashrom; - in '' - gappsWrapperArgs+=( - --prefix XDG_DATA_DIRS : "${shared-mime-info}/share" - # See programs reached with fu_common_find_program_in_path in source - --prefix PATH : "${stdenv.lib.makeBinPath binPath}" - ) - ''; - mesonFlags = [ "-Dgtkdoc=true" "-Dplugin_dummy=true" + # We are building the official releases. + "-Dsupported_build=true" + # Would dlopen libsoup to preserve compatibility with clients linking against older fwupd. + # https://github.com/fwupd/fwupd/commit/173d389fa59d8db152a5b9da7cc1171586639c97 + "-Dsoup_session_compat=false" "-Dudevdir=lib/udev" "-Dsystemd_root_prefix=${placeholder "out"}" "-Dinstalled_test_prefix=${placeholder "installedTests"}" "-Defi-libdir=${gnu-efi}/lib" "-Defi-ldsdir=${gnu-efi}/lib" "-Defi-includedir=${gnu-efi}/include/efi" + "-Defi_sbat_distro_id=nixos" + "-Defi_sbat_distro_summary=NixOS" + "-Defi_sbat_distro_pkgname=fwupd" + "-Defi_sbat_distro_version=${version}" + "-Defi_sbat_distro_url=https://search.nixos.org/packages?channel=unstable&show=fwupd&from=0&size=50&sort=relevance&query=fwupd" "--localstatedir=/var" "--sysconfdir=/etc" "-Dsysconfdir_install=${placeholder "out"}/etc" @@ -214,29 +197,83 @@ let # Our builder only adds $lib/lib to rpath but some things link # against libfwupdplugin which is in $out/lib. "-Dc_link_args=-Wl,-rpath,${placeholder "out"}/lib" - ] ++ stdenv.lib.optionals (!haveDell) [ + ] ++ lib.optionals (!haveDell) [ "-Dplugin_dell=false" "-Dplugin_synaptics=false" - ] ++ stdenv.lib.optionals (!haveRedfish) [ + ] ++ lib.optionals (!haveRedfish) [ "-Dplugin_redfish=false" - ] ++ stdenv.lib.optionals haveFlashrom [ + ] ++ lib.optionals haveFlashrom [ "-Dplugin_flashrom=true" + ] ++ lib.optionals (!haveMSR) [ + "-Dplugin_msr=false" ]; - FONTCONFIG_FILE = fontsConf; # Fontconfig error: Cannot load default config file + # TODO: wrapGAppsHook wraps efi capsule even though it is not ELF + dontWrapGApps = true; + + # /etc/os-release not available in sandbox + # doCheck = true; + + # Environment variables + + # Fontconfig error: Cannot load default config file + FONTCONFIG_FILE = + let + fontsConf = makeFontsConf { + fontDirectories = [ freefont_ttf ]; + }; + in fontsConf; # error: “PolicyKit files are missing” # https://github.com/NixOS/nixpkgs/pull/67625#issuecomment-525788428 PKG_CONFIG_POLKIT_GOBJECT_1_ACTIONDIR = "/run/current-system/sw/share/polkit-1/actions"; - # TODO: wrapGAppsHook wraps efi capsule even though it is not elf - dontWrapGApps = true; + # Phase hooks + + postPatch = '' + patchShebangs \ + contrib/get-version.py \ + contrib/generate-version-script.py \ + meson_post_install.sh \ + plugins/uefi-capsule/efi/generate_sbat.py \ + plugins/uefi-capsule/efi/generate_binary.py \ + po/make-images \ + po/make-images.sh \ + po/test-deps + ''; preCheck = '' addToSearchPath XDG_DATA_DIRS "${shared-mime-info}/share" ''; - # so we need to wrap the executables manually + postInstall = + let + testFw = fetchFromGitHub { + owner = "fwupd"; + repo = "fwupd-test-firmware"; + rev = "c13bfb26cae5f4f115dd4e08f9f00b3cb9acc25e"; + sha256 = "US81i7mtLEe85KdWz5r+fQTk61IhqjVkzykBaBPuKL4="; + }; + in '' + # These files have weird licenses so they are shipped separately. + cp --recursive --dereference "${testFw}/installed-tests/tests" "$installedTests/libexec/installed-tests/fwupd" + ''; + + preFixup = let + binPath = [ + efibootmgr + bubblewrap + tpm2-tools + ] ++ lib.optional haveFlashrom flashrom; + in '' + gappsWrapperArgs+=( + --prefix XDG_DATA_DIRS : "${shared-mime-info}/share" + # See programs reached with fu_common_find_program_in_path in source + --prefix PATH : "${lib.makeBinPath binPath}" + ) + ''; + + # Since we had to disable wrapGAppsHook, we need to wrap the executables manually. postFixup = '' find -L "$out/bin" "$out/libexec" -type f -executable -print0 \ | while IFS= read -r -d ''' file; do @@ -247,18 +284,18 @@ let done ''; + separateDebugInfo = true; + passthru = { filesInstalledToEtc = [ - "fwupd/ata.conf" "fwupd/daemon.conf" - "fwupd/redfish.conf" "fwupd/remotes.d/lvfs-testing.conf" "fwupd/remotes.d/lvfs.conf" "fwupd/remotes.d/vendor.conf" "fwupd/remotes.d/vendor-directory.conf" "fwupd/thunderbolt.conf" "fwupd/upower.conf" - "fwupd/uefi.conf" + "fwupd/uefi_capsule.conf" "pki/fwupd/GPG-KEY-Hughski-Limited" "pki/fwupd/GPG-KEY-Linux-Foundation-Firmware" "pki/fwupd/GPG-KEY-Linux-Vendor-Firmware-Service" @@ -266,18 +303,21 @@ let "pki/fwupd-metadata/GPG-KEY-Linux-Foundation-Metadata" "pki/fwupd-metadata/GPG-KEY-Linux-Vendor-Firmware-Service" "pki/fwupd-metadata/LVFS-CA.pem" - ] ++ stdenv.lib.optionals haveDell [ + ] ++ lib.optionals haveDell [ "fwupd/remotes.d/dell-esrt.conf" + ] ++ lib.optionals haveRedfish [ + "fwupd/redfish.conf" ]; - # BlacklistPlugins key in fwupd/daemon.conf - defaultBlacklistedPlugins = [ + # DisabledPlugins key in fwupd/daemon.conf + defaultDisabledPlugins = [ "test" + "test_ble" "invalid" ]; tests = let - listToPy = list: "[${stdenv.lib.concatMapStringsSep ", " (f: "'${f}'") list}]"; + listToPy = list: "[${lib.concatMapStringsSep ", " (f: "'${f}'") list}]"; in { installedTests = nixosTests.installed-tests.fwupd; @@ -295,19 +335,19 @@ let config = configparser.RawConfigParser() config.read('${self}/etc/fwupd/daemon.conf') - package_blacklisted_plugins = config.get('fwupd', 'BlacklistPlugins').rstrip(';').split(';') - passthru_blacklisted_plugins = ${listToPy passthru.defaultBlacklistedPlugins} - assert package_blacklisted_plugins == passthru_blacklisted_plugins, f'Default blacklisted plug-ins in the package {package_blacklisted_plugins} do not match those listed in passthru.defaultBlacklistedPlugins {passthru_blacklisted_plugins}' + package_disabled_plugins = config.get('fwupd', 'DisabledPlugins').rstrip(';').split(';') + passthru_disabled_plugins = ${listToPy passthru.defaultDisabledPlugins} + assert package_disabled_plugins == passthru_disabled_plugins, f'Default disabled plug-ins in the package {package_disabled_plugins} do not match those listed in passthru.defaultDisabledPlugins {passthru_disabled_plugins}' pathlib.Path(os.getenv('out')).touch() ''; }; }; - meta = with stdenv.lib; { + meta = with lib; { homepage = "https://fwupd.org/"; maintainers = with maintainers; [ jtojnar ]; - license = [ licenses.gpl2 ]; + license = licenses.lgpl21Plus; platforms = platforms.linux; }; }; diff --git a/pkgs/os-specific/linux/firmware/fwupd/installed-tests-path.patch b/pkgs/os-specific/linux/firmware/fwupd/installed-tests-path.patch index 432056cbe7f..d8f1a533b82 100644 --- a/pkgs/os-specific/linux/firmware/fwupd/installed-tests-path.patch +++ b/pkgs/os-specific/linux/firmware/fwupd/installed-tests-path.patch @@ -1,3 +1,5 @@ +diff --git a/data/device-tests/hardware.py b/data/device-tests/hardware.py +index 7f1e1907..10fee1b8 100755 --- a/data/device-tests/hardware.py +++ b/data/device-tests/hardware.py @@ -1,4 +1,4 @@ @@ -6,25 +8,41 @@ # pylint: disable=wrong-import-position,too-many-locals,unused-argument,wrong-import-order # # Copyright (C) 2017 Richard Hughes <richard@hughsie.com> +diff --git a/data/installed-tests/meson.build b/data/installed-tests/meson.build +index adadbcdd..1b51bb9c 100644 --- a/data/installed-tests/meson.build +++ b/data/installed-tests/meson.build -@@ -1,4 +1,4 @@ --installed_test_datadir = join_paths(datadir, 'installed-tests', 'fwupd') -+installed_test_datadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests', 'fwupd') - - con2 = configuration_data() - con2.set('installedtestsdir', installed_test_datadir) -@@ -52,5 +52,5 @@ configure_file( +@@ -65,5 +65,5 @@ configure_file( output : 'fwupd-tests.conf', configuration : con2, install: true, - install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'), + install_dir: join_paths(get_option('installed_test_prefix'), 'etc', 'fwupd', 'remotes.d'), ) +diff --git a/meson.build b/meson.build +index 772b7bbe..f59302cd 100644 +--- a/meson.build ++++ b/meson.build +@@ -177,8 +177,8 @@ else + datadir = join_paths(prefix, get_option('datadir')) + sysconfdir = join_paths(prefix, get_option('sysconfdir')) + localstatedir = join_paths(prefix, get_option('localstatedir')) +- installed_test_bindir = join_paths(libexecdir, 'installed-tests', meson.project_name()) +- installed_test_datadir = join_paths(datadir, 'installed-tests', meson.project_name()) ++ installed_test_bindir = join_paths(get_option('installed_test_prefix'), 'libexec', 'installed-tests', meson.project_name()) ++ installed_test_datadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests', meson.project_name()) + endif + mandir = join_paths(prefix, get_option('mandir')) + localedir = join_paths(prefix, get_option('localedir')) +diff --git a/meson_options.txt b/meson_options.txt +index 0a0e2853..5f68d78b 100644 --- a/meson_options.txt +++ b/meson_options.txt -@@ -1,3 +1,4 @@ -+option('installed_test_prefix', type: 'string', value: '', description: 'Prefix for installed tests') - option('build', type : 'combo', choices : ['all', 'standalone', 'library'], value : 'all', description : 'build type') - option('agent', type : 'boolean', value : true, description : 'enable the fwupd agent') - option('consolekit', type : 'boolean', value : true, description : 'enable ConsoleKit support') +@@ -25,6 +26,7 @@ option('plugin_coreboot', type : 'boolean', value : true, description : 'enable + option('systemd', type : 'boolean', value : true, description : 'enable systemd support') + option('systemd_root_prefix', type: 'string', value: '', description: 'Directory to base systemd’s installation directories on') + option('elogind', type : 'boolean', value : false, description : 'enable elogind support') ++option('installed_test_prefix', type: 'string', description: 'Prefix for installed tests') + option('tests', type : 'boolean', value : true, description : 'enable tests') + option('tpm', type : 'boolean', value : true, description : 'enable TPM support') + option('udevdir', type: 'string', value: '', description: 'Directory for udev rules') |