1{ lib, stdenv, fetchFromGitHub, cmake, ninja, pkg-config
2, zlib, xz, bzip2, zchunk, zstd
3, expat
4, withRpm ? !stdenv.isDarwin, rpm
5, db
6}:
7
8stdenv.mkDerivation rec {
9 version = "0.7.24";
10 pname = "libsolv";
11
12 src = fetchFromGitHub {
13 owner = "openSUSE";
14 repo = "libsolv";
15 rev = version;
16 sha256 = "sha256-UTVnGJO/9mQF9RwK75hh6IkoP1MwAlFaLCtdYU8uS34=";
17 };
18
19 cmakeFlags = [
20 "-DENABLE_COMPLEX_DEPS=true"
21 "-DENABLE_LZMA_COMPRESSION=true"
22 "-DENABLE_BZIP2_COMPRESSION=true"
23 "-DENABLE_ZSTD_COMPRESSION=true"
24 "-DENABLE_ZCHUNK_COMPRESSION=true"
25 "-DWITH_SYSTEM_ZCHUNK=true"
26 ] ++ lib.optionals withRpm [
27 "-DENABLE_PUBKEY=true"
28 "-DENABLE_RPMDB=true"
29 "-DENABLE_RPMDB_BYRPMHEADER=true"
30 "-DENABLE_RPMMD=true"
31 ];
32
33 nativeBuildInputs = [ cmake ninja pkg-config ];
34 buildInputs = [ zlib xz bzip2 zchunk zstd expat db ]
35 ++ lib.optional withRpm rpm;
36
37 meta = with lib; {
38 description = "A free package dependency solver";
39 homepage = "https://github.com/openSUSE/libsolv";
40 license = licenses.bsd3;
41 platforms = platforms.linux ++ platforms.darwin;
42 maintainers = with maintainers; [ copumpkin ];
43 };
44}
45