nerdfonts: fix wrong attribute name in error message (#364463)
[NixPkgs.git] / pkgs / by-name / dn / dnf5 / package.nix
blobaedbb9114f35d15395eed14a05a839e5d0c2ca29
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   cmake,
6   createrepo_c,
7   doxygen,
8   gettext,
9   help2man,
10   pkg-config,
11   python3Packages,
12   cppunit,
13   fmt,
14   json_c,
15   libmodulemd,
16   librepo,
17   libsmartcols,
18   libsolv,
19   libxml2,
20   libyaml,
21   pcre2,
22   rpm,
23   sdbus-cpp,
24   sphinx,
25   sqlite,
26   systemd,
27   testers,
28   toml11,
29   zchunk,
30   nix-update-script,
33 stdenv.mkDerivation (finalAttrs: {
34   pname = "dnf5";
35   version = "5.2.8.1";
37   outputs = [
38     "out"
39     "man"
40   ];
42   src = fetchFromGitHub {
43     owner = "rpm-software-management";
44     repo = "dnf5";
45     rev = finalAttrs.version;
46     hash = "sha256-R9woS84vZkF7yatbJr7KNhaUsLZcGaiS+XnYXG3i1jA=";
47   };
49   nativeBuildInputs =
50     [
51       cmake
52       createrepo_c
53       doxygen
54       gettext
55       help2man
56       pkg-config
57       sphinx
58     ]
59     ++ (with python3Packages; [
60       breathe
61       sphinx-autoapi
62       sphinx-rtd-theme
63     ]);
65   buildInputs = [
66     cppunit
67     fmt
68     json_c
69     libmodulemd
70     librepo
71     libsmartcols
72     libsolv
73     libxml2
74     libyaml
75     pcre2.dev
76     rpm
77     sdbus-cpp
78     sqlite
79     systemd
80     toml11
81     zchunk
82   ];
84   # workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329
85   NIX_CFLAGS_COMPILE = "-Wno-restrict -Wno-maybe-uninitialized";
87   cmakeFlags = [
88     "-DWITH_PERL5=OFF"
89     "-DWITH_PYTHON3=OFF"
90     "-DWITH_RUBY=OFF"
91     "-DWITH_SYSTEMD=OFF"
92     "-DWITH_PLUGIN_RHSM=OFF" # Red Hat Subscription Manager plugin
93     # the cmake package does not handle absolute CMAKE_INSTALL_INCLUDEDIR correctly
94     # (setting it to an absolute path causes include files to go to $out/$out/include,
95     #  because the absolute path is interpreted with root at $out).
96     "-DCMAKE_INSTALL_INCLUDEDIR=include"
97     "-DCMAKE_INSTALL_LIBDIR=lib"
98   ];
100   postBuild = ''
101     make doc
102   '';
104   prePatch = ''
105     substituteInPlace CMakeLists.txt \
106       --replace-fail "/usr/lib/systemd/system" "$out/lib/systemd/system"
107     substituteInPlace dnf5daemon-server/dbus/CMakeLists.txt \
108       --replace-fail "/usr" "$out"
109     substituteInPlace dnf5daemon-server/polkit/CMakeLists.txt \
110       --replace-fail "/usr" "$out"
111     substituteInPlace dnf5/CMakeLists.txt \
112       --replace-fail "/etc/bash_completion.d" "$out/etc/bash_completion.d"
113   '';
115   dontFixCmake = true;
117   passthru = {
118     tests.version = testers.testVersion { package = finalAttrs.finalPackage; };
119     updateScript = nix-update-script { };
120   };
122   meta = with lib; {
123     description = "Next-generation RPM package management system";
124     homepage = "https://github.com/rpm-software-management/dnf5";
125     changelog = "https://github.com/rpm-software-management/dnf5/releases/tag/${finalAttrs.version}";
126     license = licenses.gpl2Plus;
127     maintainers = with lib.maintainers; [
128       malt3
129       katexochen
130     ];
131     mainProgram = "dnf5";
132     platforms = platforms.linux ++ platforms.darwin;
133   };