From e9bb45821f28a804daa39f7defbfc8b69c7fe0b4 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Thu, 9 Aug 2018 14:12:34 +0200 Subject: First try --- default.nix | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 default.nix diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..3f74b23 --- /dev/null +++ b/default.nix @@ -0,0 +1,120 @@ +{ + nixpkgs ? import {}, + + kasyncSrc ? pkgs.fetchgit { + url = "https://anongit.kde.org/kasync.git"; + rev = "8a68ad7da7f9d7d10d249a16a474fa7ca82517be"; + sha256 = "1v55my24d3zhllw77sjzngs6cwddjqf9xw9v0hkwk2gq2znwp6g8"; + fetchSubmodules = true; + }, + + kimap2Src ? pkgs.fetchgit { + url = "https://anongit.kde.org/kimap2.git"; + rev = "62df1b858b3fd7c6c4b3229ff5051c0e4996b1be"; + sha256 = "1q43dzza1v5kjsvzisw5j2750550596s6hra45xbqny08hkpk355"; + fetchSubmodules = true; + }, + + kdav2Src ? pkgs.fetchgit { + url = "https://anongit.kde.org/kdav2.git"; + rev = "830f07b99dc8badf5df40edb81cbac63a3ddb3c4"; + sha256 = "1da6ivjjq9bh855jiv0kzxi83z736iazn747gkaj261ai8qn7spz"; + fetchSubmodules = true; + }, + + sinkSrc ? pkgs.fetchgit { + url = "https://github.com/KDE/sink"; + rev = "e1a6d6f5bbaeeffd92a2049849b75e248c2d492b"; + sha256 = "196vqd7gk93mfizxnfz918rs5g3723ndarx79x84q8qvk7bngc0v"; + fetchSubmodules = true; + }, + + compiler ? "gcc7", + cmakeBuildType ? "Debug" +}: + +let + stdenv = nixpkgs.overrideCC nixpkgs.stdenv nixpkgs.${compiler}; + pkgs = nixpkgs; + +in rec { + kasync = stdenv.mkDerivation { + name = "kasync"; + nativeBuildInputs = with pkgs; [ cmake ninja ccache ]; + buildInputs = with pkgs; with qt5; + [ extra-cmake-modules qtbase ]; + + src = kasyncSrc; + + inherit cmakeBuildType; + }; + + kimap2 = stdenv.mkDerivation { + name = "kimap2"; + nativeBuildInputs = with pkgs; [ cmake ninja ccache ]; + buildInputs = with pkgs; with qt5; with kdeFrameworks; + [ extra-cmake-modules qtbase kcoreaddons kcodecs kdeApplications.kmime cyrus_sasl ]; + + src = kimap2Src; + inherit cmakeBuildType; + }; + + kdav2 = stdenv.mkDerivation { + name = "kdav2"; + nativeBuildInputs = with pkgs; [ cmake ninja ccache ]; + buildInputs = with pkgs; with qt5; with kdeFrameworks; + [ extra-cmake-modules qtbase qtxmlpatterns kcoreaddons ]; + + src = kdav2Src; + + inherit cmakeBuildType; + }; + + sink = stdenv.mkDerivation { + name = "sink"; + nativeBuildInputs = with pkgs; [ cmake ninja ccache ]; + buildInputs = with pkgs; with qt5; with kdeApplications; + [ + extra-cmake-modules kmime kcontacts kcalcore + flatbuffers lmdb xapian cyrus_sasl curl libgit2 readline + qtbase + + kasync kimap2 kdav2 + ]; + + cmakeFlags = [ + "-DCMAKE_CXX_FLAGS=-fdiagnostics-color=always" + "-DCMAKE_EXPORT_COMPILE_COMMANDS=1" + ]; + + src = sinkSrc; + + inherit cmakeBuildType; + }; + + kube = stdenv.mkDerivation { + name = "kube"; + nativeBuildInputs = with pkgs; [ cmake ninja ccache ]; + buildInputs = with pkgs; with qt5; with kdeFrameworks; with kdeApplications; with libsForQt5; + [ + extra-cmake-modules kcalcore kcodecs kcontacts kmime + qtbase qtquickcontrols2 qtwebengine qgpgme + + sink kasync + ]; + + CCACHE_COMPRESS = 1; + CCACHE_DIR = "/var/cache/ccache"; + CCACHE_UMASK = "007"; + + cmakeFlags = [ + #"-DCMAKE_CXX_COMPILER_LAUNCHER=${pkgs.ccache}/bin/ccache" + "-DCMAKE_CXX_FLAGS=-fdiagnostics-color=always" + "-DCMAKE_EXPORT_COMPILE_COMMANDS=1" + ]; + + dontStrip = if (cmakeBuildType == "Debug") then 1 else 0; + + src = kubeSrc; + }; +} -- cgit v1.2.3