summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
authorBernardo Meurer <bernardo@meurer.org>2023-01-23 12:57:35 -0500
committerGitHub <noreply@github.com>2023-01-23 12:57:35 -0500
commite2881617a4b5355e45c51f616cf4f7c198c5fe13 (patch)
tree79a47a7b91aa06e2160575b8cc4fd6acbb44f09a /pkgs/os-specific
parenta8f575995434695a10b574d35ca51b0f26ae9049 (diff)
parent815282d1c0308de5bcc59d84b4a0ee97403271df (diff)
downloadnixpkgs-e2881617a4b5355e45c51f616cf4f7c198c5fe13.tar
nixpkgs-e2881617a4b5355e45c51f616cf4f7c198c5fe13.tar.gz
nixpkgs-e2881617a4b5355e45c51f616cf4f7c198c5fe13.tar.bz2
nixpkgs-e2881617a4b5355e45c51f616cf4f7c198c5fe13.tar.lz
nixpkgs-e2881617a4b5355e45c51f616cf4f7c198c5fe13.tar.xz
nixpkgs-e2881617a4b5355e45c51f616cf4f7c198c5fe13.tar.zst
nixpkgs-e2881617a4b5355e45c51f616cf4f7c198c5fe13.zip
Merge pull request #212032 from SuperSandro2000/fwupd
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/linux/firmware/fwupd/add-option-for-installation-sysconfdir.patch63
-rw-r--r--pkgs/os-specific/linux/firmware/fwupd/default.nix43
-rw-r--r--pkgs/os-specific/linux/firmware/fwupd/efi-app-path.patch6
-rw-r--r--pkgs/os-specific/linux/firmware/fwupd/install-fwupdplugin-to-out.patch37
-rw-r--r--pkgs/os-specific/linux/firmware/fwupd/installed-tests-path.patch29
5 files changed, 72 insertions, 106 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 2a6ae96cef1..cb33eb1c214 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
@@ -10,7 +10,7 @@ index b0ff5b106..13ac380d0 100644
  )
  endif
 diff --git a/data/meson.build b/data/meson.build
-index 3a77a7bfc..747bd1988 100644
+index 865b20e26..ff1c2657b 100644
 --- a/data/meson.build
 +++ b/data/meson.build
 @@ -26,7 +26,7 @@ endif
@@ -20,8 +20,8 @@ index 3a77a7bfc..747bd1988 100644
 -    install_dir: join_paths(sysconfdir, 'fwupd')
 +    install_dir: join_paths(sysconfdir_install, 'fwupd')
    )
-   plugin_quirks += join_paths(meson.current_source_dir(), 'power.quirk')
-   plugin_quirks += join_paths(meson.current_source_dir(), 'cfi.quirk')
+   plugin_quirks += files([
+     'power.quirk',
 diff --git a/data/pki/meson.build b/data/pki/meson.build
 index 3649fecea..c3462744b 100644
 --- a/data/pki/meson.build
@@ -57,28 +57,27 @@ index 3649fecea..c3462744b 100644
  )
  endif
 diff --git a/data/remotes.d/meson.build b/data/remotes.d/meson.build
-index 1d1698a7e..5469d00a6 100644
+index c20a1a05e..87b1fa930 100644
 --- a/data/remotes.d/meson.build
 +++ b/data/remotes.d/meson.build
-@@ -2,7 +2,7 @@ if build_standalone and get_option('lvfs') != 'false'
-   install_data([
-       'lvfs-testing.conf',
-     ],
--    install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d')
-+    install_dir: join_paths(sysconfdir_install, 'fwupd', 'remotes.d')
-   )
-   con3 = configuration_data()
-   if get_option('lvfs') == 'disabled'
-@@ -15,7 +15,7 @@ if build_standalone and get_option('lvfs') != 'false'
+@@ -15,14 +15,14 @@ if build_standalone and get_option('lvfs') != 'false'
      output: 'lvfs.conf',
      configuration: con3,
      install: true,
 -    install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
 +    install_dir: join_paths(sysconfdir_install, 'fwupd', 'remotes.d'),
    )
+   configure_file(
+     input: 'lvfs-testing.conf',
+     output: 'lvfs-testing.conf',
+     configuration: con3,
+     install: true,
+-    install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
++    install_dir: join_paths(sysconfdir_install, 'fwupd', 'remotes.d'),
+   )
    i18n.merge_file(
      input: 'lvfs.metainfo.xml',
-@@ -49,12 +49,12 @@ configure_file(
+@@ -54,12 +54,12 @@ configure_file(
    output: 'vendor.conf',
    configuration: con2,
    install: true,
@@ -94,10 +93,10 @@ index 1d1698a7e..5469d00a6 100644
 +  install_dir: join_paths(sysconfdir_install, 'fwupd', 'remotes.d'),
  )
 diff --git a/meson.build b/meson.build
-index e7980e965..2c66e2dc4 100644
+index d3e08af43..30011f548 100644
 --- a/meson.build
 +++ b/meson.build
-@@ -195,6 +195,12 @@ endif
+@@ -193,6 +193,12 @@ endif
  mandir = join_paths(prefix, get_option('mandir'))
  localedir = join_paths(prefix, get_option('localedir'))
  
@@ -111,7 +110,7 @@ index e7980e965..2c66e2dc4 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 6cf92e72e..2e8568292 100644
+index 204690640..6fc7e8437 100644
 --- a/meson_options.txt
 +++ b/meson_options.txt
 @@ -1,3 +1,4 @@
@@ -120,10 +119,10 @@ index 6cf92e72e..2e8568292 100644
  option('consolekit', type : 'feature', description : 'ConsoleKit support', deprecated: {'true': 'enabled', 'false': 'disabled'})
  option('static_analysis', type : 'boolean', value : false, description : 'enable GCC static analysis support')
 diff --git a/plugins/dell-esrt/meson.build b/plugins/dell-esrt/meson.build
-index 67bd3b9d9..ad04a91b6 100644
+index 88c039f85..62a7691f3 100644
 --- a/plugins/dell-esrt/meson.build
 +++ b/plugins/dell-esrt/meson.build
-@@ -38,6 +38,6 @@ configure_file(
+@@ -27,6 +27,6 @@ configure_file(
    output: 'dell-esrt.conf',
    configuration: con2,
    install: true,
@@ -132,7 +131,7 @@ index 67bd3b9d9..ad04a91b6 100644
  )
  endif
 diff --git a/plugins/msr/meson.build b/plugins/msr/meson.build
-index d626c3ad3..5a2f847d5 100644
+index 23ec5ec82..b03826fc0 100644
 --- a/plugins/msr/meson.build
 +++ b/plugins/msr/meson.build
 @@ -10,7 +10,7 @@ install_data(['fwupd-msr.conf'],
@@ -142,27 +141,27 @@ index d626c3ad3..5a2f847d5 100644
 -  install_dir: join_paths(sysconfdir, 'fwupd')
 +  install_dir: join_paths(sysconfdir_install, 'fwupd')
  )
- shared_module('fu_plugin_msr',
-   fu_hash,
+ plugin_builtins += static_library('fu_plugin_msr',
+   sources: [
 diff --git a/plugins/redfish/meson.build b/plugins/redfish/meson.build
-index 95606e478..e5355e520 100644
+index 1e35b6ce9..33ca1447f 100644
 --- a/plugins/redfish/meson.build
 +++ b/plugins/redfish/meson.build
-@@ -43,7 +43,7 @@ shared_module('fu_plugin_redfish',
- )
+@@ -35,7 +35,7 @@ plugin_builtin_redfish = static_library('fu_plugin_redfish',
+ plugin_builtins += plugin_builtin_redfish
  
  install_data(['redfish.conf'],
 -  install_dir: join_paths(sysconfdir, 'fwupd'),
 +  install_dir: join_paths(sysconfdir_install, 'fwupd'),
+   install_mode: 'rw-r-----',
  )
  
- if get_option('tests')
 diff --git a/plugins/thunderbolt/meson.build b/plugins/thunderbolt/meson.build
-index 5f8ffbf90..9ba323e75 100644
+index 71d930e62..399fb5781 100644
 --- a/plugins/thunderbolt/meson.build
 +++ b/plugins/thunderbolt/meson.build
-@@ -32,7 +32,7 @@ fu_plugin_thunderbolt = shared_module('fu_plugin_thunderbolt',
- )
+@@ -19,7 +19,7 @@ plugin_builtin_thunderbolt = static_library('fu_plugin_thunderbolt',
+ plugin_builtins += plugin_builtin_thunderbolt
  
  install_data(['thunderbolt.conf'],
 -  install_dir: join_paths(sysconfdir, 'fwupd')
@@ -171,7 +170,7 @@ index 5f8ffbf90..9ba323e75 100644
  # we use functions from 2.52 in the tests
  if get_option('tests') and run_sanitize_unsafe_tests and umockdev.found() and gio.version().version_compare('>= 2.52')
 diff --git a/plugins/uefi-capsule/meson.build b/plugins/uefi-capsule/meson.build
-index ef38dc03e..78ff65e1d 100644
+index b4b038313..9c5407c3f 100644
 --- a/plugins/uefi-capsule/meson.build
 +++ b/plugins/uefi-capsule/meson.build
 @@ -20,7 +20,7 @@ if host_machine.system() == 'linux'
@@ -183,7 +182,7 @@ index ef38dc03e..78ff65e1d 100644
    )
  elif host_machine.system() == 'freebsd'
    backend_srcs += 'fu-uefi-backend-freebsd.c'
-@@ -110,7 +110,7 @@ if get_option('compat_cli') and get_option('man')
+@@ -87,7 +87,7 @@ if get_option('compat_cli') and get_option('man')
  endif
  
  install_data(['uefi_capsule.conf'],
diff --git a/pkgs/os-specific/linux/firmware/fwupd/default.nix b/pkgs/os-specific/linux/firmware/fwupd/default.nix
index 66cfbef940b..45716087987 100644
--- a/pkgs/os-specific/linux/firmware/fwupd/default.nix
+++ b/pkgs/os-specific/linux/firmware/fwupd/default.nix
@@ -15,6 +15,7 @@
 , gusb
 , sqlite
 , libarchive
+, libredirect
 , curl
 , libjcat
 , elfutils
@@ -30,6 +31,7 @@
 , protobufc
 , python3
 , wrapGAppsNoGuiHook
+, ensureNewerSourcesForZipFilesHook
 , json-glib
 , bash-completion
 , shared-mime-info
@@ -85,13 +87,13 @@ let
 
   test-firmware =
     let
-      version = "unstable-2021-11-02";
+      version = "unstable-2022-04-02";
       src = fetchFromGitHub {
         name = "fwupd-test-firmware-${version}";
         owner = "fwupd";
         repo = "fwupd-test-firmware";
-        rev = "aaa2f9fd68a40684c256dd85b86093cba38ffd9d";
-        sha256 = "Slk7CNfkmvmOh3WtIBkPs3NYT96co6i8PwqcbpeVFgA=";
+        rev = "39954e434d63e20e85870dd1074818f48a0c08b7";
+        hash = "sha256-d4qG3fKyxkfN91AplRYqARFz+aRr+R37BpE450bPxi0=";
         passthru = {
           inherit src version; # For update script
           updateScript = unstableGitUpdater {
@@ -114,7 +116,7 @@ let
 
   self = stdenv.mkDerivation rec {
     pname = "fwupd";
-    version = "1.8.4";
+    version = "1.8.9";
 
     # libfwupd goes to lib
     # daemon, plug-ins and libfwupdplugin go to out
@@ -123,7 +125,7 @@ let
 
     src = fetchurl {
       url = "https://people.freedesktop.org/~hughsient/releases/fwupd-${version}.tar.xz";
-      sha256 = "sha256-rfoHQ0zcKexBxA/vRg6Nlwlj/gx+hJ3sfzkyrbFh+IY=";
+      hash = "sha256-cZp5GsS6WYiuuT7EJ3i9ZdM8sHXQwJO1wE5eFoK+Uoo=";
     };
 
     patches = [
@@ -147,6 +149,8 @@ let
     ];
 
     nativeBuildInputs = [
+      # required for firmware zipping
+      ensureNewerSourcesForZipFilesHook
       meson
       ninja
       gi-docgen
@@ -187,7 +191,7 @@ let
       libmbim
       libcbor
       libqmi
-      xz # for liblzma.
+      xz # for liblzma
     ] ++ lib.optionals haveDell [
       libsmbios
     ] ++ lib.optionals haveFlashrom [
@@ -210,14 +214,9 @@ let
       "-Dsysconfdir_install=${placeholder "out"}/etc"
       "-Defi_os_dir=nixos"
       "-Dplugin_modem_manager=enabled"
-      # Requires Meson 0.63
-      "-Dgresource_quirks=disabled"
 
       # We do not want to place the daemon into lib (cyclic reference)
       "--libexecdir=${placeholder "out"}/libexec"
-      # 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"
     ] ++ lib.optionals (!haveDell) [
       "-Dplugin_dell=disabled"
       "-Dplugin_synaptics_mst=disabled"
@@ -232,8 +231,7 @@ let
     # TODO: wrapGAppsHook wraps efi capsule even though it is not ELF
     dontWrapGApps = true;
 
-    # /etc/os-release not available in sandbox
-    # doCheck = true;
+    doCheck = true;
 
     # Environment variables
 
@@ -254,16 +252,18 @@ let
     postPatch = ''
       patchShebangs \
         contrib/generate-version-script.py \
-        meson_post_install.sh \
         po/test-deps
 
-      # This checks a version of a dependency of gi-docgen but gi-docgen is self-contained in Nixpkgs.
-      echo "Clearing docs/test-deps.py"
-      test -f docs/test-deps.py
-      echo > docs/test-deps.py
-
       substituteInPlace data/installed-tests/fwupdmgr-p2p.sh \
         --replace "gdbus" ${glib.bin}/bin/gdbus
+
+      # tests fail with: Failed to load SMBIOS: neither SMBIOS or DT found
+      sed -i 's/test(.*)//' plugins/lenovo-thinklmi/meson.build
+      sed -i 's/test(.*)//' plugins/mtd/meson.build
+      # fails on amd cpu
+      sed -i 's/test(.*)//' libfwupdplugin/meson.build
+      # in nixos test tries to chmod 0777 $out/share/installed-tests/fwupd/tests/redfish.conf
+      sed -i "s/get_option('tests')/false/" plugins/redfish/meson.build
     '';
 
     preBuild = ''
@@ -273,6 +273,10 @@ let
 
     preCheck = ''
       addToSearchPath XDG_DATA_DIRS "${shared-mime-info}/share"
+
+      echo "12345678901234567890123456789012" > machine-id
+      export NIX_REDIRECTS=/etc/machine-id=$(realpath machine-id) \
+      LD_PRELOAD=${libredirect}/lib/libredirect.so
     '';
 
     preInstall = ''
@@ -349,7 +353,6 @@ let
       defaultDisabledPlugins = [
         "test"
         "test_ble"
-        "invalid"
       ];
 
       # For updating.
diff --git a/pkgs/os-specific/linux/firmware/fwupd/efi-app-path.patch b/pkgs/os-specific/linux/firmware/fwupd/efi-app-path.patch
index afee6d9f61e..a91adc1a69b 100644
--- a/pkgs/os-specific/linux/firmware/fwupd/efi-app-path.patch
+++ b/pkgs/os-specific/linux/firmware/fwupd/efi-app-path.patch
@@ -1,13 +1,13 @@
 diff --git a/meson.build b/meson.build
-index b91dd037..01d70a61 100644
+index 7ac8c937a..5a23d0c80 100644
 --- a/meson.build
 +++ b/meson.build
-@@ -413,7 +413,7 @@ if build_standalone and efiboot.found() and efivar.found()
+@@ -419,7 +419,7 @@ if build_standalone and efiboot.found() and efivar.found()
      conf.set('HAVE_EFI_TIME_T', '1')
    endif
  
 -  efi_app_location = join_paths(libexecdir, 'fwupd', 'efi')
-+  efi_app_location = join_paths(dependency('fwupd-efi').get_pkgconfig_variable('prefix'), 'libexec', 'fwupd', 'efi')
++  efi_app_location = join_paths(dependency('fwupd-efi').get_variable(pkgconfig: 'prefix'), 'libexec', 'fwupd', 'efi')
    conf.set_quoted('EFI_APP_LOCATION', efi_app_location)
  
    if host_cpu == 'x86'
diff --git a/pkgs/os-specific/linux/firmware/fwupd/install-fwupdplugin-to-out.patch b/pkgs/os-specific/linux/firmware/fwupd/install-fwupdplugin-to-out.patch
index f3369b6e133..e6269ae840b 100644
--- a/pkgs/os-specific/linux/firmware/fwupd/install-fwupdplugin-to-out.patch
+++ b/pkgs/os-specific/linux/firmware/fwupd/install-fwupdplugin-to-out.patch
@@ -1,37 +1,14 @@
-diff --git a/libfwupdplugin/meson.build b/libfwupdplugin/meson.build
-index 1afa28e1..3da81d30 100644
---- a/libfwupdplugin/meson.build
-+++ b/libfwupdplugin/meson.build
-@@ -220,7 +220,8 @@ fwupdplugin = library(
-   ],
-   link_args: cc.get_supported_link_arguments([vflag]),
-   link_depends: fwupdplugin_mapfile,
--  install: true
-+  install: true,
-+  install_dir: bindir / '..' / 'lib',
- )
- 
- fwupdplugin_pkgg = import('pkgconfig')
-@@ -280,7 +281,8 @@ if introspection.allowed()
-       girtargets,
-       fwupd_gir[0],
-     ],
--    install: true
-+    install: true,
-+    install_dir_typelib: bindir / '..' / 'lib' / 'girepository-1.0',
-   )
- 
-   # Verify the map file is correct -- note we can't actually use the generated
 diff --git a/meson.build b/meson.build
-index b91dd037..f97b4c26 100644
+index 9ae278b66..7cddf1a0d 100644
 --- a/meson.build
 +++ b/meson.build
-@@ -504,7 +504,7 @@ if build_standalone
+@@ -507,7 +507,7 @@ if build_standalone
  if host_machine.system() == 'windows'
-   plugin_dir = 'fwupd-plugins-@0@'.format(libfwupdplugin_lt_current)
+   libdir_pkg = 'fwupd-@0@'.format(fwupd_version)
  else
--  plugin_dir = join_paths(libdir, 'fwupd-plugins-@0@'.format(libfwupdplugin_lt_current))
-+  plugin_dir = join_paths(bindir, '..', 'lib', 'fwupd-plugins-@0@'.format(libfwupdplugin_lt_current))
+-  libdir_pkg = join_paths(libdir, 'fwupd-@0@'.format(fwupd_version))
++  libdir_pkg = join_paths(prefix, 'lib', 'fwupd-@0@'.format(fwupd_version))
  endif
- conf.set_quoted('FWUPD_PLUGINDIR', plugin_dir)
+ conf.set_quoted('FWUPD_LIBDIR_PKG', libdir_pkg)
  endif
+
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 49bca65d9c6..a914f56c66d 100644
--- a/pkgs/os-specific/linux/firmware/fwupd/installed-tests-path.patch
+++ b/pkgs/os-specific/linux/firmware/fwupd/installed-tests-path.patch
@@ -1,19 +1,19 @@
 diff --git a/data/installed-tests/meson.build b/data/installed-tests/meson.build
-index b8ec916f..38209b36 100644
+index be3d5c6d9..14d45dcaf 100644
 --- a/data/installed-tests/meson.build
 +++ b/data/installed-tests/meson.build
 @@ -83,5 +83,5 @@ configure_file(
-   output : 'fwupd-tests.conf',
-   configuration : con2,
+   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 b91dd037..d7e20b18 100644
+index 30011f548..7ac8c937a 100644
 --- a/meson.build
 +++ b/meson.build
-@@ -188,8 +188,8 @@ else
+@@ -186,8 +186,8 @@ else
    datadir = join_paths(prefix, get_option('datadir'))
    sysconfdir = join_paths(prefix, get_option('sysconfdir'))
    localstatedir = join_paths(prefix, get_option('localstatedir'))
@@ -24,7 +24,7 @@ index b91dd037..d7e20b18 100644
    daemon_dir = join_paths(libexecdir, 'fwupd')
  endif
  mandir = join_paths(prefix, get_option('mandir'))
-@@ -492,6 +492,7 @@ gnome = import('gnome')
+@@ -498,6 +498,7 @@ gnome = import('gnome')
  i18n = import('i18n')
  
  conf.set_quoted('FWUPD_PREFIX', prefix)
@@ -33,10 +33,10 @@ index b91dd037..d7e20b18 100644
  conf.set_quoted('FWUPD_LIBDIR', libdir)
  conf.set_quoted('FWUPD_LIBEXECDIR', libexecdir)
 diff --git a/meson_options.txt b/meson_options.txt
-index d00038db..be1c45b4 100644
+index 6fc7e8437..29832fd08 100644
 --- a/meson_options.txt
 +++ b/meson_options.txt
-@@ -56,6 +56,7 @@ option('systemd', type : 'feature', description : 'systemd support', deprecated:
+@@ -57,6 +57,7 @@ option('systemd', type : 'feature', description : 'systemd support', deprecated:
  option('systemd_unit_user', type : 'string', description : 'User account to use for fwupd-refresh.service (empty for DynamicUser)')
  option('systemd_root_prefix', type: 'string', value: '', description: 'Directory to base systemd’s installation directories on')
  option('elogind', type : 'feature', description : 'elogind support', deprecated: {'true': 'enabled', 'false': 'disabled'})
@@ -44,16 +44,3 @@ index d00038db..be1c45b4 100644
  option('tests', type : 'boolean', value : true, description : 'enable tests')
  option('soup_session_compat', type : 'boolean', value : true, description : 'enable SoupSession runtime compatibility support')
  option('curl', type : 'feature', description : 'libcurl support', deprecated: {'true': 'enabled', 'false': 'disabled'})
-diff --git a/plugins/redfish/fu-self-test.c b/plugins/redfish/fu-self-test.c
-index 4d19e560..91cfaa61 100644
---- a/plugins/redfish/fu-self-test.c
-+++ b/plugins/redfish/fu-self-test.c
-@@ -27,7 +27,7 @@ fu_test_is_installed_test(void)
- 	const gchar *builddir = g_getenv("G_TEST_BUILDDIR");
- 	if (builddir == NULL)
- 		return FALSE;
--	return g_str_has_prefix(builddir, FWUPD_PREFIX);
-+	return g_str_has_prefix(builddir, FWUPD_INSTALLED_TEST_PREFIX);
- }
- 
- static void