git.iko.soy/typeable/nixpkgs
on master help sign in
libdnf: init at 0.55.2
commitdd5ffa7b94a19f4aeadbe49f53f6e3008fc1d7ad authorMarc Seeger <mseeger@fb.com> dateTue 22 Dec 2020, 15:48 (6 years ago) parent0312504
3 files changed+103
pkgs/tools/package-management/libdnf/darwin.patch+35 pkgs/tools/package-management/libdnf/default.nix+66 pkgs/top-level/all-packages.nix+2
pkgs/tools/package-management/libdnf/darwin.patchnew file+35
@@ -0,0 +1,35 @@
1+--- src/libdnf/hy-iutil.cpp 2020-12-02 07:53:42.000000000 -0800
2++++ src/libdnf/hy-iutil.cpp 2020-12-21 14:24:14.000000000 -0800
3+@@ -22,7 +22,7 @@
4+ #include <errno.h>
5+ #include <dirent.h>
6+ #include <fcntl.h>
7+-#include <linux/limits.h>
8++#include <limits.h>
9+ #include <pwd.h>
10+ #include <unistd.h>
11+ #include <stdio.h>
12+--- src/libdnf/hy-util.cpp 2020-12-02 07:53:42.000000000 -0800
13++++ src/libdnf/hy-util.cpp 2020-12-21 14:23:21.000000000 -0800
14+@@ -24,7 +24,20 @@
15+ #include <ctype.h>
16+ #include <sys/utsname.h>
17+ #include <sys/stat.h>
18+-#include <sys/auxv.h>
19++
20++// Darwin compatibility hacks
21++typedef int auxv_t;
22++#ifndef AT_HWCAP2
23++#define AT_HWCAP2 26
24++#endif
25++#ifndef AT_HWCAP
26++#define AT_HWCAP 16
27++#endif
28++static unsigned long getauxval(unsigned long type)
29++{
30++ unsigned long ret = 0;
31++ return ret;
32++}
33+
34+ // hawkey
35+ #include "dnf-types.h"
pkgs/tools/package-management/libdnf/default.nixnew file+66
@@ -0,0 +1,66 @@
1+{ gcc9Stdenv, stdenv, fetchFromGitHub, cmake, gettext, pkg-config, gpgme, libsolv, openssl, check
2+, pcre, json_c, libmodulemd, libsmartcols, sqlite, librepo, libyaml, rpm }:
3+
4+gcc9Stdenv.mkDerivation rec {
5+ pname = "libdnf";
6+ version = "0.55.2";
7+
8+ src = fetchFromGitHub {
9+ owner = "rpm-software-management";
10+ repo = pname;
11+ rev = version;
12+ sha256 = "0hiydwfa90nsrqk5ffa6ks1g73wnsgjgq7z7gwq9jj76a7gpfbfq";
13+ };
14+
15+ patches = stdenv.lib.optionals stdenv.isDarwin [ ./darwin.patch ];
16+
17+ nativeBuildInputs = [
18+ cmake
19+ gettext
20+ pkg-config
21+ ];
22+
23+ buildInputs = [
24+ check
25+ gpgme
26+ openssl
27+ json_c
28+ libsmartcols
29+ libyaml
30+ libmodulemd
31+ ];
32+
33+ propagatedBuildInputs = [
34+ sqlite
35+ libsolv
36+ librepo
37+ rpm
38+ ];
39+
40+ # See https://github.com/NixOS/nixpkgs/issues/107430
41+ prePatch = ''
42+ cp ${libsolv}/share/cmake/Modules/FindLibSolv.cmake cmake/modules/
43+ '';
44+
45+ # See https://github.com/NixOS/nixpkgs/issues/107428
46+ postPatch = ''
47+ substituteInPlace CMakeLists.txt \
48+ --replace "enable_testing()" "" \
49+ --replace "add_subdirectory(tests)" ""
50+ '';
51+
52+ cmakeFlags = [
53+ "-DWITH_GTKDOC=OFF"
54+ "-DWITH_HTML=OFF"
55+ "-DWITH_BINDINGS=OFF"
56+ "-DWITH_ZCHUNK=OFF"
57+ ];
58+
59+ meta = with stdenv.lib; {
60+ description = "Package management library.";
61+ homepage = "https://github.com/rpm-software-management/libdnf";
62+ license = licenses.gpl2Plus;
63+ platforms = platforms.linux ++ platforms.darwin;
64+ maintainers = with maintainers; [ rb2k ];
65+ };
66+}
pkgs/top-level/all-packages.nix+2
@@ -13977,6 +13977,8 @@ in
1397713977
1397813978 libdnet = callPackage ../development/libraries/libdnet { };
1397913979
13980+ libdnf = callPackage ../tools/package-management/libdnf { };
13981+
1398013982 libdrm = callPackage ../development/libraries/libdrm { };
1398113983
1398213984 libdv = callPackage ../development/libraries/libdv { };