2019-11-26 03:25:15 +00:00
|
|
|
{ wrapGAppsHook
|
|
|
|
, glib
|
|
|
|
, lib
|
2020-03-24 07:11:55 +00:00
|
|
|
, stdenv
|
|
|
|
, xorg
|
2019-08-05 19:02:06 +01:00
|
|
|
, switchboard
|
|
|
|
, switchboardPlugs
|
|
|
|
, plugs
|
2019-12-20 16:47:03 +00:00
|
|
|
# Only useful to disable for development testing.
|
|
|
|
, useDefaultPlugs ? true
|
2020-10-26 17:29:08 +00:00
|
|
|
, testName ? null
|
2019-08-05 19:02:06 +01:00
|
|
|
}:
|
2018-08-20 21:31:18 +01:00
|
|
|
|
|
|
|
let
|
2019-12-20 16:47:03 +00:00
|
|
|
selectedPlugs =
|
|
|
|
if plugs == null then switchboardPlugs
|
2019-12-23 04:09:41 +00:00
|
|
|
else plugs ++ (lib.optionals useDefaultPlugs switchboardPlugs);
|
2020-10-26 17:29:08 +00:00
|
|
|
|
|
|
|
testingName = lib.optionalString (testName != null) "${testName}-";
|
2018-08-20 21:31:18 +01:00
|
|
|
in
|
2020-03-24 07:11:55 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2022-03-01 10:39:32 +00:00
|
|
|
pname = "${testingName}${switchboard.pname}-with-plugs";
|
|
|
|
inherit (switchboard) version;
|
2018-08-20 21:31:18 +01:00
|
|
|
|
2020-03-24 07:11:55 +00:00
|
|
|
src = null;
|
|
|
|
|
2019-11-26 03:25:15 +00:00
|
|
|
paths = [
|
|
|
|
switchboard
|
|
|
|
] ++ selectedPlugs;
|
2018-08-20 21:31:18 +01:00
|
|
|
|
2020-03-24 07:11:55 +00:00
|
|
|
passAsFile = [ "paths" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2019-11-26 03:25:15 +00:00
|
|
|
glib
|
2020-03-24 07:11:55 +00:00
|
|
|
wrapGAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = lib.forEach selectedPlugs (x: x.buildInputs)
|
2019-11-26 03:25:15 +00:00
|
|
|
++ selectedPlugs;
|
2018-08-20 21:31:18 +01:00
|
|
|
|
2020-03-24 07:11:55 +00:00
|
|
|
dontUnpack = true;
|
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
2019-11-26 03:25:15 +00:00
|
|
|
|
2020-03-24 07:11:55 +00:00
|
|
|
preferLocalBuild = true;
|
|
|
|
allowSubstitutes = false;
|
2019-11-26 03:25:15 +00:00
|
|
|
|
2020-03-24 07:11:55 +00:00
|
|
|
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"
|
|
|
|
)
|
2018-08-20 21:31:18 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
inherit (switchboard) meta;
|
|
|
|
}
|
2020-03-24 07:11:55 +00:00
|
|
|
|