jami: init 20211005.2.251ac7d

Co-authored-by: doronbehar <doron.behar@gmail.com>
This commit is contained in:
linsui 2021-10-25 00:25:19 +08:00 committed by Doron Behar
parent ef9b6b9cd0
commit 6c7a6bf895
13 changed files with 588 additions and 0 deletions

View File

@ -0,0 +1,60 @@
{ version
, src
, jami-meta
, stdenv
, lib
, pkg-config
, cmake
, wrapQtAppsHook
, wrapGAppsHook
, gtk3-x11
, networkmanager # for libnm
, libayatana-appindicator
, libnotify
, clutter-gtk
, libcanberra-gtk3
, webkitgtk
, qrencode
, jami-libclient
, qttools
}:
stdenv.mkDerivation {
pname = "jami-client-gnome";
inherit version src;
sourceRoot = "source/client-gnome";
preConfigure = ''
echo ${version} > version.txt
'';
nativeBuildInputs = [
pkg-config
cmake
wrapGAppsHook
wrapQtAppsHook
];
# To spare double wrapping
dontWrapGApps = true;
preFixup = ''
qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
'';
buildInputs = [
qttools
jami-libclient
gtk3-x11
networkmanager
libayatana-appindicator
libnotify
clutter-gtk
libcanberra-gtk3
webkitgtk
qrencode
];
meta = jami-meta // {
description = "The client based on GTK" + jami-meta.description;
};
}

View File

@ -0,0 +1,59 @@
{ version
, src
, jami-meta
, mkDerivation
, lib
, pkg-config
, cmake
, networkmanager # for libnm
, python3
, qttools # for translations
, wrapQtAppsHook
, libnotify
, qrencode
, qtwebengine
, qtdeclarative
, qtquickcontrols2
, qtmultimedia
, qtsvg
, qtwebchannel
, qtgraphicaleffects # no gui without this
, jami-libclient
}:
mkDerivation {
pname = "jami-client-qt";
inherit version src;
sourceRoot = "source/client-qt";
preConfigure = ''
python gen-resources.py
echo 'const char VERSION_STRING[] = "${version}";' > src/version.h
'';
nativeBuildInputs = [
pkg-config
cmake
python3
qttools
];
buildInputs = [
jami-libclient
networkmanager
libnotify
qrencode
qtwebengine
qtdeclarative
qtquickcontrols2
qtmultimedia
qtsvg
qtwebchannel
qtgraphicaleffects
];
meta = jami-meta // {
description = "The client based on QT" + jami-meta.description;
};
}

View File

@ -0,0 +1,142 @@
--disable-everything
--enable-zlib
--enable-gpl
--enable-swscale
--enable-bsfs
--disable-filters
--disable-programs
--disable-postproc
--disable-protocols
--enable-protocol=crypto
--enable-protocol=file
--enable-protocol=rtp
--enable-protocol=srtp
--enable-protocol=tcp
--enable-protocol=udp
--enable-protocol=unix
--enable-protocol=pipe
--disable-demuxers
--disable-muxers
--enable-muxer=rtp
--enable-muxer=g722
--enable-muxer=h263
--enable-muxer=h264
--enable-muxer=hevc
--enable-muxer=webm
--enable-muxer=ogg
--enable-muxer=pcm_s16be
--enable-muxer=pcm_s16le
--enable-demuxer=rtp
--enable-demuxer=mjpeg
--enable-demuxer=mjpeg_2000
--enable-demuxer=mpegvideo
--enable-demuxer=gif
--enable-demuxer=image_jpeg_pipe
--enable-demuxer=image_png_pipe
--enable-demuxer=image_webp_pipe
--enable-demuxer=matroska
--enable-demuxer=m4v
--enable-demuxer=mp3
--enable-demuxer=ogg
--enable-demuxer=flac
--enable-demuxer=wav
--enable-demuxer=ac3
--enable-demuxer=g722
--enable-demuxer=pcm_mulaw
--enable-demuxer=pcm_alaw
--enable-demuxer=pcm_s16be
--enable-demuxer=pcm_s16le
--enable-demuxer=h263
--enable-demuxer=h264
--enable-demuxer=hevc
--enable-parser=h263
--enable-parser=h264
--enable-parser=hevc
--enable-parser=mpeg4video
--enable-parser=vp8
--enable-parser=vp9
--enable-parser=opus
--enable-encoder=adpcm_g722
--enable-decoder=adpcm_g722
--enable-encoder=rawvideo
--enable-decoder=rawvideo
--enable-encoder=libx264
--enable-decoder=h264
--enable-encoder=pcm_alaw
--enable-decoder=pcm_alaw
--enable-encoder=pcm_mulaw
--enable-decoder=pcm_mulaw
--enable-encoder=mpeg4
--enable-decoder=mpeg4
--enable-encoder=libvpx_vp8
--enable-decoder=vp8
--enable-decoder=vp9
--enable-encoder=h263
--enable-encoder=h263p
--enable-decoder=h263
--enable-encoder=mjpeg
--enable-decoder=mjpeg
--enable-decoder=mjpegb
--enable-libspeex
--enable-libopus
--enable-libvpx
--enable-libx264
--enable-encoder=libspeex
--enable-decoder=libspeex
--enable-encoder=libopus
--enable-decoder=libopus
--enable-decoder=flac
--enable-decoder=vorbis
--enable-decoder=aac
--enable-decoder=ac3
--enable-decoder=eac3
--enable-decoder=mp3
--enable-decoder=pcm_u24be
--enable-decoder=pcm_u24le
--enable-decoder=pcm_u32be
--enable-decoder=pcm_u32le
--enable-decoder=pcm_u8
--enable-decoder=pcm_f16le
--enable-decoder=pcm_f24le
--enable-decoder=pcm_f32be
--enable-decoder=pcm_f32le
--enable-decoder=pcm_f64be
--enable-decoder=pcm_f64le
--enable-decoder=pcm_s16be
--enable-decoder=pcm_s16be_planar
--enable-decoder=pcm_s16le
--enable-decoder=pcm_s16le_planar
--enable-decoder=pcm_s24be
--enable-decoder=pcm_s24le
--enable-decoder=pcm_s24le_planar
--enable-decoder=pcm_s32be
--enable-decoder=pcm_s32le
--enable-decoder=pcm_s32le_planar
--enable-decoder=pcm_s64be
--enable-decoder=pcm_s64le
--enable-decoder=pcm_s8
--enable-decoder=pcm_s8_planar
--enable-decoder=pcm_u16be
--enable-decoder=pcm_u16le
--enable-encoder=gif
--enable-decoder=gif
--enable-encoder=jpegls
--enable-decoder=jpegls
--enable-encoder=ljpeg
--enable-decoder=jpeg2000
--enable-encoder=png
--enable-decoder=png
--enable-encoder=bmp
--enable-decoder=bmp
--enable-encoder=tiff
--enable-decoder=tiff
--enable-filter=scale
--enable-filter=overlay
--enable-filter=amix
--enable-filter=amerge
--enable-filter=aresample
--enable-filter=format
--enable-filter=aformat
--enable-filter=fps
--enable-filter=transpose
--enable-filter=pad

View File

@ -0,0 +1,18 @@
--enable-pic
--target-os=linux
--enable-indev=v4l2
--enable-indev=xcbgrab
--enable-vdpau
--enable-hwaccel=h264_vdpau
--enable-hwaccel=mpeg4_vdpau
--enable-vaapi
--enable-hwaccel=h264_vaapi
--enable-hwaccel=mpeg4_vaapi
--enable-hwaccel=h263_vaapi
--enable-hwaccel=vp8_vaapi
--enable-hwaccel=mjpeg_vaapi
--enable-hwaccel=hevc_vaapi
--enable-encoder=h264_vaapi
--enable-encoder=vp8_vaapi
--enable-encoder=mjpeg_vaapi
--enable-encoder=hevc_vaapi

View File

@ -0,0 +1,10 @@
--enable-cuvid
--enable-ffnvcodec
--enable-nvdec
--enable-nvenc
--enable-hwaccel=h264_nvdec
--enable-hwaccel=hevc_nvdec
--enable-hwaccel=vp8_nvdec
--enable-hwaccel=mjpeg_nvdec
--enable-encoder=h264_nvenc
--enable-encoder=hevc_nvenc

View File

@ -0,0 +1,5 @@
remove-mjpeg-log.patch
change-RTCP-ratio.patch
rtp_ext_abs_send_time.patch
libopusdec-enable-FEC.patch
libopusenc-enable-FEC.patch

View File

@ -0,0 +1,20 @@
0001-rfc6544.patch
0002-rfc2466.patch
0003-add-tcp-keep-alive.patch
0004-multiple_listeners.patch
0005-fix_ebusy_turn.patch
0006-ignore_ipv6_on_transport_check.patch
0007-upnp-srflx-nat-assisted-cand.patch
0008-fix_ioqueue_ipv6_sendto.patch
0009-add-config-site.patch
0010-fix-tcp-death-detection.patch
0011-fix-turn-shutdown-crash.patch
0012-ignore-down-interfaces.patch
0013-ignore-addresses-for-RFC7335.patch
0014-fix-socket-leak.patch
0015-fix-socktype-and-duplicate-checking.patch
0016-use-larger-Ta-interval.patch
0017-auto-register-thread.patch
0018-fix-ioqueue-lock-acquire.patch
0019-resort-check-list-after-adding-prflx.patch
0020-avoid-immediate-nominating-triggered-check.patch

View File

@ -0,0 +1,123 @@
{ src
, version
, jami-meta
, stdenv
, lib
, autoreconfHook
, pkg-config
, perl # for pod2man
, ffmpeg
, pjsip
, alsa-lib
, asio
, dbus
, dbus_cplusplus
, fmt
, gmp
, libarchive
, libgit2
, libnatpmp
, secp256k1
, openssl
, opendht
, speex
, webrtc-audio-processing
, jsoncpp
, gnutls
, zlib
, libyamlcpp
, libpulseaudio
, jack
, udev
, libupnp
, msgpack
, restinio
, http-parser
}:
let
readLinesToList = with builtins; file: filter (s: isString s && stringLength s > 0) (split "\n" (readFile file));
ffmpeg-jami = ffmpeg.overrideAttrs (old:
let
patch-src = src + "/daemon/contrib/src/ffmpeg/";
in
{
patches = old.patches ++ (map (x: patch-src + x) (readLinesToList ./config/ffmpeg_patches));
configureFlags = old.configureFlags
++ (readLinesToList ./config/ffmpeg_args_common)
++ lib.optionals stdenv.isLinux (readLinesToList ./config/ffmpeg_args_linux)
++ lib.optionals (stdenv.isx86_32 || stdenv.isx86_64) (readLinesToList ./config/ffmpeg_args_x86);
outputs = [ "out" "doc" ];
});
pjsip-jami = pjsip.overrideAttrs (old:
let
patch-src = src + "/daemon/contrib/src/pjproject/";
in
{
patches = old.patches ++ (map (x: patch-src + x) (readLinesToList ./config/pjsip_patches));
});
opendht-jami = opendht.override {
enableProxyServerAndClient = true;
enablePushNotifications = true;
};
in stdenv.mkDerivation {
pname = "jami-daemon";
inherit src version;
sourceRoot = "source/daemon";
nativeBuildInputs = [
autoreconfHook
pkg-config
perl
];
buildInputs = [
alsa-lib
asio
dbus
dbus_cplusplus
fmt
ffmpeg-jami
gmp
gnutls
libarchive
libgit2
libnatpmp
opendht-jami
pjsip-jami
secp256k1
openssl
speex
webrtc-audio-processing
zlib
libyamlcpp
jsoncpp
libpulseaudio
jack
opendht
libupnp
udev
msgpack
restinio
http-parser
];
doCheck = false; # The tests fail to compile due to missing headers.
enableParallelBuilding = true;
passthru = {
updateScript = ./update.sh;
ffmpeg = ffmpeg-jami;
pjsip = pjsip-jami;
opendht = opendht-jami;
};
meta = jami-meta // {
description = "The daemon" + jami-meta.description;
};
}

View File

@ -0,0 +1,41 @@
{ stdenv
, lib
, callPackage
, fetchzip
, jack
, udev
, libsForQt5
}:
rec {
version = "20211005.2.251ac7d";
src = fetchzip {
url = "https://dl.jami.net/release/tarballs/jami_${version}.tar.gz";
sha256 = "12ppbwhnk5zajb73szd04sz80bp17q577bkb9j8p45apvq201db3";
stripRoot = false;
extraPostFetch = ''
cd $out
mv ring-project/* ./
rm -r ring-project.rst ring-project client-android client-ios client-macosx client-uwp
rm daemon/contrib/tarballs/*
'';
};
jami-meta = with lib; {
homepage = "https://jami.net/";
description = " for Jami, the free and universal communication platform that respects the privacy and freedoms of its users";
license = licenses.gpl3Plus;
platforms = platforms.linux;
maintainers = [ maintainers.linsui ];
};
jami-daemon = callPackage ./daemon.nix { inherit version src udev jack jami-meta; };
jami-libclient = libsForQt5.callPackage ./libclient.nix { inherit version src jami-meta; };
jami-client-gnome = libsForQt5.callPackage ./client-gnome.nix { inherit version src jami-meta; };
jami-client-qt = libsForQt5.callPackage ./client-qt.nix { inherit version src jami-meta; };
}

View File

@ -0,0 +1,13 @@
diff --git i/CMakeLists.txt w/CMakeLists.txt
index 0ee77dba..767e19df 100644
--- i/CMakeLists.txt
+++ w/CMakeLists.txt
@@ -635,7 +635,7 @@ if(ENABLE_SHARED)
)
endif()
-SET(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include)
+SET(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_FULL_INCLUDEDIR})
INSTALL( FILES ${libringclient_LIB_HDRS} ${libringclient_extra_LIB_HDRS}
DESTINATION ${INCLUDE_INSTALL_DIR}/libringclient

View File

@ -0,0 +1,48 @@
{ version
, src
, jami-meta
, stdenv
, lib
, pkg-config
, cmake
, qtbase
, jami-daemon
}:
stdenv.mkDerivation {
pname = "jami-libclient";
inherit version src;
sourceRoot = "source/lrc";
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
jami-daemon
];
patches = [
# Fix path to include dir when using split outputs
./libclient-include-path.patch
];
propagatedBuildInputs = [
qtbase
];
outputs = [ "out" "dev" ];
cmakeFlags = [
"-DRING_BUILD_DIR=${jami-daemon}/include"
"-DRING_XML_INTERFACES_DIR=${jami-daemon}/share/dbus-1/interfaces"
];
dontWrapQtApps = true;
meta = jami-meta // {
description = "The client library" + jami-meta.description;
license = lib.licenses.lgpl21Plus;
};
}

View File

@ -0,0 +1,42 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p coreutils curl gnused common-updater-scripts
set -e
jami_dir="$( dirname "${BASH_SOURCE[0]}" )"
# Update src version and hash
version=$(curl -s 'https://dl.jami.net/release/tarballs/?C=M;O=D' | sed -n -E 's/^.*jami_([0-9.a-f]+)\.tar\.gz.*$/\1/p' | head -n 1)
update-source-version jami-libclient "$version" --file=pkgs/applications/networking/instant-messengers/jami/default.nix
src=$(nix-build --no-out-link -A jami-libclient.src)
config_dir="$jami_dir/config"
mkdir -p $config_dir
ffmpeg_rules="${src}/daemon/contrib/src/ffmpeg/rules.mak"
# Update FFmpeg patches
ffmpeg_patches=$(sed -n '/.sum-ffmpeg:/,/HAVE_IOS/p' ${ffmpeg_rules} | sed -n -E 's/.*ffmpeg\/(.*patch).*/\1/p')
echo -e "Patches for FFmpeg:\n${ffmpeg_patches}\n"
echo "${ffmpeg_patches}" > "$config_dir/ffmpeg_patches"
# Update FFmpeg args
ffmpeg_args_common=$(sed -n '/#disable everything/,/#platform specific options/p' ${ffmpeg_rules} | sed -n -E 's/.*(--[0-9a-z=_-]+).*/\1/p')
echo -e "Common args for FFmpeg:\n${ffmpeg_args_common}\n"
echo "${ffmpeg_args_common}" > "$config_dir/ffmpeg_args_common"
ffmpeg_args_linux1=$(sed -n '/ifdef HAVE_LINUX/,/ifdef HAVE_ANDROID/p' ${ffmpeg_rules} | sed -n -E 's/.*(--[0-9a-z=_-]+).*/\1/p')
ffmpeg_args_linux2=$(sed -n '/# Desktop Linux/,/i386 x86_64/p' ${ffmpeg_rules} | sed -n -E 's/.*(--[0-9a-z=_-]+).*/\1/p')
echo -e "Linux args for FFmpeg:\n${ffmpeg_args_linux1}\n${ffmpeg_args_linux2}\n"
echo "${ffmpeg_args_linux1}" > "$config_dir/ffmpeg_args_linux"
echo "${ffmpeg_args_linux2}" >> "$config_dir/ffmpeg_args_linux"
ffmpeg_args_x86=$(sed -n '/i386 x86_64/,/# End Desktop Linux:/p' ${ffmpeg_rules} | sed -n -E 's/.*(--[0-9a-z=_-]+).*/\1/p')
echo -e "x86 args for FFmpeg:\n${ffmpeg_args_x86}\n"
echo "${ffmpeg_args_x86}" > "$config_dir/ffmpeg_args_x86"
# Update pjsip patches
pjsip_patches=$(sed -n '/UNPACK/,/HAVE_ANDROID/p' ${src}/daemon/contrib/src/pjproject/rules.mak | sed -n -E 's/.*pjproject\/(00.*patch).*/\1/p')
echo -e "Patches for pjsip:\n${pjsip_patches}\n"
echo "${pjsip_patches}" > "$config_dir/pjsip_patches"

View File

@ -33173,6 +33173,13 @@ with pkgs;
btcdeb = callPackage ../applications/blockchains/btcdeb { };
inherit (callPackage ../applications/networking/instant-messengers/jami {
# TODO: remove once `udev` is `systemdMinimal` everywhere.
udev = systemdMinimal;
jack = libjack2;
})
jami-daemon jami-libclient jami-client-gnome jami-client-qt;
jitsi-meet-electron = callPackage ../applications/networking/instant-messengers/jitsi-meet-electron {
electron = electron_13;
};