From db41c787f4ad85a29b291c544a843c829f123131 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Tue, 24 Mar 2020 01:21:43 -0400 Subject: [PATCH 1/2] pantheon.wingpanel-with-indicators: fix wrapping Since #81475 this caused the wrapper to be empty of entries from wrapGAppsHook because the wrapGAppsHook function doesn't add them anymore, and was moved to gappsWrapperArgsHook. Instead of just running that in postBuild it's more future proof to make this use stdenv.mkDerivation because we want to mess around with the generic builder. --- .../pantheon/desktop/wingpanel/wrapper.nix | 35 +++++++++++++------ 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix b/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix index 596ee816f891..ca887d45dc39 100644 --- a/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix +++ b/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix @@ -1,7 +1,8 @@ { lib , wrapGAppsHook , glib -, symlinkJoin +, stdenv +, xorg , wingpanel , wingpanelIndicators , switchboard-with-plugs @@ -15,30 +16,44 @@ let if indicators == null then wingpanelIndicators else indicators ++ (lib.optionals useDefaultIndicators wingpanelIndicators); in -symlinkJoin { +stdenv.mkDerivation rec { name = "${wingpanel.name}-with-indicators"; + src = null; + paths = [ wingpanel ] ++ selectedIndicators; - buildInputs = [ + passAsFile = [ "paths" ]; + + nativeBuildInputs = [ glib wrapGAppsHook - ] ++ (lib.forEach selectedIndicators (x: x.buildInputs)) + ]; + + buildInputs = lib.forEach selectedIndicators (x: x.buildInputs) ++ selectedIndicators; - # We have to set SWITCHBOARD_PLUGS_PATH because wingpanel-applications-menu - # has a plugin to search switchboard settings - postBuild = '' - make_glib_find_gsettings_schemas + dontUnpack = true; + dontConfigure = true; + dontBuild = true; + preferLocalBuild = true; + allowSubstitutes = false; + + installPhase = '' + mkdir -p $out + for i in $(cat $pathsPath); do + ${xorg.lndir}/bin/lndir -silent $i $out + done + ''; + + preFixup = '' gappsWrapperArgs+=( --set WINGPANEL_INDICATORS_PATH "$out/lib/wingpanel" --set SWITCHBOARD_PLUGS_PATH "${switchboard-with-plugs}/lib/switchboard" ) - - wrapGAppsHook ''; inherit (wingpanel) meta; From a9e7e9331152c7528155038c634201a5e1c5fc67 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Tue, 24 Mar 2020 03:11:55 -0400 Subject: [PATCH 2/2] pantheon.switchboard-with-plugs: fix wrapping Since #81475 this caused the wrapper to be empty of entries from wrapGAppsHook because the wrapGAppsHook function doesn't add them anymore, and was moved to gappsWrapperArgsHook. Instead of just running that in postBuild it's more future proof to make this use stdenv.mkDerivation because we want to mess around with the generic builder. --- .../pantheon/apps/switchboard/wrapper.nix | 38 ++++++++++++++----- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix b/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix index cc6b37095fdb..67f4105ff3d1 100644 --- a/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix +++ b/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix @@ -1,7 +1,8 @@ { wrapGAppsHook , glib , lib -, symlinkJoin +, stdenv +, xorg , switchboard , switchboardPlugs , plugs @@ -14,26 +15,45 @@ let if plugs == null then switchboardPlugs else plugs ++ (lib.optionals useDefaultPlugs switchboardPlugs); in -symlinkJoin { +stdenv.mkDerivation rec { name = "${switchboard.name}-with-plugs"; + src = null; + paths = [ switchboard ] ++ selectedPlugs; - buildInputs = [ - wrapGAppsHook + passAsFile = [ "paths" ]; + + nativeBuildInputs = [ glib - ] ++ (lib.forEach selectedPlugs (x: x.buildInputs)) + wrapGAppsHook + ]; + + buildInputs = lib.forEach selectedPlugs (x: x.buildInputs) ++ selectedPlugs; - postBuild = '' - make_glib_find_gsettings_schemas + dontUnpack = true; + dontConfigure = true; + dontBuild = true; - gappsWrapperArgs+=(--set SWITCHBOARD_PLUGS_PATH "$out/lib/switchboard") + preferLocalBuild = true; + allowSubstitutes = false; - wrapGAppsHook + installPhase = '' + mkdir -p $out + for i in $(cat $pathsPath); do + ${xorg.lndir}/bin/lndir -silent $i $out + done + ''; + + preFixup = '' + gappsWrapperArgs+=( + --set SWITCHBOARD_PLUGS_PATH "$out/lib/switchboard" + ) ''; inherit (switchboard) meta; } +