kdeFrameworks: fixup inputs and outputs
- Reduce environment pollution with a separate $bin output containing programs, plugins, and shared data. Libraries remain in $out and are not installed into the environment. - Only propagate build inputs as required.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{
|
||||
mkDerivation, lib, copyPathsToStore,
|
||||
mkDerivation, lib, copyPathsToStore, writeScript,
|
||||
extra-cmake-modules, kdoctools,
|
||||
kconfig, kcrash, ki18n, kio, kparts, kservice, kwindowsystem, plasma-framework
|
||||
}:
|
||||
@@ -10,7 +10,7 @@ mkDerivation {
|
||||
name = "kinit";
|
||||
meta = { maintainers = [ lib.maintainers.ttuegel ]; };
|
||||
nativeBuildInputs = [ extra-cmake-modules kdoctools ];
|
||||
propagatedBuildInputs = [
|
||||
buildInputs = [
|
||||
kconfig kcrash ki18n kio kservice kwindowsystem
|
||||
];
|
||||
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
|
||||
@@ -19,4 +19,18 @@ mkDerivation {
|
||||
''-DNIXPKGS_KF5_PARTS="${getLib kparts}/lib/libKF5Parts.so.5"''
|
||||
''-DNIXPKGS_KF5_PLASMA="${getLib plasma-framework}/lib/libKF5Plasma.so.5"''
|
||||
];
|
||||
postFixup = ''
|
||||
moveToOutput "lib/libexec/kf5/start_kdeinit" "$bin"
|
||||
'';
|
||||
setupHook = writeScript "setup-hook.sh" ''
|
||||
kinitFixupOutputHook() {
|
||||
if [ $prefix != ''${!outputBin} ] && [ -d $prefix/lib ]; then
|
||||
mkdir -p ''${!outputBin}/lib
|
||||
find $prefix/lib -maxdepth 1 -name 'libkdeinit5_*.so' -exec ln -s \{\} ''${!outputBin}/lib \;
|
||||
rmdir --ignore-fail-on-non-empty ''${!outputBin}/lib
|
||||
fi
|
||||
}
|
||||
|
||||
fixupOutputHooks+=(kinitFixupOutputHook)
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user