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

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

122 lines
2.5 KiB
Nix
Raw Normal View History

2023-07-14 11:33:56 +02:00
{ lib
, stdenv
, fetchFromGitHub
, cmake
, createrepo_c
2023-11-23 23:10:48 +01:00
, doxygen
2023-07-14 11:33:56 +02:00
, gettext
, help2man
, pkg-config
2023-11-23 23:10:48 +01:00
, python3Packages
2023-07-14 11:33:56 +02:00
, cppunit
, fmt
, json_c
, libmodulemd
, librepo
, libsmartcols
, libsolv
, libxml2
, libyaml
, pcre2
2023-07-14 11:33:56 +02:00
, rpm
, sdbus-cpp
2023-11-23 23:10:48 +01:00
, sphinx
2023-07-14 11:33:56 +02:00
, sqlite
, systemd
2023-11-24 08:00:39 +01:00
, testers
2023-07-14 11:33:56 +02:00
, toml11
, zchunk
}:
stdenv.mkDerivation (finalAttrs: {
pname = "dnf5";
2024-03-15 13:33:59 +01:00
version = "5.1.15";
2023-07-14 11:33:56 +02:00
2023-11-23 23:10:48 +01:00
outputs = [ "out" "man" ];
2023-07-14 11:33:56 +02:00
src = fetchFromGitHub {
owner = "rpm-software-management";
repo = "dnf5";
rev = finalAttrs.version;
2024-03-15 13:33:59 +01:00
hash = "sha256-IDF/jRnPpGbHk5bY7plkCO1x/i10H+HCcU88JI4EHvs=";
2023-07-14 11:33:56 +02:00
};
2023-11-23 23:10:48 +01:00
nativeBuildInputs = [
cmake
createrepo_c
doxygen
gettext
help2man
pkg-config
sphinx
] ++ (with python3Packages; [
breathe
sphinx-autoapi
sphinx-rtd-theme
]);
2023-07-14 11:33:56 +02:00
buildInputs = [
cppunit
fmt
json_c
libmodulemd
librepo
libsmartcols
libsolv
libxml2
libyaml
pcre2.dev
2023-07-14 11:33:56 +02:00
rpm
sdbus-cpp
sqlite
systemd
toml11
zchunk
];
# workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329
NIX_CFLAGS_COMPILE = "-Wno-restrict -Wno-maybe-uninitialized";
cmakeFlags = [
"-DWITH_PERL5=OFF"
"-DWITH_PYTHON3=OFF"
"-DWITH_RUBY=OFF"
"-DWITH_PLUGIN_RHSM=OFF" # Red Hat Subscription Manager plugin
2023-07-14 11:33:56 +02:00
# the cmake package does not handle absolute CMAKE_INSTALL_INCLUDEDIR correctly
# (setting it to an absolute path causes include files to go to $out/$out/include,
# because the absolute path is interpreted with root at $out).
"-DCMAKE_INSTALL_INCLUDEDIR=include"
"-DCMAKE_INSTALL_LIBDIR=lib"
];
2023-11-23 23:10:48 +01:00
postBuild = ''
make doc
'';
2023-07-14 11:33:56 +02:00
prePatch = ''
substituteInPlace dnf5daemon-server/dbus/CMakeLists.txt \
--replace '/etc' "$out/etc" \
--replace '/usr' "$out"
substituteInPlace dnf5daemon-server/polkit/CMakeLists.txt \
--replace '/usr' "$out"
substituteInPlace dnf5/CMakeLists.txt \
--replace '/etc/bash_completion.d' "$out/etc/bash_completion.d"
'';
dontFixCmake = true;
2023-11-24 08:00:39 +01:00
passthru.tests = {
version = testers.testVersion { package = finalAttrs.finalPackage; };
};
2023-07-14 11:33:56 +02:00
meta = with lib; {
description = "Next-generation RPM package management system";
homepage = "https://github.com/rpm-software-management/dnf5";
changelog = "https://github.com/rpm-software-management/dnf5/releases/tag/${version}";
2023-07-14 11:33:56 +02:00
license = licenses.gpl2Plus;
2023-11-09 18:36:17 +01:00
maintainers = with lib.maintainers; [ malt3 katexochen ];
mainProgram = "dnf5";
2023-07-14 11:33:56 +02:00
platforms = platforms.linux ++ platforms.darwin;
};
})