Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / applications / display-managers / lightdm-slick-greeter / default.nix
blobc1007e07b79b72531c645a18f9beaec125edda05
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , pkg-config
5 , python3
6 , vala
7 , intltool
8 , autoreconfHook
9 , wrapGAppsHook
10 , cinnamon
11 , lightdm
12 , gtk3
13 , pixman
14 , libcanberra
15 , libgnomekbd
16 , libX11
17 , libXext
18 , linkFarm
19 , lightdm-slick-greeter
20 , numlockx
23 stdenv.mkDerivation rec {
24   pname = "lightdm-slick-greeter";
25   version = "1.8.2";
27   src = fetchFromGitHub {
28     owner = "linuxmint";
29     repo = "slick-greeter";
30     rev = version;
31     sha256 = "sha256-OSL4Ls3bCua5ut8zWodeIH1SfevCbsS7BgBJYdcJaVE=";
32   };
34   nativeBuildInputs = [
35     pkg-config
36     vala
37     intltool
38     autoreconfHook
39     wrapGAppsHook
40     python3
41     python3.pkgs.wrapPython
42   ];
44   buildInputs = [
45     cinnamon.xapp
46     lightdm
47     gtk3
48     pixman
49     libcanberra
50     libgnomekbd # needed by XApp.KbdLayoutController
51     libX11
52     libXext
53   ];
55   pythonPath = [
56     python3.pkgs.pygobject3 # for slick-greeter-check-hidpi
57   ];
59   postPatch = ''
60     substituteInPlace src/slick-greeter.vala \
61       --replace "/usr/bin/numlockx" "${numlockx}/bin/numlockx" \
62       --replace "/usr/share/xsessions/" "/run/current-system/sw/share/xsessions/" \
63       --replace "/usr/share/wayland-sessions/" "/run/current-system/sw/share/wayland-sessions/" \
64       --replace "/usr/bin/slick-greeter" "${placeholder "out"}/bin/slick-greeter"
66     substituteInPlace src/session-list.vala \
67       --replace "/usr/share" "${placeholder "out"}/share"
69     # We prefer stable path here.
70     substituteInPlace data/x.dm.slick-greeter.gschema.xml \
71       --replace "/usr/share/onboard" "/run/current-system/sw/share/onboard"
73     patchShebangs files/usr/bin/*
74   '';
76   preAutoreconf = ''
77     # intltoolize fails during autoreconfPhase unless this
78     # directory is created manually.
79     mkdir m4
80   '';
82   configureFlags = [
83     "--localstatedir=/var"
84     "--sysconfdir=/etc"
85     "--sbindir=${placeholder "out"}/bin"
86   ];
88   installFlags = [
89     "localstatedir=\${TMPDIR}"
90     "sysconfdir=${placeholder "out"}/etc"
91   ];
93   postInstall = ''
94     substituteInPlace "$out/share/xgreeters/slick-greeter.desktop" \
95       --replace "Exec=slick-greeter" "Exec=$out/bin/slick-greeter"
97     cp -r files/usr/* $out
98   '';
100   preFixup = ''
101     buildPythonPath "$out $pythonPath"
102     gappsWrapperArgs+=(
103       --prefix PYTHONPATH : "$program_PYTHONPATH"
104     )
105   '';
107   passthru.xgreeters = linkFarm "lightdm-slick-greeter-xgreeters" [{
108     path = "${lightdm-slick-greeter}/share/xgreeters/slick-greeter.desktop";
109     name = "lightdm-slick-greeter.desktop";
110   }];
112   meta = with lib; {
113     description = "A slick-looking LightDM greeter";
114     homepage = "https://github.com/linuxmint/slick-greeter";
115     license = licenses.gpl3Only;
116     maintainers = with maintainers; [ water-sucks bobby285271 ];
117     platforms = platforms.linux;
118   };