From 230eb916d394f64c16e184a2398e0050bde8e3e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Federico=20Dami=C3=A1n=20Schonborn?= Date: Sun, 28 Jan 2024 19:46:44 -0300 Subject: [PATCH] budgie.budgie-session: init at 0.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Federico Damián Schonborn --- .../budgie/budgie-session/default.nix | 101 ++++++++++++++++++ .../budgie/budgie-session/fix-paths.patch | 35 ++++++ pkgs/desktops/budgie/default.nix | 1 + 3 files changed, 137 insertions(+) create mode 100644 pkgs/desktops/budgie/budgie-session/default.nix create mode 100644 pkgs/desktops/budgie/budgie-session/fix-paths.patch diff --git a/pkgs/desktops/budgie/budgie-session/default.nix b/pkgs/desktops/budgie/budgie-session/default.nix new file mode 100644 index 000000000000..70b49080cb68 --- /dev/null +++ b/pkgs/desktops/budgie/budgie-session/default.nix @@ -0,0 +1,101 @@ +{ lib +, stdenv +, fetchFromGitHub +, substituteAll +, meson +, ninja +, pkg-config +, gnome +, glib +, gtk3 +, gsettings-desktop-schemas +, gnome-desktop +, dbus +, json-glib +, libICE +, xmlto +, docbook_xsl +, docbook_xml_dtd_412 +, python3 +, libxslt +, gettext +, makeWrapper +, systemd +, xorg +, libepoxy +, bash +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "budgie-session"; + version = "0.9.1"; + + src = fetchFromGitHub { + owner = "BuddiesOfBudgie"; + repo = "budgie-session"; + rev = "v${finalAttrs.version}"; + hash = "sha256-mz+Yh3NK2Tag+MWVofFFXYYXspxhmYBD6YCiuATpZSI="; + }; + + patches = [ + (substituteAll { + src = ./fix-paths.patch; + gsettings = "${glib.bin}/bin/gsettings"; + dbusLaunch = "${dbus.lib}/bin/dbus-launch"; + bash = "${bash}/bin/bash"; + }) + ]; + + nativeBuildInputs = [ + meson + ninja + pkg-config + gettext + makeWrapper + xmlto + libxslt + docbook_xsl + docbook_xml_dtd_412 + python3 + dbus # for DTD + ]; + + buildInputs = [ + glib + gtk3 + libICE + gnome-desktop + json-glib + xorg.xtrans + gnome.adwaita-icon-theme + gnome.gnome-settings-daemon + gsettings-desktop-schemas + systemd + libepoxy + ]; + + postPatch = '' + chmod +x meson_post_install.py # patchShebangs requires executable file + patchShebangs meson_post_install.py + ''; + + # `bin/budgie-session` will reset the environment when run in wayland, we + # therefor wrap `libexec/budgie-session-binary` instead which is the actual + # binary needing wrapping + preFixup = '' + wrapProgram "$out/libexec/budgie-session-binary" \ + --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH" \ + --suffix XDG_DATA_DIRS : "$out/share:$GSETTINGS_SCHEMAS_PATH" \ + --suffix XDG_CONFIG_DIRS : "${gnome.gnome-settings-daemon}/etc/xdg" + ''; + + separateDebugInfo = true; + + meta = { + description = "Session manager for Budgie"; + homepage = "https://github.com/BuddiesOfBudgie/budgie-session"; + license = lib.licenses.gpl2Plus; + maintainers = with lib.maintainers; [federicoschonborn]; + platforms = lib.platforms.linux; + }; +}) diff --git a/pkgs/desktops/budgie/budgie-session/fix-paths.patch b/pkgs/desktops/budgie/budgie-session/fix-paths.patch new file mode 100644 index 000000000000..1c011d26b549 --- /dev/null +++ b/pkgs/desktops/budgie/budgie-session/fix-paths.patch @@ -0,0 +1,35 @@ +diff --git a/gnome-session/budgie-session.in b/gnome-session/budgie-session.in +index 8a91e061..3e2ef031 100755 +--- a/gnome-session/budgie-session.in ++++ b/gnome-session/budgie-session.in +@@ -7,13 +7,15 @@ if [ "x$XDG_SESSION_TYPE" = "xwayland" ] && + ! (echo "$SHELL" | grep -q "false") && + ! (echo "$SHELL" | grep -q "nologin"); then + if [ "$1" != '-l' ]; then +- exec bash -c "exec -l '$SHELL' -c '$0 -l $*'" ++ # Make sure the shell actually sets up the environment. ++ unset __NIXOS_SET_ENVIRONMENT_DONE ++ exec @bash@ -c "exec -l '$SHELL' -c '$0 -l $*'" + else + shift + fi + fi + +-SETTING=$(G_MESSAGES_DEBUG='' gsettings get org.gnome.system.locale region) ++SETTING=$(G_MESSAGES_DEBUG='' @gsettings@ get org.gnome.system.locale region) + REGION=${SETTING#\'} + REGION=${REGION%\'} + +diff --git a/gnome-session/main.c b/gnome-session/main.c +index 327c7c7f..301ec7ee 100644 +--- a/gnome-session/main.c ++++ b/gnome-session/main.c +@@ -219,7 +219,7 @@ require_dbus_session (int argc, + } + new_argv[i + 2] = NULL; + +- if (!execvp ("dbus-launch", new_argv)) { ++ if (!execvp ("@dbusLaunch@", new_argv)) { + g_set_error (error, + G_SPAWN_ERROR, + G_SPAWN_ERROR_FAILED, diff --git a/pkgs/desktops/budgie/default.nix b/pkgs/desktops/budgie/default.nix index 73eca3942023..031ec9cd51a0 100644 --- a/pkgs/desktops/budgie/default.nix +++ b/pkgs/desktops/budgie/default.nix @@ -8,5 +8,6 @@ lib.makeScope pkgs.newScope (self: with self; { budgie-desktop-with-plugins = callPackage ./budgie-desktop/wrapper.nix { }; budgie-gsettings-overrides = callPackage ./budgie-gsettings-overrides { }; budgie-screensaver = callPackage ./budgie-screensaver { }; + budgie-session = callPackage ./budgie-session { }; magpie = callPackage ./magpie { }; })