depot/third_party/nixpkgs/pkgs/development/python-modules/dnf4/wrapper.nix
Default email 504525a148 Project import generated by Copybara.
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
2024-01-02 12:29:13 +01:00

53 lines
968 B
Nix

{ lib
, wrapPython
, python3
, stdenv
, dnf-plugins-core
, plugins ? [ dnf-plugins-core ]
}:
let
pluginPaths = map (p: "${p}/${python3.sitePackages}/dnf-plugins") plugins;
dnf4-unwrapped = python3.pkgs.dnf4;
in
stdenv.mkDerivation {
pname = "dnf4";
inherit (dnf4-unwrapped) version;
outputs = [ "out" "man" "py" ];
dontUnpack = true;
nativeBuildInputs = [
wrapPython
];
propagatedBuildInputs = [
dnf4-unwrapped
] ++ plugins;
makeWrapperArgs = lib.optional (plugins != [ ]) ''--add-flags "--setopt=pluginpath=${lib.concatStringsSep "," pluginPaths}"'';
installPhase = ''
runHook preInstall
cp -R ${dnf4-unwrapped} $out
cp -R ${dnf4-unwrapped.py} $py
cp -R ${dnf4-unwrapped.man} $man
runHook postInstall
'';
postFixup = ''
wrapPythonPrograms
'';
passthru = {
unwrapped = dnf4-unwrapped;
};
meta = dnf4-unwrapped.meta // {
priority = (dnf4-unwrapped.meta.priority or 0) - 1;
};
}