From 50e3f6f6f97a4bc6ecf55cce5efcfcf09ebc0ecd Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 21 Jan 2024 19:11:12 +0800 Subject: [PATCH] sessiond: update and patch utilities --- ...son-Add-python-sessiond-installation.patch | 41 +++++++++++++++++++ pkgs/sessiond/default.nix | 28 ++++++++++--- 2 files changed, 63 insertions(+), 6 deletions(-) create mode 100644 pkgs/sessiond/0002-meson-Add-python-sessiond-installation.patch diff --git a/pkgs/sessiond/0002-meson-Add-python-sessiond-installation.patch b/pkgs/sessiond/0002-meson-Add-python-sessiond-installation.patch new file mode 100644 index 00000000..29ed8743 --- /dev/null +++ b/pkgs/sessiond/0002-meson-Add-python-sessiond-installation.patch @@ -0,0 +1,41 @@ +From 43e2977af8b89ff713b3043ee2d7f0c8ad11b50e Mon Sep 17 00:00:00 2001 +From: Gabriel Arazas +Date: Sun, 21 Jan 2024 17:04:11 +0800 +Subject: [PATCH 2/2] meson: Add python-sessiond installation + +--- + meson.build | 1 + + python-sessiond/meson.build | 12 ++++++++++++ + 2 files changed, 13 insertions(+) + create mode 100644 python-sessiond/meson.build + +diff --git a/meson.build b/meson.build +index 20dd185..36ac465 100644 +--- a/meson.build ++++ b/meson.build +@@ -131,3 +131,4 @@ foreach name, section : manpages + endforeach + + subdir('test') ++subdir('python-sessiond') +diff --git a/python-sessiond/meson.build b/python-sessiond/meson.build +new file mode 100644 +index 0000000..bbf071f +--- /dev/null ++++ b/python-sessiond/meson.build +@@ -0,0 +1,12 @@ ++python = import('python') ++ ++python_sessiond_srcs = [ ++ 'sessiond.py' ++] ++ ++py_installation = python.find_installation('python3', required: true) ++if not py_installation.found() ++ error('No python installation found') ++endif ++ ++py_installation.install_sources(python_sessiond_srcs) +-- +2.42.0 + diff --git a/pkgs/sessiond/default.nix b/pkgs/sessiond/default.nix index 4ce2af62..3ea44e04 100644 --- a/pkgs/sessiond/default.nix +++ b/pkgs/sessiond/default.nix @@ -1,21 +1,24 @@ -{ stdenv -, lib +{ lib , fetchFromGitHub , fetchpatch , meson , ninja , pkg-config +, coreutils , glib +, gobject-introspection , xorg , udev , wireplumber , pipewire , perl +, python3Packages }: -stdenv.mkDerivation rec { +python3Packages.buildPythonPackage rec { pname = "sessiond"; version = "0.6.1"; + format = "other"; src = fetchFromGitHub { owner = "jcrd"; @@ -26,28 +29,41 @@ stdenv.mkDerivation rec { patches = [ (fetchpatch { - url = "https://github.com/jcrd/sessiond/pull/8.patch"; + url = "https://github.com/jcrd/sessiond/commit/217ed63e2033c46c637e0564ef44ceaedff3e102.patch"; hash = "sha256-/GFPwJ4OBskavUJYhR5LGpt+HZABDOCpx6cVYDCYTNE="; }) + + ./0002-meson-Add-python-sessiond-installation.patch ]; nativeBuildInputs = [ meson ninja pkg-config + glib + gobject-introspection + perl ]; buildInputs = [ - glib udev xorg.libXi xorg.libX11 xorg.libXext wireplumber pipewire - perl ]; + propagatedBuildInputs = with python3Packages; [ + dbus-python + ]; + + postPatch = '' + substituteInPlace ./systemd/sessiond.service \ + --replace '/usr/bin/kill' '${lib.getExe' coreutils "kill"}' \ + --replace '/usr/bin' "${placeholder "out"}/bin" + ''; + meta = with lib; { homepage = "https://github.com/jcrd/sessiond"; description = "Standalone session manager for X11 window managers";