2021-02-21 21:03:54 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitLab
|
2023-06-15 14:42:21 +00:00
|
|
|
, writeText
|
|
|
|
, meson
|
2021-02-21 21:03:54 +00:00
|
|
|
, pkg-config
|
2023-06-15 14:42:21 +00:00
|
|
|
, ninja
|
2021-02-21 21:03:54 +00:00
|
|
|
, docbook-xsl-nons
|
|
|
|
, gettext
|
2023-06-15 14:42:21 +00:00
|
|
|
, libxslt
|
2021-02-21 21:03:54 +00:00
|
|
|
, gtk3
|
|
|
|
, libdrm
|
2023-06-15 14:42:21 +00:00
|
|
|
, libevdev
|
|
|
|
, libpng
|
|
|
|
, libxkbcommon
|
|
|
|
, pango
|
|
|
|
, systemd
|
|
|
|
, xorg
|
2014-05-26 17:29:53 +00:00
|
|
|
}:
|
2013-04-11 23:58:38 +00:00
|
|
|
|
2023-06-15 14:42:21 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-11-10 18:40:38 +00:00
|
|
|
pname = "plymouth";
|
2023-07-20 21:02:13 +00:00
|
|
|
version = "unstable-2023-06-17";
|
2013-04-11 23:58:38 +00:00
|
|
|
|
2023-06-15 14:42:21 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
2021-02-21 21:03:54 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "gitlab.freedesktop.org";
|
|
|
|
owner = "plymouth";
|
|
|
|
repo = "plymouth";
|
2023-07-20 21:02:13 +00:00
|
|
|
rev = "b1d5aa9d2a6033bba52cf63643e5878f8a9b68a0";
|
|
|
|
hash = "sha256-8DXcwt8CZTni5Ma+I63LzNejlIB0Cr1ATA7Nl3z9z6I=";
|
2013-04-11 23:58:38 +00:00
|
|
|
};
|
|
|
|
|
2023-06-15 14:42:21 +00:00
|
|
|
patches = [
|
|
|
|
# do not create unnecessary symlink to non-existent header-image.png
|
|
|
|
./dont-create-broken-symlink.patch
|
|
|
|
# add support for loading plugins from /run to assist NixOS module
|
|
|
|
./add-runtime-plugin-path.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
strictDeps = true;
|
|
|
|
|
2016-07-06 19:53:25 +00:00
|
|
|
nativeBuildInputs = [
|
2023-06-15 14:42:21 +00:00
|
|
|
meson
|
|
|
|
pkg-config
|
|
|
|
ninja
|
2021-02-21 21:03:54 +00:00
|
|
|
docbook-xsl-nons
|
|
|
|
gettext
|
|
|
|
libxslt
|
2014-05-26 17:29:53 +00:00
|
|
|
];
|
|
|
|
|
2016-07-06 19:53:25 +00:00
|
|
|
buildInputs = [
|
2021-02-21 21:03:54 +00:00
|
|
|
gtk3
|
|
|
|
libdrm
|
2023-06-15 14:42:21 +00:00
|
|
|
libevdev
|
|
|
|
libpng
|
|
|
|
libxkbcommon
|
2021-02-21 21:03:54 +00:00
|
|
|
pango
|
|
|
|
systemd
|
2023-06-15 14:42:21 +00:00
|
|
|
xorg.xkeyboardconfig
|
2021-02-21 21:03:54 +00:00
|
|
|
];
|
|
|
|
|
2023-06-15 14:42:21 +00:00
|
|
|
mesonFlags = let
|
|
|
|
# https://gitlab.freedesktop.org/plymouth/plymouth/-/blob/a5eda165689864cc9a25ec14fd8c6da458598f42/meson.build#L47
|
|
|
|
crossFile = writeText "cross-file.conf" ''
|
|
|
|
[binaries]
|
|
|
|
systemd-tty-ask-password-agent = '${lib.getBin systemd}/bin/systemd-tty-ask-password-agent'
|
|
|
|
'';
|
|
|
|
in [
|
2021-02-21 21:03:54 +00:00
|
|
|
"--sysconfdir=/etc"
|
2023-06-15 14:42:21 +00:00
|
|
|
"--localstatedir=/var"
|
|
|
|
"-Dlogo=/etc/plymouth/logo.png"
|
|
|
|
"-Dbackground-color=0x000000"
|
|
|
|
"-Dbackground-start-color-stop=0x000000"
|
|
|
|
"-Dbackground-end-color-stop=0x000000"
|
|
|
|
"-Drelease-file=/etc/os-release"
|
|
|
|
"-Dudev=enabled"
|
|
|
|
"-Drunstatedir=/run"
|
|
|
|
"-Druntime-plugins=true"
|
|
|
|
"--cross-file=${crossFile}"
|
2020-02-27 02:57:49 +00:00
|
|
|
];
|
2016-07-06 19:53:25 +00:00
|
|
|
|
2023-06-15 14:42:21 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace meson.build \
|
|
|
|
--replace "run_command(['scripts/generate-version.sh'], check: true).stdout().strip()" "'${finalAttrs.version}'"
|
|
|
|
|
|
|
|
# prevent installing unused non-$out dirs to DESTDIR
|
|
|
|
sed -i '/^install_emptydir/d' src/meson.build
|
|
|
|
'';
|
2013-04-11 23:58:38 +00:00
|
|
|
|
2021-02-21 21:03:54 +00:00
|
|
|
postInstall = ''
|
2023-06-15 14:42:21 +00:00
|
|
|
# Move stuff from DESTDIR to proper location.
|
|
|
|
cp -a "$DESTDIR/etc" "$out"
|
|
|
|
rm -r "$DESTDIR/etc"
|
|
|
|
for o in $(getAllOutputNames); do
|
|
|
|
if [[ "$o" = "debug" ]]; then continue; fi
|
|
|
|
cp -a "$DESTDIR/''${!o}" "$(dirname "''${!o}")"
|
|
|
|
rm -r "$DESTDIR/''${!o}"
|
|
|
|
done
|
|
|
|
# Ensure the DESTDIR is removed.
|
|
|
|
rmdir "$DESTDIR/${builtins.storeDir}" "$DESTDIR/${builtins.dirOf builtins.storeDir}" "$DESTDIR"
|
2021-02-21 21:03:54 +00:00
|
|
|
'';
|
|
|
|
|
2023-06-15 14:42:21 +00:00
|
|
|
# HACK: We want to install configuration files to $out/etc
|
|
|
|
# but Plymouth should read them from /etc on a NixOS system.
|
|
|
|
# With autotools, it was possible to override Make variables
|
|
|
|
# at install time but Meson does not support this
|
|
|
|
# so we need to convince it to install all files to a temporary
|
|
|
|
# location using DESTDIR and then move it to proper one in postInstall.
|
|
|
|
env.DESTDIR = "${placeholder "out"}/dest";
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2021-02-21 21:03:54 +00:00
|
|
|
homepage = "https://www.freedesktop.org/wiki/Software/Plymouth/";
|
|
|
|
description = "Boot splash and boot logger";
|
|
|
|
license = licenses.gpl2Plus;
|
2022-04-11 19:43:17 +00:00
|
|
|
maintainers = [ maintainers.goibhniu ] ++ teams.gnome.members;
|
2014-03-16 11:08:26 +00:00
|
|
|
platforms = platforms.linux;
|
2013-04-11 23:58:38 +00:00
|
|
|
};
|
2023-06-15 14:42:21 +00:00
|
|
|
})
|