nixpkgs/pkgs/tools/package-management/libdnf/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

105 lines
2.0 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchFromGitHub
, cmake
, gettext
, pkg-config
, libsolv
, openssl
, check
, json_c
, libmodulemd
, libsmartcols
, sqlite
, librepo
, libyaml
, rpm
, zchunk
2023-11-10 10:29:49 +00:00
, cppunit
2023-11-09 15:52:37 +00:00
, python
, swig
, glib
, sphinx
}:
2020-12-22 23:48:49 +00:00
2021-09-19 16:43:18 +01:00
stdenv.mkDerivation rec {
2020-12-22 23:48:49 +00:00
pname = "libdnf";
2024-03-29 01:16:34 +00:00
version = "0.73.1";
2020-12-22 23:48:49 +00:00
2023-11-09 15:52:37 +00:00
outputs = [ "out" "dev" "py" ];
2020-12-22 23:48:49 +00:00
src = fetchFromGitHub {
owner = "rpm-software-management";
repo = pname;
rev = "refs/tags/${version}";
2024-03-29 01:16:34 +00:00
hash = "sha256-mZCrJ1fXqKE1sMYKWHLLQEPkdLwPwqJz+8n+DlNmxvM=";
2020-12-22 23:48:49 +00:00
};
nativeBuildInputs = [
cmake
gettext
pkg-config
];
buildInputs = [
check
2023-11-10 10:29:49 +00:00
cppunit
2020-12-22 23:48:49 +00:00
openssl
json_c
libsmartcols
libyaml
libmodulemd
2021-08-13 14:26:52 +01:00
zchunk
2023-11-09 15:52:37 +00:00
python
swig
sphinx
2020-12-22 23:48:49 +00:00
];
propagatedBuildInputs = [
sqlite
libsolv
librepo
rpm
];
# See https://github.com/NixOS/nixpkgs/issues/107430
prePatch = ''
cp ${libsolv}/share/cmake/Modules/FindLibSolv.cmake cmake/modules/
'';
2023-11-09 15:52:37 +00:00
patches = [
./fix-python-install-dir.patch
];
2020-12-22 23:48:49 +00:00
postPatch = ''
2022-05-17 12:24:27 +01:00
# https://github.com/rpm-software-management/libdnf/issues/1518
substituteInPlace libdnf/libdnf.pc.in \
--replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@
2023-11-09 15:52:37 +00:00
substituteInPlace cmake/modules/FindPythonInstDir.cmake \
--replace "@PYTHON_INSTALL_DIR@" "$out/${python.sitePackages}"
2020-12-22 23:48:49 +00:00
'';
cmakeFlags = [
"-DWITH_GTKDOC=OFF"
"-DWITH_HTML=OFF"
2023-11-09 15:52:37 +00:00
"-DPYTHON_DESIRED=${lib.head (lib.splitString ["."] python.version)}"
2020-12-22 23:48:49 +00:00
];
2023-11-09 15:52:37 +00:00
postInstall = ''
rm -r $out/${python.sitePackages}/hawkey/test
'';
postFixup = ''
moveToOutput "lib/${python.libPrefix}" "$py"
'';
meta = with lib; {
description = "Package management library";
2020-12-22 23:48:49 +00:00
homepage = "https://github.com/rpm-software-management/libdnf";
changelog = "https://github.com/rpm-software-management/libdnf/releases/tag/${version}";
2020-12-22 23:48:49 +00:00
license = licenses.gpl2Plus;
platforms = platforms.linux ++ platforms.darwin;
2023-11-11 22:03:37 +00:00
maintainers = with maintainers; [ rb2k katexochen ];
2020-12-22 23:48:49 +00:00
};
}