about summary refs log tree commit diff
path: root/pkgs/tools/package-management/librepo/default.nix
blob: 4b9b593655b74065716a05012f5ff7d3695cbda2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ stdenv, fetchFromGitHub, cmake, python2, pkgconfig, expat, glib, pcre, openssl, curl, check, attr, gpgme }:

stdenv.mkDerivation rec {
  version = "1.7.18";
  name = "librepo-${version}";

  src = fetchFromGitHub {
    owner  = "rpm-software-management";
    repo   = "librepo";
    rev    = name;
    sha256 = "05iqx2kvfqsskb2r3n5p8f91i4gd4pbw6nh30pn532mgab64cvxk";
  };

  patchPhase = ''
    substituteInPlace librepo/python/python2/CMakeLists.txt \
      --replace ' ''${PYTHON_INSTALL_DIR}' " $out/lib/python2.7/site-packages"
  '';

  buildInputs = [ cmake python2 pkgconfig expat glib pcre openssl curl check attr gpgme ];

  # librepo/fastestmirror.h includes curl/curl.h, and pkg-config specfile refers to others in here
  propagatedBuildInputs = [ curl gpgme expat ];

  meta = with stdenv.lib; {
    description = "Library providing C and Python (libcURL like) API for downloading linux repository metadata and packages";
    license     = licenses.lgpl2Plus;
    platforms   = platforms.linux;
    maintainers = with maintainers; [ copumpkin ];
  };
}