1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 python3,
7 pkg-config,
8 libxml2,
9 glib,
10 openssl,
11 zchunk,
12 curl,
13 check,
14 gpgme,
15 libselinux,
16 nix-update-script,
17 doxygen,
18}:
19
20stdenv.mkDerivation (finalAttrs: {
21 version = "1.20.0";
22 pname = "librepo";
23
24 outputs = [
25 "out"
26 "dev"
27 "py"
28 ];
29
30 src = fetchFromGitHub {
31 owner = "rpm-software-management";
32 repo = "librepo";
33 tag = finalAttrs.version;
34 hash = "sha256-KYBHImdGQgf/IZ5FMhzrbBTeZF76AIP3RjVPT3w0oT8=";
35 };
36
37 nativeBuildInputs = [
38 cmake
39 pkg-config
40 doxygen
41 ];
42
43 buildInputs = [
44 python3
45 libxml2
46 glib
47 openssl
48 curl
49 check
50 gpgme
51 zchunk
52 libselinux
53 ];
54
55 # librepo/fastestmirror.h includes curl/curl.h, and pkg-config specfile refers to others in here
56 propagatedBuildInputs = [
57 curl
58 gpgme
59 libxml2
60 ];
61
62 cmakeFlags = [ "-DPYTHON_DESIRED=${lib.substring 0 1 python3.pythonVersion}" ];
63
64 postFixup = ''
65 moveToOutput "lib/${python3.libPrefix}" "$py"
66 '';
67
68 passthru.updateScript = nix-update-script { };
69
70 meta = {
71 description = "Library providing C and Python (libcURL like) API for downloading linux repository metadata and packages";
72 homepage = "https://rpm-software-management.github.io/librepo/";
73 changelog = "https://github.com/rpm-software-management/dnf5/releases/tag/${finalAttrs.version}";
74 license = lib.licenses.lgpl2Plus;
75 platforms = lib.platforms.linux;
76 maintainers = [ ];
77 };
78})