1{
2 lib,
3 check,
4 cmake,
5 doxygen,
6 expat,
7 fetchFromGitHub,
8 libxml2,
9 python3,
10 sphinx,
11 stdenv,
12 zlib,
13}:
14
15stdenv.mkDerivation rec {
16 pname = "libcomps";
17 version = "0.1.21";
18
19 outputs = [
20 "out"
21 "dev"
22 "py"
23 ];
24
25 src = fetchFromGitHub {
26 owner = "rpm-software-management";
27 repo = "libcomps";
28 rev = version;
29 hash = "sha256-2ZxU1g5HDWnSxTabnmfyQwz1ZCXK+7kJXLofeFBiwn0=";
30 };
31
32 patches = [
33 ./fix-python-install-dir.patch
34 ];
35
36 postPatch = ''
37 substituteInPlace libcomps/src/python/src/CMakeLists.txt \
38 --replace "@PYTHON_INSTALL_DIR@" "$out/${python3.sitePackages}"
39 '';
40
41 nativeBuildInputs = [
42 check
43 cmake
44 doxygen
45 python3
46 sphinx
47 ];
48
49 buildInputs = [
50 expat
51 libxml2
52 zlib
53 ];
54
55 dontUseCmakeBuildDir = true;
56 cmakeDir = "libcomps";
57
58 postFixup = ''
59 ls $out/lib
60 moveToOutput "lib/${python3.libPrefix}" "$py"
61 '';
62
63 meta = with lib; {
64 description = "Comps XML file manipulation library";
65 homepage = "https://github.com/rpm-software-management/libcomps";
66 license = licenses.gpl2Only;
67 maintainers = with maintainers; [ katexochen ];
68 platforms = platforms.unix;
69 };
70}