Merge pull request #189869 from baloo/baloo/ovmfvartool/python-package

ovmfvartool: use as a python package
This commit is contained in:
Mario Rodas 2022-09-09 20:45:44 -05:00 committed by GitHub
commit 09e11e3ffc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 35 deletions

View File

@ -1,33 +0,0 @@
{ lib, stdenvNoCC, fetchFromGitHub, python3 }:
stdenvNoCC.mkDerivation rec {
pname = "ovmfvartool";
version = "unstable-2021-06-16";
src = fetchFromGitHub {
owner = "hlandau";
repo = pname;
rev = "c4c0c24dce1d201f95dfd69fd7fd9d51ea301377";
hash = "sha256-3OvYAB41apPn1c2YTKBIEITmHSUMQ0oEijY5DhZWWGo=";
};
postPatch = let
pythonPkg = python3.withPackages (p: with p; [ pyyaml ]);
in ''
# needed in build but /usr/bin/env is not available in sandbox
substituteInPlace ovmfvartool \
--replace "/usr/bin/env python3" "${pythonPkg.interpreter}"
'';
installPhase = ''
mkdir -p $out/bin
install -m 755 ovmfvartool $out/bin/
'';
meta = with lib; {
description = "Parse and generate OVMF_VARS.fd from Yaml";
homepage = "https://github.com/hlandau/ovmfvartool";
license = licenses.gpl3;
maintainers = with maintainers; [ baloo raitobezarius ];
};
}

View File

@ -0,0 +1,27 @@
{ lib, buildPythonPackage, fetchFromGitHub, pyyaml }:
buildPythonPackage rec {
pname = "ovmfvartool";
version = "unstable-2022-09-04";
src = fetchFromGitHub {
owner = "hlandau";
repo = pname;
rev = "45e6b1e53967ee6590faae454c076febce096931";
hash = "sha256-XbvcE/MXNj5S5N7A7jxdwgEE5yMuB82Xg+PYBsFRIm0=";
};
propagatedBuildInputs = [ pyyaml ];
# has no tests
doCheck = false;
pythonImportsCheck = [ "ovmfvartool" ];
meta = with lib; {
description = "Parse and generate OVMF_VARS.fd from Yaml";
homepage = "https://github.com/hlandau/ovmfvartool";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ baloo raitobezarius ];
};
}

View File

@ -23368,8 +23368,6 @@ with pkgs;
tpmSupport = true;
};
ovmfvartool = callPackage ../applications/virtualization/ovmfvartool { };
ops = callPackage ../applications/virtualization/ops { };
seabios = callPackage ../applications/virtualization/seabios { };

View File

@ -6480,6 +6480,8 @@ in {
ovh = callPackage ../development/python-modules/ovh { };
ovmfvartool = callPackage ../development/python-modules/ovmfvartool { };
ovoenergy = callPackage ../development/python-modules/ovoenergy { };
owslib = callPackage ../development/python-modules/owslib { };