From b694eb6e6a0e27c159345ac9651f80ed28fe1a2f Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Wed, 23 Sep 2020 06:01:05 -0400 Subject: [PATCH] firmware-manager: Init at 0.1.1 --- pkgs/build-support/rust/default.nix | 8 ++-- .../firmware/firmware-manager/default.nix | 38 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 pkgs/os-specific/linux/firmware/firmware-manager/default.nix diff --git a/pkgs/build-support/rust/default.nix b/pkgs/build-support/rust/default.nix index 23fb56539e45..0103e064828b 100644 --- a/pkgs/build-support/rust/default.nix +++ b/pkgs/build-support/rust/default.nix @@ -29,7 +29,7 @@ , target ? null , cargoVendorDir ? null , checkType ? buildType - +, depsExtraArgs ? {} # Needed to `pushd`/`popd` into a subdir of a tarball if this subdir # contains a Cargo.toml, but isn't part of a workspace (which is e.g. the # case for `rustfmt`/etc from the `rust-sources). @@ -43,11 +43,11 @@ assert buildType == "release" || buildType == "debug"; let cargoDeps = if cargoVendorDir == null - then fetchCargoTarball { + then fetchCargoTarball ({ inherit name src srcs sourceRoot unpackPhase cargoUpdateHook; patches = cargoPatches; sha256 = cargoSha256; - } + } // depsExtraArgs) else null; # If we have a cargoSha256 fixed-output derivation, validate it at build time @@ -83,7 +83,7 @@ let in -stdenv.mkDerivation (args // { +stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // { inherit cargoDeps; patchRegistryDeps = ./patch-registry-deps; diff --git a/pkgs/os-specific/linux/firmware/firmware-manager/default.nix b/pkgs/os-specific/linux/firmware/firmware-manager/default.nix new file mode 100644 index 000000000000..e98de6bbe9e8 --- /dev/null +++ b/pkgs/os-specific/linux/firmware/firmware-manager/default.nix @@ -0,0 +1,38 @@ +{ rustPlatform, lib, fetchFromGitHub, lzma, pkgconfig, openssl, dbus, glib, udev, cairo, pango, atk, gdk-pixbuf, gtk3, wrapGAppsHook }: +rustPlatform.buildRustPackage rec { + pname = "firmware-manager"; + version = "0.1.1"; + + src = fetchFromGitHub { + owner = "pop-os"; + repo = pname; + rev = version; + sha256 = "0x9604jsflqxvbkfp139mzjicpyx8v21139jj8bp88c14ngvmdlw"; + }; + + nativeBuildInputs = [ pkgconfig wrapGAppsHook ]; + + buildInputs = [ lzma openssl dbus glib udev cairo pango atk gdk-pixbuf gtk3 ]; + + depsExtraArgs.postPatch = "make prefix='$(out)' toml-gen"; + + postPatch = '' + sed -i 's|etc|$(prefix)/etc|' Makefile + ''; + + buildPhase = "make prefix='$(out)'"; + + installPhase = "make prefix='$(out)' install"; + + cargoSha256 = "0byc0pqa1w2qnfrx3psrzdq1c8qjslbmzxg872b9v6fr5d4c9cvg"; + + doCheck = false; + + meta = { + description = "Graphical frontend for firmware management"; + homepage = "https://github.com/pop-os/firmware-manager"; + license = lib.licenses.gpl3; + maintainers = [ lib.maintainers.shlevy ]; + platforms = lib.platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3917c8d10ff5..ac888444f59d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17468,6 +17468,8 @@ in fwupd = callPackage ../os-specific/linux/firmware/fwupd { }; + firmware-manager = callPackage ../os-specific/linux/firmware/firmware-manager { }; + fwts = callPackage ../os-specific/linux/fwts { }; gobi_loader = callPackage ../os-specific/linux/gobi_loader { };