diff --git a/pkgs/desktops/kde-5/applications/default.nix b/pkgs/desktops/kde-5/applications/default.nix index d3dc48b52823..5b2c3847adf7 100644 --- a/pkgs/desktops/kde-5/applications/default.nix +++ b/pkgs/desktops/kde-5/applications/default.nix @@ -21,7 +21,7 @@ let packages = self: with self; { kdeApp = import ./kde-app.nix { - inherit stdenv lib; + inherit kdeDerivation lib; inherit debug srcs; }; diff --git a/pkgs/desktops/kde-5/applications/kde-app.nix b/pkgs/desktops/kde-5/applications/kde-app.nix index 2f1fdc1d643c..c0a947a65dad 100644 --- a/pkgs/desktops/kde-5/applications/kde-app.nix +++ b/pkgs/desktops/kde-5/applications/kde-app.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, debug, srcs }: +{ kdeDerivation, lib, debug, srcs }: args: @@ -7,17 +7,10 @@ let sname = args.sname or name; inherit (srcs."${sname}") src version; in -stdenv.mkDerivation (args // { +kdeDerivation (args // { name = "${name}-${version}"; inherit src; - outputs = args.outputs or [ "dev" "out" ]; - - cmakeFlags = - (args.cmakeFlags or []) - ++ [ "-DBUILD_TESTING=OFF" ] - ++ lib.optional debug "-DCMAKE_BUILD_TYPE=Debug"; - meta = { platforms = lib.platforms.linux; homepage = "http://www.kde.org"; diff --git a/pkgs/desktops/kde-5/plasma/default.nix b/pkgs/desktops/kde-5/plasma/default.nix index f6bbd5c3f51e..2299e9fbc2aa 100644 --- a/pkgs/desktops/kde-5/plasma/default.nix +++ b/pkgs/desktops/kde-5/plasma/default.nix @@ -13,7 +13,7 @@ let - inherit (pkgs) lib stdenv symlinkJoin; + inherit (pkgs) lib makeSetupHook stdenv symlinkJoin; mirror = "mirror://kde"; srcs = import ./srcs.nix { inherit (pkgs) fetchurl; inherit mirror; }; @@ -24,17 +24,10 @@ let inherit (args) name; sname = args.sname or name; inherit (srcs."${sname}") src version; - in stdenv.mkDerivation (args // { + in kdeDerivation (args // { name = "${name}-${version}"; inherit src; - outputs = args.outputs or [ "dev" "out" ]; - - cmakeFlags = - (args.cmakeFlags or []) - ++ [ "-DBUILD_TESTING=OFF" ] - ++ lib.optional debug "-DCMAKE_BUILD_TYPE=Debug"; - meta = { license = with lib.licenses; [ lgpl21Plus lgpl3Plus bsd2 mit gpl2Plus gpl3Plus fdl12 diff --git a/pkgs/development/libraries/kde-frameworks/default.nix b/pkgs/development/libraries/kde-frameworks/default.nix index bff2b394038b..94e8f5db3b77 100644 --- a/pkgs/development/libraries/kde-frameworks/default.nix +++ b/pkgs/development/libraries/kde-frameworks/default.nix @@ -19,13 +19,14 @@ let srcs = import ./srcs.nix { inherit (pkgs) fetchurl; inherit mirror; }; packages = self: with self; { - kdeFramework = args: + + kdeDerivation = args: let - inherit (args) name; - inherit (srcs."${name}") src version; + setupHook = + let drv = { qtbase, qttools }: + makeSetupHook { deps = [ qtbase qttools ]; } ./setup-hook.sh; + in callPackage drv {}; in stdenv.mkDerivation (args // { - name = "${name}-${version}"; - inherit src; outputs = args.outputs or [ "dev" "out" ]; @@ -34,6 +35,20 @@ let ++ [ "-DBUILD_TESTING=OFF" ] ++ lib.optional debug "-DCMAKE_BUILD_TYPE=Debug"; + nativeBuildInputs = + (args.nativeBuildInputs or []) + ++ [ pkgs.cmake pkgs.pkgconfig setupHook ]; + + }); + + kdeFramework = args: + let + inherit (args) name; + inherit (srcs."${name}") src version; + in kdeDerivation (args // { + name = "${name}-${version}"; + inherit src; + meta = { license = with lib.licenses; [ lgpl21Plus lgpl3Plus bsd2 mit gpl2Plus gpl3Plus fdl12 @@ -47,7 +62,9 @@ let baloo = callPackage ./baloo.nix {}; bluez-qt = callPackage ./bluez-qt.nix {}; breeze-icons = callPackage ./breeze-icons.nix {}; - extra-cmake-modules = callPackage ./extra-cmake-modules {}; + extra-cmake-modules = callPackage ./extra-cmake-modules { + inherit (srcs.extra-cmake-modules) src version; + }; frameworkintegration = callPackage ./frameworkintegration.nix {}; kactivities = callPackage ./kactivities.nix {}; kactivities-stats = callPackage ./kactivities-stats.nix {}; diff --git a/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/default.nix b/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/default.nix index 1c2ea70442d3..d2f1688e330b 100644 --- a/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/default.nix +++ b/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/default.nix @@ -1,19 +1,19 @@ -{ kdeFramework, lib, copyPathsToStore, cmake, pkgconfig, qttools }: +{ stdenv, lib, copyPathsToStore, src, version, cmake }: -kdeFramework { - name = "extra-cmake-modules"; +stdenv.mkDerivation { + name = "extra-cmake-modules-${version}"; + + inherit src; patches = copyPathsToStore (lib.readPathsFromFile ./. ./series); outputs = [ "out" ]; # this package has no runtime components - setupHook = ./setup-hook.sh; - # It is OK to propagate these inputs as long as - # extra-cmake-modules is never a propagated input - # of some other derivation. - propagatedNativeBuildInputs = [ cmake pkgconfig qttools ]; + nativeBuildInputs = [ cmake ]; meta = with lib; { + platforms = lib.platforms.linux; + homepage = "http://www.kde.org"; license = licenses.bsd2; maintainers = [ maintainers.ttuegel ]; }; diff --git a/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh b/pkgs/development/libraries/kde-frameworks/setup-hook.sh similarity index 100% rename from pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh rename to pkgs/development/libraries/kde-frameworks/setup-hook.sh