nixpkgs/pkgs/tools/package-management/libdnf/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

67 lines
1.5 KiB
Nix

{ gcc9Stdenv, lib, stdenv, fetchFromGitHub, cmake, gettext, pkg-config, gpgme, libsolv, openssl, check
, pcre, json_c, libmodulemd, libsmartcols, sqlite, librepo, libyaml, rpm }:
gcc9Stdenv.mkDerivation rec {
pname = "libdnf";
version = "0.55.2";
src = fetchFromGitHub {
owner = "rpm-software-management";
repo = pname;
rev = version;
sha256 = "0hiydwfa90nsrqk5ffa6ks1g73wnsgjgq7z7gwq9jj76a7gpfbfq";
};
patches = stdenv.lib.optionals stdenv.isDarwin [ ./darwin.patch ];
nativeBuildInputs = [
cmake
gettext
pkg-config
];
buildInputs = [
check
gpgme
openssl
json_c
libsmartcols
libyaml
libmodulemd
];
propagatedBuildInputs = [
sqlite
libsolv
librepo
rpm
];
# See https://github.com/NixOS/nixpkgs/issues/107430
prePatch = ''
cp ${libsolv}/share/cmake/Modules/FindLibSolv.cmake cmake/modules/
'';
# See https://github.com/NixOS/nixpkgs/issues/107428
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace "enable_testing()" "" \
--replace "add_subdirectory(tests)" ""
'';
cmakeFlags = [
"-DWITH_GTKDOC=OFF"
"-DWITH_HTML=OFF"
"-DWITH_BINDINGS=OFF"
"-DWITH_ZCHUNK=OFF"
];
meta = with lib; {
description = "Package management library.";
homepage = "https://github.com/rpm-software-management/libdnf";
license = licenses.gpl2Plus;
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ rb2k ];
};
}