autonix: JSON manifest format

This commit is contained in:
Thomas Tuegel 2015-06-18 14:25:51 -05:00
parent 0aa8e64967
commit 8862d8d9c9
6 changed files with 494 additions and 502 deletions

View File

@ -12,23 +12,23 @@
# make a copy of this directory first. After copying, be sure to delete ./tmp
# if it exists. Then follow the minor update instructions.
{ autonix, symlinkJoin, kde4, kf5, pkgs, qt4, qt5, stdenv, newScope, debug ? false }:
{ pkgs, newScope, kf5 ? null, plasma5 ? null, qt5 ? null, debug ? false }:
with autonix;
let inherit (pkgs) autonix kde4 stdenv symlinkJoin; in
let inherit (stdenv) lib; in
with autonix; let inherit (stdenv) lib; in
let kf5Orig = kf5; in
let
kf5_ = if kf5 != null then kf5 else pkgs.kf510;
plasma5_ = if plasma5 != null then plasma5 else pkgs.plasma53;
qt5_ = if qt5 != null then qt5 else pkgs.qt54;
in
let
kf5 = kf5Orig.override { inherit debug qt5; };
kdePackage = pkg:
(kf5.kdePackage pkg).override {
inherit (stdenv) mkDerivation;
inherit scope;
};
kf5 = kf5_.override { inherit debug qt5; };
plasma5 = plasma5_.override { inherit debug kf5 qt5; };
qt5 = qt5_;
kdeOrL10nPackage = name: pkg:
assert (builtins.isAttrs pkg);
@ -124,53 +124,58 @@ let
(lib.mapAttrs mirrorUrl)
];
overrideDerivation = pkg: f:
let mkDerivation = super: drv: super.mkDerivation (drv // f drv);
in pkg.override (super: super // { mkDerivation = mkDerivation super; });
kde4Package = pkg: overrideScope pkg (with kde4; {
inherit akonadi baloo kactivities libkdegames libkmahjongg;
kde4 = self.kdelibs;
});
scope =
# KDE Frameworks 5
kf5 //
# packages in this collection
self //
{
kf5baloo = plasma5.baloo;
kf5kdcraw = self.libkdcraw;
kf5kdegames = self.libkdegames;
kf5kipi = self.libkipi;
libkonq = self.kde-baseapps;
} //
# packages from KDE Frameworks 5
kf5.scope //
# packages requiring same Qt 5
(with pkgs; {
accountsqt5 = accounts-qt.override { inherit qt5; };
dbusmenuqt = libdbusmenu_qt;
grantlee5 = grantlee5.override { inherit qt5; };
mlt = pkgs.mlt-qt5.override { inherit qt5; };
phonon4qt5 = pkgs.phonon_qt5.override { inherit qt5; };
qca-qt5 = qca-qt5.override { inherit qt5; };
qt5script = qt5.script;
qt5x11extras = qt5.x11extras;
signonqt5 = signon.override { inherit qt5; };
telepathyqt5 = telepathy_qt5.override { inherit qt5; };
}) //
# packages from KDE 4
(with kde4; {
inherit akonadi baloo kactivities libkdegames libkmahjongg;
kde4 = self.kdelibs;
}) //
# packages from nixpkgs
(with pkgs; {
inherit acl attr automoc4 avahi bison cdparanoia cfitsio cups
inherit acl attr automoc4 avahi bison cdparanoia cfitsio cmake cups
djvulibre docbook_xml_dtd_42 docbook_xsl enchant eigen2
exiv2 fam ffmpeg flac flex freetype gmp gettext gpgme
grantlee gsl hunspell ilmbase intltool jasper lcms2
libgcrypt libraw libssh libspectre libvncserver libical
networkmanager openal opencv openexr phonon pkgconfig
polkit_qt4 prison python qca2 qimageblitz qjson qt4
samba saneBackends soprano
speechd strigi taglib udev xplanet xscreensaver xz;
libaccounts-glib libgcrypt libotr libraw libssh libspectre
libvncserver libical networkmanager openal opencv
openexr perl phonon pkgconfig polkit_qt4 prison python qca2
qimageblitz qjson qt4 samba saneBackends soprano speechd
strigi taglib udev xlibs xplanet xscreensaver xz;
alsa = alsaLib;
assuan = libassuan;
boost = boost156;
canberra = libcanberra;
eigen3 = eigen;
epub = ebook_tools;
gif = giflib;
gphoto2 = libgphoto2;
hupnp = herqq;
indi = indilib;
jpeg = libjpeg;
ldap = openldap;
libattica = attica;
musicbrainz3 = libmusicbrainz;
@ -180,6 +185,7 @@ let
qalculate = libqalculate;
sasl2 = cyrus_sasl;
shareddesktopontologies = shared_desktop_ontologies;
sharedmimeinfo = shared_mime_info;
sndfile = libsndfile;
tiff = libtiff;
telepathyqt4 = telepathy_qt;
@ -189,212 +195,330 @@ let
});
self =
(builtins.removeAttrs super [ "artikulate" # build failure; wrong boost?
(builtins.removeAttrs super [
"artikulate" # build failure; wrong boost?
"kde-dev-scripts" "kde-dev-utils" # docbook errors
"kdewebdev" # unknown build failure
"kde-l10n-sr" # missing CMake command
]) // {
inherit kdePackage qt5 scope;
audiocd-kio = kde4Package super.audiocd-kio;
ark = overrideDerivation super.ark (drv: {
buildInputs = (drv.buildInputs or []) ++ [ pkgs.makeWrapper ];
amor = kde4Package super.amor;
ark = extendDerivation (kde4Package super.ark) {
buildInputs = [ pkgs.makeWrapper ];
# runtime dependency
postInstall = (drv.postInstall or "") + ''
postInstall = ''
wrapProgram $out/bin/ark --prefix PATH : "${pkgs.unzipNLS}/bin"
'';
});
};
ffmpegthumbs = overrideDerivation super.ffmpegthumbs (drv: {
nativeBuildInputs = (drv.nativeBuildInputs or []) ++ [ scope.pkgconfig ];
});
cervisia = kde4Package super.cervisia;
kaccounts-providers = overrideDerivation super.kaccounts-providers (drv: {
buildInputs = (drv.buildInputs or []) ++ [ pkgs.libaccounts-glib ];
dolphin-plugins = kde4Package super.dolphin-plugins;
dragon = kde4Package super.dragon;
ffmpegthumbs = extendDerivation (kde4Package super.ffmpegthumbs) {
nativeBuildInputs = [ scope.pkgconfig ];
};
juk = kde4Package super.juk;
jovie = kde4Package super.jovie;
kaccessible = kde4Package super.kaccessible;
kaccounts-providers = extendDerivation super.kaccounts-providers {
buildInputs = [ pkgs.libaccounts-glib ];
# hard-coded install path
preConfigure = (drv.preConfigure or "") + ''
preConfigure = ''
substituteInPlace webkit-options/CMakeLists.txt \
--replace "/etc/signon-ui/webkit-options.d/" \
"$out/etc/signon-ui/webkit-options.d/"
'';
});
};
kalzium = overrideDerivation super.kalzium (drv: {
nativeBuildInputs = (drv.nativeBuildInputs or []) ++ [ scope.pkgconfig ];
});
kajongg = kde4Package super.kajongg;
kate = overrideDerivation super.kate (drv: {
buildInputs =
(drv.buildInputs or [])
++ (with kf5; [ kconfig kguiaddons kiconthemes ki18n kinit kjobwidgets
kio kparts ktexteditor kwindowsystem kxmlgui ]);
nativeBuildInputs = (drv.nativeBuildInputs or []) ++ ([ kf5.kdoctools ]);
});
kalzium = extendDerivation (kde4Package super.kalzium) {
nativeBuildInputs = [ scope.pkgconfig ];
};
/*
kde-baseapps = overrideDerivation super.kde-baseapps (drv: {
buildInputs = (drv.buildInputs or []) ++ [ scope.qt4 ];
});
*/
kamera = kde4Package super.kamera;
kde-runtime = overrideDerivation super.kde-runtime (drv: {
buildInputs = (drv.buildInputs or []) ++ [ scope.canberra ];
nativeBuildInputs = (drv.nativeBuildInputs or []) ++ [ scope.pkgconfig ];
kate = extendDerivation super.kate {
buildInputs = with scope; [
kconfig kguiaddons kiconthemes ki18n kinit kjobwidgets kio
kparts ktexteditor kwindowsystem kxmlgui
];
nativeBuildInputs = [ scope.kdoctools ];
};
kcachegrind = kde4Package super.kcachegrind;
kcolorchooser = kde4Package super.kcolorchooser;
kde-base-artwork = kde4Package super.kde-base-artwork;
kde-baseapps = kde4Package super.kde-baseapps;
kde-runtime = extendDerivation (kde4Package super.kde-runtime) {
buildInputs = [ scope.canberra ];
nativeBuildInputs = [ scope.pkgconfig ];
# cmake does not detect path to `ilmbase`
NIX_CFLAGS_COMPILE =
(drv.NIX_CFLAGS_COMPILE or "") + " -I${scope.ilmbase}/include/OpenEXR";
NIX_CFLAGS_COMPILE = "-I${scope.ilmbase}/include/OpenEXR";
# some components of this package have been replaced in other packages
meta = { priority = 10; };
});
};
kde-workspace = overrideDerivation super.kde-workspace (drv: {
buildInputs =
(drv.buildInputs or []) ++
(with pkgs.xlibs; [
kde-wallpapers = kde4Package super.kde-wallpapers;
kde-workspace = extendDerivation (kde4Package super.kde-workspace) {
buildInputs = with scope.xlibs; [
libxkbfile libXcomposite xcbutilimage xcbutilkeysyms xcbutilrenderutil
]);
nativeBuildInputs = (drv.nativeBuildInputs or []) ++ [ scope.pkgconfig ];
];
nativeBuildInputs = [ scope.pkgconfig ];
# some components of this package have been replaced in other packages
meta = { priority = 10; };
});
};
kdelibs = overrideDerivation super.kdelibs (drv: {
buildInputs =
(drv.buildInputs or []) ++ (with scope; [ attr polkit_qt4 xsltproc xz ]);
kdeartwork = kde4Package super.kdeartwork;
nativeBuildInputs = (drv.nativeBuildInputs or []) ++ [ scope.pkgconfig ];
kdegraphics-mobipocket = kde4Package super.kdegraphics-mobipocket;
kdegraphics-strigi-analyzer = kde4Package super.kdegraphics-strigi-analyzer;
kdegraphics-thumbnailers = kde4Package super.kdegraphics-thumbnailers;
kdelibs = extendDerivation super.kdelibs {
buildInputs = with scope; [ attr polkit_qt4 xsltproc xz ];
propagatedBuildInputs = with scope; [ qt4 soprano phonon strigi ];
nativeBuildInputs = [ scope.pkgconfig ];
propagatedNativeBuildInputs = with scope; [
automoc4 cmake perl sharedmimeinfo
];
patches = [ ./kdelibs/polkit-install.patch ];
# cmake does not detect path to `ilmbase`
NIX_CFLAGS_COMPILE =
(drv.NIX_CFLAGS_COMPILE or "") + " -I${scope.ilmbase}/include/OpenEXR";
NIX_CFLAGS_COMPILE = "-I${scope.ilmbase}/include/OpenEXR";
propagatedBuildInputs =
(drv.propagatedBuildInputs or [])
++ (with scope; [ qt4 soprano phonon strigi ]);
propagatedNativeBuildInputs =
(drv.propagatedNativeBuildInputs or [])
++ (with scope; [ automoc4 cmake perl sharedmimeinfo ]);
patches = (drv.patches or []) ++ [ ./kdelibs/polkit-install.patch ];
cmakeFlags = (drv.cmakeFlags or []) ++ [
cmakeFlags = [
"-DDOCBOOKXML_CURRENTDTD_DIR=${scope.docbook_xml_dtd_42}/xml/dtd/docbook"
"-DDOCBOOKXSL_DIR=${scope.docbook_xsl}/xml/xsl/docbook"
"-DHUPNP_ENABLED=ON"
"-DWITH_SOLID_UDISKS2=ON"
"-DKDE_DEFAULT_HOME=.kde"
];
});
};
kdenlive = overrideDerivation super.kdenlive (drv: {
buildInputs = (drv.buildInputs or []) ++ [ scope.mlt ];
});
kdenetwork-filesharing = kde4Package super.kdenetwork-filesharing;
kdepim = overrideDerivation super.kdepim (drv: {
buildInputs = (drv.buildInputs or []) ++ (with scope; [ gpgme assuan ]);
nativeBuildInputs = (drv.nativeBuildInputs or []) ++ [ scope.pkgconfig ];
});
kdenetwork-strigi-analyzers = kde4Package super.kdenetwork-strigi-analyzers;
kdepimlibs = overrideDerivation super.kdepimlibs (drv: {
nativeBuildInputs = (drv.nativeBuildInputs or []) ++ [ scope.pkgconfig ];
});
kdenlive = extendDerivation super.kdenlive { buildInputs = [ scope.mlt ]; };
kdesdk-thumbnailers = overrideDerivation super.kdesdk-thumbnailers (drv: {
nativeBuildInputs = (drv.nativeBuildInputs or []) ++ [ scope.gettext ];
});
kdepim = extendDerivation (kde4Package super.kdepim) {
buildInputs = with scope; [ gpgme assuan ];
nativeBuildInputs = [ scope.pkgconfig ];
};
kgpg = overrideDerivation super.kgpg (drv: {
buildInputs = (drv.buildInputs or []) ++ [ scope.boost ];
});
kdepim-runtime = kde4Package super.kdepim-runtime;
khangman = overrideDerivation super.khangman (drv: {
buildInputs = (drv.buildInputs or []) ++ [ kf5.kio ];
});
kdepimlibs = extendDerivation (kde4Package super.kdepimlibs) {
nativeBuildInputs = [ scope.pkgconfig ];
};
kmix = overrideDerivation super.kmix (drv: {
nativeBuildInputs = (drv.nativeBuildInputs or []) ++ [ scope.pkgconfig ];
cmakeFlags = (drv.cmakeFlags or []) ++ [ "-DKMIX_KF5_BUILD=ON" ];
});
kdesdk-kioslaves = kde4Package super.kdesdk-kioslaves;
kmousetool = overrideDerivation super.kmousetool (drv: {
buildInputs = (drv.buildInputs or []) ++ (with pkgs.xlibs; [ libXtst libXt ]);
});
kdesdk-strigi-analyzers = kde4Package super.kdesdk-strigi-analyzers;
kremotecontrol = overrideDerivation super.kremotecontrol (drv: {
buildInputs = (drv.buildInputs or []) ++ [ pkgs.xlibs.libXtst ];
});
kdesdk-thumbnailers =
extendDerivation (kde4Package super.kdesdk-thumbnailers) {
nativeBuildInputs = [ scope.gettext ];
};
krfb = overrideDerivation super.krfb (drv: {
buildInputs =
(drv.buildInputs or [])
++ [ pkgs.xlibs.libXtst scope.ktp-common-internals ];
});
kdf = kde4Package super.kdf;
kstars = overrideDerivation super.kstars (drv: {
buildInputs = (drv.buildInputs or []) ++ (with scope; [ kparts cfitsio ]);
});
kfloppy = kde4Package super.kfloppy;
ktp-accounts-kcm = overrideDerivation super.ktp-accounts-kcm (drv: {
buildInputs = (drv.buildInputs or []) ++ [ pkgs.libaccounts-glib ];
});
kgamma = kde4Package super.kgamma;
ktp-common-internals = overrideDerivation super.ktp-common-internals (drv: {
buildInputs =
(drv.buildInputs or [])
++ (with scope; [ kdelibs4support kparts ])
++ [ pkgs.libotr ]; # needed for ktp-text-ui
});
kget = kde4Package super.kget;
ktp-text-ui = overrideDerivation super.ktp-text-ui (drv: {
buildInputs = (drv.buildInputs or []) ++ [ scope.kdbusaddons ];
});
kgoldrunner = kde4Package super.kgoldrunner;
lokalize = overrideDerivation super.lokalize (drv: {
buildInputs = (drv.buildInputs or []) ++ [ scope.kdbusaddons ];
});
kgpg = extendDerivation (kde4Package super.kgpg) {
buildInputs = [ scope.boost ];
};
libkdcraw = overrideDerivation super.libkdcraw (drv: {
buildInputs = (drv.buildInputs or []) ++ (with scope; [ kdelibs libraw ]);
nativeBuildInputs = (drv.nativeBuildInputs or []) ++ [ scope.pkgconfig ];
});
khangman = extendDerivation super.khangman { buildInputs = [ scope.kio ]; };
libkexiv2 = overrideDerivation super.libkexiv2 (drv: {
buildInputs = (drv.buildInputs or []) ++ (with scope; [ exiv2 kdelibs ]);
});
kigo = kde4Package super.kigo;
libkface = overrideDerivation super.libkface (drv: {
buildInputs = (drv.buildInputs or []) ++ (with scope; [ kdelibs opencv ]);
});
kiriki = kde4Package super.kiriki;
libkgeomap = overrideDerivation super.libkgeomap (drv: {
klickety = kde4Package super.klickety;
kmag = kde4Package super.kmag;
kmahjongg = kde4Package super.kmahjongg;
kmix = extendDerivation super.kmix {
nativeBuildInputs = [ scope.pkgconfig ];
cmakeFlags = [ "-DKMIX_KF5_BUILD=ON" ];
};
kmousetool = extendDerivation (kde4Package super.kmousetool) {
buildInputs = with scope.xlibs; [ libXtst libXt ];
};
kmouth = kde4Package super.kmouth;
knavalbattle = kde4Package super.knavalbattle;
kolf = kde4Package super.kolf;
kolourpaint = kde4Package super.kolourpaint;
konquest = kde4Package super.konquest;
kopete = kde4Package super.kopete;
kppp = kde4Package super.kppp;
kqtquickcharts = kde4Package super.kqtquickcharts;
krdc = kde4Package super.krdc;
kremotecontrol = extendDerivation (kde4Package super.kremotecontrol) {
buildInputs = [ scope.xlibs.libXtst ];
};
kreversi = kde4Package super.kreversi;
krfb = extendDerivation (kde4Package super.krfb) {
buildInputs = with scope; [ xlibs.libXtst ktp-common-internals ];
};
ksaneplugin = kde4Package super.ksaneplugin;
kscd = kde4Package super.kscd;
ksirk = kde4Package super.ksirk;
ksnakeduel = kde4Package super.ksnakeduel;
ksnapshot = kde4Package super.ksnapshot;
kspaceduel = kde4Package super.kspaceduel;
kstars = extendDerivation super.kstars {
buildInputs = with scope; [ kparts cfitsio ];
};
ksudoku = kde4Package super.ksudoku;
ksystemlog = kde4Package super.ksystemlog;
ktp-accounts-kcm = extendDerivation super.ktp-accounts-kcm {
buildInputs = [ scope.libaccounts-glib ];
};
ktp-common-internals = extendDerivation super.ktp-common-internals {
buildInputs = with scope; [ kdelibs4support kparts libotr ];
};
ktp-text-ui = extendDerivation super.ktp-text-ui {
buildInputs = [ scope.kdbusaddons ];
};
ktuberling = kde4Package super.ktuberling;
ktux = kde4Package super.ktux;
kubrick = kde4Package super.kubrick;
kuser = kde4Package super.kuser;
kwalletmanager = kde4Package super.kwalletmanager;
lokalize = extendDerivation super.lokalize {
buildInputs = [ scope.kdbusaddons ];
};
libkcddb = kde4Package super.libkcddb;
libkcompactdisc = kde4Package super.libkcompactdisc;
libkdcraw = extendDerivation super.libkdcraw {
buildInputs = with scope; [ kdelibs libraw ];
nativeBuildInputs = [ scope.pkgconfig ];
};
libkdeedu = kde4Package super.libkdeedu;
libkexiv2 = extendDerivation super.libkexiv2 {
buildInputs = with scope; [ exiv2 kdelibs ];
};
libkface = extendDerivation super.libkface {
buildInputs = with scope; [ kdelibs opencv ];
};
libkgeomap = extendDerivation (kde4Package super.libkgeomap) {
cmakeFlags =
(drv.cmakeFlags or [])
++ [ "-DCMAKE_MODULE_PATH=${scope.marble}/share/apps/cmake/modules" ];
});
[ "-DCMAKE_MODULE_PATH=${scope.marble}/share/apps/cmake/modules" ];
};
libkipi = overrideDerivation super.libkipi (drv: {
buildInputs = (drv.buildInputs or []) ++ [ scope.kdelibs ];
});
libkipi = extendDerivation super.libkipi {
buildInputs = [ scope.kdelibs ];
};
libksane = overrideDerivation super.libksane (drv: {
buildInputs = (drv.buildInputs or []) ++ (with scope; [ kdelibs saneBackends]);
});
libksane = extendDerivation super.libksane {
buildInputs = with scope; [ kdelibs saneBackends];
};
okular = overrideDerivation super.okular (drv: {
nativeBuildInputs = (drv.nativeBuildInputs or []) ++ [ scope.pkgconfig ];
});
lskat = kde4Package super.lskat;
rocs = overrideDerivation super.rocs (drv: {
buildInputs = (drv.buildInputs or []) ++ [ scope.kdelibs4support ];
});
marble = kde4Package super.marble;
signon-kwallet-extension =
overrideDerivation super.signon-kwallet-extension (drv: {
buildInputs = (drv.buildInputs or []) ++ [ scope.signonqt5 ];
preConfigure = (drv.preConfigure or "") + ''
sed -i src/CMakeLists.txt \
-e "s,\''${SIGNONEXTENSION_PLUGINDIR},$out/lib/signon/extensions,"
'';
});
mplayerthumbs = kde4Package super.mplayerthumbs;
okular = extendDerivation (kde4Package super.okular) {
nativeBuildInputs = [ scope.pkgconfig ];
};
pairs = kde4Package super.pairs;
palapeli = kde4Package super.palapeli;
picmi = kde4Package super.picmi;
poxml = kde4Package super.poxml;
rocs = extendDerivation super.rocs {
buildInputs = [ scope.kdelibs4support ];
};
signon-kwallet-extension = extendDerivation super.signon-kwallet-extension {
buildInputs = [ scope.signonqt5 ];
preConfigure = ''
sed -i src/CMakeLists.txt \
-e "s,\''${SIGNONEXTENSION_PLUGINDIR},$out/lib/signon/extensions,"
'';
};
superkaramba = kde4Package super.superkaramba;
svgpart = kde4Package super.svgpart;
sweeper = kde4Package super.sweeper;
umbrello = kde4Package super.umbrello;
zeroconf-ioslave = kde4Package super.zeroconf-ioslave;
};

View File

@ -1 +1,12 @@
addToSearchPath XDG_DATA_DIRS @out@/share
addQt4Plugins() {
if [[ -d "$1/lib/qt4/plugins" ]]; then
propagatedUserEnvPkgs+=" $1"
fi
if [[ -d "$1/lib/kde4/plugins" ]]; then
propagatedUserEnvPkgs+=" $1"
fi
}
envHooks+=(addQt4Plugins)

View File

@ -1,5 +1,8 @@
{ bash, callPackage, coreutils, fetchurl, findutils, nix, runCommand, stdenv
, substituteAll, wget, writeText }:
{ pkgs }:
let inherit (pkgs) bash coreutils findutils nix wget;
inherit (pkgs) callPackage fetchurl runCommand stdenv substituteAll writeText;
in
/* autonix is a collection of tools to automate packaging large collections
* of software, particularly KDE. It consists of three components:
@ -10,10 +13,18 @@
* expressions from the output of the previous steps.
*/
with stdenv.lib;
let inherit (stdenv) lib; in
let
resolveDeps = scope: deps:
let resolve = dep:
let res = scope."${dep}" or [];
in if lib.isList res then res else [res];
in lib.concatMap resolve deps;
in rec {
/* Download the packages into the Nix store, compute their hashes,
* and generate a package manifest in ./manifest.nix.
*/
@ -32,240 +43,94 @@ let
chmod +x $out
'';
/* Convert a manifest.nix file to XML to be read by autonix-deps. */
writeManifestXML = filename:
let
generateStores = mapAttrs (n: pkg: pkg.store);
manifest = importManifest filename { mirror = ""; };
stores = generateStores manifest;
in
writeText "manifest.xml" (builtins.toXML stores);
mkPackage = callPackage: defaultOverride: name: pkg: let drv =
{ mkDerivation, fetchurl, scope }:
/* Generate a set of Nix expressions for the collection, given a
* manifest.nix, dependencies.nix, and renames.nix in the same directory.
*/
generateCollection = dir: # path to directory
{ mirror # mirror to download packages from
, mkDerivation ? mkDerivation
, preResolve ? id # modify package set before dependency resolution
, postResolve ? id # modify package set after dependency resolution
, renames ? {}
, scope ? {}
}:
let
mkDerivation (defaultOverride {
inherit (pkg) name;
fix = f: let x = f x; in x;
src = fetchurl pkg.src;
resolvePkg = name:
mapAttrs (attr: if isDepAttr attr then resolveDeps scope else id);
buildInputs = resolveDeps scope pkg.buildInputs;
nativeBuildInputs = resolveDeps scope pkg.nativeBuildInputs;
propagatedBuildInputs = resolveDeps scope pkg.propagatedBuildInputs;
propagatedNativeBuildInputs =
resolveDeps scope pkg.propagatedNativeBuildInputs;
propagatedUserEnvPkgs = resolveDeps scope pkg.propagatedUserEnvPkgs;
resolve = mapAttrs resolvePkg;
enableParallelBuilding = true;
});
in callPackage drv {};
derive = mapAttrs (name: mkDerivation);
renameDeps = renames: lib.mapAttrs (name: pkg:
let breakCycles = lib.filter (dep: dep != name);
rename = dep: renames."${dep}" or dep;
in pkg // {
buildInputs = breakCycles (map rename pkg.buildInputs);
nativeBuildInputs = breakCycles (map rename pkg.nativeBuildInputs);
propagatedBuildInputs = breakCycles (map rename pkg.propagatedBuildInputs);
propagatedNativeBuildInputs =
breakCycles (map rename pkg.propagatedNativeBuildInputs);
propagatedUserEnvPkgs = breakCycles (map rename pkg.propagatedUserEnvPkgs);
});
renames_ =
if renames == {} then (import (dir + "/renames.nix") {}) else renames;
propagateDeps = propagated: lib.mapAttrs (name: pkg:
let isPropagated = dep: lib.elem dep propagated;
isNotPropagated = dep: !(isPropagated dep);
in pkg // {
buildInputs = lib.filter isNotPropagated pkg.buildInputs;
nativeBuildInputs = lib.filter isNotPropagated pkg.nativeBuildInputs;
propagatedBuildInputs =
pkg.propagatedBuildInputs
++ lib.filter isPropagated pkg.buildInputs;
propagatedNativeBuildInputs =
pkg.propagatedNativeBuildInputs
++ lib.filter isPropagated pkg.nativeBuildInputs;
});
packages = importPackages dir renames_ { inherit mirror; };
nativeDeps = native: lib.mapAttrs (name: pkg:
let isNative = dep: lib.elem dep native;
isNotNative = dep: !(isNative dep);
in pkg // {
buildInputs = lib.filter isNotNative pkg.buildInputs;
nativeBuildInputs =
pkg.nativeBuildInputs
++ lib.filter isNative pkg.buildInputs;
propagatedBuildInputs = lib.filter isNotNative pkg.propagatedBuildInputs;
propagatedNativeBuildInputs =
pkg.propagatedNativeBuildInputs
++ lib.filter isNative pkg.propagatedBuildInputs;
});
in derive (postResolve (resolve (preResolve packages)));
userEnvDeps = user: lib.mapAttrs (name: pkg:
let allDeps = with pkg; lib.concatLists [
buildInputs
nativeBuildInputs
propagatedBuildInputs
propagatedNativeBuildInputs
];
in assert (lib.isList allDeps); pkg // {
propagatedUserEnvPkgs = lib.filter (dep: lib.elem dep user) allDeps;
});
pkgAttrName = pkg: (builtins.parseDrvName pkg.name).name;
pkgVersion = pkg: (builtins.parseDrvName pkg.name).version;
overrideDerivation = pkg: f: pkg.override (super: super // {
mkDerivation = drv: super.mkDerivation (drv // f drv);
});
depAttrNames = [
"buildInputs" "nativeBuildInputs"
"propagatedBuildInputs" "propagatedNativeBuildInputs"
"propagatedUserEnvPkgs"
];
isDepAttr = name: builtins.elem name depAttrNames;
removePkgDeps = deps:
let removeDepsIfDepAttr = attr: value:
if isDepAttr attr then fold remove value deps else value;
in mapAttrs removeDepsIfDepAttr;
hasDep = dep: pkg:
let depAttrs = attrValues (filterAttrs (n: v: isDepAttr n) pkg);
allDeps = concatLists depAttrs;
in elem dep allDeps;
importManifest = path: { mirror }:
let
uniqueNames = manifest:
unique (map pkgAttrName manifest);
versionsOf = manifest: name:
filter (pkg: pkgAttrName pkg == name) manifest;
bestVersions = manifest:
let best = versions:
let
strictlyLess = a: b:
builtins.compareVersions (pkgVersion a) (pkgVersion b) > 0;
sorted = sort strictlyLess versions;
in head sorted;
in map (name: best (versionsOf manifest name)) (uniqueNames manifest);
withNames = manifest:
builtins.listToAttrs
(map (p: nameValuePair (toLower (pkgAttrName p)) p) manifest);
orig = import path { inherit stdenv fetchurl mirror; };
in
fold (f: x: f x) orig [ withNames bestVersions ];
importPackages = path: renames: manifestScope:
let
# Do not allow any package to depend on itself.
breakRecursion =
let removeSelfDep = pkg:
mapAttrs
(n: if isDepAttr n
then filter (dep: dep != pkg && renamed dep != pkg)
else id);
in mapAttrs removeSelfDep;
renamed = dep: renames."${dep}" or dep;
manifest = importManifest (path + "/manifest.nix") manifestScope;
deps = import (path + "/dependencies.nix") {};
mkPkg = name: manifest:
{
inherit (manifest) name src;
inherit (deps."${name}")
buildInputs nativeBuildInputs propagatedBuildInputs
propagatedNativeBuildInputs propagatedUserEnvPkgs;
extendDerivation = pkg: attrs:
let mergeAttrBy = lib.mergeAttrBy // {
propagatedNativeBuildInputs = a: b: a ++ b;
NIX_CFLAGS_COMPILE = a: b: "${a} ${b}";
cmakeFlags = a: b: a ++ b;
};
mergeAttrsByFunc = sets:
let merged = lib.foldl lib.mergeAttrByFunc { inherit mergeAttrBy; } sets;
in builtins.removeAttrs merged ["mergeAttrBy"];
in overrideDerivation pkg (drv: mergeAttrsByFunc [ drv attrs ]);
in breakRecursion (mapAttrs mkPkg manifest);
mkDerivation = drv: stdenv.mkDerivation (drv // { src = fetchurl drv.src; });
resolveDeps = scope: deps:
let resolve = dep:
let res = scope."${dep}" or [];
in if lib.isList res then res else [res];
in lib.concatMap resolve deps;
userEnvPkg = dep:
mapAttrs
(name: pkg: pkg // {
propagatedUserEnvPkgs =
(pkg.propagatedUserEnvPkgs or [])
++ optional (hasDep dep pkg) dep;
});
in
{
inherit generateCollection;
inherit importManifest;
inherit isDepAttr;
inherit manifest;
inherit removePkgDeps;
inherit resolveDeps;
inherit userEnvPkg;
inherit writeManifestXML;
blacklist = names: pkgs:
let
removeDeps = deps: mapAttrs (name: removePkgDeps deps);
removePkgs = names: pkgs: builtins.removeAttrs pkgs names;
in removeDeps names (removePkgs names pkgs);
lib = rec {
mkPackage = callPackage: defaultOverride: name: pkg: let drv =
{ mkDerivation, fetchurl, scope }:
mkDerivation (defaultOverride {
inherit (pkg) name;
src = fetchurl pkg.src;
buildInputs = resolveDeps scope pkg.buildInputs;
nativeBuildInputs = resolveDeps scope pkg.nativeBuildInputs;
propagatedBuildInputs = resolveDeps scope pkg.propagatedBuildInputs;
propagatedNativeBuildInputs =
resolveDeps scope pkg.propagatedNativeBuildInputs;
propagatedUserEnvPkgs = resolveDeps scope pkg.propagatedUserEnvPkgs;
enableParallelBuilding = true;
});
in callPackage drv {};
renameDeps = renames: lib.mapAttrs (name: pkg:
let breakCycles = lib.filter (dep: dep != name);
rename = dep: renames."${dep}" or dep;
in pkg // {
buildInputs = breakCycles (map rename pkg.buildInputs);
nativeBuildInputs = breakCycles (map rename pkg.nativeBuildInputs);
propagatedBuildInputs = breakCycles (map rename pkg.propagatedBuildInputs);
propagatedNativeBuildInputs = breakCycles (map rename pkg.propagatedNativeBuildInputs);
propagatedUserEnvPkgs = breakCycles (map rename pkg.propagatedUserEnvPkgs);
});
propagateDeps = propagated: lib.mapAttrs (name: pkg:
let isPropagated = dep: lib.elem dep propagated;
isNotPropagated = dep: !(isPropagated dep);
in pkg // {
buildInputs = lib.filter isNotPropagated pkg.buildInputs;
nativeBuildInputs = lib.filter isNotPropagated pkg.nativeBuildInputs;
propagatedBuildInputs =
pkg.propagatedBuildInputs
++ lib.filter isPropagated pkg.buildInputs;
propagatedNativeBuildInputs =
pkg.propagatedNativeBuildInputs
++ lib.filter isPropagated pkg.nativeBuildInputs;
});
nativeDeps = native: lib.mapAttrs (name: pkg:
let isNative = dep: lib.elem dep native;
isNotNative = dep: !(isNative dep);
in pkg // {
buildInputs = lib.filter isNotNative pkg.buildInputs;
nativeBuildInputs =
pkg.nativeBuildInputs
++ lib.filter isNative pkg.buildInputs;
propagatedBuildInputs = lib.filter isNotNative pkg.propagatedBuildInputs;
propagatedNativeBuildInputs =
pkg.propagatedNativeBuildInputs
++ lib.filter isNative pkg.propagatedBuildInputs;
});
userEnvDeps = user: lib.mapAttrs (name: pkg:
let allDeps = with pkg; lib.concatLists [
buildInputs
nativeBuildInputs
propagatedBuildInputs
propagatedNativeBuildInputs
];
in assert (lib.isList allDeps); pkg // {
propagatedUserEnvPkgs = lib.filter (dep: lib.elem dep user) allDeps;
});
overrideDerivation = pkg: f: pkg.override (super: super // {
mkDerivation = drv: super.mkDerivation (drv // f drv);
});
extendDerivation = pkg: attrs:
let mergeAttrBy = lib.mergeAttrBy // {
propagatedNativeBuildInputs = a: b: a ++ b;
NIX_CFLAGS_COMPILE = a: b: "${a} ${b}";
cmakeFlags = a: b: a ++ b;
};
mergeAttrsByFunc = sets:
let merged = lib.foldl lib.mergeAttrByFunc { inherit mergeAttrBy; } sets;
in builtins.removeAttrs merged ["mergeAttrBy"];
in overrideDerivation pkg (drv: mergeAttrsByFunc [ drv attrs ]);
overrideScope = pkg: fnOrSet: pkg.override (super: super // {
scope = if builtins.isFunction fnOrSet
then super.scope // fnOrSet super.scope
else super.scope // fnOrSet;
});
};
overrideScope = pkg: fnOrSet: pkg.override (super: super // {
scope = if builtins.isFunction fnOrSet
then super.scope // fnOrSet super.scope
else super.scope // fnOrSet;
});
}

View File

@ -16,7 +16,7 @@
let inherit (pkgs) autonix stdenv symlinkJoin; in
let kf5Orig = kf5; in
with autonix; let inherit (stdenv) lib; in
let
kf5_ = if kf5 != null then kf5 else pkgs.kf510;
@ -26,7 +26,7 @@ in
let
qt5 = qt5_;
kf5 = kf5_.override { inherit qt5; };
kf5 = kf5_.override { inherit debug qt5; };
kdePackage = name: pkg:
let defaultOverride = drv: drv // {
@ -106,7 +106,7 @@ let
modemmanager openconnect openexr pam pango qt4 samba
socat substituteAll taglib utillinux wayland xapian
xkeyboard_config xlibs xorg;
boost = boost155;
boost = boost156;
canberra = libcanberra;
epub = ebook_tools;
fontforge_executable = fontforge;
@ -153,7 +153,7 @@ let
});
in symlinkJoin "breeze-${version}" [ breeze-qt4 breeze-qt5 ];
kde-gtk-config = overrideDerivation super.kde-gtk-config (drv: {
kde-gtk-config = extendDerivation super.kde-gtk-config {
NIX_CFLAGS_COMPILE = with scope;
lib.concatStringsSep " " [
"-I${cairo}/include/cairo"
@ -163,55 +163,51 @@ let
"-I${glib}/lib/glib-2.0/include"
"-I${pango}/include/pango-1.0"
];
});
};
kfilemetadata = overrideDerivation super.kfilemetadata (drv: {
buildInputs = drv.buildInputs ++ [ pkgs.attr ];
});
kfilemetadata = extendDerivation super.kfilemetadata {
buildInputs = [ scope.attr ];
};
kwin = overrideDerivation super.kwin (drv: {
buildInputs =
drv.buildInputs ++ (with pkgs.xlibs; [ libICE libSM libXcursor ]);
kwin = extendDerivation super.kwin {
buildInputs = with scope.xlibs; [ libICE libSM libXcursor ];
patches = [ ./kwin/kwin-import-plugin-follow-symlinks.patch ];
});
};
libkscreen = overrideDerivation super.libkscreen (drv: {
buildInputs = drv.buildInputs ++ [ pkgs.xlibs.libXrandr];
});
libkscreen = extendDerivation super.libkscreen {
buildInputs = [ scope.xlibs.libXrandr];
};
plasma-desktop = overrideDerivation super.plasma-desktop (drv: {
buildInputs =
drv.buildInputs
++ [ pkgs.libcanberra ]
++ (with pkgs.xlibs; [ libxkbfile libXcursor libXft ]);
plasma-desktop = extendDerivation super.plasma-desktop {
buildInputs = with scope;
[ canberra ]
++ (with xlibs; [ libxkbfile libXcursor libXft ]);
patches = [
./plasma-desktop/plasma-desktop-hwclock.patch
./plasma-desktop/plasma-desktop-zoneinfo.patch
(pkgs.substituteAll {
(scope.substituteAll {
src = ./plasma-desktop/plasma-desktop-xkb-rules.patch;
xkb = pkgs.xkeyboard_config;
xkb = scope.xkeyboard_config;
})
];
preConfigure = ''
substituteInPlace kcms/dateandtime/helper.cpp \
--subst-var-by hwclock "${scope.utillinux}/sbin/hwclock"
'';
});
};
plasma-workspace = overrideDerivation super.plasma-workspace (drv: {
plasma-workspace = extendDerivation super.plasma-workspace {
patches = [
(pkgs.substituteAll {
(scope.substituteAll {
src = ./plasma-workspace/0001-startkde-NixOS-patches.patch;
inherit (pkgs) bash gnused gnugrep socat;
inherit (kf5) kconfig kinit kservice;
inherit (pkgs.xorg) mkfontdir xmessage xprop xrdb xset xsetroot;
qt5tools = qt5.tools;
dbus_tools = pkgs.dbus.tools;
inherit (scope) bash gnused gnugrep socat;
inherit (scope) kconfig kinit kservice;
inherit (scope.xorg) mkfontdir xmessage xprop xrdb xset xsetroot;
qt5tools = scope.qt5tools;
dbus_tools = scope.dbus.tools;
})
];
buildInputs =
(drv.buildInputs or [])
++ (with pkgs.xlibs; [ libSM libXcursor scope.pam ]);
buildInputs = with scope.xlibs; [ libSM libXcursor scope.pam ];
postPatch = ''
substituteInPlace startkde/kstartupconfig/kstartupconfig.cpp \
--replace kdostartupconfig5 $out/bin/kdostartupconfig5
@ -220,15 +216,15 @@ let
substituteInPlace startkde/startkde.cmake \
--subst-var-by plasmaWorkspace "$out"
'';
});
};
powerdevil = overrideDerivation super.powerdevil (drv: {
buildInputs = drv.buildInputs ++ [pkgs.xlibs.libXrandr];
});
powerdevil = extendDerivation super.powerdevil {
buildInputs = [ scope.xlibs.libXrandr ];
};
sddm-kcm = overrideDerivation super.sddm-kcm (drv: {
buildInputs = drv.buildInputs ++ [pkgs.xlibs.libXcursor];
});
sddm-kcm = extendDerivation super.sddm-kcm {
buildInputs = [ scope.xlibs.libXcursor ];
};
};

View File

@ -12,13 +12,19 @@
# make a copy of this directory first. After copying, be sure to delete ./tmp
# if it exists. Then follow the minor update instructions.
{ autonix, fetchurl, pkgs, qt5, stdenv, newScope, debug ? false }:
{ pkgs, newScope, qt5 ? null, debug ? false }:
with autonix;
let inherit (pkgs) autonix stdenv symlinkJoin; in
let inherit (stdenv) lib; in
with autonix; let inherit (stdenv) lib; in
let
qt5_ = if qt5 != null then qt5 else pkgs.qt54;
in
let
qt5 = qt5_;
super =
let json = builtins.fromJSON (builtins.readFile ./packages.json);
@ -114,8 +120,6 @@ let
);
self = super // {
inherit kdePackage scope;
extra-cmake-modules = overrideDerivation super.extra-cmake-modules (drv: {
buildInputs = [];
nativeBuildInputs = [];
@ -132,78 +136,72 @@ let
};
});
frameworkintegration = overrideDerivation super.frameworkintegration (drv: {
buildInputs = drv.buildInputs ++ [ pkgs.xlibs.libXcursor ];
});
frameworkintegration = extendDerivation super.frameworkintegration {
buildInputs = [ scope.xlibs.libXcursor ];
};
kauth = overrideDerivation super.kauth (drv: {
buildInputs = drv.buildInputs ++ [ scope.polkit_qt5 ];
patches = [./kauth/kauth-policy-install.patch];
});
kauth = extendDerivation super.kauth {
buildInputs = [ scope.polkit_qt5 ];
patches = [ ./kauth/kauth-policy-install.patch ];
};
kcmutils = overrideDerivation super.kcmutils (drv: {
patches = [./kcmutils/kcmutils-pluginselector-follow-symlinks.patch];
});
kcmutils = extendDerivation super.kcmutils {
patches = [ ./kcmutils/kcmutils-pluginselector-follow-symlinks.patch ];
};
kconfigwidgets = overrideDerivation super.kconfigwidgets (drv: {
patches = [./kconfigwidgets/kconfigwidgets-helpclient-follow-symlinks.patch];
});
kconfigwidgets = extendDerivation super.kconfigwidgets {
patches = [ ./kconfigwidgets/kconfigwidgets-helpclient-follow-symlinks.patch ];
};
kdelibs4support = overrideDerivation super.kdelibs4support (drv: {
buildInputs = drv.buildInputs ++ [ scope.networkmanager pkgs.xlibs.libSM ];
cmakeFlags =
drv.cmakeFlags
++ [
"-DDocBookXML4_DTD_DIR=${pkgs.docbook_xml_dtd_45}/xml/dtd/docbook"
"-DDocBookXML4_DTD_VERSION=4.5"
];
});
kdelibs4support = extendDerivation super.kdelibs4support {
buildInputs = [ scope.networkmanager scope.xlibs.libSM ];
cmakeFlags = [
"-DDocBookXML4_DTD_DIR=${pkgs.docbook_xml_dtd_45}/xml/dtd/docbook"
"-DDocBookXML4_DTD_VERSION=4.5"
];
};
kdoctools = overrideDerivation super.kdoctools (drv: {
propagatedNativeBuildInputs =
drv.propagatedNativeBuildInputs ++ [ scope.perl scope.perlPackages.URI ];
cmakeFlags =
drv.cmakeFlags
++ [
"-DDocBookXML4_DTD_DIR=${pkgs.docbook_xml_dtd_45}/xml/dtd/docbook"
"-DDocBookXML4_DTD_VERSION=4.5"
"-DDocBookXSL_DIR=${pkgs.docbook5_xsl}/xml/xsl/docbook"
];
patches = [./kdoctools/kdoctools-no-find-docbook-xml.patch];
});
kdoctools = extendDerivation super.kdoctools {
propagatedNativeBuildInputs = [ scope.perl scope.perlPackages.URI ];
cmakeFlags = [
"-DDocBookXML4_DTD_DIR=${scope.docbook_xml_dtd_45}/xml/dtd/docbook"
"-DDocBookXML4_DTD_VERSION=4.5"
"-DDocBookXSL_DIR=${scope.docbook5_xsl}/xml/xsl/docbook"
];
patches = [ ./kdoctools/kdoctools-no-find-docbook-xml.patch ];
};
ki18n = overrideDerivation super.ki18n (drv: {
propagatedNativeBuildInputs =
drv.propagatedNativeBuildInputs ++ [ scope.libintl scope.pythoninterp ];
});
ki18n = extendDerivation super.ki18n {
propagatedNativeBuildInputs = with scope; [ libintl pythoninterp ];
};
kimageformats = overrideDerivation super.kimageformats (drv: {
kimageformats = extendDerivation super.kimageformats {
NIX_CFLAGS_COMPILE = "-I${pkgs.ilmbase}/include/OpenEXR";
});
};
kinit = overrideDerivation super.kinit (drv: {
kinit = extendDerivation super.kinit {
patches = [./kinit/0001-kinit-libpath.patch];
});
};
kpackage = overrideDerivation super.kpackage (drv: {
patches = [./kpackage/0001-allow-external-paths.patch];
});
kpackage = extendDerivation super.kpackage {
patches = [ ./kpackage/0001-allow-external-paths.patch ];
};
kservice = overrideDerivation super.kservice (drv: {
buildInputs = drv.buildInputs ++ [ self.kwindowsystem ];
kservice = extendDerivation super.kservice {
buildInputs = [ scope.kwindowsystem ];
patches = [
./kservice/kservice-kbuildsycoca-follow-symlinks.patch
./kservice/kservice-kbuildsycoca-no-canonicalize-path.patch
];
});
};
ktexteditor = overrideDerivation super.ktexteditor (drv: {
ktexteditor = extendDerivation super.ktexteditor {
patches = [ ./ktexteditor/0001-no-qcoreapplication.patch ];
});
};
networkmanager-qt = overrideDerivation super.networkmanager-qt (drv: {
propagatedBuildInputs = drv.propagatedBuildInputs ++ [ scope.networkmanager ];
});
networkmanager-qt = extendDerivation super.networkmanager-qt {
propagatedBuildInputs = [ scope.networkmanager ];
};
};
in self

View File

@ -251,7 +251,7 @@ let
theAttrSet = arg;
};
autonix = callPackage ../build-support/autonix {};
autonix = import ../build-support/autonix { inherit pkgs; };
autoreconfHook = makeSetupHook
{ substitutions = { inherit autoconf automake libtool gettext; }; }
@ -11658,9 +11658,7 @@ let
boost = boost155;
};
kdeApps_15_04 = recurseIntoAttrs (callPackage ../applications/kde-apps-15.04 {
kf5 = kf510;
});
kdeApps_15_04 = recurseIntoAttrs (callPackage ../applications/kde-apps-15.04 {});
kdeApps_stable = kdeApps_15_04;
kdeApps_latest = kdeApps_15_04;
@ -13940,7 +13938,7 @@ let
numix-gtk-theme = callPackage ../misc/themes/gtk3/numix-gtk-theme { };
plasma53 = recurseIntoAttrs (import ../desktops/plasma-5.3 { inherit pkgs newScope; });
plasma53 = recurseIntoAttrs (callPackage ../desktops/plasma-5.3 { inherit pkgs newScope; });
plasma5_latest = plasma53;
plasma5_stable = plasma53;