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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
{
stdenv,
fetchFromGitHub,
lib,
gettext,
glib,
pkg-config,
polkit,
python3,
sqlite,
gobject-introspection,
vala,
jansson,
docbook_xsl_ns,
gtk-doc,
boost,
meson,
ninja,
libxslt,
docbook-xsl-nons,
docbook_xml_dtd_42,
libxml2,
gst_all_1,
gtk3,
enableCommandNotFound ? false,
enableBashCompletion ? false,
bash-completion ? null,
enableSystemd ? lib.meta.availableOn stdenv.hostPlatform systemdLibs,
systemdLibs,
nixosTests,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "packagekit";
version = "1.3.5";
outputs = [
"out"
"dev"
"devdoc"
];
src = fetchFromGitHub {
owner = "PackageKit";
repo = "PackageKit";
rev = "v${finalAttrs.version}";
hash = "sha256-aKucwqwNyZWyHfNu9ntzSwD+eQy8KjCt6RVMjjjZmZg=";
};
buildInputs = [
glib
polkit
python3
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
gtk3
jansson
sqlite
boost
]
++ lib.optional enableSystemd systemdLibs
++ lib.optional enableBashCompletion bash-completion;
nativeBuildInputs = [
gobject-introspection
glib
vala
gettext
pkg-config
gtk-doc
meson
libxslt
docbook-xsl-nons
docbook_xml_dtd_42
libxml2
ninja
];
mesonFlags = [
(lib.mesonBool "systemd" enableSystemd)
# often fails to build with nix updates
# and remounts /nix/store as rw
# https://github.com/NixOS/nixpkgs/issues/177946
#"-Dpackaging_backend=nix"
"-Ddbus_sys=${placeholder "out"}/share/dbus-1/system.d"
"-Ddbus_services=${placeholder "out"}/share/dbus-1/system-services"
"-Dsystemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
"-Dcron=false"
"-Dgtk_doc=true"
"--sysconfdir=/etc"
"--localstatedir=/var"
]
++ lib.optional (!enableBashCompletion) "-Dbash_completion=false"
++ lib.optional (!enableCommandNotFound) "-Dbash_command_not_found=false";
postPatch = ''
# HACK: we want packagekit to look in /etc for configs but install
# those files in $out/etc ; we just override the runtime paths here
# same for /var & $out/var
substituteInPlace etc/meson.build \
--replace-fail "install_dir: join_paths(get_option('sysconfdir'), 'PackageKit')" "install_dir: join_paths('$out', 'etc', 'PackageKit')"
substituteInPlace data/meson.build \
--replace-fail "install_dir: join_paths(get_option('localstatedir'), 'lib', 'PackageKit')," "install_dir: join_paths('$out', 'var', 'lib', 'PackageKit'),"
substituteInPlace client/meson.build \
--replace-fail http://docbook.sourceforge.net/release/xsl-ns/current ${docbook_xsl_ns}/share/xml/docbook-xsl-ns
'';
passthru.tests = {
nixos-test = nixosTests.packagekit;
};
meta = {
description = "System to facilitate installing and updating packages";
longDescription = ''
PackageKit is a system designed to make installing and updating software
on your computer easier. The primary design goal is to unify all the
software graphical tools used in different distributions, and use some of
the latest technology like PolicyKit. The actual nuts-and-bolts distro
tool (dnf, apt, etc) is used by PackageKit using compiled and scripted
helpers. PackageKit isn't meant to replace these tools, instead providing
a common set of abstractions that can be used by standard GUI and text
mode package managers.
'';
homepage = "https://github.com/PackageKit/PackageKit";
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.unix;
maintainers = [ ];
};
})
|