about summary refs log tree commit diff
path: root/pkgs/by-name/ap/apt/package.nix
blob: 945be641d855093ba40ec5b650465e61e705bfba (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
{ lib
, stdenv
, fetchurl
, bzip2
, cmake
, curl
, db
, docbook_xml_dtd_45
, docbook_xsl
, doxygen
, dpkg
, gettext
, gnutls
, gtest
, libgcrypt
, libgpg-error
, libseccomp
, libtasn1
, libxslt
, lz4
, p11-kit
, perlPackages
, pkg-config
, triehash
, udev
, w3m
, xxHash
, xz
, zstd
, withDocs ? true
, withNLS ? true
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "apt";
  version = "2.9.2";

  src = fetchurl {
    url = "mirror://debian/pool/main/a/apt/apt_${finalAttrs.version}.tar.xz";
    hash = "sha256-gKp0RmsTLlDtjQFZ8Q5kpEi2psZHI9YsQrg6UZnKA6c=";
  };

  # cycle detection; lib can't be split
  outputs = [ "out" "dev" "doc" "man" ];

  nativeBuildInputs = [
    cmake
    gtest
    (lib.getBin libxslt)
    pkg-config
    triehash
  ];

  buildInputs = [
    bzip2
    curl
    db
    dpkg
    gnutls
    libgcrypt
    libgpg-error
    libseccomp
    libtasn1
    lz4
    p11-kit
    perlPackages.perl
    udev
    xxHash
    xz
    zstd
  ] ++ lib.optionals withDocs [
    docbook_xml_dtd_45
    doxygen
    perlPackages.Po4a
    w3m
  ] ++ lib.optionals withNLS [
    gettext
  ];

  cmakeFlags = [
    (lib.cmakeOptionType "filepath" "BERKELEY_INCLUDE_DIRS" "${lib.getDev db}/include")
    (lib.cmakeOptionType "filepath" "DOCBOOK_XSL""${docbook_xsl}/share/xml/docbook-xsl")
    (lib.cmakeOptionType "filepath" "GNUTLS_INCLUDE_DIR" "${lib.getDev gnutls}/include")
    (lib.cmakeFeature "DROOT_GROUP" "root")
    (lib.cmakeBool "USE_NLS" withNLS)
    (lib.cmakeBool "WITH_DOC" withDocs)
  ];

  meta = {
    homepage = "https://salsa.debian.org/apt-team/apt";
    description = "Command-line package management tools used on Debian-based systems";
    changelog = "https://salsa.debian.org/apt-team/apt/-/raw/${finalAttrs.version}/debian/changelog";
    license = with lib.licenses; [ gpl2Plus ];
    mainProgram = "apt";
    maintainers = with lib.maintainers; [ AndersonTorres ];
    platforms = lib.platforms.linux;
  };
})