From cf25c427f3030b16a5d8e249fcd12179200f8c32 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Fri, 21 Apr 2023 10:37:42 +0800 Subject: [PATCH] xfce.xfce4-dockbarx-plugin: 0.6 -> 0.7.2 https://github.com/xuzhen/xfce4-dockbarx-plugin/compare/v0.6...v0.7.2 --- .../xfce4-dockbarx-plugin/default.nix | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/pkgs/desktops/xfce/panel-plugins/xfce4-dockbarx-plugin/default.nix b/pkgs/desktops/xfce/panel-plugins/xfce4-dockbarx-plugin/default.nix index 97c564a40c63..2dad2d688eca 100644 --- a/pkgs/desktops/xfce/panel-plugins/xfce4-dockbarx-plugin/default.nix +++ b/pkgs/desktops/xfce/panel-plugins/xfce4-dockbarx-plugin/default.nix @@ -2,28 +2,25 @@ , stdenv , fetchFromGitHub , bash +, cmake , dockbarx , gobject-introspection , keybinder3 , pkg-config , python3Packages -, vala -, wafHook , wrapGAppsHook , xfce }: stdenv.mkDerivation rec { pname = "xfce4-dockbarx-plugin"; - version = "${ver}-${rev}"; - ver = "0.6"; - rev = "5213876151f1836f044e9902a22d1e682144c1e0"; + version = "0.7.2"; src = fetchFromGitHub { owner = "xuzhen"; repo = "xfce4-dockbarx-plugin"; - rev = rev; - sha256 = "sha256-VqtGcBRjvpCO9prVHOv6Gt1rAZtcAgkQkVCoR6ykC2k="; + rev = "v${version}"; + sha256 = "sha256-ZxaWORqA8LiM4CzakxClg5C6AsyHrzCGydgboCrC45g="; }; pythonPath = [ @@ -32,11 +29,10 @@ stdenv.mkDerivation rec { ]; nativeBuildInputs = [ + cmake gobject-introspection pkg-config python3Packages.wrapPython - vala - wafHook wrapGAppsHook ]; @@ -49,14 +45,20 @@ stdenv.mkDerivation rec { ++ pythonPath; postPatch = '' - substituteInPlace wscript --replace /usr/share/ "\''${PREFIX}/share/" - substituteInPlace src/dockbarx.vala --replace /usr/share/ $out/share/ - substituteInPlace src/dockbarx.vala --replace '/usr/bin/env python3' ${bash}/bin/bash + # We execute the wrapped xfce4-panel-plug directly. + # Since argv is used for g_free() we also need to shift the indexes. + substituteInPlace src/xfce_panel_plugin.c \ + --replace '"python3",' "" \ + --replace "g_free(argv[3]);" "g_free(argv[2]);" \ + --replace "g_free(argv[5]);" "g_free(argv[4]);" + + patchShebangs src/xfce4-dockbarx-plug.py ''; postFixup = '' makeWrapperArgs+=("''${gappsWrapperArgs[@]}") - wrapPythonProgramsIn "$out/share/xfce4/panel/plugins" "$out $pythonPath" + chmod +x $out/share/dockbarx/xfce4-panel-plug + wrapPythonProgramsIn "$out/share/dockbarx" "$out $pythonPath" ''; meta = with lib; {