nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitLab,
5 bzip2,
6 cmake,
7 curl,
8 db,
9 docbook_xml_dtd_45,
10 docbook_xsl,
11 doxygen,
12 dpkg,
13 gettext,
14 gnutls,
15 gtest,
16 libgcrypt,
17 libgpg-error,
18 libseccomp,
19 libtasn1,
20 libxslt,
21 lz4,
22 p11-kit,
23 perlPackages,
24 pkg-config,
25 triehash,
26 udev,
27 w3m,
28 xxHash,
29 xz,
30 zstd,
31 withDocs ? true,
32 withNLS ? true,
33}:
34
35stdenv.mkDerivation (finalAttrs: {
36 pname = "apt";
37 version = "3.1.14";
38
39 src = fetchFromGitLab {
40 domain = "salsa.debian.org";
41 owner = "apt-team";
42 repo = "apt";
43 rev = finalAttrs.version;
44 hash = "sha256-hGa+7sQ52PscYDlcB67czPXdoD1g1meu8zVUua5lrnw=";
45 };
46
47 # cycle detection; lib can't be split
48 outputs = [
49 "out"
50 "dev"
51 "doc"
52 "man"
53 ];
54
55 nativeBuildInputs = [
56 cmake
57 dpkg # dpkg-architecture
58 gettext # msgfmt
59 gtest
60 (lib.getBin libxslt)
61 pkg-config
62 triehash
63 perlPackages.perl
64 ]
65 ++ lib.optionals withDocs [
66 docbook_xml_dtd_45
67 doxygen
68 perlPackages.Po4a
69 w3m
70 ];
71
72 buildInputs = [
73 bzip2
74 curl
75 db
76 dpkg
77 gnutls
78 gtest
79 libgcrypt
80 libgpg-error
81 libseccomp
82 libtasn1
83 lz4
84 p11-kit
85 udev
86 xxHash
87 xz
88 zstd
89 ]
90 ++ lib.optionals withNLS [
91 gettext
92 ];
93
94 cmakeFlags = [
95 (lib.cmakeOptionType "filepath" "BERKELEY_INCLUDE_DIRS" "${lib.getDev db}/include")
96 (lib.cmakeOptionType "filepath" "DPKG_DATADIR" "${dpkg}/share/dpkg")
97 (lib.cmakeOptionType "filepath" "DOCBOOK_XSL" "${docbook_xsl}/share/xml/docbook-xsl")
98 (lib.cmakeOptionType "filepath" "GNUTLS_INCLUDE_DIR" "${lib.getDev gnutls}/include")
99 (lib.cmakeFeature "DROOT_GROUP" "root")
100 (lib.cmakeBool "USE_NLS" withNLS)
101 (lib.cmakeBool "WITH_DOC" withDocs)
102 ];
103
104 meta = {
105 homepage = "https://salsa.debian.org/apt-team/apt";
106 description = "Command-line package management tools used on Debian-based systems";
107 changelog = "https://salsa.debian.org/apt-team/apt/-/raw/${finalAttrs.version}/debian/changelog";
108 license = with lib.licenses; [ gpl2Plus ];
109 mainProgram = "apt";
110 maintainers = [ ];
111 platforms = lib.platforms.linux;
112 };
113})