Skip to content

Commit

Permalink
pantheon.switchboard-with-plugs: fix wrapping
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
worldofpeace committed Mar 24, 2020
1 parent db41c78 commit a9e7e93
Showing 1 changed file with 29 additions and 9 deletions.
38 changes: 29 additions & 9 deletions pkgs/desktops/pantheon/apps/switchboard/wrapper.nix
@@ -1,7 +1,8 @@
{ wrapGAppsHook
, glib
, lib
, symlinkJoin
, stdenv
, xorg
, switchboard
, switchboardPlugs
, plugs
Expand All @@ -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;
}

0 comments on commit a9e7e93

Please sign in to comment.