2011-08-15 20:06:26 +02:00
|
|
|
{ callPackage, runCommand, stdenv, fetchurl, qt47, cmake, automoc4 }:
|
2011-07-07 22:48:51 +02:00
|
|
|
|
|
|
|
let
|
2011-07-28 14:52:15 +02:00
|
|
|
release = "4.7.0";
|
2011-07-07 22:48:51 +02:00
|
|
|
|
2011-08-15 20:06:26 +02:00
|
|
|
manifest = import (./kde-package + "/${release}.nix");
|
2011-07-11 17:33:41 +02:00
|
|
|
|
2011-08-15 20:06:26 +02:00
|
|
|
kdesrc = name: fetchurl {
|
|
|
|
url = "mirror://kde/" + (if manifest.stable then "" else "un")
|
|
|
|
+ "stable/${release}/src/${name}-${release}.tar.bz2";
|
|
|
|
sha256 = builtins.getAttr name manifest.hashes;
|
|
|
|
};
|
2011-07-17 16:24:43 +02:00
|
|
|
|
2011-08-15 20:06:26 +02:00
|
|
|
mergeMeta = meta:
|
|
|
|
{
|
|
|
|
homepage = http://www.kde.org;
|
|
|
|
inherit (qt47.meta) platforms maintainers;
|
|
|
|
} // meta;
|
|
|
|
|
|
|
|
kdeMonoPkg = name: a@{meta, ...}:
|
|
|
|
stdenv.mkDerivation ({
|
|
|
|
name = "${name}-${release}";
|
|
|
|
src = kdesrc name;
|
|
|
|
meta = mergeMeta meta;
|
|
|
|
} // (builtins.removeAttrs a [ "meta" ]));
|
|
|
|
kdeMonolithic = name: path: callPackage path { kde = kdeMonoPkg name; };
|
|
|
|
|
|
|
|
kdeSubdirPkg = module:
|
|
|
|
{name, subdir ? name, sane ? name}:
|
|
|
|
let name_ = name; in
|
|
|
|
a@{cmakeFlags ? [], name ? name_, ...}:
|
|
|
|
stdenv.mkDerivation ({
|
|
|
|
name = "${name}-${release}";
|
|
|
|
src = kdesrc module;
|
|
|
|
cmakeFlags = ["-DDISABLE_ALL_OPTIONAL_SUBDIRECTORIES=TRUE"
|
|
|
|
"-DBUILD_doc=TRUE" "-DBUILD_${subdir}=TRUE"] ++ cmakeFlags;
|
|
|
|
} // (removeAttrs a [ "name" "cmakeFlags" ]));
|
|
|
|
|
|
|
|
kdeSplittedPkg = module: {name, sane ? name}: kdeMonoPkg name;
|
|
|
|
|
|
|
|
combinePkgs = pkgFun: module: pkgs:
|
|
|
|
let
|
|
|
|
f = p@{name, ...}:
|
|
|
|
callPackage (./. + "/${module}/${name}.nix") { kde = pkgFun module p; };
|
|
|
|
list = map f pkgs;
|
|
|
|
attrs = builtins.listToAttrs (map
|
|
|
|
({name, sane ? name, ...}@p: { name = sane; value = f p; })
|
|
|
|
pkgs);
|
|
|
|
in
|
|
|
|
runCommand "${module}-${release}"
|
2011-08-15 21:28:12 +02:00
|
|
|
({passthru = attrs // {
|
|
|
|
propagatedUserEnvPackages = list;
|
|
|
|
recurseForDerivations = true;
|
|
|
|
projects = attrs;
|
|
|
|
};})
|
2011-08-15 20:06:26 +02:00
|
|
|
''
|
|
|
|
mkdir -pv $out/nix-support
|
|
|
|
echo "${toString list}" | tee $out/nix-support/propagated-user-env-packages
|
|
|
|
'';
|
|
|
|
|
|
|
|
kdeModule = { module, sane ? module, split, pkgs ? [] }:
|
|
|
|
let pkgs_ = filterPkgs module pkgs; in
|
|
|
|
{
|
|
|
|
name = sane;
|
|
|
|
value =
|
|
|
|
# Module is splitted by upstream
|
|
|
|
if split then combinePkgs kdeSplittedPkg module pkgs_
|
|
|
|
# Monolithic module
|
|
|
|
else if pkgs == [] then kdeMonolithic module (./. + "/${module}.nix")
|
|
|
|
# Module is splitted by us
|
|
|
|
else combinePkgs kdeSubdirPkg module pkgs_;
|
|
|
|
};
|
2011-07-22 03:28:09 +02:00
|
|
|
|
2011-08-15 20:06:26 +02:00
|
|
|
kdepkgs = builtins.listToAttrs (map kdeModule manifest.modules);
|
2011-07-29 19:24:59 +02:00
|
|
|
|
2011-08-15 20:06:26 +02:00
|
|
|
filterPkgs = module: (p:
|
|
|
|
removeNames (stdenv.lib.attrByPath [module] [] ignoreList) p
|
|
|
|
++ (stdenv.lib.attrByPath [module] [] extraSubpkgs));
|
2011-07-07 22:48:51 +02:00
|
|
|
|
2011-08-15 20:06:26 +02:00
|
|
|
# List difference, big - subst; optimised for empty subst
|
|
|
|
removeNames = subst: big: stdenv.lib.fold (s: out: stdenv.lib.filter (x: x.name != s) out) big subst;
|
2011-08-07 02:38:11 +02:00
|
|
|
|
2011-08-15 20:06:26 +02:00
|
|
|
ignoreList = {
|
|
|
|
kdeadmin = [ "strigi-analyzer" ];
|
|
|
|
kdesdk = [ "kioslave" ];
|
|
|
|
kdebindings = [ "kimono" "korundum" "kross-interpreters" "perlkde" "perlqt"
|
|
|
|
"qtruby" "qyoto" "smokekde" ];
|
2011-08-07 02:37:14 +02:00
|
|
|
};
|
|
|
|
|
2011-08-15 20:06:26 +02:00
|
|
|
extraSubpkgs = {
|
|
|
|
kdesdk =
|
|
|
|
[
|
|
|
|
{
|
|
|
|
name = "kioslave-svn";
|
|
|
|
sane = "kioslave_svn";
|
|
|
|
subdir = "kioslave";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "kioslave-perldoc";
|
|
|
|
sane = "kioslave_perldoc";
|
|
|
|
subdir = "kioslave";
|
|
|
|
}
|
|
|
|
];
|
2011-07-07 22:48:51 +02:00
|
|
|
};
|
2011-07-29 14:41:31 +02:00
|
|
|
|
2011-08-15 20:06:26 +02:00
|
|
|
in
|
|
|
|
kdepkgs // kdepkgs.kdebase //
|
|
|
|
{
|
|
|
|
recurseForRelease = true;
|
|
|
|
akonadi = callPackage ./support/akonadi { };
|
|
|
|
soprano = callPackage ./support/soprano { };
|
2011-07-07 22:48:51 +02:00
|
|
|
|
2011-08-15 20:06:26 +02:00
|
|
|
qt4 = qt47;
|
2011-07-07 22:48:51 +02:00
|
|
|
|
2011-08-15 20:06:26 +02:00
|
|
|
kdebase_workspace = kdepkgs.kdebase.kde_workspace;
|
2011-07-07 22:48:51 +02:00
|
|
|
|
2011-08-15 20:06:26 +02:00
|
|
|
# Propagate some libraries to the top-level
|
|
|
|
inherit (kdepkgs.kdegraphics) libkdcraw libkipi libkexiv2 libksane;
|
|
|
|
inherit (kdepkgs.kdebindings) pykde4;
|
|
|
|
inherit (kdepkgs.kdeedu) libkdeedu;
|
2011-07-07 22:48:51 +02:00
|
|
|
|
2011-08-15 20:06:26 +02:00
|
|
|
inherit release;
|
2011-07-07 22:48:51 +02:00
|
|
|
|
2011-08-15 21:28:12 +02:00
|
|
|
# nix-instantiate /etc/nixos/nixpkgs -A kde47.moduleNames --strict to see
|
|
|
|
# available packages
|
|
|
|
moduleNames = stdenv.lib.mapAttrs
|
|
|
|
(n: v: if v ? projects then builtins.attrNames v.projects else null) kdepkgs;
|
|
|
|
|
2011-08-15 20:06:26 +02:00
|
|
|
full = stdenv.lib.attrValues kdepkgs;
|
2011-07-07 22:48:51 +02:00
|
|
|
|
|
|
|
l10n = callPackage ./l10n { inherit release; };
|
|
|
|
}
|