1{
2 lib,
3 wrapPython,
4 python,
5 stdenv,
6 dnf4,
7 dnf-plugins-core,
8 plugins ? [ dnf-plugins-core ],
9}:
10let
11 pluginPaths = map (p: "${p}/${python.sitePackages}/dnf-plugins") plugins;
12
13 dnf4-unwrapped = dnf4;
14in
15
16stdenv.mkDerivation {
17 pname = "dnf4";
18 inherit (dnf4-unwrapped) version;
19
20 outputs = [
21 "out"
22 "man"
23 "py"
24 ];
25
26 dontUnpack = true;
27
28 nativeBuildInputs = [ wrapPython ];
29
30 propagatedBuildInputs = [ dnf4-unwrapped ] ++ plugins;
31
32 makeWrapperArgs = lib.optional (
33 plugins != [ ]
34 ) ''--add-flags "--setopt=pluginpath=${lib.concatStringsSep "," pluginPaths}"'';
35
36 installPhase = ''
37 runHook preInstall
38
39 cp -R ${dnf4-unwrapped} $out
40 cp -R ${dnf4-unwrapped.py} $py
41 cp -R ${dnf4-unwrapped.man} $man
42
43 runHook postInstall
44 '';
45
46 postFixup = ''
47 wrapPythonPrograms
48 '';
49
50 passthru = {
51 unwrapped = dnf4-unwrapped;
52 };
53
54 meta = dnf4-unwrapped.meta // {
55 priority = (dnf4-unwrapped.meta.priority or lib.meta.defaultPriority) - 1;
56 };
57}