2022-03-31 15:25:54 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2018-05-06 18:57:45 +00:00
|
|
|
, autoreconfHook
|
|
|
|
, fetchurl
|
|
|
|
, gettext
|
|
|
|
, glib
|
2022-10-06 21:38:35 +00:00
|
|
|
, gnome-bluetooth
|
2018-05-06 18:57:45 +00:00
|
|
|
, gnome-desktop
|
2019-01-09 08:52:58 +00:00
|
|
|
, gnome-panel
|
2018-05-06 18:57:45 +00:00
|
|
|
, gnome-session
|
2021-05-07 21:18:14 +00:00
|
|
|
, gnome
|
2018-05-06 18:57:45 +00:00
|
|
|
, gsettings-desktop-schemas
|
2019-02-13 21:47:50 +00:00
|
|
|
, gtk3
|
2018-05-06 18:57:45 +00:00
|
|
|
, ibus
|
|
|
|
, libcanberra-gtk3
|
|
|
|
, libpulseaudio
|
|
|
|
, libxkbfile
|
|
|
|
, libxml2
|
2021-01-17 02:21:50 +00:00
|
|
|
, pkg-config
|
2018-05-06 18:57:45 +00:00
|
|
|
, polkit
|
2020-02-09 00:39:46 +00:00
|
|
|
, gdm
|
|
|
|
, systemd
|
2018-05-06 18:57:45 +00:00
|
|
|
, upower
|
2020-02-09 00:39:46 +00:00
|
|
|
, pam
|
2019-01-09 08:52:58 +00:00
|
|
|
, wrapGAppsHook
|
|
|
|
, writeTextFile
|
|
|
|
, xkeyboard_config
|
2021-04-17 06:58:29 +00:00
|
|
|
, xorg
|
2019-11-06 20:05:22 +00:00
|
|
|
, runCommand
|
2021-06-01 07:59:58 +00:00
|
|
|
, buildEnv
|
2019-01-09 08:52:58 +00:00
|
|
|
}:
|
2018-05-06 18:57:45 +00:00
|
|
|
let
|
|
|
|
pname = "gnome-flashback";
|
2023-09-23 15:36:27 +00:00
|
|
|
version = "3.50.0";
|
2020-02-09 00:39:46 +00:00
|
|
|
|
|
|
|
# From data/sessions/Makefile.am
|
2021-02-21 22:17:27 +00:00
|
|
|
requiredComponentsCommon = enableGnomePanel:
|
|
|
|
[ "gnome-flashback" ]
|
|
|
|
++ lib.optional enableGnomePanel "gnome-panel";
|
2020-02-09 00:39:46 +00:00
|
|
|
requiredComponentsGsd = [
|
|
|
|
"org.gnome.SettingsDaemon.A11ySettings"
|
|
|
|
"org.gnome.SettingsDaemon.Color"
|
|
|
|
"org.gnome.SettingsDaemon.Datetime"
|
|
|
|
"org.gnome.SettingsDaemon.Housekeeping"
|
|
|
|
"org.gnome.SettingsDaemon.Keyboard"
|
|
|
|
"org.gnome.SettingsDaemon.MediaKeys"
|
|
|
|
"org.gnome.SettingsDaemon.Power"
|
|
|
|
"org.gnome.SettingsDaemon.PrintNotifications"
|
|
|
|
"org.gnome.SettingsDaemon.Rfkill"
|
|
|
|
"org.gnome.SettingsDaemon.ScreensaverProxy"
|
|
|
|
"org.gnome.SettingsDaemon.Sharing"
|
|
|
|
"org.gnome.SettingsDaemon.Smartcard"
|
|
|
|
"org.gnome.SettingsDaemon.Sound"
|
|
|
|
"org.gnome.SettingsDaemon.UsbProtection"
|
|
|
|
"org.gnome.SettingsDaemon.Wacom"
|
|
|
|
"org.gnome.SettingsDaemon.XSettings"
|
|
|
|
];
|
2021-02-21 22:17:27 +00:00
|
|
|
requiredComponents = wmName: enableGnomePanel: "RequiredComponents=${lib.concatStringsSep ";" ([ wmName ] ++ requiredComponentsCommon enableGnomePanel ++ requiredComponentsGsd)};";
|
|
|
|
|
2019-01-09 08:52:58 +00:00
|
|
|
gnome-flashback = stdenv.mkDerivation rec {
|
|
|
|
name = "${pname}-${version}";
|
2018-05-06 18:57:45 +00:00
|
|
|
|
2019-01-09 08:52:58 +00:00
|
|
|
src = fetchurl {
|
2021-01-15 13:21:58 +00:00
|
|
|
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${name}.tar.xz";
|
2023-09-23 15:36:27 +00:00
|
|
|
sha256 = "sha256-0ExDSCICLJ+n5gh05cjNIGDI88BwPBnytAMr4lQnKv4=";
|
2019-01-09 08:52:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# make .desktop Execs absolute
|
|
|
|
postPatch = ''
|
|
|
|
patch -p0 <<END_PATCH
|
2019-09-02 16:44:48 +00:00
|
|
|
+++ data/applications/gnome-flashback.desktop.in.in
|
2019-01-09 08:52:58 +00:00
|
|
|
@@ -4 +4 @@
|
|
|
|
-Exec=gnome-flashback
|
|
|
|
+Exec=$out/bin/gnome-flashback
|
|
|
|
END_PATCH
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# Check that our expected RequiredComponents match the stock session files, but then don't install them.
|
|
|
|
# They can be installed using mkSessionForWm.
|
2021-02-21 22:17:27 +00:00
|
|
|
grep '${requiredComponents "metacity" true}' $out/share/gnome-session/sessions/gnome-flashback-metacity.session || (echo "RequiredComponents have changed, please update gnome-flashback/default.nix."; false)
|
2019-01-09 08:52:58 +00:00
|
|
|
|
|
|
|
rm -r $out/share/gnome-session
|
|
|
|
rm -r $out/share/xsessions
|
2023-05-25 00:16:10 +00:00
|
|
|
rm $out/libexec/gnome-flashback-metacity
|
2019-01-09 08:52:58 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
|
|
|
gettext
|
|
|
|
libxml2
|
2021-01-17 02:21:50 +00:00
|
|
|
pkg-config
|
2019-01-09 08:52:58 +00:00
|
|
|
wrapGAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
glib
|
2022-10-06 21:38:35 +00:00
|
|
|
gnome-bluetooth
|
2019-01-09 08:52:58 +00:00
|
|
|
gnome-desktop
|
|
|
|
gsettings-desktop-schemas
|
2019-02-13 21:47:50 +00:00
|
|
|
gtk3
|
2019-01-09 08:52:58 +00:00
|
|
|
ibus
|
|
|
|
libcanberra-gtk3
|
|
|
|
libpulseaudio
|
|
|
|
libxkbfile
|
2021-04-17 06:58:29 +00:00
|
|
|
xorg.libXxf86vm
|
2019-01-09 08:52:58 +00:00
|
|
|
polkit
|
2020-02-09 00:39:46 +00:00
|
|
|
gdm
|
|
|
|
gnome-panel
|
|
|
|
systemd
|
2019-01-09 08:52:58 +00:00
|
|
|
upower
|
2020-02-09 00:39:46 +00:00
|
|
|
pam
|
2019-01-09 08:52:58 +00:00
|
|
|
xkeyboard_config
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = true;
|
2018-05-06 18:57:45 +00:00
|
|
|
|
2019-01-09 08:52:58 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2020-02-09 00:39:46 +00:00
|
|
|
PKG_CONFIG_LIBGNOME_PANEL_LAYOUTSDIR = "${placeholder "out"}/share/gnome-panel/layouts";
|
|
|
|
PKG_CONFIG_LIBGNOME_PANEL_MODULESDIR = "${placeholder "out"}/lib/gnome-panel/modules";
|
|
|
|
|
2019-01-09 08:52:58 +00:00
|
|
|
passthru = {
|
2021-05-07 21:18:14 +00:00
|
|
|
updateScript = gnome.updateScript {
|
2019-01-09 08:52:58 +00:00
|
|
|
packageName = pname;
|
2021-05-07 21:18:14 +00:00
|
|
|
attrPath = "gnome.${pname}";
|
2021-03-20 23:57:24 +00:00
|
|
|
versionPolicy = "odd-unstable";
|
2019-01-09 08:52:58 +00:00
|
|
|
};
|
|
|
|
|
2023-10-06 09:56:38 +00:00
|
|
|
mkWmApplication = { wmName, wmLabel, wmCommand }:
|
|
|
|
writeTextFile {
|
|
|
|
name = "gnome-flashback-${wmName}-wm";
|
|
|
|
destination = "/share/applications/${wmName}.desktop";
|
|
|
|
text = ''
|
|
|
|
[Desktop Entry]
|
|
|
|
Type=Application
|
|
|
|
Encoding=UTF-8
|
|
|
|
Name=${wmLabel}
|
|
|
|
Exec=${wmCommand}
|
|
|
|
NoDisplay=true
|
|
|
|
X-GNOME-WMName=${wmLabel}
|
|
|
|
X-GNOME-Autostart-Phase=WindowManager
|
|
|
|
X-GNOME-Provides=windowmanager
|
|
|
|
X-GNOME-Autostart-Notify=false
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-10-06 10:07:17 +00:00
|
|
|
mkGnomeSession = { wmName, wmLabel, enableGnomePanel }:
|
|
|
|
writeTextFile {
|
|
|
|
name = "gnome-flashback-${wmName}-gnome-session";
|
|
|
|
destination = "/share/gnome-session/sessions/gnome-flashback-${wmName}.session";
|
|
|
|
text = ''
|
|
|
|
[GNOME Session]
|
|
|
|
Name=GNOME Flashback (${wmLabel})
|
|
|
|
${requiredComponents wmName enableGnomePanel}
|
|
|
|
'';
|
|
|
|
};
|
2019-01-09 08:52:58 +00:00
|
|
|
|
2023-10-06 10:07:17 +00:00
|
|
|
mkSessionForWm = { wmName, wmLabel, wmCommand }:
|
2020-08-25 07:33:38 +00:00
|
|
|
writeTextFile
|
|
|
|
{
|
|
|
|
name = "gnome-flashback-${wmName}-xsession";
|
|
|
|
destination = "/share/xsessions/gnome-flashback-${wmName}.desktop";
|
|
|
|
text = ''
|
|
|
|
[Desktop Entry]
|
|
|
|
Name=GNOME Flashback (${wmLabel})
|
|
|
|
Comment=This session logs you into GNOME Flashback with ${wmLabel}
|
2023-10-06 10:34:48 +00:00
|
|
|
Exec=${gnome-session}/bin/gnome-session --session=gnome-flashback-${wmName}
|
2020-08-25 07:33:38 +00:00
|
|
|
TryExec=${wmCommand}
|
|
|
|
Type=Application
|
|
|
|
DesktopNames=GNOME-Flashback;GNOME;
|
|
|
|
'';
|
|
|
|
} // {
|
|
|
|
providedSessions = [ "gnome-flashback-${wmName}" ];
|
|
|
|
};
|
2019-11-06 20:05:22 +00:00
|
|
|
|
2021-02-21 22:17:27 +00:00
|
|
|
mkSystemdTargetForWm = { wmName, wmLabel, wmCommand, enableGnomePanel }:
|
2023-10-06 08:40:53 +00:00
|
|
|
runCommand "gnome-flashback-${wmName}.target" { } ''
|
2019-11-06 20:05:22 +00:00
|
|
|
mkdir -p $out/lib/systemd/user
|
2021-02-21 22:17:27 +00:00
|
|
|
cp -r "${gnome-flashback}/lib/systemd/user/gnome-session@gnome-flashback-metacity.target.d" \
|
|
|
|
"$out/lib/systemd/user/gnome-session@gnome-flashback-${wmName}.target.d"
|
2019-11-06 20:05:22 +00:00
|
|
|
'';
|
2018-05-06 18:57:45 +00:00
|
|
|
};
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-01-09 08:52:58 +00:00
|
|
|
description = "GNOME 2.x-like session for GNOME 3";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://wiki.gnome.org/Projects/GnomeFlashback";
|
2019-01-09 08:52:58 +00:00
|
|
|
license = licenses.gpl2;
|
2020-04-01 12:40:51 +00:00
|
|
|
maintainers = teams.gnome.members;
|
2019-01-09 08:52:58 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
2018-05-06 18:57:45 +00:00
|
|
|
};
|
2020-08-25 07:33:38 +00:00
|
|
|
in
|
|
|
|
gnome-flashback
|