3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #35065 from jtojnar/fwupd-1.0.5

fwupd: 1.0.5 update & cleanups
This commit is contained in:
Jan Tojnar 2018-02-23 17:22:47 +01:00 committed by GitHub
commit 3b512ca185
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 233 additions and 89 deletions

View file

@ -8,12 +8,8 @@ let
cfg = config.services.fwupd; cfg = config.services.fwupd;
originalEtc = originalEtc =
let let
isRegular = v: v == "regular";
listFiles = d: builtins.attrNames (filterAttrs (const isRegular) (builtins.readDir d));
copiedDirs = [ "fwupd/remotes.d" "pki/fwupd" "pki/fwupd-metadata" ];
originalFiles = concatMap (d: map (f: "${d}/${f}") (listFiles "${pkgs.fwupd}/etc/${d}")) copiedDirs;
mkEtcFile = n: nameValuePair n { source = "${pkgs.fwupd}/etc/${n}"; }; mkEtcFile = n: nameValuePair n { source = "${pkgs.fwupd}/etc/${n}"; };
in listToAttrs (map mkEtcFile originalFiles); in listToAttrs (map mkEtcFile pkgs.fwupd.filesInstalledToEtc);
extraTrustedKeys = extraTrustedKeys =
let let
mkName = p: "pki/fwupd/${baseNameOf (toString p)}"; mkName = p: "pki/fwupd/${baseNameOf (toString p)}";

View file

@ -258,7 +258,7 @@ in rec {
tests.firefox = callTest tests/firefox.nix {}; tests.firefox = callTest tests/firefox.nix {};
tests.firewall = callTest tests/firewall.nix {}; tests.firewall = callTest tests/firewall.nix {};
tests.fleet = callTestOnTheseSystems ["x86_64-linux"] tests/fleet.nix {}; tests.fleet = callTestOnTheseSystems ["x86_64-linux"] tests/fleet.nix {};
#tests.fwupd = callTest tests/fwupd.nix {}; # build during evaluation tests.fwupd = callTest tests/fwupd.nix {};
#tests.gitlab = callTest tests/gitlab.nix {}; #tests.gitlab = callTest tests/gitlab.nix {};
tests.gitolite = callTest tests/gitolite.nix {}; tests.gitolite = callTest tests/gitolite.nix {};
tests.gjs = callTest tests/gjs.nix {}; tests.gjs = callTest tests/gjs.nix {};

View file

@ -1,25 +1,21 @@
{ stdenv, fetchFromGitHub, autoreconfHook { stdenv, fetchFromGitHub, automake, autoconf, libtool, gtk_doc
, pkgconfig, glib, systemd, libgudev, vala }: , pkgconfig, glib, systemd, libgudev, vala }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "umockdev"; name = "umockdev-${version}";
version = "0.8.13"; version = "0.11";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "martinpitt"; owner = "martinpitt";
repo = "umockdev"; repo = "umockdev";
rev = version; rev = version;
sha256 ="0bw2dpshlgbdwg5mhq4j22z474llpqix8pxii63r2bk5nhjc537k"; sha256 ="1gpk2f03nad4qv084hx7549d68cqc1xibxm0ncanafm5xjz1hp55";
}; };
buildInputs = [ glib systemd libgudev vala ]; buildInputs = [ glib systemd libgudev ];
nativeBuildInputs = [ autoreconfHook pkgconfig ]; nativeBuildInputs = [ automake autoconf libtool gtk_doc pkgconfig vala ];
### docs/gtk-doc.make not found preConfigure = "NOCONFIGURE=1 ./autogen.sh";
prePatch = ''
sed -i 's|include $(top_srcdir)/docs/gtk-doc.make||g' docs/reference/Makefile.am
sed -i 's|+=|=|g' docs/reference/Makefile.am
'';
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Mock hardware devices for creating unit tests"; description = "Mock hardware devices for creating unit tests";

View file

@ -6,14 +6,15 @@
, shared_mime_info, umockdev , shared_mime_info, umockdev
}: }:
let let
version = "1.0.4"; # Updating? Keep $out/etc synchronized with passthru.filesInstalledToEtc
version = "1.0.5";
python = python3.withPackages (p: with p; [ pygobject3 pycairo pillow ]); python = python3.withPackages (p: with p; [ pygobject3 pycairo pillow ]);
installedTestsPython = python3.withPackages (p: with p; [ pygobject3 requests ]); installedTestsPython = python3.withPackages (p: with p; [ pygobject3 requests ]);
in stdenv.mkDerivation { in stdenv.mkDerivation {
name = "fwupd-${version}"; name = "fwupd-${version}";
src = fetchurl { src = fetchurl {
url = "https://people.freedesktop.org/~hughsient/releases/fwupd-${version}.tar.xz"; url = "https://people.freedesktop.org/~hughsient/releases/fwupd-${version}.tar.xz";
sha256 = "1n4d6fw3ffg051072hbxn106s52x2wlh5dh2kxwdfjsb5kh03ra3"; sha256 = "0wm195vkf6x1kg1dz0sbfwpdcn9f6638l7vyzplcfrb3v07pqxpq";
}; };
outputs = [ "out" "devdoc" "man" "installedTests" ]; outputs = [ "out" "devdoc" "man" "installedTests" ];
@ -31,20 +32,9 @@ in stdenv.mkDerivation {
patches = [ patches = [
./fix-missing-deps.patch ./fix-missing-deps.patch
# https://github.com/hughsie/fwupd/issues/403
(fetchpatch { (fetchpatch {
url = https://github.com/hughsie/fwupd/commit/bd6082574989e4f48b66c7270bb408d439b77a06.patch; url = https://github.com/hughsie/fwupd/commit/767210e4b1401d5d5bb7ac1e7c052a60b6529d88.patch;
sha256 = "17pixyizkmn6wlsjmr1wwya17ivn770hdv9mp769vifxinya8w9y"; sha256 = "00adfabxpgdg74jx7i6jihhh8njjk2r7v3fxqs4scj3vn06k5fmw";
})
# 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;
sha256 = "1dxhqps12x7bz0s974xk5hfpk4nwn1gs29vl0dfi9j54wy18f688";
}) })
]; ];
@ -77,7 +67,20 @@ in stdenv.mkDerivation {
--prefix GI_TYPELIB_PATH : "$out/lib/girepository-1.0:${libsoup}/lib/girepository-1.0" --prefix GI_TYPELIB_PATH : "$out/lib/girepository-1.0:${libsoup}/lib/girepository-1.0"
''; '';
enableParallelBuilding = true; passthru = {
filesInstalledToEtc = [
"fwupd/remotes.d/fwupd.conf"
"fwupd/remotes.d/lvfs-testing.conf"
"fwupd/remotes.d/lvfs.conf"
"fwupd/remotes.d/vendor.conf"
"pki/fwupd/GPG-KEY-Hughski-Limited"
"pki/fwupd/GPG-KEY-Linux-Vendor-Firmware-Service"
"pki/fwupd/LVFS-CA.pem"
"pki/fwupd-metadata/GPG-KEY-Linux-Vendor-Firmware-Service"
"pki/fwupd-metadata/LVFS-CA.pem"
];
};
meta = with stdenv.lib; { meta = with stdenv.lib; {
homepage = https://fwupd.org/; homepage = https://fwupd.org/;
maintainers = with maintainers; []; maintainers = with maintainers; [];

View file

@ -1,37 +1,62 @@
{ stdenv, fetchurl, gnu-efi, efivar, libsmbios, popt, pkgconfig { efivar, fetchurl, gettext, gnu-efi, libsmbios, pkgconfig, popt, stdenv }:
, gettext }: let
let version = "8"; in version = "10";
stdenv.mkDerivation in stdenv.mkDerivation {
{ name = "fwupdate-${version}"; name = "fwupdate-${version}";
src = fetchurl src = fetchurl {
{ url = "https://github.com/rhinstaller/fwupdate/releases/download/${version}/fwupdate-${version}.tar.bz2"; url = "https://github.com/rhinstaller/fwupdate/releases/download/${version}/fwupdate-${version}.tar.bz2";
sha256 = "10q8k1kghvbcb5fwcl2smzp8vqdfzimx9dkk0c3hz39py1phy4n8"; sha256 = "0fpk3q0msq2l0bs2mvk0cqp8jbwnmi17ggc81r4v96h4jxh2rx3k";
}; };
makeFlags =
[ "EFIDIR=nixos" patches = [
"LIBDIR=$(out)/lib" # https://github.com/rhboot/fwupdate/pull/99
"GNUEFIDIR=${gnu-efi}/lib" ./fix-paths.patch
"TARGETDIR=$(out)/boot/efi/nixos/" ./do-not-create-sharedstatedir.patch
"prefix=$(out)/" ];
];
nativeBuildInputs = [ pkgconfig ]; NIX_CFLAGS_COMPILE = [ "-I${gnu-efi}/include/efi" ];
buildInputs = [ gnu-efi libsmbios popt gettext ];
propagatedBuildInputs = [ efivar ]; # TODO: Just apply the disable to the efi subdir
# TODO: Just apply the disable to the efi subdir hardeningDisable = [ "stackprotector" ];
hardeningDisable = [ "all" ];
patchPhase = '' makeFlags = [
sed -i 's|/usr/include/smbios_c/token.h|smbios_c/token.h|' \ "EFIDIR=nixos"
linux/libfwup.c "prefix=$(out)"
sed -i 's|/usr/share|$(prefix)share|' linux/Makefile "LIBDIR=$(out)/lib"
sed -i "s|/usr/include|$out/include|" linux/fwup.pc.in "GNUEFIDIR=${gnu-efi}/lib"
find . -type f -print0 | xargs -0 sed -i -e 's|/boot/efi|/boot|g' -e 's|/boot/efi/EFI|/boot/EFI|g' "ESPMOUNTPOINT=$(out)/boot"
''; ];
configurePhase = ''
arch=$(cc -dumpmachine | cut -f1 -d- | sed 's,i[3456789]86,ia32,' ) nativeBuildInputs = [
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${gnu-efi}/include/efi -I${efivar}/include/efivar -I${gnu-efi}/include/efi/$arch" pkgconfig
''; gettext
meta = ];
{ license = [ stdenv.lib.licenses.gpl2 ];
platforms = stdenv.lib.platforms.linux; buildInputs = [
}; gnu-efi
} libsmbios
popt
];
propagatedBuildInputs = [
efivar
];
# TODO: fix wrt cross-compilation
preConfigure = ''
arch=$(cc -dumpmachine | cut -f1 -d- | sed 's,i[3456789]86,ia32,' )
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${gnu-efi}/include/efi/$arch"
'';
postInstall = ''
rm -rf $out/src
rm -rf $out/lib/debug
'';
meta = with stdenv.lib; {
description = "Tools for using the ESRT and UpdateCapsule() to apply firmware updates";
maintainers = with maintainers; [ ];
license = licenses.gpl2;
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,10 @@
--- a/linux/Makefile
+++ b/linux/Makefile
@@ -131,7 +131,6 @@
ln -fs $(x) $(patsubst %.so.1.$(VERSION),%.so.1,$(DESTDIR)$(libdir)/$(x)) ;\
ln -fs $(x) $(patsubst %.so.1.$(VERSION),%.so,$(DESTDIR)$(libdir)/$(x)) ;\
)
- $(INSTALL) -d -m 755 $(DESTDIR)$(sharedstatedir)/fwupdate/
$(INSTALL) -d -m 755 $(DESTDIR)$(libexecdir)/fwupdate/
$(INSTALL) -m 755 cleanup $(DESTDIR)$(libexecdir)/fwupdate/cleanup
$(INSTALL) -d -m 755 $(DESTDIR)$(libdatadir)/systemd/system

View file

@ -0,0 +1,116 @@
--- a/Make.defaults
+++ b/Make.defaults
@@ -18,19 +18,20 @@
ABIDIFF := abidiff
ABIDW := abidw
prefix ?= /usr/
-prefix := $(abspath $(prefix))/
+prefix := $(abspath $(prefix))
+exec_prefix ?= $(prefix)
ARCH = $(shell $(CC) -dumpmachine | cut -f1 -d- | sed s,i[3456789]86,ia32,)
ifeq ($(ARCH),x86_64)
- LIBDIR ?= $(prefix)lib64
+ LIBDIR ?= $(exec_prefix)/lib64
endif
ifeq ($(ARCH),ia32)
- LIBDIR ?= $(prefix)lib
+ LIBDIR ?= $(exec_prefix)/lib
endif
ifeq ($(ARCH),aarch64)
- LIBDIR ?= $(prefix)lib64
+ LIBDIR ?= $(exec_prefix)/lib64
endif
ifeq ($(ARCH),arm)
- LIBDIR ?= $(prefix)lib
+ LIBDIR ?= $(exec_prefix)/lib
endif
LIBDIR ?= unknown
ifeq ($(LIBDIR),unknown)
@@ -45,13 +46,13 @@
GNUEFIDIR ?= $(LIBDIR)/gnuefi
libdir ?= $(LIBDIR)
pcdir ?= $(libdir)/pkgconfig
-mandir ?= $(prefix)share/man
-includedir ?= $(prefix)include
-bindir ?= $(prefix)bin
-datadir ?= $(prefix)share
+mandir ?= $(prefix)/share/man
+includedir ?= $(prefix)/include
+bindir ?= $(exec_prefix)/bin
+datadir ?= $(prefix)/share
localedir ?= $(datadir)/locale
-libexecdir ?= $(prefix)libexec
-libdatadir ?= $(prefix)lib
+libexecdir ?= $(exec_prefix)/libexec
+libdatadir ?= $(exec_prefix)/lib
sharedstatedir ?= /var/lib
EFIDIR ?= $(shell x=$$(which --skip-alias --skip-functions git 2>/dev/null) ; [ -n "$$x" ] && git config --get fwupdate.efidir)
@@ -63,8 +64,8 @@
ESPMOUNTPOINT = "/boot/efi"
endif
-DEBUGINFO ?= $(prefix)lib/debug
-DEBUGSOURCE ?= $(prefix)src/debug
+DEBUGINFO ?= $(exec_prefix)/lib/debug
+DEBUGSOURCE ?= $(prefix)/src/debug
TARGETDIR ?= $(ESPMOUNTPOINT)/EFI/$(EFIDIR)
.PHONY: check_efidir_error
--- a/linux/Makefile
+++ b/linux/Makefile
@@ -93,16 +93,19 @@
sed -e "s,@@VERSION@@,$(VERSION),g" \
-e "s,@@FWUP_MAJOR_VERSION@@,$(MAJOR_VERSION),g" \
-e "s,@@FWUP_MINOR_VERSION@@,$(MINOR_VERSION),g" \
+ -e "s,@@PREFIX@@,$(prefix),g" \
+ -e "s,@@EXEC_PREFIX@@,$(exec_prefix),g" \
-e "s,@@SHAREDSTATEDIR@@,$(sharedstatedir),g" \
-e "s,@@ESPMOUNTPOINT@@,$(ESPMOUNTPOINT),g" \
-e "s,@@EFIDIR@@,$(EFIDIR),g" \
-e "s,@@LIBDIR@@,$(libdir),g" \
-e "s,@@LIBEXECDIR@@,$(libexecdir),g" \
+ -e "s,@@INCLUDEDIR@@,$(includedir),g" \
$< > $@
tester : tester.c
- $(CC) -Wall -Werror -ggdb -L. -I./include -I/usr/include/efivar \
- -lefivar -lfwup -o $@ $^
+ $(CC) -Wall -Werror -ggdb -L. -I./include $(shell $(PKG_CONFIG) --cflags efivar) \
+ $(shell $(PKG_CONFIG) --libs efivar) -lfwup -o $@ $^
test : tester
LD_LIBRARY_PATH=$(shell pwd) ./tester
@@ -134,6 +137,6 @@
$(INSTALL) -d -m 755 $(DESTDIR)$(libdatadir)/systemd/system
$(INSTALL) -m 644 cleanup.service \
$(DESTDIR)$(libdatadir)/systemd/system/fwupdate-cleanup.service
- $(INSTALL) -d -m 755 $(DESTDIR)/usr/share/bash-completion/completions/
+ $(INSTALL) -d -m 755 $(DESTDIR)$(datadir)/bash-completion/completions/
$(INSTALL) -m 755 $(VPATH)/bash-completion \
- $(DESTDIR)/usr/share/bash-completion/completions/fwupdate
+ $(DESTDIR)$(datadir)/bash-completion/completions/fwupdate
--- a/linux/fwup.pc.in
+++ b/linux/fwup.pc.in
@@ -1,7 +1,7 @@
-prefix=/usr
-exec_prefix=/usr
+prefix=@@PREFIX@@
+exec_prefix=@@EXEC_PREFIX@@
libdir=@@LIBDIR@@
-includedir=/usr/include
+includedir=@@INCLUDEDIR@@
Name: fwup
Description: Library for deployment of UEFI firmware updates.
--- a/linux/libfwup.c
+++ b/linux/libfwup.c
@@ -35,7 +35,7 @@
#include <dell-wmi-smi.h>
#ifdef FWUPDATE_HAVE_LIBSMBIOS__
-#include </usr/include/smbios_c/token.h>
+#include <smbios_c/token.h>
#include <smbios_c/smi.h>
#endif

View file

@ -1,38 +1,37 @@
{ stdenv, fetchFromGitHub, pkgconfig, autoreconfHook, libtool, gettext { stdenv, fetchFromGitHub, pkgconfig, autoreconfHook, help2man, gettext
, libxml2, perl, doxygen }: , libxml2, perl, doxygen }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "libsmbios-${version}"; name = "libsmbios-${version}";
version = "2.3.3"; version = "2.4.1";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "dell"; owner = "dell";
repo = "libsmbios"; repo = "libsmbios";
rev = "v${version}"; rev = "v${version}";
sha256 = "1cl5nb6qk8ki87hwqf9n1dd9nlhkjnlpdxlhzvm82za16gs7apkl"; sha256 = "158w5fz777is7nr5yhpr69b17nn6i1pavycxq1q9899frrpkzbsc";
}; };
nativeBuildInputs = [ autoreconfHook doxygen gettext libtool perl pkgconfig ]; nativeBuildInputs = [ autoreconfHook doxygen gettext libxml2 help2man perl pkgconfig ];
buildInputs = [ libxml2 ];
configureFlags = [ "--disable-python" "--disable-graphviz" ]; configureFlags = [ "--disable-python" "--disable-graphviz" ];
enableParallelBuilding = true; enableParallelBuilding = true;
postInstall = postInstall = ''
'' mkdir -p $out/include
mkdir -p $out/include cp -a src/include/smbios_c $out/include/
cp -a src/include/smbios_c $out/include/ cp -a out/public-include/smbios_c $out/include/
cp -a out/public-include/smbios_c $out/include/ '';
'';
preFixup = ''rm -rf "$(pwd)" ''; # Hack to avoid TMPDIR in RPATHs preFixup = ''rm -rf "$(pwd)" ''; # Hack to avoid TMPDIR in RPATHs
meta = { meta = with stdenv.lib; {
homepage = https://github.com/dell/libsmbios; homepage = https://github.com/dell/libsmbios;
description = "A library to obtain BIOS information"; description = "A library to obtain BIOS information";
license = with stdenv.lib.licenses; [ osl21 gpl2Plus ]; license = with licenses; [ osl21 gpl2Plus ];
maintainers = with maintainers; [ ];
platforms = [ "i686-linux" "x86_64-linux" ]; platforms = [ "i686-linux" "x86_64-linux" ];
}; };
} }

View file

@ -9,22 +9,21 @@ stdenv.mkDerivation rec {
buildInputs = [ efivar popt ]; buildInputs = [ efivar popt ];
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "rhinstaller"; owner = "rhboot";
repo = "efibootmgr"; repo = "efibootmgr";
rev = version; rev = version;
sha256 = "0z7h1dirp8za6lbbf4f3dzn7l1px891rdymhkbqc10yj6gi1jpqp"; sha256 = "0z7h1dirp8za6lbbf4f3dzn7l1px891rdymhkbqc10yj6gi1jpqp";
}; };
NIX_CFLAGS_COMPILE = "-I${efivar}/include/efivar";
makeFlags = [ "EFIDIR=nixos" ]; makeFlags = [ "EFIDIR=nixos" ];
installFlags = [ "prefix=$(out)" ]; installFlags = [ "prefix=$(out)" ];
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "A Linux user-space application to modify the Intel Extensible Firmware Interface (EFI) Boot Manager"; description = "A Linux user-space application to modify the Intel Extensible Firmware Interface (EFI) Boot Manager";
homepage = https://github.com/rhinstaller/efibootmgr; homepage = https://github.com/rhboot/efibootmgr;
license = licenses.gpl2; license = licenses.gpl2;
maintainers = with maintainers; [ ];
platforms = platforms.linux; platforms = platforms.linux;
}; };
} }