2011-08-15 19:06:26 +01:00
|
|
|
{ callPackage, runCommand, stdenv, fetchurl, qt47, cmake, automoc4 }:
|
2011-07-07 21:48:51 +01:00
|
|
|
|
|
|
|
let
|
2011-07-28 13:52:15 +01:00
|
|
|
release = "4.7.0";
|
2011-07-07 21:48:51 +01:00
|
|
|
|
2011-08-15 19:06:26 +01:00
|
|
|
manifest = import (./kde-package + "/${release}.nix");
|
2011-07-11 16:33:41 +01:00
|
|
|
|
2011-08-15 19:06:26 +01: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 15:24:43 +01:00
|
|
|
|
2011-08-15 19:06:26 +01: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 20:28:12 +01:00
|
|
|
({passthru = attrs // {
|
|
|
|
propagatedUserEnvPackages = list;
|
|
|
|
recurseForDerivations = true;
|
|
|
|
projects = attrs;
|
|
|
|
};})
|
2011-08-15 19:06:26 +01: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 02:28:09 +01:00
|
|
|
|
2011-08-15 19:06:26 +01:00
|
|
|
kdepkgs = builtins.listToAttrs (map kdeModule manifest.modules);
|
2011-07-29 18:24:59 +01:00
|
|
|
|
2011-08-15 19:06:26 +01:00
|
|
|
filterPkgs = module: (p:
|
|
|
|
removeNames (stdenv.lib.attrByPath [module] [] ignoreList) p
|
|
|
|
++ (stdenv.lib.attrByPath [module] [] extraSubpkgs));
|
2011-07-07 21:48:51 +01:00
|
|
|
|
2011-08-15 19:06:26 +01: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 01:38:11 +01:00
|
|
|
|
2011-08-15 19:06:26 +01:00
|
|
|
ignoreList = {
|
|
|
|
kdeadmin = [ "strigi-analyzer" ];
|
|
|
|
kdesdk = [ "kioslave" ];
|
|
|
|
kdebindings = [ "kimono" "korundum" "kross-interpreters" "perlkde" "perlqt"
|
|
|
|
"qtruby" "qyoto" "smokekde" ];
|
2011-08-07 01:37:14 +01:00
|
|
|
};
|
|
|
|
|
2011-08-15 19:06:26 +01:00
|
|
|
extraSubpkgs = {
|
|
|
|
kdesdk =
|
|
|
|
[
|
|
|
|
{
|
|
|
|
name = "kioslave-svn";
|
|
|
|
sane = "kioslave_svn";
|
|
|
|
subdir = "kioslave";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "kioslave-perldoc";
|
|
|
|
sane = "kioslave_perldoc";
|
|
|
|
subdir = "kioslave";
|
|
|
|
}
|
|
|
|
];
|
2011-07-07 21:48:51 +01:00
|
|
|
};
|
2011-07-29 13:41:31 +01:00
|
|
|
|
2011-08-15 19:06:26 +01:00
|
|
|
in
|
|
|
|
kdepkgs // kdepkgs.kdebase //
|
|
|
|
{
|
|
|
|
recurseForRelease = true;
|
|
|
|
akonadi = callPackage ./support/akonadi { };
|
|
|
|
soprano = callPackage ./support/soprano { };
|
2011-07-07 21:48:51 +01:00
|
|
|
|
2011-08-15 19:06:26 +01:00
|
|
|
qt4 = qt47;
|
2011-07-07 21:48:51 +01:00
|
|
|
|
2011-08-15 19:06:26 +01:00
|
|
|
kdebase_workspace = kdepkgs.kdebase.kde_workspace;
|
2011-07-07 21:48:51 +01:00
|
|
|
|
2011-08-15 19:06:26 +01: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 21:48:51 +01:00
|
|
|
|
2011-08-15 19:06:26 +01:00
|
|
|
inherit release;
|
2011-07-07 21:48:51 +01:00
|
|
|
|
2011-08-15 20:28:12 +01: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 19:06:26 +01:00
|
|
|
full = stdenv.lib.attrValues kdepkgs;
|
2011-07-07 21:48:51 +01:00
|
|
|
|
|
|
|
l10n = callPackage ./l10n { inherit release; };
|
|
|
|
}
|