plymouth: unstable-2021-10-18 -> unstable-2023-06-05

Includes switch from autotools-based build system to meson-based build
system.

Co-Authored-By: Ilan Joselevich <personal@ilanjoselevich.com>

+154 -56
+67
pkgs/os-specific/linux/plymouth/add-runtime-plugin-path.patch
···
··· 1 + diff --git a/meson.build b/meson.build 2 + index 650ad189..1e1ebe1d 100644 3 + --- a/meson.build 4 + +++ b/meson.build 5 + @@ -18,6 +18,11 @@ plymouth_time_dir = get_option('prefix') / get_option('localstatedir') / 'lib' / 6 + 7 + plymouth_runtime_dir = get_option('runstatedir') / 'plymouth' 8 + plymouth_runtime_theme_path = plymouth_runtime_dir / 'themes/' 9 + +if get_option('runtime-plugins') 10 + + plymouth_runtime_plugin_path = plymouth_runtime_dir / 'plugins/' 11 + +else 12 + + plymouth_runtime_plugin_path = plymouth_plugin_path 13 + +endif 14 + 15 + # Dependencies 16 + cc = meson.get_compiler('c') 17 + @@ -76,7 +81,7 @@ conf.set('PLY_ENABLE_TRACING', get_option('tracing')) 18 + conf.set_quoted('PLYMOUTH_RUNTIME_DIR', plymouth_runtime_dir) 19 + conf.set_quoted('PLYMOUTH_THEME_PATH', plymouth_theme_path) 20 + conf.set_quoted('PLYMOUTH_RUNTIME_THEME_PATH', plymouth_runtime_theme_path) 21 + -conf.set_quoted('PLYMOUTH_PLUGIN_PATH', plymouth_plugin_path) 22 + +conf.set_quoted('PLYMOUTH_PLUGIN_PATH', plymouth_runtime_plugin_path) 23 + conf.set_quoted('PLYMOUTH_POLICY_DIR', plymouth_policy_dir) 24 + conf.set_quoted('PLYMOUTH_CONF_DIR', plymouth_conf_dir) 25 + conf.set_quoted('PLYMOUTH_TIME_DIRECTORY', plymouth_time_dir) 26 + diff --git a/meson_options.txt b/meson_options.txt 27 + index 4f601bb0..61fccc12 100644 28 + --- a/meson_options.txt 29 + +++ b/meson_options.txt 30 + @@ -28,6 +28,11 @@ option('runstatedir', 31 + value: '/run', 32 + description: 'runstatedir', 33 + ) 34 + +option('runtime-plugins', 35 + + type: 'boolean', 36 + + value: false, 37 + + description: 'Use runstatedir for loading theme plugins', 38 + +) 39 + option('boot-tty', 40 + type: 'string', 41 + value: '/dev/tty1', 42 + diff --git a/src/libply-splash-core/meson.build b/src/libply-splash-core/meson.build 43 + index 69636b13..02bd5cbd 100644 44 + --- a/src/libply-splash-core/meson.build 45 + +++ b/src/libply-splash-core/meson.build 46 + @@ -31,7 +31,7 @@ libply_splash_core_cflags = [ 47 + '-DPLYMOUTH_BACKGROUND_COLOR=@0@'.format(get_option('background-color')), 48 + '-DPLYMOUTH_BACKGROUND_START_COLOR=@0@'.format(get_option('background-start-color-stop')), 49 + '-DPLYMOUTH_BACKGROUND_END_COLOR=@0@'.format(get_option('background-end-color-stop')), 50 + - '-DPLYMOUTH_PLUGIN_PATH="@0@"'.format(plymouth_plugin_path), 51 + + '-DPLYMOUTH_PLUGIN_PATH="@0@"'.format(plymouth_runtime_plugin_path), 52 + ] 53 + 54 + libply_splash_core = library('ply-splash-core', 55 + diff --git a/src/libply-splash-graphics/meson.build b/src/libply-splash-graphics/meson.build 56 + index 32fad963..02b8440b 100644 57 + --- a/src/libply-splash-graphics/meson.build 58 + +++ b/src/libply-splash-graphics/meson.build 59 + @@ -20,7 +20,7 @@ libply_splash_graphics_cflags = [ 60 + '-DPLYMOUTH_BACKGROUND_COLOR=@0@'.format(get_option('background-color')), 61 + '-DPLYMOUTH_BACKGROUND_START_COLOR=@0@'.format(get_option('background-start-color-stop')), 62 + '-DPLYMOUTH_BACKGROUND_END_COLOR=@0@'.format(get_option('background-end-color-stop')), 63 + - '-DPLYMOUTH_PLUGIN_PATH="@0@"'.format(plymouth_plugin_path), 64 + + '-DPLYMOUTH_PLUGIN_PATH="@0@"'.format(plymouth_runtime_plugin_path), 65 + ] 66 + 67 + libply_splash_graphics = library('ply-splash-graphics',
+74 -56
pkgs/os-specific/linux/plymouth/default.nix
··· 1 { lib 2 , stdenv 3 - , fetchpatch 4 , fetchFromGitLab 5 , pkg-config 6 - , autoreconfHook 7 - , libxslt 8 , docbook-xsl-nons 9 , gettext 10 , gtk3 11 - , systemd 12 , pango 13 - , cairo 14 - , libdrm 15 }: 16 17 - stdenv.mkDerivation rec { 18 pname = "plymouth"; 19 - version = "unstable-2021-10-18"; 20 21 - outputs = [ 22 - "out" 23 - "dev" 24 - ]; 25 26 src = fetchFromGitLab { 27 domain = "gitlab.freedesktop.org"; 28 owner = "plymouth"; 29 repo = "plymouth"; 30 - rev = "18363cd887dbfe7e82a2f4cc1a49ef9513919142"; 31 - sha256 = "sha256-+AP4ALOFdYFt/8MDXjMaHptkogCwK1iXKuza1zfMaws="; 32 }; 33 34 nativeBuildInputs = [ 35 - autoreconfHook 36 docbook-xsl-nons 37 gettext 38 libxslt 39 - pkg-config 40 ]; 41 42 buildInputs = [ 43 - cairo 44 gtk3 45 libdrm 46 pango 47 systemd 48 ]; 49 50 - postPatch = '' 51 - sed -i \ 52 - -e "s#plymouthplugindir=.*#plymouthplugindir=/etc/plymouth/plugins/#" \ 53 - -e "s#plymouththemedir=.*#plymouththemedir=/etc/plymouth/themes#" \ 54 - -e "s#plymouthpolicydir=.*#plymouthpolicydir=/etc/plymouth/#" \ 55 - -e "s#plymouthconfdir=.*#plymouthconfdir=/etc/plymouth/#" \ 56 - configure.ac 57 - ''; 58 - 59 - configurePlatforms = [ "host" ]; 60 - 61 - configureFlags = [ 62 - "--enable-documentation" 63 - "--enable-drm" 64 - "--enable-gtk" 65 - "--enable-pango" 66 - "--enable-systemd-integration" 67 - "--enable-tracing" 68 "--localstatedir=/var" 69 - "--sysconfdir=/etc" 70 - "--with-background-color=0x000000" 71 - "--with-background-end-color-stop=0x000000" 72 - "--with-background-start-color-stop=0x000000" 73 - "--with-logo=/etc/plymouth/logo.png" 74 - "--with-release-file=/etc/os-release" 75 - "--with-runtimedir=/run" 76 - "--with-systemdunitdir=${placeholder "out"}/etc/systemd/system" 77 - "--without-rhgb-compat-link" 78 - "--without-system-root-install" 79 - "ac_cv_path_SYSTEMD_ASK_PASSWORD_AGENT=${lib.getBin systemd}/bin/systemd-tty-ask-password-agent" 80 ]; 81 82 - installFlags = [ 83 - "localstatedir=\${TMPDIR}" 84 - "plymouthd_confdir=${placeholder "out"}/etc/plymouth" 85 - "plymouthd_defaultsdir=${placeholder "out"}/share/plymouth" 86 - "sysconfdir=${placeholder "out"}/etc" 87 - ]; 88 89 postInstall = '' 90 - # Makes a symlink to /usr/share/pixmaps/system-logo-white.png 91 - # We'll handle it in the nixos module. 92 - rm $out/share/plymouth/themes/spinfinity/header-image.png 93 ''; 94 95 meta = with lib; { 96 homepage = "https://www.freedesktop.org/wiki/Software/Plymouth/"; 97 description = "Boot splash and boot logger"; ··· 99 maintainers = [ maintainers.goibhniu ] ++ teams.gnome.members; 100 platforms = platforms.linux; 101 }; 102 - }
··· 1 { lib 2 , stdenv 3 , fetchFromGitLab 4 + , writeText 5 + , meson 6 , pkg-config 7 + , ninja 8 , docbook-xsl-nons 9 , gettext 10 + , libxslt 11 , gtk3 12 + , libdrm 13 + , libevdev 14 + , libpng 15 + , libxkbcommon 16 , pango 17 + , systemd 18 + , xorg 19 }: 20 21 + stdenv.mkDerivation (finalAttrs: { 22 pname = "plymouth"; 23 + version = "unstable-2023-06-05"; 24 25 + outputs = [ "out" "dev" ]; 26 27 src = fetchFromGitLab { 28 domain = "gitlab.freedesktop.org"; 29 owner = "plymouth"; 30 repo = "plymouth"; 31 + rev = "a5eda165689864cc9a25ec14fd8c6da458598f42"; 32 + hash = "sha256-TpMZZ0naC4D0Knmclc8JpmXPfnpM6q8YotIkNX+aRVo="; 33 }; 34 35 + patches = [ 36 + # do not create unnecessary symlink to non-existent header-image.png 37 + ./dont-create-broken-symlink.patch 38 + # add support for loading plugins from /run to assist NixOS module 39 + ./add-runtime-plugin-path.patch 40 + ]; 41 + 42 + strictDeps = true; 43 + 44 nativeBuildInputs = [ 45 + meson 46 + pkg-config 47 + ninja 48 docbook-xsl-nons 49 gettext 50 libxslt 51 ]; 52 53 buildInputs = [ 54 gtk3 55 libdrm 56 + libevdev 57 + libpng 58 + libxkbcommon 59 pango 60 systemd 61 + xorg.xkeyboardconfig 62 ]; 63 64 + mesonFlags = let 65 + # https://gitlab.freedesktop.org/plymouth/plymouth/-/blob/a5eda165689864cc9a25ec14fd8c6da458598f42/meson.build#L47 66 + crossFile = writeText "cross-file.conf" '' 67 + [binaries] 68 + systemd-tty-ask-password-agent = '${lib.getBin systemd}/bin/systemd-tty-ask-password-agent' 69 + ''; 70 + in [ 71 + "--sysconfdir=/etc" 72 "--localstatedir=/var" 73 + "-Dlogo=/etc/plymouth/logo.png" 74 + "-Dbackground-color=0x000000" 75 + "-Dbackground-start-color-stop=0x000000" 76 + "-Dbackground-end-color-stop=0x000000" 77 + "-Drelease-file=/etc/os-release" 78 + "-Dudev=enabled" 79 + "-Drunstatedir=/run" 80 + "-Druntime-plugins=true" 81 + "--cross-file=${crossFile}" 82 ]; 83 84 + postPatch = '' 85 + substituteInPlace meson.build \ 86 + --replace "run_command(['scripts/generate-version.sh'], check: true).stdout().strip()" "'${finalAttrs.version}'" 87 + 88 + # prevent installing unused non-$out dirs to DESTDIR 89 + sed -i '/^install_emptydir/d' src/meson.build 90 + ''; 91 92 postInstall = '' 93 + # Move stuff from DESTDIR to proper location. 94 + cp -a "$DESTDIR/etc" "$out" 95 + rm -r "$DESTDIR/etc" 96 + for o in $(getAllOutputNames); do 97 + if [[ "$o" = "debug" ]]; then continue; fi 98 + cp -a "$DESTDIR/''${!o}" "$(dirname "''${!o}")" 99 + rm -r "$DESTDIR/''${!o}" 100 + done 101 + # Ensure the DESTDIR is removed. 102 + rmdir "$DESTDIR/${builtins.storeDir}" "$DESTDIR/${builtins.dirOf builtins.storeDir}" "$DESTDIR" 103 ''; 104 105 + # HACK: We want to install configuration files to $out/etc 106 + # but Plymouth should read them from /etc on a NixOS system. 107 + # With autotools, it was possible to override Make variables 108 + # at install time but Meson does not support this 109 + # so we need to convince it to install all files to a temporary 110 + # location using DESTDIR and then move it to proper one in postInstall. 111 + env.DESTDIR = "${placeholder "out"}/dest"; 112 + 113 meta = with lib; { 114 homepage = "https://www.freedesktop.org/wiki/Software/Plymouth/"; 115 description = "Boot splash and boot logger"; ··· 117 maintainers = [ maintainers.goibhniu ] ++ teams.gnome.members; 118 platforms = platforms.linux; 119 }; 120 + })
+13
pkgs/os-specific/linux/plymouth/dont-create-broken-symlink.patch
···
··· 1 + diff --git a/themes/spinfinity/meson.build b/themes/spinfinity/meson.build 2 + index f48e8e55..5a2050c8 100644 3 + --- a/themes/spinfinity/meson.build 4 + +++ b/themes/spinfinity/meson.build 5 + @@ -53,8 +53,3 @@ install_data( 6 + 'throbber-33.png', 7 + install_dir: plymouth_theme_path / 'spinfinity', 8 + ) 9 + - 10 + -install_symlink('header-image.png', 11 + - install_dir: plymouth_theme_path / 'spinfinity', 12 + - pointing_to: plymouth_logo_file, 13 + -)