2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
wrapPython,
|
2024-09-19 14:19:46 +00:00
|
|
|
python,
|
2024-06-05 15:53:02 +00:00
|
|
|
stdenv,
|
2024-09-19 14:19:46 +00:00
|
|
|
dnf4,
|
2024-06-05 15:53:02 +00:00
|
|
|
dnf-plugins-core,
|
|
|
|
plugins ? [ dnf-plugins-core ],
|
2024-01-02 11:29:13 +00:00
|
|
|
}:
|
|
|
|
let
|
2024-09-19 14:19:46 +00:00
|
|
|
pluginPaths = map (p: "${p}/${python.sitePackages}/dnf-plugins") plugins;
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
dnf4-unwrapped = dnf4;
|
2024-01-02 11:29:13 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "dnf4";
|
|
|
|
inherit (dnf4-unwrapped) version;
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"man"
|
|
|
|
"py"
|
|
|
|
];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ wrapPython ];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [ dnf4-unwrapped ] ++ plugins;
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
makeWrapperArgs = lib.optional (
|
|
|
|
plugins != [ ]
|
|
|
|
) ''--add-flags "--setopt=pluginpath=${lib.concatStringsSep "," pluginPaths}"'';
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
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 // {
|
2024-09-19 14:19:46 +00:00
|
|
|
priority = (dnf4-unwrapped.meta.priority or lib.meta.defaultPriority) - 1;
|
2024-01-02 11:29:13 +00:00
|
|
|
};
|
|
|
|
}
|