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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
{
lib,
stdenv,
buildPackages,
fetchFromGitHub,
nix-update-script,
replaceVars,
plymouth,
pam,
pkg-config,
autoreconfHook,
gettext,
libtool,
libxcb,
glib,
libxdmcp,
itstool,
intltool,
libxklavier,
libgcrypt,
audit,
busybox,
polkit,
accountsservice,
gtk-doc,
gobject-introspection,
vala,
fetchpatch,
withQt5 ? false,
qt5,
withQt6 ? false,
qt6,
yelp-tools,
yelp-xsl,
nixosTests,
}:
assert !(withQt5 && withQt6);
stdenv.mkDerivation (finalAttrs: {
pname = "lightdm";
version = "1.33.1";
outputs = [
"out"
"dev"
];
src = fetchFromGitHub {
owner = "ubuntu";
repo = "lightdm";
tag = finalAttrs.version;
hash = "sha256-/p5/V2KNRkm1cP9/Ld3crfAxAdHYc2mFyNl1rV6QXr0=";
};
nativeBuildInputs = [
autoreconfHook
gettext
yelp-tools
yelp-xsl
gobject-introspection
gtk-doc
intltool
itstool
libtool
pkg-config
vala
];
buildInputs = [
accountsservice
audit
glib
libxdmcp
libgcrypt
libxcb
libxklavier
pam
polkit
]
++ lib.optional withQt5 qt5.qtbase
++ lib.optional withQt6 qt6.qtbase;
patches = [
# Adds option to disable writing dmrc files
(fetchpatch {
url = "https://src.fedoraproject.org/rpms/lightdm/raw/4cf0d2bed8d1c68970b0322ccd5dbbbb7a0b12bc/f/lightdm-1.25.1-disable_dmrc.patch";
hash = "sha256-NpASGgEhOjxuKME2f7RM2U5JvRRdl0OF5lHnp5aKxxk=";
})
# Hardcode plymouth to fix transitions.
# For some reason it can't find `plymouth`
# even when it's in PATH in environment.systemPackages.
(replaceVars ./fix-paths.patch {
plymouth = "${plymouth}/bin/plymouth";
})
];
dontWrapQtApps = true;
preConfigure =
lib.optionalString withQt6 ''
# See m4/qt-validate-moc.m4 for how moc is found.
export PATH=${buildPackages.qt6Packages.qtbase}/libexec:$PATH
''
+ ''
NOCONFIGURE=1 ./autogen.sh
'';
configureFlags = [
"--localstatedir=/var"
"--sysconfdir=/etc"
"--disable-tests"
"--disable-dmrc"
]
++ lib.optional withQt5 "--enable-liblightdm-qt5"
++ lib.optional withQt6 "--enable-liblightdm-qt6";
installFlags = [
"sysconfdir=${placeholder "out"}/etc"
"localstatedir=\${TMPDIR}"
];
postPatch = ''
substituteInPlace autogen.sh \
--replace-fail "which" "${buildPackages.busybox}/bin/which"
substituteInPlace src/shared-data-manager.c \
--replace-fail /bin/rm ${busybox}/bin/rm
'';
postInstall = ''
rm -rf $out/etc/apparmor.d $out/etc/init $out/etc/pam.d
'';
passthru = {
updateScript = nix-update-script { };
tests = { inherit (nixosTests) lightdm; };
};
meta = {
homepage = "https://github.com/ubuntu/lightdm";
description = "Cross-desktop display manager";
platforms = lib.platforms.linux;
license = with lib.licenses; [
gpl3Plus
# and (
lgpl2Only
# or
lgpl3Only
# )
];
teams = [ lib.teams.pantheon ];
};
})
|