pytrainer: unpin python 3.10
[NixPkgs.git] / pkgs / tools / package-management / libdnf / default.nix
blobac510b954feefcbae7902e6c1d913b2be6e2363e
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   cmake,
6   gettext,
7   pkg-config,
8   libsolv,
9   openssl,
10   check,
11   json_c,
12   libmodulemd,
13   libsmartcols,
14   sqlite,
15   librepo,
16   libyaml,
17   rpm,
18   zchunk,
19   cppunit,
20   python,
21   swig,
22   pcre2,
23   sphinx,
26 stdenv.mkDerivation rec {
27   pname = "libdnf";
28   version = "0.73.3";
30   outputs = [
31     "out"
32     "dev"
33     "py"
34   ];
36   src = fetchFromGitHub {
37     owner = "rpm-software-management";
38     repo = pname;
39     rev = "refs/tags/${version}";
40     hash = "sha256-XzPpjnmL2wwLZnLAJLuOQGWXAoCJnij14P6qSXglMhY=";
41   };
43   nativeBuildInputs = [
44     cmake
45     gettext
46     pkg-config
47   ];
49   buildInputs = [
50     check
51     cppunit
52     openssl
53     json_c
54     libsmartcols
55     libyaml
56     libmodulemd
57     zchunk
58     python
59     swig
60     sphinx
61     pcre2.dev
62   ];
64   propagatedBuildInputs = [
65     sqlite
66     libsolv
67     librepo
68     rpm
69   ];
71   # See https://github.com/NixOS/nixpkgs/issues/107430
72   prePatch = ''
73     cp ${libsolv}/share/cmake/Modules/FindLibSolv.cmake cmake/modules/
74   '';
76   patches = [ ./fix-python-install-dir.patch ];
78   postPatch = ''
79     # https://github.com/rpm-software-management/libdnf/issues/1518
80     substituteInPlace libdnf/libdnf.pc.in \
81       --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@
82     substituteInPlace cmake/modules/FindPythonInstDir.cmake \
83       --replace "@PYTHON_INSTALL_DIR@" "$out/${python.sitePackages}"
84   '';
86   cmakeFlags = [
87     "-DWITH_GTKDOC=OFF"
88     "-DWITH_HTML=OFF"
89     "-DPYTHON_DESIRED=${lib.head (lib.splitString [ "." ] python.version)}"
90   ];
92   postInstall = ''
93     rm -r $out/${python.sitePackages}/hawkey/test
94   '';
96   postFixup = ''
97     moveToOutput "lib/${python.libPrefix}" "$py"
98   '';
100   meta = {
101     description = "Package management library";
102     homepage = "https://github.com/rpm-software-management/libdnf";
103     changelog = "https://github.com/rpm-software-management/libdnf/releases/tag/${version}";
104     license = lib.licenses.gpl2Plus;
105     platforms = lib.platforms.linux ++ lib.platforms.darwin;
106     maintainers = with lib.maintainers; [
107       rb2k
108       katexochen
109     ];
110   };