psi-plus: add more build options (#129710)

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
(cherry picked from commit 53ca0b16646ae358e37c396f6c5f8955977002c1)
This commit is contained in:
Viacheslav Lotsmanov 2021-07-15 19:25:38 +03:00
parent b106a26a4d
commit c4a4920b2d
No known key found for this signature in database
GPG Key ID: D276FF7467007335

View File

@ -1,14 +1,45 @@
{ lib, mkDerivation, fetchFromGitHub, cmake { lib
, qtbase, qtmultimedia, qtx11extras, qttools, qtwebengine , mkDerivation
, libidn, qca-qt5, libXScrnSaver, hunspell , fetchFromGitHub
, libsecret, libgcrypt, libotr, html-tidy, libgpgerror, libsignal-protocol-c , cmake
, qtbase
, qtmultimedia
, qtx11extras
, qttools
, libidn
, qca-qt5
, libXScrnSaver
, hunspell
, libsecret
, libgcrypt
, libotr
, html-tidy
, libgpgerror
, libsignal-protocol-c
, usrsctp , usrsctp
# Voice messages , chatType ? "basic" # See the assertion below for available options
, qtwebkit
, qtwebengine
, enablePlugins ? true
# Voice messages
, voiceMessagesSupport ? true , voiceMessagesSupport ? true
, gst_all_1 , gst_all_1
, enablePsiMedia ? false
, pkg-config
}: }:
assert builtins.elem (lib.toLower chatType) [
"basic" # Basic implementation, no web stuff involved
"webkit" # Legacy one, based on WebKit (see https://wiki.qt.io/Qt_WebKit)
"webengine" # QtWebEngine (see https://wiki.qt.io/QtWebEngine)
];
assert enablePsiMedia -> enablePlugins;
mkDerivation rec { mkDerivation rec {
pname = "psi-plus"; pname = "psi-plus";
version = "1.5.1520"; version = "1.5.1520";
@ -21,19 +52,40 @@ mkDerivation rec {
}; };
cmakeFlags = [ cmakeFlags = [
"-DENABLE_PLUGINS=ON" "-DCHAT_TYPE=${chatType}"
"-DENABLE_PLUGINS=${if enablePlugins then "ON" else "OFF"}"
"-DBUILD_PSIMEDIA=${if enablePsiMedia then "ON" else "OFF"}"
]; ];
nativeBuildInputs = [ cmake qttools ]; nativeBuildInputs = [
cmake
qttools
] ++ lib.optionals enablePsiMedia [
pkg-config
];
buildInputs = [ buildInputs = [
qtbase qtmultimedia qtx11extras qtwebengine qtbase
libidn qca-qt5 libXScrnSaver hunspell qtmultimedia
libsecret libgcrypt libotr html-tidy libgpgerror libsignal-protocol-c qtx11extras
libidn
qca-qt5
libXScrnSaver
hunspell
libsecret
libgcrypt
libotr
html-tidy
libgpgerror
libsignal-protocol-c
usrsctp usrsctp
] ++ lib.optionals voiceMessagesSupport [ ] ++ lib.optionals voiceMessagesSupport [
gst_all_1.gst-plugins-base gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good gst_all_1.gst-plugins-good
] ++ lib.optionals (chatType == "webkit") [
qtwebkit
] ++ lib.optionals (chatType == "webengine") [
qtwebengine
]; ];
preFixup = lib.optionalString voiceMessagesSupport '' preFixup = lib.optionalString voiceMessagesSupport ''