biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / applications / networking / instant-messengers / psi-plus / default.nix
blob295f92b9ef9a93c0a6b58755fe697e4dda4e2769
1 { lib
2 , mkDerivation
3 , fetchFromGitHub
4 , cmake
5 , qtbase
6 , qtmultimedia
7 , qtimageformats
8 , qtx11extras
9 , qttools
10 , libidn
11 , qca-qt5
12 , libXScrnSaver
13 , hunspell
14 , libsecret
15 , libgcrypt
16 , libotr
17 , html-tidy
18 , libgpg-error
19 , libsignal-protocol-c
20 , usrsctp
22 , chatType ? "basic" # See the assertion below for available options
23 , qtwebkit
24 , qtwebengine
26 , enablePlugins ? true
28   # Voice messages
29 , voiceMessagesSupport ? true
30 , gst_all_1
32 , enablePsiMedia ? false
33 , pkg-config
36 assert builtins.elem (lib.toLower chatType) [
37   "basic" # Basic implementation, no web stuff involved
38   "webkit" # Legacy one, based on WebKit (see https://wiki.qt.io/Qt_WebKit)
39   "webengine" # QtWebEngine (see https://wiki.qt.io/QtWebEngine)
42 assert enablePsiMedia -> enablePlugins;
44 mkDerivation rec {
45   pname = "psi-plus";
46   version = "1.5.1653";
48   src = fetchFromGitHub {
49     owner = "psi-plus";
50     repo = "psi-plus-snapshots";
51     rev = version;
52     sha256 = "sha256-9WT2S6ZgIsrHoEAvlWUB078gzCdrPylvSjkkogU5tsU=";
53   };
55   cmakeFlags = [
56     "-DCHAT_TYPE=${chatType}"
57     "-DENABLE_PLUGINS=${if enablePlugins then "ON" else "OFF"}"
58     "-DBUILD_PSIMEDIA=${if enablePsiMedia then "ON" else "OFF"}"
59   ];
61   nativeBuildInputs = [
62     cmake
63     qttools
64   ] ++ lib.optionals enablePsiMedia [
65     pkg-config
66   ];
68   buildInputs = [
69     qtbase
70     qtmultimedia
71     qtimageformats
72     qtx11extras
73     libidn
74     qca-qt5
75     libXScrnSaver
76     hunspell
77     libsecret
78     libgcrypt
79     libotr
80     html-tidy
81     libgpg-error
82     libsignal-protocol-c
83     usrsctp
84   ] ++ lib.optionals voiceMessagesSupport [
85     gst_all_1.gst-plugins-base
86     gst_all_1.gst-plugins-good
87   ] ++ lib.optionals (chatType == "webkit") [
88     qtwebkit
89   ] ++ lib.optionals (chatType == "webengine") [
90     qtwebengine
91   ];
93   preFixup = lib.optionalString voiceMessagesSupport ''
94     qtWrapperArgs+=(
95       --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0"
96     )
97   '';
99   meta = with lib; {
100     homepage = "https://psi-plus.com";
101     description = "XMPP (Jabber) client based on Qt5";
102     mainProgram = "psi-plus";
103     maintainers = with maintainers; [ orivej misuzu unclechu ];
104     license = licenses.gpl2Only;
105     platforms = platforms.linux;
106   };