kdeWrapper: allow wrapping several packages
This commit is contained in:
parent
5ba7f33e3a
commit
e908442693
@ -60,8 +60,9 @@ let
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
kdeWrapper unwrapped
|
kdeWrapper
|
||||||
{
|
{
|
||||||
|
inherit unwrapped;
|
||||||
targets = [ "bin/kile" ];
|
targets = [ "bin/kile" ];
|
||||||
paths = [ konsole.unwrapped ];
|
paths = [ konsole.unwrapped ];
|
||||||
}
|
}
|
||||||
|
@ -55,9 +55,9 @@ let
|
|||||||
|
|
||||||
|
|
||||||
in
|
in
|
||||||
kdeWrapper unwrapped
|
kdeWrapper
|
||||||
{
|
{
|
||||||
|
inherit unwrapped;
|
||||||
targets = [ "bin/yakuake" ];
|
targets = [ "bin/yakuake" ];
|
||||||
paths = [ konsole.unwrapped ];
|
paths = [ konsole.unwrapped ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,7 +75,8 @@ let
|
|||||||
homepage = https://konversation.kde.org;
|
homepage = https://konversation.kde.org;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in kdeWrapper unwrapped {
|
in kdeWrapper {
|
||||||
|
inherit unwrapped;
|
||||||
targets = [ "bin/konversation" ];
|
targets = [ "bin/konversation" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,8 @@ let
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
kdeWrapper unwrapped
|
kdeWrapper
|
||||||
{
|
{
|
||||||
|
inherit unwrapped;
|
||||||
targets = [ "bin/ark" ];
|
targets = [ "bin/ark" ];
|
||||||
}
|
}
|
||||||
|
@ -24,8 +24,9 @@ let
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
kdeWrapper unwrapped
|
kdeWrapper
|
||||||
{
|
{
|
||||||
|
inherit unwrapped;
|
||||||
targets = [ "bin/dolphin" ];
|
targets = [ "bin/dolphin" ];
|
||||||
paths = [ dolphin-plugins konsole.unwrapped ];
|
paths = [ dolphin-plugins konsole.unwrapped ];
|
||||||
}
|
}
|
||||||
|
@ -18,4 +18,7 @@ let
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
kdeWrapper unwrapped { targets = [ "bin/filelight" ]; }
|
kdeWrapper {
|
||||||
|
inherit unwrapped;
|
||||||
|
targets = [ "bin/filelight" ];
|
||||||
|
}
|
||||||
|
@ -20,7 +20,8 @@ let
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
kdeWrapper unwrapped {
|
kdeWrapper {
|
||||||
|
inherit unwrapped;
|
||||||
targets = [ "bin/gwenview" ];
|
targets = [ "bin/gwenview" ];
|
||||||
paths = [ kipi-plugins ];
|
paths = [ kipi-plugins ];
|
||||||
}
|
}
|
||||||
|
@ -24,8 +24,9 @@ let
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
kdeWrapper unwrapped
|
kdeWrapper
|
||||||
{
|
{
|
||||||
|
inherit unwrapped;
|
||||||
targets = [ "bin/kate" "bin/kwrite" ];
|
targets = [ "bin/kate" "bin/kwrite" ];
|
||||||
paths = [ konsole.unwrapped ];
|
paths = [ konsole.unwrapped ];
|
||||||
}
|
}
|
||||||
|
@ -18,4 +18,7 @@ let
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
kdeWrapper unwrapped { targets = [ "bin/kcalc" ]; }
|
kdeWrapper {
|
||||||
|
inherit unwrapped;
|
||||||
|
targets = [ "bin/kcalc" ];
|
||||||
|
}
|
||||||
|
@ -15,4 +15,7 @@ let
|
|||||||
propagatedBuildInputs = [ ki18n kwidgetsaddons kxmlgui ];
|
propagatedBuildInputs = [ ki18n kwidgetsaddons kxmlgui ];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
kdeWrapper unwrapped { targets = [ "bin/kcolorchooser" ]; }
|
kdeWrapper {
|
||||||
|
inherit unwrapped;
|
||||||
|
targets = [ "bin/kcolorchooser" ];
|
||||||
|
}
|
||||||
|
@ -74,8 +74,9 @@ unwrapped = kdeApp {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
kdeWrapper unwrapped
|
kdeWrapper
|
||||||
{
|
{
|
||||||
|
inherit unwrapped;
|
||||||
targets = [ "bin/kdenlive" ];
|
targets = [ "bin/kdenlive" ];
|
||||||
paths = [ kinit ];
|
paths = [ kinit ];
|
||||||
}
|
}
|
||||||
|
@ -18,4 +18,7 @@ let
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
kdeWrapper unwrapped { targets = [ "bin/kdf" ]; }
|
kdeWrapper {
|
||||||
|
inherit unwrapped;
|
||||||
|
targets = [ "bin/kdf" ];
|
||||||
|
}
|
||||||
|
@ -16,4 +16,7 @@ let
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
kdeWrapper unwrapped { targets = [ "bin/khelpcenter" ]; }
|
kdeWrapper {
|
||||||
|
inherit unwrapped;
|
||||||
|
targets = [ "bin/khelpcenter" ];
|
||||||
|
}
|
||||||
|
@ -15,4 +15,7 @@ let
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
kdeWrapper unwrapped { targets = [ "bin/kompare" ]; }
|
kdeWrapper {
|
||||||
|
inherit unwrapped;
|
||||||
|
targets = [ "bin/kompare" ];
|
||||||
|
}
|
||||||
|
@ -24,4 +24,7 @@ let
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
kdeWrapper unwrapped { targets = [ "bin/konsole" ]; }
|
kdeWrapper {
|
||||||
|
inherit unwrapped;
|
||||||
|
targets = [ "bin/konsole" ];
|
||||||
|
}
|
||||||
|
@ -30,6 +30,7 @@ let
|
|||||||
kxmlgui
|
kxmlgui
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
in kdeWrapper unwrapped {
|
in kdeWrapper {
|
||||||
|
inherit unwrapped;
|
||||||
targets = ["bin/kwalletmanager5"];
|
targets = ["bin/kwalletmanager5"];
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,8 @@ let
|
|||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
kdeWrapper unwrapped {
|
kdeWrapper {
|
||||||
|
inherit unwrapped;
|
||||||
targets = [ "bin/marble-qt" ];
|
targets = [ "bin/marble-qt" ];
|
||||||
paths = [ unwrapped ];
|
paths = [ unwrapped ];
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ let
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
kdeWrapper unwrapped {
|
kdeWrapper {
|
||||||
|
inherit unwrapped;
|
||||||
targets = [ "bin/okular" ];
|
targets = [ "bin/okular" ];
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,8 @@ let
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
kdeWrapper unwrapped {
|
kdeWrapper {
|
||||||
|
inherit unwrapped;
|
||||||
targets = [ "bin/spectacle" ];
|
targets = [ "bin/spectacle" ];
|
||||||
paths = [ kipi-plugins ];
|
paths = [ kipi-plugins ];
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ let
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
kdeWrapper unwrapped {
|
kdeWrapper {
|
||||||
|
inherit unwrapped;
|
||||||
targets = [ "bin/oxygen-demo5" "bin/oxygen-settings5" ];
|
targets = [ "bin/oxygen-demo5" "bin/oxygen-settings5" ];
|
||||||
}
|
}
|
||||||
|
@ -1,53 +1,73 @@
|
|||||||
{ stdenv, lib, makeWrapper, buildEnv }:
|
{ stdenv, lib, makeWrapper, buildEnv }:
|
||||||
|
|
||||||
drv:
|
packages:
|
||||||
|
|
||||||
{ targets, paths ? [] }:
|
|
||||||
|
|
||||||
let
|
let
|
||||||
|
packages_ = if builtins.isList packages then packages else [packages];
|
||||||
|
|
||||||
|
unwrapped = lib.concatMap (p: if builtins.isList p.unwrapped then p.unwrapped else [p.unwrapped]) packages_;
|
||||||
|
targets = lib.concatMap (p: p.targets) packages_;
|
||||||
|
paths = lib.concatMap (p: p.paths or []) packages_;
|
||||||
|
|
||||||
|
name =
|
||||||
|
if builtins.length unwrapped == 1
|
||||||
|
then (lib.head unwrapped).name
|
||||||
|
else "kde-application";
|
||||||
|
meta =
|
||||||
|
if builtins.length unwrapped == 1
|
||||||
|
then (lib.head unwrapped).meta
|
||||||
|
else {};
|
||||||
|
|
||||||
env = buildEnv {
|
env = buildEnv {
|
||||||
inherit (drv) name meta;
|
inherit name meta;
|
||||||
paths = builtins.map lib.getBin ([drv] ++ paths);
|
paths = builtins.map lib.getBin (unwrapped ++ paths);
|
||||||
pathsToLink = [ "/bin" "/share" "/lib/qt5" "/etc/xdg" ];
|
pathsToLink = [ "/bin" "/share" "/lib/qt5" "/etc/xdg" ];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
inherit (drv) name meta;
|
inherit name meta;
|
||||||
preferLocalBuild = true;
|
preferLocalBuild = true;
|
||||||
|
|
||||||
paths = builtins.map lib.getBin ([drv] ++ paths);
|
inherit unwrapped env targets;
|
||||||
inherit drv env targets;
|
|
||||||
passthru = { unwrapped = drv; };
|
passthru = {
|
||||||
|
inherit targets paths;
|
||||||
|
unwrapped = if builtins.length unwrapped == 1 then lib.head unwrapped else unwrapped;
|
||||||
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ makeWrapper ];
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
|
|
||||||
builder = builtins.toFile "builder.sh" ''
|
buildCommand = ''
|
||||||
. $stdenv/setup
|
|
||||||
|
|
||||||
for t in $targets; do
|
for t in $targets; do
|
||||||
if [ -a "$drv/$t" ]; then
|
good=""
|
||||||
makeWrapper "$drv/$t" "$out/$t" \
|
for drv in $unwrapped; do
|
||||||
--argv0 '"$0"' \
|
if [ -a "$drv/$t" ]; then
|
||||||
--suffix PATH : "$env/bin" \
|
makeWrapper "$drv/$t" "$out/$t" \
|
||||||
--prefix XDG_CONFIG_DIRS : "$env/share" \
|
--argv0 '"$0"' \
|
||||||
--prefix XDG_DATA_DIRS : "$env/etc/xdg" \
|
--suffix PATH : "$env/bin" \
|
||||||
--set QML_IMPORT_PATH "$env/lib/qt5/imports" \
|
--prefix XDG_CONFIG_DIRS : "$env/share" \
|
||||||
--set QML2_IMPORT_PATH "$env/lib/qt5/qml" \
|
--prefix XDG_DATA_DIRS : "$env/etc/xdg" \
|
||||||
--set QT_PLUGIN_PATH "$env/lib/qt5/plugins"
|
--set QML_IMPORT_PATH "$env/lib/qt5/imports" \
|
||||||
else
|
--set QML2_IMPORT_PATH "$env/lib/qt5/qml" \
|
||||||
echo "no such file or directory: $drv/$t"
|
--set QT_PLUGIN_PATH "$env/lib/qt5/plugins"
|
||||||
|
good="1"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ -z "$good" ]; then
|
||||||
|
echo "file or directory not found in derivations: $t"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -a "$drv/share" ]; then
|
ln -s "$env/share" "$out"
|
||||||
ln -s "$drv/share" "$out"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -a "$drv/nix-support/propagated-user-env-packages" ]; then
|
for drv in $unwrapped; do
|
||||||
mkdir -p "$out/nix-support"
|
if [ -a "$drv/nix-support/propagated-user-env-packages" ]; then
|
||||||
ln -s "$drv/nix-support/propagated-user-env-packages" "$out/nix-support/"
|
mkdir -p "$out/nix-support"
|
||||||
fi
|
cat "$drv/nix-support/propagated-user-env-packages" >> "$out/nix-support/propagated-user-env-packages"
|
||||||
|
fi
|
||||||
|
done
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@ let
|
|||||||
propagatedBuildInputs = [ kconfig kinit ];
|
propagatedBuildInputs = [ kconfig kinit ];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
kdeWrapper unwrapped {
|
kdeWrapper {
|
||||||
|
inherit unwrapped;
|
||||||
targets = [ "bin/kronometer" ];
|
targets = [ "bin/kronometer" ];
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ let
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
in kdeWrapper unwrapped {
|
in kdeWrapper {
|
||||||
|
inherit unwrapped;
|
||||||
targets = [ "bin/peruse" ];
|
targets = [ "bin/peruse" ];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user