forked from mirrors/nixpkgs
fwupd: clean up
* reorder attributes to match standard * do not use package aliases * add some comments * fix license (https://github.com/fwupd/fwupd/issues/526)
This commit is contained in:
parent
f66d92b585
commit
f9fbbd519e
|
@ -5,7 +5,7 @@
|
||||||
, fetchpatch
|
, fetchpatch
|
||||||
, substituteAll
|
, substituteAll
|
||||||
, gtk-doc
|
, gtk-doc
|
||||||
, pkgconfig
|
, pkg-config
|
||||||
, gobject-introspection
|
, gobject-introspection
|
||||||
, intltool
|
, intltool
|
||||||
, libgudev
|
, libgudev
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
, libuuid
|
, libuuid
|
||||||
, colord
|
, colord
|
||||||
, docbook_xml_dtd_43
|
, docbook_xml_dtd_43
|
||||||
, docbook_xsl
|
, docbook-xsl-nons
|
||||||
, ninja
|
, ninja
|
||||||
, gcab
|
, gcab
|
||||||
, python3
|
, python3
|
||||||
|
@ -67,10 +67,6 @@ let
|
||||||
requests
|
requests
|
||||||
]);
|
]);
|
||||||
|
|
||||||
fontsConf = makeFontsConf {
|
|
||||||
fontDirectories = [ freefont_ttf ];
|
|
||||||
};
|
|
||||||
|
|
||||||
isx86 = stdenv.isx86_64 || stdenv.isi686;
|
isx86 = stdenv.isx86_64 || stdenv.isi686;
|
||||||
|
|
||||||
# Dell isn't supported on Aarch64
|
# Dell isn't supported on Aarch64
|
||||||
|
@ -95,28 +91,53 @@ let
|
||||||
pname = "fwupd";
|
pname = "fwupd";
|
||||||
version = "1.4.5";
|
version = "1.4.5";
|
||||||
|
|
||||||
src = fetchurl {
|
|
||||||
url = "https://people.freedesktop.org/~hughsient/releases/fwupd-${version}.tar.xz";
|
|
||||||
sha256 = "0hpqxwqbbqn440c2swpnc06z8dskisrli4ynsxrzzqyp0dan46xw";
|
|
||||||
};
|
|
||||||
|
|
||||||
# libfwupd goes to lib
|
# libfwupd goes to lib
|
||||||
# daemon, plug-ins and libfwupdplugin go to out
|
# daemon, plug-ins and libfwupdplugin go to out
|
||||||
# CLI programs go to out
|
# CLI programs go to out
|
||||||
outputs = [ "out" "lib" "dev" "devdoc" "man" "installedTests" ];
|
outputs = [ "out" "lib" "dev" "devdoc" "man" "installedTests" ];
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
|
url = "https://people.freedesktop.org/~hughsient/releases/fwupd-${version}.tar.xz";
|
||||||
|
sha256 = "0hpqxwqbbqn440c2swpnc06z8dskisrli4ynsxrzzqyp0dan46xw";
|
||||||
|
};
|
||||||
|
|
||||||
|
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;
|
||||||
|
})
|
||||||
|
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://github.com/fwupd/fwupd/commit/3e82beeddac31292c50229e59e2404865edee5ad.patch";
|
||||||
|
sha256 = "17p9r8qddqkrnhy9bvp9207afh5fcl1whn79nqcp57b4q4c17zgk";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
meson
|
meson
|
||||||
ninja
|
ninja
|
||||||
gtk-doc
|
gtk-doc
|
||||||
pkgconfig
|
pkg-config
|
||||||
gobject-introspection
|
gobject-introspection
|
||||||
intltool
|
intltool
|
||||||
shared-mime-info
|
shared-mime-info
|
||||||
valgrind
|
valgrind
|
||||||
gcab
|
gcab
|
||||||
docbook_xml_dtd_43
|
docbook_xml_dtd_43
|
||||||
docbook_xsl
|
docbook-xsl-nons
|
||||||
help2man
|
help2man
|
||||||
libxslt
|
libxslt
|
||||||
python
|
python
|
||||||
|
@ -152,55 +173,6 @@ let
|
||||||
libsmbios
|
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;
|
|
||||||
})
|
|
||||||
|
|
||||||
(fetchpatch {
|
|
||||||
url = "https://github.com/fwupd/fwupd/commit/3e82beeddac31292c50229e59e2404865edee5ad.patch";
|
|
||||||
sha256 = "17p9r8qddqkrnhy9bvp9207afh5fcl1whn79nqcp57b4q4c17zgk";
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
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 = [
|
mesonFlags = [
|
||||||
"-Dgtkdoc=true"
|
"-Dgtkdoc=true"
|
||||||
"-Dplugin_dummy=true"
|
"-Dplugin_dummy=true"
|
||||||
|
@ -228,20 +200,57 @@ let
|
||||||
"-Dplugin_flashrom=true"
|
"-Dplugin_flashrom=true"
|
||||||
];
|
];
|
||||||
|
|
||||||
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”
|
# error: “PolicyKit files are missing”
|
||||||
# https://github.com/NixOS/nixpkgs/pull/67625#issuecomment-525788428
|
# https://github.com/NixOS/nixpkgs/pull/67625#issuecomment-525788428
|
||||||
PKG_CONFIG_POLKIT_GOBJECT_1_ACTIONDIR = "/run/current-system/sw/share/polkit-1/actions";
|
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
|
# Phase hooks
|
||||||
dontWrapGApps = true;
|
|
||||||
|
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
|
||||||
|
'';
|
||||||
|
|
||||||
preCheck = ''
|
preCheck = ''
|
||||||
addToSearchPath XDG_DATA_DIRS "${shared-mime-info}/share"
|
addToSearchPath XDG_DATA_DIRS "${shared-mime-info}/share"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# so we need to wrap the executables manually
|
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}"
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Since we had to disable wrapGAppsHook, we need to wrap the executables manually.
|
||||||
postFixup = ''
|
postFixup = ''
|
||||||
find -L "$out/bin" "$out/libexec" -type f -executable -print0 \
|
find -L "$out/bin" "$out/libexec" -type f -executable -print0 \
|
||||||
| while IFS= read -r -d ''' file; do
|
| while IFS= read -r -d ''' file; do
|
||||||
|
@ -312,7 +321,7 @@ let
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
homepage = "https://fwupd.org/";
|
homepage = "https://fwupd.org/";
|
||||||
maintainers = with maintainers; [ jtojnar ];
|
maintainers = with maintainers; [ jtojnar ];
|
||||||
license = [ licenses.gpl2 ];
|
license = licenses.lgpl21Plus;
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue