nixpkgs/pkgs/by-name/li/lightdm-slick-greeter/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

105 lines
2.4 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, meson
, ninja
, pkg-config
, python3
, vala
, wrapGAppsHook3
, xapp
, lightdm
, gtk3
, pixman
, libcanberra
, libgnomekbd
, libX11
, libXext
, linkFarm
, lightdm-slick-greeter
, numlockx
}:
stdenv.mkDerivation rec {
pname = "lightdm-slick-greeter";
version = "2.0.6";
src = fetchFromGitHub {
owner = "linuxmint";
repo = "slick-greeter";
rev = version;
sha256 = "sha256-Q6V4axKlGhX1/uaugNkjoynHSL5jWA/eqzAsbJYcRSo=";
};
nativeBuildInputs = [
meson
ninja
pkg-config
vala
wrapGAppsHook3
python3
python3.pkgs.wrapPython
];
buildInputs = [
xapp
lightdm
gtk3
pixman
libcanberra
libgnomekbd # needed by XApp.KbdLayoutController
libX11
libXext
];
pythonPath = [
python3.pkgs.pygobject3 # for slick-greeter-check-hidpi
];
postPatch = ''
substituteInPlace src/slick-greeter.vala \
--replace-fail "/usr/bin/numlockx" "${numlockx}/bin/numlockx" \
--replace-fail "/usr/share/xsessions/" "/run/current-system/sw/share/xsessions/" \
--replace-fail "/usr/share/wayland-sessions/" "/run/current-system/sw/share/wayland-sessions/" \
--replace-fail "/usr/bin/slick-greeter" "${placeholder "out"}/bin/slick-greeter"
substituteInPlace src/session-list.vala \
--replace-fail "/usr/share" "${placeholder "out"}/share"
# We prefer stable path here.
substituteInPlace data/x.dm.slick-greeter.gschema.xml \
--replace-fail "/usr/share/onboard" "/run/current-system/sw/share/onboard"
patchShebangs files/usr/bin/*
'';
mesonFlags = [
"--sbindir=${placeholder "out"}/bin"
];
postInstall = ''
substituteInPlace "$out/share/xgreeters/slick-greeter.desktop" \
--replace-fail "Exec=slick-greeter" "Exec=$out/bin/slick-greeter"
'';
preFixup = ''
buildPythonPath "$out $pythonPath"
gappsWrapperArgs+=(
--prefix PYTHONPATH : "$program_PYTHONPATH"
)
'';
passthru.xgreeters = linkFarm "lightdm-slick-greeter-xgreeters" [{
path = "${lightdm-slick-greeter}/share/xgreeters/slick-greeter.desktop";
name = "lightdm-slick-greeter.desktop";
}];
meta = with lib; {
description = "Slick-looking LightDM greeter";
homepage = "https://github.com/linuxmint/slick-greeter";
license = licenses.gpl3Only;
maintainers = with maintainers; [ water-sucks bobby285271 ];
platforms = platforms.linux;
};
}