Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 134 lines 3.1 kB view raw
1{ 2 monolithic ? true, # build monolithic Quassel 3 enableDaemon ? false, # build Quassel daemon 4 client ? false, # build Quassel client 5 tag ? "-kf5", # tag added to the package name 6 static ? false, # link statically 7 8 lib, 9 stdenv, 10 fetchFromGitHub, 11 cmake, 12 makeWrapper, 13 dconf, 14 mkDerivation, 15 qtbase, 16 boost, 17 zlib, 18 qtscript, 19 phonon, 20 libdbusmenu, 21 qca-qt5, 22 openldap, 23 24 withKDE ? true, # enable KDE integration 25 extra-cmake-modules, 26 kconfigwidgets, 27 kcoreaddons, 28 knotifications, 29 knotifyconfig, 30 ktextwidgets, 31 kwidgetsaddons, 32 kxmlgui, 33}: 34 35let 36 buildClient = monolithic || client; 37 buildCore = monolithic || enableDaemon; 38in 39 40assert monolithic -> !client && !enableDaemon; 41assert client || enableDaemon -> !monolithic; 42assert !buildClient -> !withKDE; # KDE is used by the client only 43 44let 45 edf = flag: feature: [ ("-D" + feature + (if flag then "=ON" else "=OFF")) ]; 46 47in 48(if !buildClient then stdenv.mkDerivation else mkDerivation) rec { 49 pname = "quassel${tag}"; 50 version = "0.14.0"; 51 52 src = fetchFromGitHub { 53 owner = "quassel"; 54 repo = "quassel"; 55 rev = version; 56 sha256 = "sha256-eulhNcyCmy9ryietOhT2yVJeJH+MMZRbTUo2XuTy9qU="; 57 }; 58 59 # Prevent ``undefined reference to `qt_version_tag''' in SSL check 60 env.NIX_CFLAGS_COMPILE = "-DQT_NO_VERSION_TAGGING=1"; 61 62 nativeBuildInputs = [ 63 cmake 64 makeWrapper 65 ]; 66 buildInputs = [ 67 qtbase 68 boost 69 zlib 70 ] 71 ++ lib.optionals buildCore [ 72 qtscript 73 qca-qt5 74 openldap 75 ] 76 ++ lib.optionals buildClient [ 77 libdbusmenu 78 phonon 79 ] 80 ++ lib.optionals (buildClient && withKDE) [ 81 extra-cmake-modules 82 kconfigwidgets 83 kcoreaddons 84 knotifications 85 knotifyconfig 86 ktextwidgets 87 kwidgetsaddons 88 kxmlgui 89 ]; 90 91 cmakeFlags = [ 92 "-DEMBED_DATA=OFF" 93 "-DUSE_QT5=ON" 94 ] 95 ++ edf static "STATIC" 96 ++ edf monolithic "WANT_MONO" 97 ++ edf enableDaemon "WANT_CORE" 98 ++ edf enableDaemon "WITH_LDAP" 99 ++ edf client "WANT_QTCLIENT" 100 ++ edf withKDE "WITH_KDE"; 101 102 dontWrapQtApps = true; 103 104 postFixup = 105 lib.optionalString enableDaemon '' 106 wrapProgram "$out/bin/quasselcore" --suffix PATH : "${qtbase.bin}/bin" 107 '' 108 + lib.optionalString buildClient '' 109 wrapQtApp "$out/bin/quassel${lib.optionalString client "client"}" \ 110 --prefix GIO_EXTRA_MODULES : "${dconf}/lib/gio/modules" 111 ''; 112 113 meta = with lib; { 114 homepage = "https://quassel-irc.org/"; 115 description = "Qt/KDE distributed IRC client supporting a remote daemon"; 116 longDescription = '' 117 Quassel IRC is a cross-platform, distributed IRC client, 118 meaning that one (or multiple) client(s) can attach to 119 and detach from a central core -- much like the popular 120 combination of screen and a text-based IRC client such 121 as WeeChat, but graphical (based on Qt4/KDE4 or Qt5/KF5). 122 ''; 123 license = licenses.gpl3; 124 maintainers = with maintainers; [ ttuegel ]; 125 mainProgram = 126 if monolithic then 127 "quassel" 128 else if buildClient then 129 "quasselclient" 130 else 131 "quasselcore"; 132 inherit (qtbase.meta) platforms; 133 }; 134}