Merge pull request #100116 from worldofpeace/pantheon-stuff

Pantheon fixups
This commit is contained in:
WORLDofPEACE 2020-10-12 18:48:43 -04:00 committed by GitHub
commit 8cd159b861
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 43 additions and 24 deletions

View File

@ -62,24 +62,45 @@ let
'';
executable = writeScript "pantheon" ''
export XDG_CONFIG_DIRS=${elementary-settings-daemon}/etc/xdg:${elementary-default-settings}/etc:$XDG_CONFIG_DIRS
# gnome-session can find RequiredComponents for `pantheon` session (notably pantheon's patched g-s-d autostarts)
export XDG_CONFIG_DIRS=@out@/etc/xdg:$XDG_CONFIG_DIRS
# Make sure we use our gtk-3.0/settings.ini
export XDG_CONFIG_DIRS=${elementary-default-settings}/etc:$XDG_CONFIG_DIRS
# * gnome-session can find the `pantheon' session
# * use pantheon-mimeapps.list
export XDG_DATA_DIRS=@out@/share:$XDG_DATA_DIRS
exec ${gnome-session}/bin/gnome-session --session=pantheon "$@"
# Start pantheon session. Keep in sync with upstream
exec ${gnome-session}/bin/gnome-session --builtin --session=pantheon "$@"
'';
# Absolute path patched version of the upstream xsession
xsession = writeText "pantheon.desktop" ''
[Desktop Entry]
Name=Pantheon
Comment=This session provides elementary experience
Exec=@out@/libexec/pantheon
TryExec=${wingpanel}/bin/wingpanel
Icon=
DesktopNames=Pantheon
Type=Application
'';
in
stdenv.mkDerivation rec {
pname = "elementary-session-settings-unstable";
version = "2020-06-11";
version = "2020-07-06";
repoName = "session-settings";
src = fetchFromGitHub {
owner = "elementary";
repo = repoName;
rev = "130c9ae221913032ed18bcf6d21e3dcdba3c4209";
sha256 = "0bzg9vbq0ssnxgcb2vxpx6x9zv8ngkm9r3ki5q83m9al9919n0pr";
rev = "fa15cbd83fba0ba30e9a302db880350bff5ace52";
hash = "sha256-26H791c7OAjFYtjVChIatICSocMt0uTej1TKBOvw+6w=";
};
nativeBuildInputs = [
@ -104,20 +125,22 @@ stdenv.mkDerivation rec {
];
postInstall = ''
# our mimeapps patched from upstream to exclude:
# * pantheon-mail -> geary
# * evince.desktop -> org.gnome.Evince.desktop
mkdir -p $out/share/applications
cp -av ${./pantheon-mimeapps.list} $out/share/applications/pantheon-mimeapps.list
# instantiates pantheon's dockitems
cp "${dockitemAutostart}" $out/etc/xdg/autostart/default-elementary-dockitems.desktop
# script `Exec` to start pantheon
mkdir -p $out/libexec
substitute ${executable} $out/libexec/pantheon --subst-var out
chmod +x $out/libexec/pantheon
'';
postFixup = ''
substituteInPlace $out/share/xsessions/pantheon.desktop \
--replace "gnome-session --session=pantheon" "$out/libexec/pantheon" \
--replace "wingpanel" "${wingpanel}/bin/wingpanel"
# absolute path patched xsession
substitute ${xsession} $out/share/xsessions/pantheon.desktop --subst-var out
'';
passthru = {

View File

@ -17,7 +17,7 @@
, json-glib
, elementary-dock
, bamf
, switchboard
, switchboard-with-plugs
, libunity
, libsoup
, wingpanel
@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
pkgconfig
python3
vala
];
];
buildInputs = [
bamf
@ -66,10 +66,16 @@ stdenv.mkDerivation rec {
libhandy
libsoup
libunity
switchboard
switchboard-with-plugs
wingpanel
zeitgeist
];
] ++
# applications-menu has a plugin to search switchboard plugins
# see https://github.com/NixOS/nixpkgs/issues/100209
# wingpanel's wrapper will need to pick up the fact that
# applications-menu needs a version of switchboard with all
# its plugins for search.
switchboard-with-plugs.buildInputs;
mesonFlags = [
"--sysconfdir=${placeholder "out"}/etc"

View File

@ -131,16 +131,6 @@ stdenv.mkDerivation rec {
'';
postFixup = ''
for autostart in $(grep -rl "OnlyShowIn=GNOME;" $out/etc/xdg/autostart)
do
echo "Patching OnlyShowIn to Pantheon in: $autostart"
sed -i "s,OnlyShowIn=GNOME;,OnlyShowIn=Pantheon;," $autostart
done
# This breaks lightlocker https://github.com/elementary/session-settings/commit/b0e7a2867608c3a3916f9e4e21a68264a20e44f8
# TODO: shouldn't be neeed for the 5.1 greeter (awaiting release)
rm $out/etc/xdg/autostart/org.gnome.SettingsDaemon.ScreensaverProxy.desktop
# So the polkit policy can reference /run/current-system/sw/bin/elementary-settings-daemon/gsd-backlight-helper
mkdir -p $out/bin/elementary-settings-daemon
ln -s $out/libexec/gsd-backlight-helper $out/bin/elementary-settings-daemon/gsd-backlight-helper