push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,92 @@
{
lib,
fetchurl,
fetchpatch,
stdenv,
gnutls,
glib,
pkg-config,
check,
libotr,
python3,
enableLibPurple ? false,
pidgin ? null,
enablePam ? false,
pam ? null,
}:
stdenv.mkDerivation rec {
pname = "bitlbee";
version = "3.6";
src = fetchurl {
url = "mirror://bitlbee/src/bitlbee-${version}.tar.gz";
sha256 = "0zhhcbcr59sx9h4maf8zamzv2waya7sbsl7w74gbyilvy93dw5cz";
};
nativeBuildInputs = [ pkg-config ] ++ lib.optional doCheck check;
buildInputs = [
gnutls
libotr
python3
]
++ lib.optional enableLibPurple pidgin
++ lib.optional enablePam pam;
propagatedBuildInputs = [ glib ];
configureFlags = [
"--otr=1"
"--ssl=gnutls"
"--pidfile=/var/lib/bitlbee/bitlbee.pid"
]
++ lib.optional enableLibPurple "--purple=1"
++ lib.optional enablePam "--pam=1";
patches = [
# This should be dropped once the issue is fixed upstream.
(fetchpatch {
url = "https://github.com/bitlbee/bitlbee/commit/6ff651b3ec93e5fd74f80766d5e9714d963137bc.diff";
sha256 = "144dpm4kq7c268fpww1q3n88ayg068n73fbabr5arh1zryw48qfv";
})
];
installTargets = [
"install"
"install-dev"
];
doCheck = !enableLibPurple; # Checks fail with libpurple for some reason
checkPhase = ''
# check flags set VERBOSE=y which breaks the build due overriding a command
make check
'';
enableParallelBuilding = true;
meta = with lib; {
description = "IRC instant messaging gateway";
mainProgram = "bitlbee";
longDescription = ''
BitlBee brings IM (instant messaging) to IRC clients. It's a
great solution for people who have an IRC client running all the
time and don't want to run an additional MSN/AIM/whatever
client.
BitlBee currently supports the following IM networks/protocols:
XMPP/Jabber (including Google Talk), MSN Messenger, Yahoo!
Messenger, AIM and ICQ.
'';
homepage = "https://www.bitlbee.org/";
license = licenses.gpl2Plus;
maintainers = with maintainers; [
lassulus
pSub
];
platforms = platforms.gnu ++ platforms.linux; # arbitrary choice
};
}

View File

@@ -0,0 +1,23 @@
{
lib,
runCommandLocal,
bitlbee,
}:
plugins:
runCommandLocal "bitlbee-plugins"
{
inherit plugins;
buildInputs = [
bitlbee
plugins
];
}
''
mkdir -p $out/lib/bitlbee
for plugin in $plugins; do
for thing in $(ls $plugin/lib/bitlbee); do
ln -s $plugin/lib/bitlbee/$thing $out/lib/bitlbee/
done
done
''

View File

@@ -0,0 +1,126 @@
{
lib,
stdenv,
fetchFromGitHub,
vala,
ninja,
wrapGAppsHook4,
pkg-config,
gettext,
gobject-introspection,
glib,
gdk-pixbuf,
gtk4,
glib-networking,
libadwaita,
libcanberra,
libnotify,
libsoup_3,
libgee,
libomemo-c,
libgcrypt,
meson,
sqlite,
gpgme,
qrencode,
icu,
srtp,
libnice,
gnutls,
gstreamer,
gst-plugins-base,
gst-plugins-good,
gst-plugins-bad,
gst-vaapi,
webrtc-audio-processing,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "dino";
version = "0.5.0";
src = fetchFromGitHub {
owner = "dino";
repo = "dino";
tag = "v${finalAttrs.version}";
hash = "sha256-Y3MGKpfhjmqnIvmt4mXnkmpjF/riXPDXyUiSrsceY6o=";
};
postPatch = ''
echo ${finalAttrs.version} > VERSION
'';
nativeBuildInputs = [
vala
meson
ninja
pkg-config
wrapGAppsHook4
gettext
gobject-introspection
];
buildInputs = [
qrencode
glib
glib-networking # required for TLS support
libadwaita
libgee
sqlite
gdk-pixbuf
gtk4
libnotify
gpgme
libgcrypt
libsoup_3
icu
libcanberra
libomemo-c
srtp
libnice
gnutls
gstreamer
gst-plugins-base
gst-plugins-good # contains rtpbin, required for VP9
gst-plugins-bad # required for H264, MSDK
gst-vaapi # required for VAAPI
webrtc-audio-processing
];
doCheck = true;
mesonFlags = [
"-Dplugin-notification-sound=enabled"
"-Dplugin-rtp-h264=enabled"
"-Dplugin-rtp-msdk=enabled"
"-Dplugin-rtp-vaapi=enabled"
"-Dplugin-rtp-vp9=enabled"
];
# Undefined symbols for architecture arm64: "_gpg_strerror"
NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-lgpg-error";
# Dino looks for plugins with a .so filename extension, even on macOS where
# .dylib is appropriate, and despite the fact that it builds said plugins with
# that as their filename extension
#
# Therefore, on macOS rename all of the plugins to use correct names that Dino
# will load
#
# See https://github.com/dino/dino/wiki/macOS
postFixup = lib.optionalString (stdenv.hostPlatform.isDarwin) ''
cd "$out/lib/dino/plugins/"
for f in *.dylib; do
mv "$f" "$(basename "$f" .dylib).so"
done
'';
meta = with lib; {
description = "Modern Jabber/XMPP Client using GTK/Vala";
mainProgram = "dino";
homepage = "https://github.com/dino/dino";
license = licenses.gpl3Plus;
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ qyliss ];
};
})

View File

@@ -0,0 +1,62 @@
{
lib,
stdenv,
fetchFromGitHub,
wrapQtAppsHook,
cmake,
pkg-config,
qtbase,
qtwebengine,
qtwayland,
pipewire,
kdePackages,
nix-update-script,
}:
stdenv.mkDerivation rec {
pname = "discord-screenaudio";
version = "1.10.1";
src = fetchFromGitHub {
owner = "maltejur";
repo = "discord-screenaudio";
rev = "v${version}";
hash = "sha256-+F+XRBQn4AVDVARdM2XtBDE7c6tMPZTR3cntDL8aenw=";
fetchSubmodules = true;
};
nativeBuildInputs = [
wrapQtAppsHook
cmake
pkg-config
];
buildInputs = [
qtbase
qtwebengine
qtwayland
pipewire
kdePackages.knotifications
kdePackages.kxmlgui
kdePackages.kglobalaccel
];
preConfigure = ''
# version.cmake either uses git tags or a version.txt file to get app version.
# Since cmake can't access git tags, write the version to a version.txt ourselves.
echo "${version}" > version.txt
'';
passthru.updateScript = nix-update-script { };
meta = {
description = "Custom discord client that supports streaming with audio on Linux";
mainProgram = "discord-screenaudio";
homepage = "https://github.com/maltejur/discord-screenaudio";
downloadPage = "https://github.com/maltejur/discord-screenaudio/releases";
changelog = "https://github.com/maltejur/discord-screenaudio/releases/tag/v${version}";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ huantian ];
platforms = lib.platforms.linux;
};
}

View File

@@ -0,0 +1,136 @@
{
pname,
version,
src,
meta,
stdenv,
binaryName,
desktopName,
self,
lib,
undmg,
makeWrapper,
writeScript,
python3,
runCommand,
branch,
withOpenASAR ? false,
openasar,
withVencord ? false,
vencord,
withEquicord ? false,
equicord,
withMoonlight ? false,
moonlight,
commandLineArgs ? "",
}:
let
discordMods = [
withVencord
withEquicord
withMoonlight
];
enabledDiscordModsCount = builtins.length (lib.filter (x: x) discordMods);
disableBreakingUpdates =
runCommand "disable-breaking-updates.py"
{
pythonInterpreter = "${python3.interpreter}";
configDirName = lib.toLower binaryName;
meta.mainProgram = "disable-breaking-updates.py";
}
''
mkdir -p $out/bin
cp ${./disable-breaking-updates.py} $out/bin/disable-breaking-updates.py
substituteAllInPlace $out/bin/disable-breaking-updates.py
chmod +x $out/bin/disable-breaking-updates.py
'';
in
assert lib.assertMsg (
enabledDiscordModsCount <= 1
) "discord: Only one of Vencord, Equicord or Moonlight can be enabled at the same time";
stdenv.mkDerivation {
inherit
pname
version
src
meta
;
nativeBuildInputs = [
undmg
makeWrapper
];
sourceRoot = ".";
installPhase = ''
runHook preInstall
mkdir -p $out/Applications
cp -r "${desktopName}.app" $out/Applications
# wrap executable to $out/bin
mkdir -p $out/bin
makeWrapper "$out/Applications/${desktopName}.app/Contents/MacOS/${binaryName}" "$out/bin/${binaryName}" \
--run ${lib.getExe disableBreakingUpdates} \
--add-flags ${lib.escapeShellArg commandLineArgs}
runHook postInstall
'';
postInstall =
lib.strings.optionalString withOpenASAR ''
cp -f ${openasar} $out/Applications/${desktopName}.app/Contents/Resources/app.asar
''
+ lib.strings.optionalString withVencord ''
mv $out/Applications/${desktopName}.app/Contents/Resources/app.asar $out/Applications/${desktopName}.app/Contents/Resources/_app.asar
mkdir $out/Applications/${desktopName}.app/Contents/Resources/app.asar
echo '{"name":"discord","main":"index.js"}' > $out/Applications/${desktopName}.app/Contents/Resources/app.asar/package.json
echo 'require("${vencord}/patcher.js")' > $out/Applications/${desktopName}.app/Contents/Resources/app.asar/index.js
''
+ lib.strings.optionalString withEquicord ''
mv $out/Applications/${desktopName}.app/Contents/Resources/app.asar $out/Applications/${desktopName}.app/Contents/Resources/_app.asar
mkdir $out/Applications/${desktopName}.app/Contents/Resources/app.asar
echo '{"name":"discord","main":"index.js"}' > $out/Applications/${desktopName}.app/Contents/Resources/app.asar/package.json
echo 'require("${equicord}/patcher.js")' > $out/Applications/${desktopName}.app/Contents/Resources/app.asar/index.js
''
+ lib.strings.optionalString withMoonlight ''
mv $out/Applications/${desktopName}.app/Contents/Resources/app.asar $out/Applications/${desktopName}.app/Contents/Resources/_app.asar
mkdir $out/Applications/${desktopName}.app/Contents/Resources/app.asar
echo '{"name":"discord","main":"injector.js","private": true}' > $out/Applications/${desktopName}.app/Contents/Resources/app.asar/package.json
echo 'require("${moonlight}/injector.js").inject(require("path").join(__dirname, "../_app.asar"));' > $out/Applications/${desktopName}.app/Contents/Resources/app.asar/injector.js
'';
passthru = {
# make it possible to run disableBreakingUpdates standalone
inherit disableBreakingUpdates;
updateScript = writeScript "discord-update-script" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl gnugrep common-updater-scripts
set -x
set -eou pipefail;
url=$(curl -sI -o /dev/null -w '%header{location}' "https://discord.com/api/download/${branch}?platform=osx&format=dmg")
version=$(echo $url | grep -oP '/\K(\d+\.){2}\d+')
update-source-version ${
lib.optionalString (!stdenv.buildPlatform.isDarwin) "pkgsCross.aarch64-darwin."
}${pname} "$version" --file=./pkgs/applications/networking/instant-messengers/discord/default.nix --version-key=${branch}
'';
tests = {
withVencord = self.override {
withVencord = true;
};
withEquicord = self.override {
withEquicord = true;
};
withMoonlight = self.override {
withMoonlight = true;
};
withOpenASAR = self.override {
withOpenASAR = true;
};
};
};
}

View File

@@ -0,0 +1,163 @@
{
callPackage,
fetchurl,
lib,
stdenv,
discord,
discord-ptb,
discord-canary,
discord-development,
}:
let
variants = rec {
x86_64-linux = {
discord = rec {
version = "0.0.111";
src = fetchurl {
url = "https://stable.dl2.discordapp.net/apps/linux/${version}/discord-${version}.tar.gz";
hash = "sha256-o4U6i223Agtbt1N9v0GO/Ivx68OQcX/N3mHXUX2gruA=";
};
branch = "stable";
binaryName = desktopName;
desktopName = "Discord";
self = discord;
};
discord-ptb = rec {
version = "0.0.161";
src = fetchurl {
url = "https://ptb.dl2.discordapp.net/apps/linux/${version}/discord-ptb-${version}.tar.gz";
hash = "sha256-pDWOnj8tQK9runi/QzcvEFbNGCwAb/gISM9LrLoTzxM=";
};
branch = "ptb";
binaryName = "DiscordPTB";
desktopName = "Discord PTB";
self = discord-ptb;
};
discord-canary = rec {
version = "0.0.761";
src = fetchurl {
url = "https://canary.dl2.discordapp.net/apps/linux/${version}/discord-canary-${version}.tar.gz";
hash = "sha256-L3MIcrz/xj8zOb2QVXBrBCHGt4BdHhjwKpPZ4iClQYQ=";
};
branch = "canary";
binaryName = "DiscordCanary";
desktopName = "Discord Canary";
self = discord-canary;
};
discord-development = rec {
version = "0.0.89";
src = fetchurl {
url = "https://development.dl2.discordapp.net/apps/linux/${version}/discord-development-${version}.tar.gz";
hash = "sha256-ZMsBR0LAISrM3dib8fehW/eZGkwSCinQF60jJG76O7M=";
};
branch = "development";
binaryName = "DiscordDevelopment";
desktopName = "Discord Development";
self = discord-development;
};
};
x86_64-darwin = {
discord = rec {
version = "0.0.362";
src = fetchurl {
url = "https://stable.dl2.discordapp.net/apps/osx/${version}/Discord.dmg";
hash = "sha256-DHe0WwJOB3mm1HbQwEOJ9NWqxzhOBQynhjJXYSNvA/k=";
};
branch = "stable";
binaryName = desktopName;
desktopName = "Discord";
self = discord;
};
discord-ptb = rec {
version = "0.0.192";
src = fetchurl {
url = "https://ptb.dl2.discordapp.net/apps/osx/${version}/DiscordPTB.dmg";
hash = "sha256-AZ9enKJf6WZLELFLKrzeyAR/Q/pzD8SGvCPcInS8vsk=";
};
branch = "ptb";
binaryName = desktopName;
desktopName = "Discord PTB";
self = discord-ptb;
};
discord-canary = rec {
version = "0.0.867";
src = fetchurl {
url = "https://canary.dl2.discordapp.net/apps/osx/${version}/DiscordCanary.dmg";
hash = "sha256-67B2wZRZEOKutMPsrRlc96UZWShYLAgwOoF2/QzBgzE=";
};
branch = "canary";
binaryName = desktopName;
desktopName = "Discord Canary";
self = discord-canary;
};
discord-development = rec {
version = "0.0.100";
src = fetchurl {
url = "https://development.dl2.discordapp.net/apps/osx/${version}/DiscordDevelopment.dmg";
hash = "sha256-PknNHr9txxp3+nO7FgHH7n04qx6p6Jzbs92/Hcfh13Y=";
};
branch = "development";
binaryName = desktopName;
desktopName = "Discord Development";
self = discord-development;
};
};
aarch64-darwin = x86_64-darwin;
default = x86_64-linux; # Used for unsupported platforms, so we can return *something* there.
};
meta = {
description = "All-in-one cross-platform voice and text chat for gamers";
downloadPage = "https://discordapp.com/download";
homepage = "https://discordapp.com/";
license = lib.licenses.unfree;
mainProgram = "discord";
maintainers = with lib.maintainers; [
artturin
FlameFlag
infinidoge
jopejoe1
Scrumplex
];
platforms = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
};
package = if stdenv.hostPlatform.isLinux then ./linux.nix else ./darwin.nix;
in
lib.genAttrs [ "discord" "discord-ptb" "discord-canary" "discord-development" ] (
pname:
let
args = (variants.${stdenv.hostPlatform.system} or variants.default).${pname};
in
callPackage package (
args
// {
inherit pname;
meta = meta // {
mainProgram = args.binaryName;
};
}
)
)

View File

@@ -0,0 +1,56 @@
#!@pythonInterpreter@
# slightly tweaked from the script created by @lionirdeadman
# https://github.com/flathub/com.discordapp.Discord/blob/master/disable-breaking-updates.py
"""
Disable breaking updates which will prompt users to download a deb or tar file
and lock them out of Discord making the program unusable.
This will dramatically improve the experience :
1) The maintainer doesn't need to be worried at all times of an update which will break Discord.
2) People will not be locked out of the program while the maintainer runs to update it.
"""
import json
import os
import sys
from pathlib import Path
config_home = {
"darwin": os.path.join(os.path.expanduser("~"), "Library", "Application Support"),
"linux": os.environ.get("XDG_CONFIG_HOME") or os.path.join(os.path.expanduser("~"), ".config")
}.get(sys.platform, None)
if config_home is None:
print("[Nix] Unsupported operating system.")
sys.exit(1)
config_dir_name = "@configDirName@".replace(" ", "") if sys.platform == "darwin" else "@configDirName@"
settings_path = Path(f"{config_home}/{config_dir_name}/settings.json")
settings_path_temp = Path(f"{config_home}/{config_dir_name}/settings.json.tmp")
if os.path.exists(settings_path):
with settings_path.open(encoding="utf-8") as settings_file:
try:
settings = json.load(settings_file)
except json.JSONDecodeError:
print("[Nix] settings.json is malformed, letting Discord fix itself")
sys.exit(0)
else:
settings = {}
if settings.get("SKIP_HOST_UPDATE"):
print("[Nix] Disabling updates already done")
else:
skip_host_update = {"SKIP_HOST_UPDATE": True}
settings.update(skip_host_update)
os.makedirs(os.path.dirname(settings_path), exist_ok=True)
with settings_path_temp.open("w", encoding="utf-8") as settings_file_temp:
json.dump(settings, settings_file_temp, indent=2)
settings_path_temp.rename(settings_path)
print("[Nix] Disabled updates")

View File

@@ -0,0 +1,280 @@
{
pname,
version,
src,
meta,
binaryName,
desktopName,
self,
autoPatchelfHook,
makeDesktopItem,
lib,
stdenv,
wrapGAppsHook3,
makeShellWrapper,
alsa-lib,
at-spi2-atk,
at-spi2-core,
atk,
cairo,
cups,
dbus,
expat,
fontconfig,
freetype,
gdk-pixbuf,
glib,
gtk3,
libcxx,
libdrm,
libglvnd,
libnotify,
libpulseaudio,
libuuid,
libva,
libX11,
libXScrnSaver,
libXcomposite,
libXcursor,
libXdamage,
libXext,
libXfixes,
libXi,
libXrandr,
libXrender,
libXtst,
libxcb,
libxshmfence,
libgbm,
nspr,
nss,
pango,
systemdLibs,
libappindicator-gtk3,
libdbusmenu,
writeScript,
pipewire,
python3,
runCommand,
libunity,
speechd-minimal,
wayland,
branch,
withOpenASAR ? false,
openasar,
withVencord ? false,
vencord,
withEquicord ? false,
equicord,
withMoonlight ? false,
moonlight,
withTTS ? true,
enableAutoscroll ? false,
# Disabling this would normally break Discord.
# The intended use-case for this is when SKIP_HOST_UPDATE is enabled via other means,
# for example if a settings.json is linked declaratively (e.g., with home-manager).
disableUpdates ? true,
commandLineArgs ? "",
}:
let
discordMods = [
withVencord
withEquicord
withMoonlight
];
enabledDiscordModsCount = builtins.length (lib.filter (x: x) discordMods);
disableBreakingUpdates =
runCommand "disable-breaking-updates.py"
{
pythonInterpreter = "${python3.interpreter}";
configDirName = lib.toLower binaryName;
meta.mainProgram = "disable-breaking-updates.py";
}
''
mkdir -p $out/bin
cp ${./disable-breaking-updates.py} $out/bin/disable-breaking-updates.py
substituteAllInPlace $out/bin/disable-breaking-updates.py
chmod +x $out/bin/disable-breaking-updates.py
'';
in
assert lib.assertMsg (
enabledDiscordModsCount <= 1
) "discord: Only one of Vencord, Equicord or Moonlight can be enabled at the same time";
stdenv.mkDerivation (finalAttrs: {
inherit
pname
version
src
meta
;
nativeBuildInputs = [
alsa-lib
autoPatchelfHook
cups
libdrm
libuuid
libXdamage
libX11
libXScrnSaver
libXtst
libxcb
libxshmfence
libgbm
nss
wrapGAppsHook3
makeShellWrapper
];
dontWrapGApps = true;
libPath = lib.makeLibraryPath (
[
libcxx
systemdLibs
libpulseaudio
libdrm
libgbm
stdenv.cc.cc
alsa-lib
atk
at-spi2-atk
at-spi2-core
cairo
cups
dbus
expat
fontconfig
freetype
gdk-pixbuf
glib
gtk3
libglvnd
libnotify
libX11
libXcomposite
libunity
libuuid
libva
libXcursor
libXdamage
libXext
libXfixes
libXi
libXrandr
libXrender
libXtst
nspr
libxcb
pango
pipewire
libXScrnSaver
libappindicator-gtk3
libdbusmenu
wayland
]
++ lib.optionals withTTS [ speechd-minimal ]
);
installPhase = ''
runHook preInstall
mkdir -p $out/{bin,opt/${binaryName},share/pixmaps,share/icons/hicolor/256x256/apps}
mv * $out/opt/${binaryName}
chmod +x $out/opt/${binaryName}/${binaryName}
patchelf --set-interpreter ${stdenv.cc.bintools.dynamicLinker} \
$out/opt/${binaryName}/${binaryName}
wrapProgramShell $out/opt/${binaryName}/${binaryName} \
"''${gappsWrapperArgs[@]}" \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \
${lib.strings.optionalString withTTS ''
--run 'if [[ "''${NIXOS_SPEECH:-default}" != "False" ]]; then NIXOS_SPEECH=True; else unset NIXOS_SPEECH; fi' \
--add-flags "\''${NIXOS_SPEECH:+--enable-speech-dispatcher}" \
''} \
${lib.strings.optionalString enableAutoscroll "--add-flags \"--enable-blink-features=MiddleClickAutoscroll\""} \
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
--prefix LD_LIBRARY_PATH : ${finalAttrs.libPath}:$out/opt/${binaryName} \
${lib.strings.optionalString disableUpdates "--run ${lib.getExe disableBreakingUpdates}"} \
--add-flags ${lib.escapeShellArg commandLineArgs}
ln -s $out/opt/${binaryName}/${binaryName} $out/bin/
# Without || true the install would fail on case-insensitive filesystems
ln -s $out/opt/${binaryName}/${binaryName} $out/bin/${lib.strings.toLower binaryName} || true
ln -s $out/opt/${binaryName}/discord.png $out/share/pixmaps/${pname}.png
ln -s $out/opt/${binaryName}/discord.png $out/share/icons/hicolor/256x256/apps/${pname}.png
ln -s "$desktopItem/share/applications" $out/share/
runHook postInstall
'';
postInstall =
lib.strings.optionalString withOpenASAR ''
cp -f ${openasar} $out/opt/${binaryName}/resources/app.asar
''
+ lib.strings.optionalString withVencord ''
mv $out/opt/${binaryName}/resources/app.asar $out/opt/${binaryName}/resources/_app.asar
mkdir $out/opt/${binaryName}/resources/app.asar
echo '{"name":"discord","main":"index.js"}' > $out/opt/${binaryName}/resources/app.asar/package.json
echo 'require("${vencord}/patcher.js")' > $out/opt/${binaryName}/resources/app.asar/index.js
''
+ lib.strings.optionalString withEquicord ''
mv $out/opt/${binaryName}/resources/app.asar $out/opt/${binaryName}/resources/_app.asar
mkdir $out/opt/${binaryName}/resources/app.asar
echo '{"name":"discord","main":"index.js"}' > $out/opt/${binaryName}/resources/app.asar/package.json
echo 'require("${equicord}/desktop/patcher.js")' > $out/opt/${binaryName}/resources/app.asar/index.js
''
+ lib.strings.optionalString withMoonlight ''
mv $out/opt/${binaryName}/resources/app.asar $out/opt/${binaryName}/resources/_app.asar
mkdir $out/opt/${binaryName}/resources/app
echo '{"name":"discord","main":"injector.js","private": true}' > $out/opt/${binaryName}/resources/app/package.json
echo 'require("${moonlight}/injector.js").inject(require("path").join(__dirname, "../_app.asar"));' > $out/opt/${binaryName}/resources/app/injector.js
'';
desktopItem = makeDesktopItem {
name = pname;
exec = binaryName;
icon = pname;
inherit desktopName;
genericName = meta.description;
categories = [
"Network"
"InstantMessaging"
];
mimeTypes = [ "x-scheme-handler/discord" ];
startupWMClass = "discord";
};
passthru = {
# make it possible to run disableBreakingUpdates standalone
inherit disableBreakingUpdates;
updateScript = writeScript "discord-update-script" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl gnugrep common-updater-scripts
set -eou pipefail;
url=$(curl -sI -o /dev/null -w '%header{location}' "https://discord.com/api/download/${branch}?platform=linux&format=tar.gz")
version=$(echo $url | grep -oP '/\K(\d+\.){2}\d+')
update-source-version ${pname} "$version" --file=./pkgs/applications/networking/instant-messengers/discord/default.nix --version-key=${branch}
'';
tests = {
withVencord = self.override {
withVencord = true;
};
withEquicord = self.override {
withEquicord = true;
};
withMoonlight = self.override {
withMoonlight = true;
};
withOpenASAR = self.override {
withOpenASAR = true;
};
};
};
})

View File

@@ -0,0 +1,49 @@
{
lib,
mkFranzDerivation,
fetchurl,
xorg,
stdenv,
}:
let
arch =
{
x86_64-linux = "amd64";
aarch64-linux = "arm64";
}
."${stdenv.hostPlatform.system}" or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
hash =
{
amd64-linux_hash = "sha256-84W40++U+5/kTI84vGEqAVb93TCgFPduBkhMQG0yDRo=";
arm64-linux_hash = "sha256-lOQW559aXXBIDuindVj8YBB8pzNAJPoTSJ70y1YnZQ4=";
}
."${arch}-linux_hash";
in
mkFranzDerivation rec {
pname = "ferdium";
name = "Ferdium";
version = "7.1.0";
src = fetchurl {
url = "https://github.com/ferdium/ferdium-app/releases/download/v${version}/Ferdium-linux-${version}-${arch}.deb";
inherit hash;
};
extraBuildInputs = [ xorg.libxshmfence ];
passthru = {
updateScript = ./update.sh;
};
meta = with lib; {
description = "All your services in one place built by the community";
homepage = "https://ferdium.org/";
license = licenses.asl20;
maintainers = with maintainers; [ magnouvean ];
platforms = [
"x86_64-linux"
"aarch64-linux"
];
hydraPlatforms = [ ];
};
}

View File

@@ -0,0 +1,12 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p git bash curl jq nix-update
set -xe
dirname="$(dirname "$0")"
latestTag=$(curl https://api.github.com/repos/ferdium/ferdium-app/releases/latest | jq -r ".tag_name")
latestVersion="$(expr $latestTag : 'v\(.*\)')"
nix-update --version "$latestVersion" --system aarch64-linux --override-filename "$dirname/default.nix" ferdium
nix-update --version skip --system x86_64-linux --override-filename "$dirname/default.nix" ferdium

View File

@@ -0,0 +1,24 @@
{
lib,
mkFranzDerivation,
fetchurl,
}:
mkFranzDerivation rec {
pname = "franz";
name = "Franz";
version = "5.11.0";
src = fetchurl {
url = "https://github.com/meetfranz/franz/releases/download/v${version}/franz_${version}_amd64.deb";
sha256 = "sha256-4+HeH9lY5/2fswSwzMPM1Idllj01zU7nmlLOMYfcSsU=";
};
meta = with lib; {
description = "Free messaging app that combines chat & messaging services into one application";
homepage = "https://meetfranz.com";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.free;
maintainers = [ ];
platforms = [ "x86_64-linux" ];
hydraPlatforms = [ ];
};
}

View File

@@ -0,0 +1,134 @@
{
stdenv,
lib,
makeWrapper,
wrapGAppsHook3,
autoPatchelfHook,
dpkg,
xorg,
atk,
glib,
pango,
gdk-pixbuf,
cairo,
freetype,
fontconfig,
gtk3,
dbus,
nss,
nspr,
alsa-lib,
cups,
expat,
udev,
libnotify,
xdg-utils,
libgbm,
libglvnd,
libappindicator-gtk3,
}:
# Helper function for building a derivation for Franz and forks.
{
pname,
name,
version,
src,
meta,
extraBuildInputs ? [ ],
...
}@args:
let
cleanedArgs = removeAttrs args [
"pname"
"name"
"version"
"src"
"meta"
"extraBuildInputs"
];
in
stdenv.mkDerivation (
rec {
inherit
pname
version
src
meta
;
# Don't remove runtime deps.
dontPatchELF = true;
nativeBuildInputs = [
autoPatchelfHook
makeWrapper
wrapGAppsHook3
dpkg
];
buildInputs =
extraBuildInputs
++ (with xorg; [
libXi
libXcursor
libXdamage
libXrandr
libXcomposite
libXext
libXfixes
libXrender
libX11
libXtst
libXScrnSaver
])
++ [
libgbm
gtk3
atk
glib
pango
gdk-pixbuf
cairo
freetype
fontconfig
dbus
nss
nspr
alsa-lib
cups
expat
stdenv.cc.cc
];
runtimeDependencies = [
libglvnd
(lib.getLib stdenv.cc.cc)
(lib.getLib udev)
libnotify
libappindicator-gtk3
];
installPhase = ''
mkdir -p $out/bin
cp -r opt $out
ln -s $out/opt/${name}/${pname} $out/bin
# Provide desktop item and icon.
cp -r usr/share $out
substituteInPlace $out/share/applications/${pname}.desktop \
--replace /opt/${name}/${pname} ${pname}
'';
dontWrapGApps = true;
postFixup = ''
# make xdg-open overridable at runtime
wrapProgramShell $out/opt/${name}/${pname} \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath runtimeDependencies}" \
--suffix PATH : ${xdg-utils}/bin \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations,WebRTCPipeWireCapturer --enable-wayland-ime=true}}" \
"''${gappsWrapperArgs[@]}"
'';
}
// cleanedArgs
)

View File

@@ -0,0 +1,153 @@
{
lib,
fetchFromGitLab,
gettext,
wrapGAppsHook3,
# Native dependencies
python3,
gtk4,
gobject-introspection,
adwaita-icon-theme,
gtksourceview5,
glib-networking,
libadwaita,
# Test dependencies
xvfb-run,
dbus,
# Optional dependencies
enableJingle ? true,
farstream,
gstreamer,
gst-plugins-base,
gst-libav,
gst-plugins-good,
libnice,
enableE2E ? true,
enableSecrets ? true,
libsecret,
enableRST ? true,
docutils,
enableSpelling ? true,
gspell,
enableUPnP ? true,
gupnp-igd,
enableAppIndicator ? true,
libappindicator-gtk3,
enableSoundNotifications ? true,
gsound,
extraPythonPackages ? ps: [ ],
}:
python3.pkgs.buildPythonApplication rec {
pname = "gajim";
version = "2.3.6";
src = fetchFromGitLab {
domain = "dev.gajim.org";
owner = "gajim";
repo = "gajim";
tag = version;
hash = "sha256-Mvi69FI2zRefcCnLsurdVNMxYaqKsUCKgeFxOh6vg/o=";
};
format = "pyproject";
buildInputs = [
gtk4
adwaita-icon-theme
gtksourceview5
glib-networking
]
++ lib.optionals enableJingle [
farstream
gstreamer
gst-plugins-base
gst-libav
gst-plugins-good
libnice
]
++ lib.optional enableSecrets libsecret
++ lib.optional enableSpelling gspell
++ lib.optional enableUPnP gupnp-igd
++ lib.optional enableAppIndicator libappindicator-gtk3
++ lib.optional enableSoundNotifications gsound;
nativeBuildInputs = [
gettext
wrapGAppsHook3
gobject-introspection
libadwaita
];
dontWrapGApps = true;
preBuild = ''
python make.py build --dist unix
'';
postInstall = ''
python make.py install --dist unix --prefix=$out
'';
preFixup = ''
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
'';
propagatedBuildInputs =
with python3.pkgs;
[
nbxmpp
dbus-python
pillow
css-parser
precis-i18n
keyring
setuptools
packaging
gssapi
omemo-dr
qrcode
sqlalchemy
emoji
]
++ lib.optionals enableE2E [
pycrypto
python-gnupg
]
++ lib.optional enableRST docutils
++ extraPythonPackages python3.pkgs;
nativeCheckInputs = [
xvfb-run
dbus
];
checkPhase = ''
xvfb-run dbus-run-session \
--config-file=${dbus}/share/dbus-1/session.conf \
${python3.interpreter} -m unittest discover -s test/gui -v
${python3.interpreter} -m unittest discover -s test/common -v
'';
# test are broken in 1.7.3, 1.8.0
doCheck = false;
# necessary for wrapGAppsHook3
strictDeps = false;
meta = {
homepage = "http://gajim.org/";
description = "Jabber client written in PyGTK";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [
raskin
hlad
];
downloadPage = "http://gajim.org/download/";
platforms = lib.platforms.linux;
mainProgram = "gajim";
};
}

View File

@@ -0,0 +1,72 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchYarnDeps,
yarn,
fixup-yarn-lock,
nodejs,
olm,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "hydrogen-web";
version = "0.5.0";
src = fetchFromGitHub {
owner = "element-hq";
repo = "hydrogen-web";
rev = "v${finalAttrs.version}";
hash = "sha256-pXrmWPp4/MYIS1FHEGzAxGbh4OnTaiPudg+NauvA6Vc=";
};
offlineCache = fetchYarnDeps {
yarnLock = finalAttrs.src + "/yarn.lock";
hash = "sha256-j+BwlmL0ncaccy9qQbzb9GpDRC4KB9MwOR2ISx+vbLE=";
};
nativeBuildInputs = [
yarn
fixup-yarn-lock
nodejs
];
configurePhase = ''
runHook preConfigure
export HOME=$PWD/tmp
mkdir -p $HOME
fixup-yarn-lock yarn.lock
yarn config --offline set yarn-offline-mirror $offlineCache
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
patchShebangs node_modules
runHook postConfigure
'';
buildPhase = ''
runHook preBuild
yarn build --offline
runHook postBuild
'';
installPhase = ''
runHook preInstall
cp -R target $out
runHook postInstall
'';
meta = {
description = "Lightweight matrix client with legacy and mobile browser support";
homepage = "https://github.com/element-hq/hydrogen-web";
teams = [ lib.teams.matrix ];
license = lib.licenses.asl20;
platforms = lib.platforms.all;
inherit (olm.meta) knownVulnerabilities;
};
})

View File

@@ -0,0 +1,29 @@
{
stdenv,
jq,
hydrogen-web-unwrapped,
conf ? { },
}:
if (conf == { }) then
hydrogen-web-unwrapped
else
stdenv.mkDerivation {
pname = "${hydrogen-web-unwrapped.pname}-wrapped";
inherit (hydrogen-web-unwrapped) version meta;
dontUnpack = true;
nativeBuildInputs = [ jq ];
installPhase = ''
runHook preInstall
mkdir -p $out
ln -s ${hydrogen-web-unwrapped}/* $out
rm $out/config.json
jq -s '.[0] * $conf' "${hydrogen-web-unwrapped}/config.json" --argjson "conf" '${builtins.toJSON conf}' > "$out/config.json"
runHook postInstall
'';
}

View File

@@ -0,0 +1,58 @@
{
lib,
fetchFromGitHub,
ocamlPackages,
}:
with ocamlPackages;
buildDunePackage {
pname = "jackline";
version = "unstable-2024-10-21";
minimalOCamlVersion = "4.13";
src = fetchFromGitHub {
owner = "hannesm";
repo = "jackline";
rev = "cf6b26e37e37b0b48be9fd2e74fc563375f757f0";
hash = "sha256-6QZZ77C1G3x/GOJsUEQMrCatVsyyxNjq36ez/TgeHSY=";
};
nativeBuildInputs = [
ppx_sexp_conv
ppx_deriving
];
buildInputs = [
erm_xmpp
tls
tls-lwt
mirage-crypto-pk
x509
domain-name
lwt
otr
astring
ptime
notty
sexplib
hex
uchar
uucp
uuseg
uutf
dns-client
base64
happy-eyeballs-lwt
ppx_sexp_conv
];
meta = with lib; {
homepage = "https://github.com/hannesm/jackline";
description = "Minimalistic secure XMPP client in OCaml";
mainProgram = "jackline";
license = licenses.bsd2;
maintainers = with maintainers; [ sternenseemann ];
};
}

View File

@@ -0,0 +1,41 @@
# Linphone
Linphone is a SIP softphone application developed by Belledonne Communications.
The main application is located in the [`linphone-desktop`](https://gitlab.linphone.org/BC/public/linphone-desktop) repository, and depends on many bespoke libraries, as well as third-party libraries with custom patches.
This scope provides all libraries and patches needed for Linphone to build.
BC-developed libraries are housed within the [`linphone-sdk`](https://gitlab.linphone.org/BC/public/linphone-sdk) monorepo.
Current stable versions of the monorepo utilize git submodules to link the respective package repos, but BC has since integrated all of their libraries into the monorepo proper, which is why we're already using a single source for the entire repo.
An auxiliary function `mkLinphoneDerivation` is provided in this scope, to streamline building libraries from that repository.
Other third-party libraries for which BC has provided custom patches, and are not included in the monorepo, are prefixed with `bc-`.
All libraries and packages are exposed in nixpkgs under the `linphonePackage` scope via `pkgs/all-packages.nix`.
## Updating
Updating is done in 3 steps:
1. Update the main Linphone application in the derivation directly
2. Update all libraries derived from the `linphone-sdk` monorepo, by updating the monorepo version and hash in `./default.nix`
3. Update all custom versions of third-party libraries individually (those prefixed with `bc-`)
4. Verify that the build is working by building (and running) `linphonePackages.linphone-desktop`.
> [!TIP]
>
> When testing, run the app with `./result/bin/linphone --verbose` to get useful logs in `stdout`.
## Adding new libraries
To add a new package to this scope, simply add a new subdirectory containing a `default.nix` file with the appropriate package name. The scope automatically picks up any directories and adds an according toplevel package.
If the package you are adding is contained within the `linphone-sdk` monorepo, it makes sense to use the `mkLinphoneDerivation` function to streamline the build process.
If the package you are adding is a third-party libary with custom patches from BC, it should be prefixed with `bc-` for easy recognizability, so e.g. if BC were to patch `ffmpeg`, you would call the package `bc-ffmpeg`.
## Notes for the future
As mentioned before, currently most libraries within `linphone-sdk` are simply git submodules, but in the future, they will be properly integrated into the monorepo (this is already the case for their main branch).
Also, currently the build relies on Qt5, but starting with Linphone 6.0.0, which as of 2025-09-20 is in its RC phase, the build will involve Qt6.

View File

@@ -0,0 +1,43 @@
{
cmake,
fetchFromGitLab,
lib,
python3,
stdenv,
}:
stdenv.mkDerivation {
pname = "bc-decaf";
# version retrieved from `HISTORY.txt`
version = "1.0.2-unstable-2025-06-25";
nativeBuildInputs = [ cmake ];
buildInputs = [
python3
];
src = fetchFromGitLab {
domain = "gitlab.linphone.org";
group = "BC";
owner = "public/external";
repo = "decaf";
rev = "e5cc6240690d3ffdfcbdb1e4e851954b789cd5d9";
sha256 = "sha256-4oZtpdelyKbd2k4LAhtsLkL5Y84C1Qb02fpVywYorr8=";
};
# Do not build static libraries and do not enable -Werror
cmakeFlags = [
"-DENABLE_STATIC=NO"
"-DBUILD_SHARED_LIBS=ON"
"-DENABLE_STRICT=NO"
];
meta = {
description = "Elliptic curve library supporting Ed448-Goldilocks and Curve25519. Belledonne Communications' fork for Linphone";
homepage = "https://gitlab.linphone.org/BC/public/external/decaf";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
naxdy
];
platforms = lib.platforms.linux;
};
}

View File

@@ -0,0 +1,59 @@
{
cmake,
fetchFromGitLab,
lib,
stdenv,
# tests
testers,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "bc-ispell";
# version retrieved from `CHANGES`
version = "3.4.02-unstable-2025-05-05";
src = fetchFromGitLab {
domain = "gitlab.linphone.org";
group = "BC";
owner = "public/external";
repo = "ispell";
rev = "05574fe160222c3d0b6283c1433c9b087271fad1";
sha256 = "sha256-YoRLiMjk2BxoI27xc2nzucxfHV9UbouFRSECb3RdHGo=";
};
patches = [
# linphone has custom find modules that look for this package,
# but they do not work in nix, so we need to patch this library to
# install regular cmake config files
./install-config-files.patch
];
cmakeFlags = [
"-DENABLE_STATIC=NO"
"-DBUILD_SHARED_LIBS=ON"
];
nativeBuildInputs = [ cmake ];
passthru.tests = {
cmake-config = testers.hasCmakeConfigModules {
package = finalAttrs.finalPackage;
moduleNames = [
"ISpell"
];
};
};
meta = {
description = "Interactive spelling checker";
homepage = "https://gitlab.linphone.org/BC/public/external/ispell";
platforms = lib.platforms.all;
# NOTE: ISpell itself does not explicitly provide a license. From its
# 'Contributors' file, it can be deduced that it is distributed under
# "some" open source license, but the details are not clear.
license = lib.licenses.free;
maintainers = with lib.maintainers; [
naxdy
];
};
})

View File

@@ -0,0 +1,90 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6edcc88..6f5601d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -47,11 +47,62 @@ set(ISPELL_SOURCES
xgets.c
)
+set(ISPELL_HEADERS
+ config.h
+ defhash.h
+ exp_table.h
+ fields.h
+ ispell.h
+ libispell.h
+ local.h
+ msgs.h
+ proto.h
+ version.h
+)
+
add_library(${ISPELL_TARGET_NAME} SHARED ${ISPELL_SOURCES})
+install(
+ FILES
+ ${ISPELL_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+)
+
+install(TARGETS ${ISPELL_TARGET_NAME}
+ EXPORT ${ISPELL_TARGET_NAME}Targets
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+)
+
install(TARGETS ${ISPELL_TARGET_NAME}
EXPORT ${ISPELL_TARGET_NAME}LibraryDepends
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
+
+install(
+ EXPORT ${ISPELL_TARGET_NAME}Targets
+ FILE ${ISPELL_TARGET_NAME}Targets.cmake
+ DESTINATION "${CMAKE_INSTALL_DATADIR}/${ISPELL_TARGET_NAME}/cmake"
+ NAMESPACE ${ISPELL_TARGET_NAME}::
+)
+
+install(
+ EXPORT ${ISPELL_TARGET_NAME}LibraryDepends
+ FILE ${ISPELL_TARGET_NAME}LibraryDepends.cmake
+ DESTINATION "${CMAKE_INSTALL_DATADIR}/${ISPELL_TARGET_NAME}/cmake"
+ NAMESPACE ${ISPELL_TARGET_NAME}::
+)
+
+configure_package_config_file(
+ ${ISPELL_TARGET_NAME}Config.cmake.in
+ "${CMAKE_CURRENT_BINARY_DIR}/${ISPELL_TARGET_NAME}Config.cmake"
+ INSTALL_DESTINATION "${CMAKE_INSTALL_DATADIR}/${ISPELL_TARGET_NAME}/cmake"
+)
+
+install(
+ FILES "${CMAKE_CURRENT_BINARY_DIR}/${ISPELL_TARGET_NAME}Config.cmake"
+ DESTINATION "${CMAKE_INSTALL_DATADIR}/${ISPELL_TARGET_NAME}/cmake"
+)
diff --git a/ISpellConfig.cmake.in b/ISpellConfig.cmake.in
index 052194b..cb71737 100644
--- a/ISpellConfig.cmake.in
+++ b/ISpellConfig.cmake.in
@@ -6,13 +6,13 @@
@PACKAGE_INIT@
-include("${CMAKE_CURRENT_LIST_DIR}/@ISPELL_TARGET_NAME@LibraryDepends.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/ISpellLibraryDepends.cmake")
-set(ISPELL_LIBRARIES "@ISPELL_TARGET_NAME@")
-get_target_property(ISPELL_INCLUDE_DIRS "@ISPELL_TARGET_NAME@" INTERFACE_INCLUDE_DIRECTORIES)
+set(ISPELL_LIBRARIES "ISpell")
+get_target_property(ISPELL_INCLUDE_DIRS "ISpell::ISpell" INTERFACE_INCLUDE_DIRECTORIES)
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.18.0)
- add_library(@ISpell_TARGET_NAME@::@ISpell_TARGET_NAME@ ALIAS @ISpell_TARGET_NAME@)
+ add_library(ISpell ALIAS ISpell::ISpell)
endif()
-check_required_components(@ISpell_TARGET_NAME@)
+check_required_components(ISpell)

View File

@@ -0,0 +1,57 @@
{
cmake,
fetchFromGitLab,
fetchpatch,
sqlite,
boost,
lib,
stdenv,
}:
stdenv.mkDerivation {
pname = "bc-soci";
# version retrieved from `CHANGELOG.md`
version = "3.2.3-unstable-2025-05-05";
src = fetchFromGitLab {
domain = "gitlab.linphone.org";
group = "BC";
owner = "public/external";
repo = "soci";
rev = "3a9c79088212941d0175c22cd2da8fe1bdd639df";
sha256 = "sha256-7aSTFD4yk1i6c9cEGqdo/eJtuqoOUZUTJlZijgjuYpM=";
};
patches = [
(fetchpatch {
name = "fix-backend-search-path.patch";
url = "https://github.com/SOCI/soci/commit/56c93afc467bdba8ffbe68739eea76059ea62f7a.patch";
sha256 = "sha256-nC/39pn3Cv5e65GgIfF3l64/AbCsfZHPUPIWETZFZAY=";
})
];
cmakeFlags = [
# Do not build static libraries
"-DSOCI_SHARED=YES"
"-DSOCI_STATIC=OFF"
"-DSOCI_TESTS=NO"
"-DWITH_SQLITE3=YES"
];
nativeBuildInputs = [ cmake ];
buildInputs = [
sqlite
boost
];
meta = {
description = "Database access library for C++. Belledonne Communications' fork for Linphone";
homepage = "https://gitlab.linphone.org/BC/public/external/soci";
license = lib.licenses.boost;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [
naxdy
];
};
}

View File

@@ -0,0 +1,50 @@
{
bcunit,
bc-decaf,
mkLinphoneDerivation,
openssl,
lib,
# tests
testers,
}:
mkLinphoneDerivation (finalAttrs: {
pname = "bctoolbox";
propagatedBuildInputs = [
bcunit
bc-decaf
openssl
];
cmakeFlags = [
"-DENABLE_STRICT=NO"
# mbedtils does not build
"-DENABLE_MBEDTLS=NO"
"-DENABLE_OPENSSL=YES"
];
strictDeps = true;
passthru.tests = {
cmake-config = testers.hasCmakeConfigModules {
package = finalAttrs.finalPackage;
moduleNames = [
"BCToolbox"
];
};
};
meta = {
description = "Utilities library for Linphone";
mainProgram = "bctoolbox_tester";
license = lib.licenses.gpl3Only;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [
jluttine
naxdy
raskin
];
};
})

View File

@@ -0,0 +1,17 @@
{
mkLinphoneDerivation,
lib,
}:
mkLinphoneDerivation {
pname = "bcunit";
meta = {
description = "Fork of the defunct project CUnit, a unit testing framework";
license = lib.licenses.gpl2Only;
maintainers = with lib.maintainers; [
jluttine
naxdy
raskin
];
};
}

View File

@@ -0,0 +1,35 @@
{
bctoolbox,
belr,
lib,
mkLinphoneDerivation,
# tests
testers,
}:
mkLinphoneDerivation (finalAttrs: {
pname = "belcard";
propagatedBuildInputs = [
bctoolbox
belr
];
cmakeFlags = [
"-DENABLE_UNIT_TESTS=NO" # Do not build test executables
];
passthru.tests = {
cmake-config = testers.hasCmakeConfigModules {
package = finalAttrs.finalPackage;
moduleNames = [
"BelCard"
];
};
};
meta = {
description = "C++ library to manipulate VCard standard format. Part of the Linphone project";
license = lib.licenses.gpl3Only;
};
})

View File

@@ -0,0 +1,43 @@
{
bctoolbox,
belr,
lib,
libantlr3c,
stdenv,
zlib,
python3,
mkLinphoneDerivation,
}:
mkLinphoneDerivation {
pname = "belle-sip";
nativeBuildInputs = [
python3
];
env.NIX_CFLAGS_COMPILE = toString (
[
"-Wno-error=cast-function-type"
"-Wno-error=deprecated-declarations"
"-Wno-error=format-truncation"
"-Wno-error=stringop-overflow"
]
++ lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
# Needed with GCC 12 but problematic with some old GCCs and probably clang
"-Wno-error=use-after-free"
]
);
propagatedBuildInputs = [
libantlr3c
bctoolbox
belr
zlib
];
meta = {
description = "Modern library implementing SIP (RFC 3261) transport, transaction and dialog layers. Part of the Linphone project";
mainProgram = "belle_sip_tester";
license = lib.licenses.gpl3Only;
};
}

View File

@@ -0,0 +1,17 @@
{
bctoolbox,
lib,
mkLinphoneDerivation,
}:
mkLinphoneDerivation {
pname = "belr";
buildInputs = [
bctoolbox
];
meta = {
description = "Belledonne Communications' language recognition library (a SIP parsing library). Part of the Linphone project";
license = lib.licenses.gpl3Only;
};
}

View File

@@ -0,0 +1,24 @@
{
bctoolbox,
sqlite,
lib,
mkLinphoneDerivation,
}:
mkLinphoneDerivation {
pname = "bzrtp";
buildInputs = [
bctoolbox
sqlite
];
env.NIX_CFLAGS_COMPILE = toString [
# Needed with GCC 12
"-Wno-error=stringop-overflow"
];
meta = {
description = "Opensource implementation of ZRTP keys exchange protocol. Part of the Linphone project";
license = lib.licenses.gpl3Only;
};
}

View File

@@ -0,0 +1,20 @@
{
generateSplicesForMkScope,
makeScopeWithSplicing',
lib,
}:
makeScopeWithSplicing' {
otherSplices = generateSplicesForMkScope "linphonePackages";
extra = self: {
mkLinphoneDerivation = self.mk-linphone-derivation;
linphoneSdkVersion = "5.4.43";
linphoneSdkHash = "sha256-lv2phU2qF51OIejzjgaBUo9NIdDv4bbK+bpY37Gnr8U=";
};
f =
self:
let
packages = lib.filterAttrs (name: value: value == "directory") (builtins.readDir ./.);
in
lib.mapAttrs (name: value: self.callPackage ./${name} { }) packages;
}

View File

@@ -0,0 +1,83 @@
{
lib,
bc-soci,
belcard,
belle-sip,
doxygen,
jsoncpp,
libxml2,
lime,
mediastreamer2,
python3,
sqlite,
xercesc,
zxing-cpp,
mkLinphoneDerivation,
}:
mkLinphoneDerivation {
pname = "liblinphone";
cmakeFlags = [
"-DENABLE_UNIT_TESTS=NO" # Do not build test executables
"-DENABLE_STRICT=NO" # Do not build with -Werror
# normally set by a cmake module, but
# we need to disable it to prevent downstream link errors
"-DJsonCPP_TARGET=jsoncpp"
];
buildInputs = [
# Made by BC
belcard
belle-sip
lime
mediastreamer2
# Vendored by BC
bc-soci
libxml2
sqlite
xercesc
zxing-cpp
];
propagatedBuildInputs = [
jsoncpp
];
nativeBuildInputs = [
doxygen
(python3.withPackages (ps: [
ps.pystache
ps.six
ps.pyturbojpeg
]))
];
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace-fail JsonCPP jsoncpp
'';
preConfigure = ''
rm cmake/FindJsonCPP.cmake
'';
strictDeps = true;
# Some grammar files needed to be copied too from some dependencies. I suppose
# if one define a dependency in such a way that its share directory is found,
# then this copying would be unnecessary. Instead of actually copying these
# files, create a symlink.
postInstall = ''
mkdir -p $out/share/belr/grammars
ln -s ${belcard}/share/belr/grammars/* $out/share/belr/grammars/
'';
meta = {
description = "Library for SIP calls and instant messaging";
license = lib.licenses.agpl3Plus;
platforms = lib.platforms.linux;
};
}

View File

@@ -0,0 +1,31 @@
{
bctoolbox,
belle-sip,
lib,
bc-soci,
sqlite,
mkLinphoneDerivation,
}:
mkLinphoneDerivation {
pname = "lime";
buildInputs = [
# Made by BC
bctoolbox
belle-sip
# Vendored by BC
bc-soci
sqlite
];
cmakeFlags = [
"-DENABLE_UNIT_TESTS=NO" # Do not build test executables
];
meta = {
description = "End-to-end encryption library for instant messaging. Part of the Linphone project";
license = lib.licenses.gpl3Only;
};
}

View File

@@ -0,0 +1,167 @@
{
bc-ispell,
bc-soci,
bctoolbox,
belcard,
belle-sip,
belr,
boost,
cmake,
doxygen,
fetchFromGitLab,
lib,
liblinphone,
libsForQt5,
lime,
mediastreamer2,
minizip-ng,
msopenh264,
python3,
python3Packages,
stdenv,
symlinkJoin,
xercesc,
zxing-cpp,
}:
let
grammars = symlinkJoin {
name = "belr-grammars";
paths =
let
grammarPackages = [
belle-sip
belcard
liblinphone
];
in
map (e: "${e}/share/belr/grammars") grammarPackages;
};
in
stdenv.mkDerivation (finalAttrs: {
pname = "linphone-desktop";
version = "5.3.0";
src = fetchFromGitLab {
domain = "gitlab.linphone.org";
owner = "public";
group = "BC";
repo = "linphone-desktop";
rev = finalAttrs.version;
hash = "sha256-SxYI2ZOtA49K2XPoTRPAIziAwC8SRrHMC3NISBFyuH0=";
};
patches = [
./require-finding-packages.patch
./remove-bc-versions.patch
./do-not-override-install-prefix.patch
./fix-translation-dirs.patch
./unset-qml-dir.patch
# .mkv recordings are broken in NixOS and other distros (see
# https://github.com/NixOS/nixpkgs/issues/219551), and simply changing the
# file extension is enough to affect the chosen codec (wav makes more
# sense for audio recordings anyway)
./record-in-wav-format.patch
];
buildInputs = [
# Made by BC
bctoolbox
belcard
belle-sip
belr
liblinphone
mediastreamer2
msopenh264
lime
bc-soci
bc-ispell
xercesc
minizip-ng
libsForQt5.qtgraphicaleffects
libsForQt5.qtmultimedia
libsForQt5.qtquickcontrols2
zxing-cpp
boost
python3Packages.pystache
python3Packages.six
];
nativeBuildInputs = [
cmake
libsForQt5.qttools
libsForQt5.wrapQtAppsHook
python3
doxygen
];
cmakeFlags = [
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5"
"-DBUILD_SHARED_LIBS=ON"
"-DMINIZIP_INCLUDE_DIRS=${minizip-ng}/include"
"-DMINIZIP_LIBRARIES=minizip"
# RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/
"-DCMAKE_SKIP_BUILD_RPATH=ON"
# Requires EQt5Keychain
"-DENABLE_QT_KEYCHAIN=OFF"
"-DCMAKE_INSTALL_BINDIR=bin"
"-DCMAKE_INSTALL_INCLUDEDIR=include"
"-DCMAKE_INSTALL_LIBDIR=lib"
"-DLINPHONEAPP_VERSION=${finalAttrs.version}"
"-DLINPHONE_QT_ONLY=ON"
"-DLINPHONEAPP_INSTALL_PREFIX=${placeholder "out"}"
"-DLINPHONE_QML_DIR=${placeholder "out"}/${libsForQt5.qtbase.qtQmlPrefix}/ui"
# normally set by the custom find modules, which we have disabled
"-DLibLinphone_TARGET=liblinphone"
"-DLinphoneCxx_TARGET=liblinphone++"
"-DISpell_SOURCE_DIR=${bc-ispell.src}"
];
preConfigure = ''
# custom "find" modules are causing issues during build,
# as they are blinding cmake to nix dependencies
rm -rf linphone-app/cmake
'';
preInstall = ''
mkdir -p $out/share/linphone
mkdir -p $out/share/sounds/linphone
mkdir -p $out/share/belr
'';
# In order to find mediastreamer plugins, mediastreamer package was patched to
# support an environment variable pointing to the plugin directory. Set that
# environment variable by wrapping the Linphone executable.
#
# It is quite likely that there are some other files still missing and
# Linphone will randomly crash when it tries to access those files. Then,
# those just need to be linked manually below.
postInstall = ''
mkdir -p $out/lib/mediastreamer/plugins
ln -s ${msopenh264}/lib/mediastreamer/plugins/* $out/lib/mediastreamer/plugins/
ln -s ${mediastreamer2}/lib/mediastreamer/plugins/* $out/lib/mediastreamer/plugins/
ln -s ${grammars} $out/share/belr/grammars
wrapProgram $out/bin/linphone \
--unset QML2_IMPORT_PATH \
--set MEDIASTREAMER_PLUGINS_DIR $out/lib/mediastreamer/plugins
'';
meta = {
homepage = "https://www.linphone.org/";
description = "Open source SIP phone for voice/video calls and instant messaging";
mainProgram = "linphone";
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [
jluttine
naxdy
];
};
})

View File

@@ -0,0 +1,16 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 312df041d..43500be48 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -116,11 +116,6 @@ endif ()
#------------------------------------------------------------------------------
# Prepare gobal CMAKE configuration specific to the current project
-if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
- set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/OUTPUT" CACHE PATH "Default linphone-app installation prefix" FORCE)
- set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT FALSE)
-endif()
-
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified")
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo" FORCE)

View File

@@ -0,0 +1,15 @@
diff --git a/linphone-app/assets/languages/CMakeLists.txt b/linphone-app/assets/languages/CMakeLists.txt
index ffe2b6a5b..12f02bdfe 100644
--- a/linphone-app/assets/languages/CMakeLists.txt
+++ b/linphone-app/assets/languages/CMakeLists.txt
@@ -32,8 +32,8 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${I18N_FILENAME}" "${I18N_CONTENT}")
#Files or directories to inspect for translations references
set(TRANSLATION_SOURCES)
-list(APPEND TRANSLATION_SOURCES "${PROJECT_SOURCE_DIR}/src")
-list(APPEND TRANSLATION_SOURCES "${PROJECT_SOURCE_DIR}/ui")
+list(APPEND TRANSLATION_SOURCES "${PROJECT_SOURCE_DIR}/linphone-app/src")
+list(APPEND TRANSLATION_SOURCES "${PROJECT_SOURCE_DIR}/linphone-app/ui")
if (WIN32)
foreach (lang ${LANGUAGES})

View File

@@ -0,0 +1,48 @@
diff --git a/linphone-app/src/components/call/CallModel.cpp b/linphone-app/src/components/call/CallModel.cpp
index d0286a89a..483bc35e4 100644
--- a/linphone-app/src/components/call/CallModel.cpp
+++ b/linphone-app/src/components/call/CallModel.cpp
@@ -289,7 +289,7 @@ void CallModel::setRecordFile (const shared_ptr<linphone::CallParams> &callParam
callParams->setRecordFile(Utils::appStringToCoreString(
CoreManager::getInstance()->getSettingsModel()->getSavedCallsFolder()
.append(generateSavedFilename())
- .append(".mkv")
+ .append(".wav")
));
}
@@ -303,7 +303,7 @@ void CallModel::setRecordFile (const shared_ptr<linphone::CallParams> &callParam
callParams->setRecordFile(Utils::appStringToCoreString(
CoreManager::getInstance()->getSettingsModel()->getSavedCallsFolder()
.append(generateSavedFilename(from, to))
- .append(".mkv")
+ .append(".wav")
));
}
diff --git a/linphone-app/src/components/conference/ConferenceProxyModel.cpp b/linphone-app/src/components/conference/ConferenceProxyModel.cpp
index 0cf654dd4..931c0e5cf 100644
--- a/linphone-app/src/components/conference/ConferenceProxyModel.cpp
+++ b/linphone-app/src/components/conference/ConferenceProxyModel.cpp
@@ -84,7 +84,7 @@ void ConferenceProxyModel::startRecording () {
mLastRecordFile =
- QStringLiteral("%1%2.mkv")
+ QStringLiteral("%1%2.wav")
.arg(coreManager->getSettingsModel()->getSavedCallsFolder())
.arg(QDateTime::currentDateTime().toString("yyyy-MM-dd_hh-mm-ss"));
conference->startRecording(Utils::appStringToCoreString(mLastRecordFile) );
diff --git a/linphone-app/src/components/recorder/RecorderModel.cpp b/linphone-app/src/components/recorder/RecorderModel.cpp
index 0d17ff6f8..5c6d7c679 100644
--- a/linphone-app/src/components/recorder/RecorderModel.cpp
+++ b/linphone-app/src/components/recorder/RecorderModel.cpp
@@ -83,7 +83,7 @@ QDateTime RecorderModel::getDateTimeSavedFilename(const QString& filename){
void RecorderModel::start(){
bool soFarSoGood;
- QString filename = QStringLiteral("vocal_%1.mkv")
+ QString filename = QStringLiteral("vocal_%1.wav")
.arg(QDateTime::currentDateTime().toString("yyyy-MM-dd_hh-mm-ss-zzz"));
const QString safeFilePath = Utils::getSafeFilePath(
QStringLiteral("%1%2")

View File

@@ -0,0 +1,15 @@
diff --git a/linphone-app/CMakeLists.txt b/linphone-app/CMakeLists.txt
index d40842fa2..7d7bc57d8 100644
--- a/linphone-app/CMakeLists.txt
+++ b/linphone-app/CMakeLists.txt
@@ -40,10 +40,8 @@ set(version_minor)
set(version_patch)
set(identifiers )
set(metadata )
-bc_parse_full_version("${LINPHONEAPP_VERSION}" version_major version_minor version_patch identifiers metadata)
-project(linphoneqt VERSION "${version_major}.${version_minor}.${version_patch}")
if(ENABLE_BUILD_VERBOSE)
#message("CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH}")

View File

@@ -0,0 +1,41 @@
diff --git a/linphone-app/CMakeLists.txt b/linphone-app/CMakeLists.txt
index d40842fa2..5ea1330ca 100644
--- a/linphone-app/CMakeLists.txt
+++ b/linphone-app/CMakeLists.txt
@@ -24,14 +24,11 @@ cmake_minimum_required(VERSION 3.22)
#Linphone targets
-set(LINPHONE_PACKAGES LinphoneCxx Mediastreamer2 Belcard LibLinphone)
+set(LINPHONE_PACKAGES LinphoneCxx Mediastreamer2 BelCard LibLinphone)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
-find_package(BCToolbox)
-if(NOT BCToolbox_FOUND)
- find_package(bctoolbox CONFIG REQUIRED)
-endif()
+find_package(BCToolbox REQUIRED)
if(NOT LINPHONEAPP_VERSION)
bc_compute_full_version(LINPHONEAPP_VERSION)
endif()
@@ -105,17 +102,14 @@ set(ENABLE_DB_STORAGE ON CACHE BOOLEAN "Enable Storage")
foreach(PACKAGE ${LINPHONE_PACKAGES})
message(STATUS "Trying to find ${PACKAGE}")
- find_package(${PACKAGE})
- if(NOT ${PACKAGE}_FOUND)
- find_package(${PACKAGE} CONFIG REQUIRED)
- endif()
+ find_package(${PACKAGE} REQUIRED)
endforeach()
set(PLUGIN_TARGETS ${LinphoneCxx_TARGET})
set(APP_TARGETS ${LinphoneCxx_TARGET}
${BCToolbox_TARGET}#Logger/App
${Mediastreamer2_TARGET}#MediastreamerUtils
- ${Belcard_TARGET}#VCard Model
+ ${BelCard_TARGET}#VCard Model
${LibLinphone_TARGET})#MediastreamerUtils
####################################

View File

@@ -0,0 +1,13 @@
diff --git a/linphone-app/CMakeLists.txt b/linphone-app/CMakeLists.txt
index d40842fa2..112d45711 100644
--- a/linphone-app/CMakeLists.txt
+++ b/linphone-app/CMakeLists.txt
@@ -54,7 +54,6 @@ include(CheckCXXCompilerFlag)
set(TARGET_NAME linphone-qt)
-set(LINPHONE_QML_DIR "WORK/qml_files/ui")
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS true)
set(CMAKE_CXX_STANDARD 14)

View File

@@ -0,0 +1,80 @@
{
bctoolbox,
bzrtp,
ffmpeg_4,
glew,
gsm,
lib,
libX11,
libXext,
libopus,
libpulseaudio,
libsForQt5,
libv4l,
libvpx,
mkLinphoneDerivation,
ortp,
python3,
speex,
sqlite,
srtp,
}:
mkLinphoneDerivation (finalAttrs: {
pname = "mediastreamer2";
dontWrapQtApps = true;
patches = [
# Plugins directory is normally fixed during compile time. This patch makes
# it possible to set the plugins directory run time with an environment
# variable MEDIASTREAMER_PLUGINS_DIR. This makes it possible to construct a
# plugin directory with desired plugins and wrap executables so that the
# environment variable points to that directory.
./plugins_dir.patch
];
nativeBuildInputs = [
python3
libsForQt5.qtbase
libsForQt5.qtdeclarative
];
propagatedBuildInputs = [
# Made by BC
bctoolbox
bzrtp
ortp
ffmpeg_4
glew
libX11
libXext
libpulseaudio
libv4l
speex
srtp
sqlite
# Optional
gsm # GSM audio codec
libopus # Opus audio codec
libvpx # VP8 video codec
];
strictDeps = true;
cmakeFlags = [
"-DENABLE_QT_GL=ON" # Build necessary MSQOGL plugin for Linphone desktop
"-DCMAKE_C_FLAGS=-DGIT_VERSION=\"v${finalAttrs.version}\""
"-DENABLE_STRICT=NO" # Disable -Werror
"-DENABLE_UNIT_TESTS=NO" # Do not build test executables
];
NIX_LDFLAGS = "-lXext";
meta = {
description = "Powerful and lightweight streaming engine specialized for voice/video telephony applications. Part of the Linphone project";
license = lib.licenses.agpl3Plus;
platforms = lib.platforms.linux;
};
})

View File

@@ -0,0 +1,18 @@
diff --git a/src/base/msfactory.c b/src/base/msfactory.c
index 14f868e3..2e3445a1 100644
--- a/src/base/msfactory.c
+++ b/src/base/msfactory.c
@@ -770,7 +770,12 @@ void ms_factory_uninit_plugins(MSFactory *factory){
}
void ms_factory_init_plugins(MSFactory *obj) {
- if (obj->plugins_dir == NULL) {
+ char *package_plugins_dir;
+ // Force plugin dir from environment variable if set
+ package_plugins_dir = getenv("MEDIASTREAMER_PLUGINS_DIR");
+ if (package_plugins_dir != NULL) {
+ ms_factory_set_plugins_dir(obj, package_plugins_dir);
+ } else if (obj->plugins_dir == NULL) {
#ifdef __APPLE__
char *dir = getPluginsDir();
if (dir != NULL) {

View File

@@ -0,0 +1,61 @@
{
stdenv,
fetchFromGitLab,
lib,
cmake,
linphoneSdkVersion,
linphoneSdkHash,
}:
lib.extendMkDerivation {
constructDrv = stdenv.mkDerivation;
excludeDrvArgNames = [
"sourceRoot"
"version"
];
extendDrvArgs =
finalAttrs:
{
sourceRoot ? finalAttrs.pname,
nativeBuildInputs ? [ ],
cmakeFlags ? [ ],
...
}@args:
{
version = linphoneSdkVersion;
src = fetchFromGitLab {
domain = "gitlab.linphone.org";
owner = "public";
group = "BC";
repo = "linphone-sdk";
tag = linphoneSdkVersion;
hash = linphoneSdkHash;
fetchSubmodules = true;
};
nativeBuildInputs = [
cmake
]
++ nativeBuildInputs;
sourceRoot = "${finalAttrs.src.name}/${sourceRoot}";
cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON"
]
++ cmakeFlags;
meta = {
homepage = "https://gitlab.linphone.org/BC/public/linphone-sdk";
# maintainers for all linphone packages
maintainers = [
lib.maintainers.jluttine
lib.maintainers.naxdy
];
platforms = lib.platforms.all;
}
// (lib.optionalAttrs (args ? meta) args.meta);
};
}

View File

@@ -0,0 +1,27 @@
{
mediastreamer2,
openh264,
lib,
mkLinphoneDerivation,
}:
mkLinphoneDerivation {
pname = "msopenh264";
buildInputs = [
mediastreamer2
openh264
];
# CMAKE_INSTALL_PREFIX has no effect so let's install manually. See:
# https://gitlab.linphone.org/BC/public/msopenh264/issues/1
installPhase = ''
mkdir -p $out/lib/mediastreamer/plugins
cp lib/mediastreamer2/plugins/libmsopenh264.so $out/lib/mediastreamer/plugins/
'';
meta = {
description = "H.264 encoder/decoder plugin for mediastreamer2. Part of the Linphone project";
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.linux;
};
}

View File

@@ -0,0 +1,18 @@
{
bctoolbox,
lib,
mkLinphoneDerivation,
}:
mkLinphoneDerivation {
pname = "ortp";
env.NIX_CFLAGS_COMPILE = "-Wno-error=stringop-truncation";
buildInputs = [ bctoolbox ];
meta = {
description = "Real-Time Transport Protocol (RFC3550) stack. Part of the Linphone project";
mainProgram = "ortp_tester";
license = lib.licenses.agpl3Plus;
};
}

View File

@@ -0,0 +1,65 @@
{
lib,
fetchFromGitHub,
buildPythonApplication,
cacert,
setuptools,
matrix-nio,
python-magic,
markdown,
pillow,
aiofiles,
notify2,
dbus-python,
pyxdg,
python-olm,
emoji,
}:
buildPythonApplication rec {
pname = "matrix-commander";
version = "8.0.4";
src = fetchFromGitHub {
owner = "8go";
repo = "matrix-commander";
rev = "v${version}";
hash = "sha256-JZcdAo6d7huwDQ9hJE8oT5FH0ZQjg0DhoglOkhOyk1o=";
};
format = "pyproject";
postPatch = ''
# Dependencies already bundled with Python
sed -i \
-e '/uuid/d' \
-e '/argparse/d' \
-e '/asyncio/d' \
-e '/datetime/d' \
setup.cfg requirements.txt
'';
propagatedBuildInputs = [
cacert
setuptools
(matrix-nio.override { withOlm = true; })
python-magic
markdown
pillow
aiofiles
notify2
dbus-python
pyxdg
python-olm
emoji
];
meta = with lib; {
description = "Simple but convenient CLI-based Matrix client app for sending and receiving";
mainProgram = "matrix-commander";
homepage = "https://github.com/8go/matrix-commander";
license = licenses.gpl3Plus;
platforms = platforms.unix;
maintainers = [ maintainers.seb314 ];
};
}

View File

@@ -0,0 +1,96 @@
{
lib,
stdenv,
python3Packages,
fetchFromGitHub,
installShellFiles,
nixosTests,
enableDbusUi ? true,
wrapGAppsHook3,
}:
python3Packages.buildPythonApplication rec {
pname = "pantalaimon";
version = "0.10.6";
pyproject = true;
# pypi tarball miss tests
src = fetchFromGitHub {
owner = "matrix-org";
repo = "pantalaimon";
rev = version;
hash = "sha256-g+ZWarZnjlSOpD75yf53Upqj1qDlil7pdbfEsMAsjh0=";
};
build-system = [
installShellFiles
]
++ (with python3Packages; [
setuptools
]);
pythonRelaxDeps = [
"matrix-nio"
];
dependencies =
with python3Packages;
[
aiohttp
attrs
cachetools
click
janus
keyring
logbook
(matrix-nio.override { withOlm = true; })
peewee
platformdirs
prompt-toolkit
]
++ lib.optionals enableDbusUi optional-dependencies.ui;
optional-dependencies.ui = with python3Packages; [
dbus-python
notify2
pygobject3
pydbus
];
nativeCheckInputs =
with python3Packages;
[
aioresponses
faker
pytest-aiohttp
pytestCheckHook
]
++ lib.flatten (lib.attrValues optional-dependencies);
nativeBuildInputs = lib.optionals enableDbusUi [
wrapGAppsHook3
];
dontWrapGApps = enableDbusUi;
makeWrapperArgs = lib.optionals enableDbusUi [
"\${gappsWrapperArgs[@]}"
];
# darwin has difficulty communicating with server, fails some integration tests
doCheck = !stdenv.hostPlatform.isDarwin;
postInstall = ''
installManPage docs/man/*.[1-9]
'';
passthru.tests = {
inherit (nixosTests) pantalaimon;
};
meta = with lib; {
description = "End-to-end encryption aware Matrix reverse proxy daemon";
homepage = "https://github.com/matrix-org/pantalaimon";
license = licenses.asl20;
maintainers = with maintainers; [ valodim ];
};
}

View File

@@ -0,0 +1,20 @@
diff --git a/libpurple/plugin.c b/libpurple/plugin.c
index 4f2b402..fda9add 100644
--- a/libpurple/plugin.c
+++ b/libpurple/plugin.c
@@ -1181,8 +1181,15 @@ purple_plugins_get_handle(void) {
void
purple_plugins_init(void) {
void *handle = purple_plugins_get_handle();
+ gchar **paths, **p;
purple_plugins_add_search_path(LIBDIR);
+ paths = g_strsplit(g_getenv("PURPLE_PLUGIN_PATH"), ":", -1);
+ if (paths) {
+ for (p = paths; *p; ++p)
+ if (**p) purple_plugins_add_search_path(*p);
+ }
+ g_strfreev(paths);
purple_signal_register(handle, "plugin-load",
purple_marshal_VOID__POINTER,

View File

@@ -0,0 +1,183 @@
{
stdenv,
callPackage,
fetchurl,
makeWrapper,
aspell,
avahi,
cacert,
dbus,
dbus-glib,
farstream,
gettext,
gst_all_1,
gtk2,
gtk2-x11,
gtkspell2,
intltool,
lib,
libICE,
libSM,
libXScrnSaver,
libXext,
libgcrypt,
libgnt,
libidn,
libstartup_notification,
libxml2,
ncurses,
nspr,
nss,
perlPackages,
pkg-config,
python3,
pidgin,
plugins ? [ ],
withOpenssl ? false,
openssl,
withGnutls ? false,
gnutls,
withCyrus_sasl ? true,
cyrus_sasl,
pidginPackages,
}:
# FIXME: clean the mess around choosing the SSL library (nss by default)
let
unwrapped = stdenv.mkDerivation rec {
pname = "pidgin";
version = "2.14.14";
src = fetchurl {
url = "mirror://sourceforge/pidgin/pidgin-${version}.tar.bz2";
sha256 = "sha256-D/yZlN7xAmD5ilXNEy3u+o3EqYNUUcwOmCdHvUWOI1Y=";
};
nativeBuildInputs = [
makeWrapper
intltool
];
env.NIX_CFLAGS_COMPILE = "-I${gst_all_1.gst-plugins-base.dev}/include/gstreamer-1.0";
buildInputs =
let
python-with-dbus = python3.withPackages (pp: with pp; [ dbus-python ]);
in
[
aspell
avahi
cyrus_sasl
dbus
dbus-glib
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good
gst_all_1.gstreamer
libICE
libSM
libXScrnSaver
libXext
libgnt
libidn
libstartup_notification
libxml2
ncurses # optional: build finch - the console UI
nspr
nss
python-with-dbus
]
++ lib.optional withOpenssl openssl
++ lib.optionals withGnutls [
gnutls
libgcrypt
]
++ lib.optionals stdenv.hostPlatform.isLinux [
gtk2
gtkspell2
farstream
]
++ lib.optional stdenv.hostPlatform.isDarwin gtk2-x11;
propagatedBuildInputs = [
pkg-config
gettext
]
++ (with perlPackages; [
perl
XMLParser
])
++ lib.optional stdenv.hostPlatform.isLinux gtk2
++ lib.optional stdenv.hostPlatform.isDarwin gtk2-x11;
patches = [
./add-search-path.patch
./pidgin-makefile.patch
];
configureFlags = [
"--with-nspr-includes=${nspr.dev}/include/nspr"
"--with-nspr-libs=${nspr.out}/lib"
"--with-nss-includes=${nss.dev}/include/nss"
"--with-nss-libs=${nss.out}/lib"
"--with-ncurses-headers=${ncurses.dev}/include"
"--with-system-ssl-certs=${cacert}/etc/ssl/certs"
"--disable-meanwhile"
"--disable-nm"
"--disable-tcl"
"--disable-gevolution"
]
++ lib.optionals withCyrus_sasl [ "--enable-cyrus-sasl=yes" ]
++ lib.optionals withGnutls [
"--enable-gnutls=yes"
"--enable-nss=no"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
"--disable-gtkspell"
"--disable-vv"
]
++ lib.optionals stdenv.cc.isClang [ "CFLAGS=-Wno-error=int-conversion" ];
enableParallelBuilding = true;
postInstall = ''
wrapProgram $out/bin/pidgin \
--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0"
'';
doInstallCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
# In particular, this detects missing python imports in some of the tools.
postFixup =
let
# TODO: python is a script, so it doesn't work as interpreter on darwin
binsToTest = lib.optionalString stdenv.hostPlatform.isLinux "purple-remote," + "pidgin,finch";
in
lib.optionalString doInstallCheck ''
for f in "''${!outputBin}"/bin/{${binsToTest}}; do
echo "Testing: $f --help"
"$f" --help
done
'';
passthru = {
makePluginPath = lib.makeSearchPathOutput "lib" "lib/purple-${lib.versions.major version}";
withPlugins =
pluginfn:
callPackage ./wrapper.nix {
plugins = pluginfn pidginPackages;
pidgin = unwrapped;
};
};
meta = {
description = "Multi-protocol instant messaging client";
mainProgram = "pidgin";
homepage = "https://pidgin.im/";
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.unix;
maintainers = [ lib.maintainers.lucasew ];
};
};
in
if plugins == [ ] then unwrapped else unwrapped.withPlugins (_: plugins)

View File

@@ -0,0 +1,64 @@
diff --git a/pidgin/Makefile.am b/pidgin/Makefile.am
index 84d927b..1467c19 100644
--- a/pidgin/Makefile.am
+++ b/pidgin/Makefile.am
@@ -151,6 +151,7 @@ pidgin_LDADD = \
$(GLIB_LIBS) \
$(DBUS_LIBS) \
$(GSTREAMER_LIBS) \
+ $(GSTINTERFACES_LIBS) \
$(GSTVIDEO_LIBS) \
$(XSS_LIBS) \
$(SM_LIBS) \
@@ -171,6 +172,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir) \
$(GLIB_CFLAGS) \
$(GSTREAMER_CFLAGS) \
+ $(GSTINTERFACES_CFLAGS) \
$(DEBUG_CFLAGS) \
$(GTK_CFLAGS) \
$(DBUS_CFLAGS) \
diff --git a/pidgin/Makefile.in b/pidgin/Makefile.in
index 0d51e25..dd5d879 100644
--- a/pidgin/Makefile.in
+++ b/pidgin/Makefile.in
@@ -703,6 +703,7 @@ EXTRA_DIST = \
@ENABLE_GTK_TRUE@ $(GLIB_LIBS) \
@ENABLE_GTK_TRUE@ $(DBUS_LIBS) \
@ENABLE_GTK_TRUE@ $(GSTREAMER_LIBS) \
+@ENABLE_GTK_TRUE@ $(GSTINTERFACES_LIBS) \
@ENABLE_GTK_TRUE@ $(GSTVIDEO_LIBS) \
@ENABLE_GTK_TRUE@ $(XSS_LIBS) \
@ENABLE_GTK_TRUE@ $(SM_LIBS) \
@@ -723,6 +724,7 @@ EXTRA_DIST = \
@ENABLE_GTK_TRUE@ -I$(top_srcdir) \
@ENABLE_GTK_TRUE@ $(GLIB_CFLAGS) \
@ENABLE_GTK_TRUE@ $(GSTREAMER_CFLAGS) \
+@ENABLE_GTK_TRUE@ $(GSTINTERFACES_CFLAGS) \
@ENABLE_GTK_TRUE@ $(DEBUG_CFLAGS) \
@ENABLE_GTK_TRUE@ $(GTK_CFLAGS) \
@ENABLE_GTK_TRUE@ $(DBUS_CFLAGS) \
diff --git a/pidgin/plugins/Makefile.am b/pidgin/plugins/Makefile.am
index 3bb8c22..6d1e869 100644
--- a/pidgin/plugins/Makefile.am
+++ b/pidgin/plugins/Makefile.am
@@ -145,6 +145,7 @@ AM_CPPFLAGS = \
$(GTK_CFLAGS) \
$(UNITY_CFLAGS) \
$(GSTREAMER_CFLAGS) \
+ $(GSTINTERFACES_CFLAGS) \
$(PLUGIN_CFLAGS)
#
diff --git a/pidgin/plugins/Makefile.in b/pidgin/plugins/Makefile.in
index 82a34aa..1f7db00 100644
--- a/pidgin/plugins/Makefile.in
+++ b/pidgin/plugins/Makefile.in
@@ -781,6 +781,7 @@ AM_CPPFLAGS = \
$(GTK_CFLAGS) \
$(UNITY_CFLAGS) \
$(GSTREAMER_CFLAGS) \
+ $(GSTINTERFACES_CFLAGS) \
$(PLUGIN_CFLAGS)

View File

@@ -0,0 +1,36 @@
{
lib,
stdenv,
libxml2,
pidgin,
pkg-config,
fetchFromGitHub,
}:
stdenv.mkDerivation rec {
pname = "pidgin-carbons";
version = "0.2.3";
src = fetchFromGitHub {
owner = "gkdr";
repo = "carbons";
rev = "v${version}";
sha256 = "sha256-qiyIvmJbRmCrAi/93UxDVtO76nSdtzUVfT/sZGxxAh8=";
};
makeFlags = [ "PURPLE_PLUGIN_DIR=$(out)/lib/pidgin" ];
nativeBuildInputs = [ pkg-config ];
buildInputs = [
libxml2
pidgin
];
meta = with lib; {
homepage = "https://github.com/gkdr/carbons";
description = "XEP-0280: Message Carbons plugin for libpurple";
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,67 @@
{
lib,
newScope,
pidgin,
texliveBasic,
config,
}:
lib.makeScope newScope (
self:
let
callPackage = self.callPackage;
in
{
pidgin = callPackage ../. {
withOpenssl = config.pidgin.openssl or true;
withGnutls = config.pidgin.gnutls or false;
plugins = [ ];
};
pidginPackages = self;
pidgin-indicator = callPackage ./pidgin-indicator { };
pidgin-latex = callPackage ./pidgin-latex {
texLive = texliveBasic;
};
pidgin-carbons = callPackage ./carbons { };
pidgin-xmpp-receipts = callPackage ./pidgin-xmpp-receipts { };
pidgin-otr = callPackage ./otr { };
pidgin-osd = callPackage ./pidgin-osd { };
pidgin-sipe = callPackage ./sipe { };
pidgin-window-merge = callPackage ./window-merge { };
purple-discord = callPackage ./purple-discord { };
purple-googlechat = callPackage ./purple-googlechat { };
purple-lurch = callPackage ./purple-lurch { };
purple-mm-sms = callPackage ./purple-mm-sms { };
purple-plugin-pack = callPackage ./purple-plugin-pack { };
purple-slack = callPackage ./purple-slack { };
purple-xmpp-http-upload = callPackage ./purple-xmpp-http-upload { };
tdlib-purple = callPackage ./tdlib-purple { };
}
// lib.optionalAttrs config.allowAliases {
purple-matrix = throw "'pidginPackages.purple-matrix' has been unmaintained since April 2022, so it was removed.";
pidgin-skypeweb = throw "'pidginPackages.pidgin-skypeweb' has been removed since Skype was shut down in May 2025.";
purple-hangouts = throw "'pidginPackages.purple-hangouts' has been removed as Hangouts Classic is obsolete and migrated to Google Chat.";
pidgin-msn-pecan = throw "'pidginPackages.pidgin-msn-pecan' has been removed as it's unmaintained upstream and doesn't work with escargot";
pidgin-mra = throw "'pidginPackages.pidgin-mra' has been removed since mail.ru agent service has stopped functioning in 2024.";
purple-facebook = throw "'pidginPackages.purple-facebook' has been removed as it is unmaintained and doesn't support e2ee enforced by facebook.";
pidgin-opensteamworks = throw "'pidginPackages.pidgin-opensteamworks' has been removed as it is unmaintained and no longer works with Steam.";
purple-vk-plugin = throw "'pidginPackages.purple-vk-plugin' has been removed as upstream repository was deleted and no active forks are found.";
}
)

View File

@@ -0,0 +1,33 @@
{
lib,
stdenv,
fetchurl,
libotr,
pidgin,
intltool,
}:
stdenv.mkDerivation rec {
pname = "pidgin-otr";
version = "4.0.2";
src = fetchurl {
url = "https://otr.cypherpunks.ca/pidgin-otr-${version}.tar.gz";
sha256 = "1i5s9rrgbyss9rszq6c6y53hwqyw1k86s40cpsfx5ccl9bprxdgl";
};
postInstall = "ln -s \$out/lib/pidgin \$out/share/pidgin-otr";
nativeBuildInputs = [ intltool ];
buildInputs = [
libotr
pidgin
];
meta = with lib; {
homepage = "https://otr.cypherpunks.ca/";
description = "Plugin for Pidgin 2.x which implements OTR Messaging";
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,42 @@
{
autoreconfHook,
fetchFromGitHub,
glib,
intltool,
lib,
libappindicator-gtk2,
libtool,
pidgin,
stdenv,
}:
stdenv.mkDerivation rec {
pname = "pidgin-indicator";
version = "1.0.1";
src = fetchFromGitHub {
owner = "philipl";
repo = "pidgin-indicator";
rev = version;
sha256 = "sha256-CdA/aUu+CmCRbVBKpJGydicqFQa/rEsLWS3MBKlH2/M=";
};
nativeBuildInputs = [
autoreconfHook
intltool
];
buildInputs = [
glib
libappindicator-gtk2
libtool
pidgin
];
meta = with lib; {
description = "AppIndicator and KStatusNotifierItem Plugin for Pidgin";
homepage = "https://github.com/philipl/pidgin-indicator";
maintainers = with maintainers; [ imalison ];
license = licenses.gpl2;
platforms = with platforms; linux;
};
}

View File

@@ -0,0 +1,53 @@
{
lib,
stdenv,
fetchurl,
pkg-config,
pidgin,
texLive,
imagemagick,
glib,
gtk2,
}:
let
version = "1.5.0";
in
stdenv.mkDerivation {
pname = "pidgin-latex";
inherit version;
src = fetchurl {
url = "mirror://sourceforge/pidgin-latex/pidgin-latex_${version}.tar.bz2";
sha256 = "9c850aee90d7e59de834f83e09fa6e3e51b123f06e265ead70957608ada95441";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [
gtk2
glib
pidgin
];
makeFlags = [ "PREFIX=$(out)" ];
postPatch = ''
sed -e 's/-Wl,-soname//' -i Makefile
'';
passthru = {
wrapArgs = "--prefix PATH ':' ${
lib.makeBinPath [
texLive
imagemagick
]
}";
};
meta = with lib; {
homepage = "https://sourceforge.net/projects/pidgin-latex/";
description = "LaTeX rendering plugin for Pidgin IM";
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,41 @@
{
lib,
stdenv,
fetchFromGitHub,
pidgin,
xosd,
autoreconfHook,
}:
stdenv.mkDerivation rec {
pname = "pidgin-osd";
version = "0.2.0";
src = fetchFromGitHub {
owner = "edanaher";
repo = "pidgin-osd";
rev = "${pname}-${version}";
sha256 = "07wa9anz99hnv6kffpcph3fbq8mjbyq17ij977ggwgw37zb9fzb5";
};
# autoreconf is run such that it *really* wants all the files, and there's no
# default ChangeLog. So make it happy.
preAutoreconf = "touch ChangeLog";
postInstall = ''
mkdir -p $out/lib/pidgin
mv $out/lib/pidgin-osd.{la,so} $out/lib/pidgin
'';
nativeBuildInputs = [ autoreconfHook ];
buildInputs = [
xosd
pidgin
];
meta = with lib; {
homepage = "https://github.com/mbroemme/pidgin-osd";
description = "Plugin for Pidgin which implements on-screen display via libxosd";
license = licenses.gpl3;
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,36 @@
{
lib,
stdenv,
fetchFromGitHub,
pidgin,
}:
let
version = "0.8";
in
stdenv.mkDerivation {
pname = "pidgin-xmpp-receipts";
inherit version;
src = fetchFromGitHub {
owner = "noonien-d";
repo = "pidgin-xmpp-receipts";
rev = "release_${version}";
sha256 = "13kwaymzkymjsdv8q95byd173i4vanj211vgx9cm0y8ag2r3cjsb";
};
buildInputs = [ pidgin ];
installPhase = ''
mkdir -p $out/lib/pidgin/
cp xmpp-receipts.so $out/lib/pidgin/
'';
meta = with lib; {
homepage = "http://devel.kondorgulasch.de/pidgin-xmpp-receipts/";
description = "Message delivery receipts (XEP-0184) Pidgin plugin";
license = licenses.gpl3;
platforms = platforms.linux;
maintainers = with maintainers; [ orivej ];
};
}

View File

@@ -0,0 +1,41 @@
{
lib,
stdenv,
fetchFromGitHub,
imagemagick,
gettext,
pidgin,
json-glib,
}:
stdenv.mkDerivation {
pname = "purple-discord";
version = "unstable-2021-10-17";
src = fetchFromGitHub {
owner = "EionRobb";
repo = "purple-discord";
rev = "b7ac72399218d2ce011ac84bb171b572560aa2d2";
sha256 = "0xvj9rdvgsvcr55sk9m40y07rchg699l1yr98xqwx7sc2sba3814";
};
nativeBuildInputs = [
imagemagick
gettext
];
buildInputs = [
pidgin
json-glib
];
PKG_CONFIG_PURPLE_PLUGINDIR = "${placeholder "out"}/lib/purple-2";
PKG_CONFIG_PURPLE_DATADIR = "${placeholder "out"}/share";
meta = with lib; {
homepage = "https://github.com/EionRobb/purple-discord";
description = "Discord plugin for Pidgin";
license = licenses.gpl3;
platforms = platforms.linux;
maintainers = with maintainers; [ sna ];
};
}

View File

@@ -0,0 +1,41 @@
{
lib,
stdenv,
fetchFromGitHub,
pidgin,
glib,
json-glib,
protobuf,
protobufc,
}:
stdenv.mkDerivation {
pname = "purple-googlechat";
version = "unstable-2021-10-18";
src = fetchFromGitHub {
owner = "EionRobb";
repo = "purple-googlechat";
rev = "56ba7f79883eca67d37629d365776f6c0b40abdc";
sha256 = "sha256-iTYVgYI9+6rqqBl5goeEAXpK8FgHDv0MmPsV/82reWA=";
};
nativeBuildInputs = [ protobufc ];
buildInputs = [
pidgin
glib
json-glib
protobuf
];
PKG_CONFIG_PURPLE_PLUGINDIR = "${placeholder "out"}/lib/purple-2";
PKG_CONFIG_PURPLE_DATADIR = "${placeholder "out"}/share";
meta = with lib; {
homepage = "https://github.com/EionRobb/purple-googlechat";
description = "Native Google Chat support for pidgin";
license = licenses.gpl3Plus;
platforms = platforms.linux;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,47 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
pidgin,
minixml,
libxml2,
sqlite,
libgcrypt,
}:
stdenv.mkDerivation rec {
pname = "purple-lurch";
version = "0.7.0";
src = fetchFromGitHub {
owner = "gkdr";
repo = "lurch";
rev = "v${version}";
hash = "sha256-yyzotKL1Z4B2BxloJndJKemONMPLG9pVDVe2K5AL05g=";
fetchSubmodules = true;
};
nativeBuildInputs = [ cmake ];
buildInputs = [
pidgin
minixml
libxml2
sqlite
libgcrypt
];
dontUseCmakeConfigure = true;
installPhase = ''
install -Dm755 -t $out/lib/purple-2 build/lurch.so
'';
meta = with lib; {
homepage = "https://github.com/gkdr/lurch";
description = "XEP-0384: OMEMO Encryption for libpurple";
license = licenses.gpl3;
platforms = platforms.linux;
maintainers = with maintainers; [ emmanuelrosa ];
};
}

View File

@@ -0,0 +1,42 @@
{
lib,
stdenv,
glibmm,
pidgin,
pkg-config,
modemmanager,
fetchFromGitLab,
}:
stdenv.mkDerivation rec {
pname = "purple-mm-sms";
version = "0.1.7";
src = fetchFromGitLab {
domain = "source.puri.sm";
owner = "Librem5";
repo = "purple-mm-sms";
rev = "v${version}";
sha256 = "0917gjig35hmi6isqb62vhxd3lkc2nwdn13ym2gvzgcjfgjzjajr";
};
makeFlags = [
"DATA_ROOT_DIR_PURPLE=$(out)/share"
"PLUGIN_DIR_PURPLE=$(out)/lib/purple-2"
];
nativeBuildInputs = [ pkg-config ];
buildInputs = [
glibmm
pidgin
modemmanager
];
meta = with lib; {
homepage = "https://source.puri.sm/Librem5/purple-mm-sms";
description = "Libpurple plugin for sending and receiving SMS via Modemmanager";
license = licenses.gpl3Plus;
platforms = platforms.linux;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,43 @@
{
lib,
stdenv,
fetchurl,
meson,
ninja,
pidgin,
}:
stdenv.mkDerivation {
pname = "purple-plugin-pack";
version = "2.8.0";
src = fetchurl {
url = "mirror://sourceforge/pidgin/purple-plugin-pack-2.8.0.tar.xz";
hash = "sha256-gszemnJRp1t+A6P5qSkBTY4AjBtvRuWGOPX0dto+JC0=";
};
postPatch = ''
substituteInPlace meson.build \
--replace "PURPLE.get_pkgconfig_variable('plugindir')" "'$out/lib/purple-2'" \
--replace "PURPLE.get_pkgconfig_variable('datadir')" "'$out/share'" \
--replace "PIDGIN.get_pkgconfig_variable('plugindir')" "'$out/lib/pidgin'" \
--replace "PIDGIN.get_pkgconfig_variable('datadir')" "'$out/share'"
'';
nativeBuildInputs = [
meson
ninja
];
buildInputs = [
pidgin
];
meta = with lib; {
homepage = "https://keep.imfreedom.org/pidgin/purple-plugin-pack";
description = "Collection of plugins for purple-based clients such as Pidgin";
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ bdimcheff ];
};
}

View File

@@ -0,0 +1,33 @@
{
lib,
stdenv,
fetchFromGitHub,
pidgin,
pkg-config,
}:
stdenv.mkDerivation {
pname = "purple-slack-unstable";
version = "2020-09-22";
src = fetchFromGitHub {
owner = "dylex";
repo = "slack-libpurple";
rev = "2e9fa028224b02e29473b1b998fc1e5f487e79ec";
sha256 = "1sksqshiwldd32k8jmiflp2pcax31ym6rypr4qa4v5vdn907g80m";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [ pidgin ];
PKG_CONFIG_PURPLE_PLUGINDIR = "${placeholder "out"}/lib/purple-2";
PKG_CONFIG_PURPLE_DATAROOTDIR = "${placeholder "out"}/share";
meta = with lib; {
homepage = "https://github.com/dylex/slack-libpurple";
description = "Slack plugin for Pidgin";
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = with maintainers; [ eyjhb ];
};
}

View File

@@ -0,0 +1,38 @@
{
lib,
stdenv,
fetchFromGitHub,
pidgin,
glib,
libxml2,
}:
stdenv.mkDerivation {
pname = "purple-xmpp-upload";
version = "unstable-2021-11-04";
src = fetchFromGitHub {
owner = "Junker";
repo = "purple-xmpp-http-upload";
rev = "f370b4a2c474c6fe4098d929d8b7c18aeba87b6b";
sha256 = "0n05jybmibn44xb660p08vrrbanfsyjn17w1xm9gwl75fxxq8cdc";
};
buildInputs = [
pidgin
glib
libxml2
];
installPhase = ''
install -Dm644 -t $out/lib/purple-2 jabber_http_file_upload.so
'';
meta = with lib; {
homepage = "https://github.com/Junker/purple-xmpp-http-upload";
description = "HTTP File Upload plugin for libpurple (XMPP Protocol XEP-0363)";
license = licenses.gpl3;
platforms = platforms.linux;
maintainers = with maintainers; [ emmanuelrosa ];
};
}

View File

@@ -0,0 +1,21 @@
diff --git a/src/core/sipe-xml.c b/src/core/sipe-xml.c
index cfc5311..c38f6e8 100644
--- a/src/core/sipe-xml.c
+++ b/src/core/sipe-xml.c
@@ -29,6 +29,7 @@
#include <time.h>
#include "libxml/parser.h"
+#include "libxml/xmlerror.h"
#include "libxml/c14n.h"
#include "libxml/xmlversion.h"
@@ -154,7 +155,7 @@ static void callback_error(void *user_data, const char *msg, ...)
g_free(errmsg);
}
-static void callback_serror(void *user_data, xmlErrorPtr error)
+static void callback_serror(void *user_data, const xmlError *error)
{
struct _parser_data *pd = user_data;

View File

@@ -0,0 +1,59 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
pidgin,
intltool,
libxml2,
gmime,
nss,
}:
stdenv.mkDerivation rec {
pname = "pidgin-sipe";
version = "1.25.0";
src = fetchurl {
url = "mirror://sourceforge/sipe/${pname}-${version}.tar.gz";
sha256 = "0262sz00iqxylx0xfyr48xikhiqzr8pg7b4b7vwj5iv4qxpxv939";
};
patches = [
# add sipe_utils_memdup() function
(fetchpatch {
url = "https://repo.or.cz/siplcs.git/patch/567d0ddc0692adfef5f15d0d383825a9b2ea4b49";
sha256 = "24L8ZfoOGc3JoTCGxuTNjuHzt5QgFDu1+vSoJpGvde4=";
})
# replace g_memdup() with sipe_utils_memdup()
# g_memdup is deprecatein newer Glib
(fetchpatch {
url = "https://repo.or.cz/siplcs.git/patch/583a734e63833f03d11798b7b0d59a17d08ae60f";
sha256 = "Ai6Czpy/FYvBi4GZR7yzch6OcouJgfreI9HcojhGVV4=";
})
./0001-fix-libxml-error-signature.patch
];
nativeBuildInputs = [ intltool ];
buildInputs = [
pidgin
gmime
libxml2
nss
];
configureFlags = [
"--without-dbus"
"--enable-quality-check=no"
];
enableParallelBuilding = true;
postInstall = "ln -s \$out/lib/purple-2 \$out/share/pidgin-sipe";
meta = with lib; {
description = "SIPE plugin for Pidgin IM";
homepage = "http://sipe.sourceforge.net/";
license = licenses.gpl2;
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,60 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
cmake,
libwebp,
pidgin,
tdlib,
}:
stdenv.mkDerivation rec {
pname = "tdlib-purple";
version = "0.8.1";
src = fetchFromGitHub {
owner = "ars3niy";
repo = "tdlib-purple";
rev = "v${version}";
sha256 = "sha256-mrowzTtNLyMc2WwLVIop8Mg2DbyiQs0OPXmJuM9QUnM=";
};
patches = [
# Update to tdlib 1.8.0
(fetchpatch {
url = "https://github.com/ars3niy/tdlib-purple/commit/8c87b899ddbec32ec6ab4a34ddf0dc770f97d396.patch";
sha256 = "sha256-sysPYPno+wS8mZwQAXtX5eVnhwKAZrtr5gXuddN3mko=";
})
];
preConfigure = ''
sed -i -e 's|DESTINATION.*PURPLE_PLUGIN_DIR}|DESTINATION "lib/purple-2|' CMakeLists.txt
sed -i -e 's|DESTINATION.*PURPLE_DATA_DIR}|DESTINATION "share|' CMakeLists.txt
'';
nativeBuildInputs = [ cmake ];
buildInputs = [
libwebp
pidgin
tdlib
];
cmakeFlags = [ "-DNoVoip=True" ]; # libtgvoip required
env.NIX_CFLAGS_COMPILE = toString (
lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ "-U__ARM_NEON__" ]
);
meta = with lib; {
homepage = "https://github.com/ars3niy/tdlib-purple";
description = "libpurple Telegram plugin using tdlib";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ sikmir ];
platforms = platforms.unix;
# tdlib-purple is not actively maintained and currently not
# compatible with recent versions of tdlib
broken = true;
};
}

View File

@@ -0,0 +1,26 @@
{
lib,
stdenv,
fetchurl,
pidgin,
}:
stdenv.mkDerivation rec {
pname = "pidgin-window-merge";
version = "0.3";
src = fetchurl {
url = "https://github.com/downloads/dm0-/window_merge/window_merge-${version}.tar.gz";
sha256 = "0cb5rvi7jqvm345g9mlm4wpq0240kcybv81jpw5wlx7hz0lwi478";
};
buildInputs = [ pidgin ];
meta = with lib; {
homepage = "https://github.com/dm0-/window_merge";
description = "Pidgin plugin that merges the Buddy List window with a conversation window";
license = licenses.gpl3;
platforms = platforms.linux;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,27 @@
{
lib,
symlinkJoin,
pidgin,
makeWrapper,
plugins,
}:
let
extraArgs = map (x: x.wrapArgs or "") plugins;
in
symlinkJoin {
name = "pidgin-with-plugins-${pidgin.version}";
paths = [ pidgin ] ++ plugins;
nativeBuildInputs = [ makeWrapper ];
postBuild = ''
wrapProgram $out/bin/pidgin \
--suffix-each PURPLE_PLUGIN_PATH ':' "$out/lib/purple-${lib.versions.major pidgin.version} $out/lib/pidgin" \
${toString extraArgs}
wrapProgram $out/bin/finch \
--suffix-each PURPLE_PLUGIN_PATH ':' "$out/lib/purple-${lib.versions.major pidgin.version}" \
${toString extraArgs}
'';
}

View File

@@ -0,0 +1,123 @@
{
lib,
stdenv,
fetchFromGitHub,
autoconf-archive,
autoreconfHook,
cmocka,
curl,
expat,
expect,
glib,
glibcLocales,
libstrophe,
libmicrohttpd,
libotr,
libuuid,
ncurses,
openssl,
pkg-config,
readline,
sqlite,
autoAwaySupport ? true,
libXScrnSaver,
libX11,
notifySupport ? true,
libnotify,
gdk-pixbuf,
omemoSupport ? true,
libsignal-protocol-c,
libgcrypt,
qrencode,
pgpSupport ? true,
gpgme,
pythonPluginSupport ? true,
python3,
traySupport ? true,
gtk3,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "profanity";
version = "0.15.1";
src = fetchFromGitHub {
owner = "profanity-im";
repo = "profanity";
rev = finalAttrs.version;
hash = "sha256-h+R+hasc45NZOneuqZ+z+yjfpsPm317OXq0LYe3t+cQ=";
};
patches = [
./patches/packages-osx.patch
];
enableParallelBuilding = true;
nativeBuildInputs = [
autoconf-archive
autoreconfHook
glibcLocales
pkg-config
];
buildInputs = [
cmocka
curl
expat
expect
glib
libstrophe
libmicrohttpd
libotr
libuuid
ncurses
openssl
readline
sqlite
]
++ lib.optionals autoAwaySupport [
libXScrnSaver
libX11
]
++ lib.optionals notifySupport [
libnotify
gdk-pixbuf
]
++ lib.optionals omemoSupport [
libsignal-protocol-c
libgcrypt
qrencode
]
++ lib.optionals pgpSupport [ gpgme ]
++ lib.optionals pythonPluginSupport [ python3 ]
++ lib.optionals traySupport [ gtk3 ];
# Enable feature flags, so that build fail if libs are missing
configureFlags = [
"--enable-c-plugins"
"--enable-otr"
]
++ lib.optionals notifySupport [ "--enable-notifications" ]
++ lib.optionals traySupport [ "--enable-icons-and-clipboard" ]
++ lib.optionals pgpSupport [ "--enable-pgp" ]
++ lib.optionals pythonPluginSupport [ "--enable-python-plugins" ]
++ lib.optionals omemoSupport [ "--enable-omemo" ];
doCheck = true;
LC_ALL = "en_US.utf8";
meta = with lib; {
homepage = "http://www.profanity.im/";
description = "Console based XMPP client";
mainProgram = "profanity";
longDescription = ''
Profanity is a console based XMPP client written in C using ncurses and
libstrophe, inspired by Irssi.
'';
license = licenses.gpl3Plus;
maintainers = [ maintainers.devhell ];
platforms = platforms.unix;
};
})

View File

@@ -0,0 +1,13 @@
diff --git a/configure.ac b/configure.ac
index 5c00aca..eb78060 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,6 @@ PLATFORM="unknown"
AS_CASE([$host_os],
[freebsd*], [PLATFORM="freebsd"],
[openbsd*], [PLATFORM="openbsd"],
- [darwin*], [PLATFORM="osx"],
[cygwin], [PLATFORM="cygwin"],
[PLATFORM="nix"])

View File

@@ -0,0 +1,120 @@
{
lib,
mkDerivation,
fetchFromGitHub,
cmake,
qtbase,
qtmultimedia,
qtimageformats,
qtx11extras,
qttools,
libidn,
qca-qt5,
libXScrnSaver,
hunspell,
libsecret,
libgcrypt,
libgpg-error,
usrsctp,
qtkeychain,
chatType ? "basic", # See the assertion below for available options
qtwebkit,
qtwebengine,
enablePlugins ? true,
html-tidy,
http-parser,
libotr,
libomemo-c,
# Voice messages
voiceMessagesSupport ? true,
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 {
pname = "psi-plus";
version = "1.5.2115";
src = fetchFromGitHub {
owner = "psi-plus";
repo = "psi-plus-snapshots";
rev = version;
sha256 = "sha256-4is3ksl6IsYP1L0WhTT/56QUtR+EC1X6Lftre2BO6pM=";
};
cmakeFlags = [
"-DCHAT_TYPE=${chatType}"
"-DENABLE_PLUGINS=${if enablePlugins then "ON" else "OFF"}"
"-DBUILD_PSIMEDIA=${if enablePsiMedia then "ON" else "OFF"}"
];
nativeBuildInputs = [
cmake
qttools
]
++ lib.optionals enablePsiMedia [
pkg-config
];
buildInputs = [
qtbase
qtmultimedia
qtimageformats
qtx11extras
libidn
qca-qt5
libXScrnSaver
hunspell
libsecret
libgcrypt
libgpg-error
usrsctp
qtkeychain
]
++ lib.optionals voiceMessagesSupport [
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good
]
++ lib.optionals enablePlugins [
html-tidy
http-parser
libotr
libomemo-c
]
++ lib.optionals (chatType == "webkit") [
qtwebkit
]
++ lib.optionals (chatType == "webengine") [
qtwebengine
];
preFixup = lib.optionalString voiceMessagesSupport ''
qtWrapperArgs+=(
--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0"
)
'';
meta = {
homepage = "https://psi-plus.com";
description = "XMPP (Jabber) client based on Qt5";
mainProgram = "psi-plus";
maintainers = with lib.maintainers; [
orivej
unclechu
];
license = lib.licenses.gpl2Only;
platforms = lib.platforms.linux;
};
}

View File

@@ -0,0 +1,53 @@
{
lib,
mkDerivation,
fetchFromGitHub,
cmake,
qtbase,
qtmultimedia,
qtx11extras,
qttools,
qtwebengine,
libidn,
qca-qt5,
libXScrnSaver,
hunspell,
}:
mkDerivation rec {
pname = "psi";
version = "1.5";
src = fetchFromGitHub {
owner = "psi-im";
repo = "psi";
rev = version;
sha256 = "hXDZODHl14kimRlMQ1XjISQ2kk9NS78axVN3U21wkuM=";
fetchSubmodules = true;
};
patches = [
./fix-cmake-hunspell-1.7.patch
];
nativeBuildInputs = [
cmake
qttools
];
buildInputs = [
qtbase
qtmultimedia
qtx11extras
qtwebengine
libidn
qca-qt5
libXScrnSaver
hunspell
];
meta = with lib; {
homepage = "https://psi-im.org";
description = "XMPP (Jabber) client";
mainProgram = "psi";
maintainers = [ maintainers.raskin ];
license = licenses.gpl2;
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,12 @@
diff --git a/cmake/modules/FindHunspell.cmake b/cmake/modules/FindHunspell.cmake
index a2d180b3..3a5aef3a 100644
--- a/cmake/modules/FindHunspell.cmake
+++ b/cmake/modules/FindHunspell.cmake
@@ -64,6 +64,7 @@ set(HUNSPELL_NAMES
hunspell-1.4
hunspell-1.5
hunspell-1.6
+ hunspell-1.7
libhunspell${d}
)
find_library(

View File

@@ -0,0 +1,77 @@
{
stdenv,
lib,
fetchFromGitHub,
cmake,
wrapQtAppsHook,
qtbase,
qtquickcontrols2 ? null, # only a separate package on qt5
qtkeychain,
qtmultimedia,
qttools,
libquotient,
libsecret,
olm,
}:
let
inherit (lib) cmakeBool;
in
stdenv.mkDerivation (finalAttrs: {
pname = "quaternion";
version = "0.0.96.1";
src = fetchFromGitHub {
owner = "quotient-im";
repo = "Quaternion";
rev = finalAttrs.version;
hash = "sha256-lRCSEb/ldVnEv6z0moU4P5rf0ssKb9Bw+4QEssLjuwI=";
};
buildInputs = [
libquotient
libsecret
olm
qtbase
qtkeychain
qtmultimedia
qtquickcontrols2
];
nativeBuildInputs = [
cmake
qttools
wrapQtAppsHook
];
# qt6 needs UTF
env.LANG = "C.UTF-8";
cmakeFlags = [
# drop this from 0.0.97 onwards as it will be qt6 only
(cmakeBool "BUILD_WITH_QT6" ((lib.versions.major qtbase.version) == "6"))
];
postInstall =
if stdenv.hostPlatform.isDarwin then
''
mkdir -p $out/Applications
mv $out/bin/quaternion.app $out/Applications
rmdir $out/bin || :
''
else
''
substituteInPlace $out/share/applications/com.github.quaternion.desktop \
--replace 'Exec=quaternion' "Exec=$out/bin/quaternion"
'';
meta = with lib; {
description = "Cross-platform desktop IM client for the Matrix protocol";
mainProgram = "quaternion";
homepage = "https://matrix.org/ecosystem/clients/quaternion/";
license = licenses.gpl3;
maintainers = with maintainers; [ peterhoeg ];
inherit (qtbase.meta) platforms;
};
})

View File

@@ -0,0 +1,38 @@
{
stdenvNoCC,
lib,
fetchzip,
}:
stdenvNoCC.mkDerivation rec {
pname = "ripcord";
version = "0.4.29";
src = fetchzip {
url = "https://cancel.fm/dl/Ripcord_Mac_${version}.zip";
sha256 = "sha256-v8iydjLBjFN5LuctpcBpEkhSICxPhLKzLjSASWtsQok=";
stripRoot = false;
};
dontBuild = true;
dontFixup = true; # modification is not allowed by the license https://cancel.fm/ripcord/shareware-redistribution/
installPhase = ''
runHook preInstall
mkdir -p $out/Applications
cp -r $src/Ripcord.app $out/Applications/
runHook postInstall
'';
meta = with lib; {
description = "Desktop chat client for Slack and Discord";
homepage = "https://cancel.fm/ripcord/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
# See: https://cancel.fm/ripcord/shareware-redistribution/
license = licenses.unfreeRedistributable;
maintainers = with maintainers; [ mikroskeem ];
platforms = [ "x86_64-darwin" ];
};
}

View File

@@ -0,0 +1,108 @@
{
lib,
mkDerivation,
fetchurl,
makeFontsConf,
appimageTools,
qtbase,
qtsvg,
qtmultimedia,
qtwebsockets,
qtimageformats,
autoPatchelfHook,
desktop-file-utils,
imagemagick,
twemoji-color-font,
xorg,
libsodium,
libopus,
libGL,
alsa-lib,
}:
mkDerivation rec {
pname = "ripcord";
version = "0.4.29";
src =
let
appimage = fetchurl {
url = "https://cancel.fm/dl/Ripcord-${version}-x86_64.AppImage";
sha256 = "sha256-4yDLPEBDsPKWtLwdpmSyl3b5XCwLAr2/EVtNRrFmmJk=";
name = "${pname}-${version}.AppImage";
};
in
appimageTools.extract {
inherit pname version;
src = appimage;
};
nativeBuildInputs = [
autoPatchelfHook
desktop-file-utils
imagemagick
];
buildInputs = [
libsodium
libopus
libGL
alsa-lib
]
++ [
qtbase
qtsvg
qtmultimedia
qtwebsockets
qtimageformats
]
++ (with xorg; [
libX11
libXScrnSaver
libXcursor
xkeyboardconfig
]);
fontsConf = makeFontsConf {
fontDirectories = [ twemoji-color-font ];
};
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r ${src}/{qt.conf,translations,twemoji.ripdb} $out
for size in 16 32 48 64 72 96 128 192 256 512 1024; do
mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps
convert -resize "$size"x"$size" ${src}/Ripcord_Icon.png $out/share/icons/hicolor/"$size"x"$size"/apps/ripcord.png
done
desktop-file-install --dir $out/share/applications \
--set-key Exec --set-value ripcord \
--set-key Icon --set-value ripcord \
--set-key Comment --set-value "${meta.description}" \
${src}/Ripcord.desktop
mv $out/share/applications/Ripcord.desktop $out/share/applications/ripcord.desktop
install -Dm755 ${src}/Ripcord $out/Ripcord
patchelf --replace-needed libsodium.so.18 libsodium.so $out/Ripcord
makeQtWrapper $out/Ripcord $out/bin/ripcord \
--chdir "$out" \
--set FONTCONFIG_FILE "${fontsConf}" \
--prefix LD_LIBRARY_PATH ":" "${xorg.libXcursor}/lib" \
--prefix QT_XKB_CONFIG_ROOT ":" "${xorg.xkeyboardconfig}/share/X11/xkb" \
--set RIPCORD_ALLOW_UPDATES 0
runHook postInstall
'';
meta = with lib; {
description = "Desktop chat client for Slack and Discord";
homepage = "https://cancel.fm/ripcord/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
# See: https://cancel.fm/ripcord/shareware-redistribution/
license = licenses.unfreeRedistributable;
maintainers = [ ];
platforms = [ "x86_64-linux" ];
};
}

View File

@@ -0,0 +1,93 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
libsForQt5,
yasm,
alsa-lib,
jemalloc,
libopus,
libpulseaudio,
withWebkit ? true,
}:
let
telegram-desktop = libsForQt5.callPackage ../telegram-desktop {
inherit stdenv;
# N/A on Qt5
kimageformats = null;
};
version = "1.4.9";
tg_owt = telegram-desktop.tg_owt.overrideAttrs (oldAttrs: {
version = "0-unstable-2024-06-15";
src = fetchFromGitHub {
owner = "desktop-app";
repo = "tg_owt";
rev = "c9cc4390ab951f2cbc103ff783a11f398b27660b";
hash = "sha256-FfWmSYaeryTDbsGJT3R7YK1oiyJcrR7YKKBOF+9PmpY=";
fetchSubmodules = true;
};
patches = [
(fetchpatch {
url = "https://webrtc.googlesource.com/src/+/e7d10047096880feb5e9846375f2da54aef91202%5E%21/?format=TEXT";
decode = "base64 -d";
stripLen = 1;
extraPrefix = "src/";
hash = "sha256-goxnuRRbwcdfIk1jFaKGiKCTCYn2saEj7En1Iyglzko=";
})
];
nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [ yasm ];
});
in
telegram-desktop.override {
pname = "kotatogram-desktop";
inherit withWebkit;
unwrapped = (telegram-desktop.unwrapped.override { inherit tg_owt; }).overrideAttrs (old: {
pname = "kotatogram-desktop-unwrapped";
version = "${version}-unstable-2024-09-27";
src = fetchFromGitHub {
owner = "kotatogram";
repo = "kotatogram-desktop";
rev = "0581eb6219343b3cfcbb81124b372df1039b7568";
hash = "sha256-rvn8GZmHdMkVutLUe/LmUNIawlb9VgU3sYhPwZ2MWsI=";
fetchSubmodules = true;
};
patches = [
./macos-qt5.patch
(fetchpatch {
url = "https://gitlab.com/mnauw/cppgir/-/commit/c8bb1c6017a6f7f2e47bd10543aea6b3ec69a966.patch";
stripLen = 1;
extraPrefix = "cmake/external/glib/cppgir/";
hash = "sha256-8B4h3BTG8dIlt3+uVgBI569E9eCebcor9uohtsrZpnI=";
})
];
buildInputs = (old.buildInputs or [ ]) ++ [
alsa-lib
jemalloc
libopus
libpulseaudio
];
meta = {
description = "Kotatogram experimental Telegram Desktop fork";
longDescription = ''
Unofficial desktop client for the Telegram messenger, based on Telegram Desktop.
It contains some useful (or purely cosmetic) features, but they could be unstable. A detailed list is available here: https://kotatogram.github.io/changes
'';
license = lib.licenses.gpl3Only;
platforms = lib.platforms.all;
homepage = "https://kotatogram.github.io";
changelog = "https://github.com/kotatogram/kotatogram-desktop/releases/tag/k${version}";
maintainers = with lib.maintainers; [ ilya-fedin ];
mainProgram = if stdenv.hostPlatform.isLinux then "kotatogram-desktop" else "Kotatogram";
};
});
}

View File

@@ -0,0 +1,75 @@
diff --git a/Telegram/SourceFiles/platform/mac/main_window_mac.h b/Telegram/SourceFiles/platform/mac/main_window_mac.h
index 2a3a59b9cf..16b7b6cdde 100644
--- a/Telegram/SourceFiles/platform/mac/main_window_mac.h
+++ b/Telegram/SourceFiles/platform/mac/main_window_mac.h
@@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "platform/platform_main_window.h"
#include "platform/mac/specific_mac_p.h"
#include "base/timer.h"
+#include "base/qt/qt_common_adapters.h"
#include <QtWidgets/QMenuBar>
#include <QtCore/QTimer>
@@ -52,7 +53,7 @@ private:
bool nativeEvent(
const QByteArray &eventType,
void *message,
- qintptr *result) override;
+ base::NativeEventResult *result) override;
void hideAndDeactivate();
void updateDockCounter();
diff --git a/Telegram/SourceFiles/platform/mac/main_window_mac.mm b/Telegram/SourceFiles/platform/mac/main_window_mac.mm
index e95ef79f16..c3381926a9 100644
--- a/Telegram/SourceFiles/platform/mac/main_window_mac.mm
+++ b/Telegram/SourceFiles/platform/mac/main_window_mac.mm
@@ -305,7 +305,7 @@ void MainWindow::updateWindowIcon() {
bool MainWindow::nativeEvent(
const QByteArray &eventType,
void *message,
- qintptr *result) {
+ base::NativeEventResult *result) {
if (message && eventType == "NSEvent") {
const auto event = static_cast<NSEvent*>(message);
if (PossiblyTextTypingEvent(event)) {
diff --git a/Telegram/SourceFiles/platform/mac/notifications_manager_mac.mm b/Telegram/SourceFiles/platform/mac/notifications_manager_mac.mm
index de28809077..2521428567 100644
--- a/Telegram/SourceFiles/platform/mac/notifications_manager_mac.mm
+++ b/Telegram/SourceFiles/platform/mac/notifications_manager_mac.mm
@@ -502,11 +502,11 @@ void Manager::Private::invokeIfNotFocused(Fn<void()> callback) {
} else {
if (!_processesInited) {
_processesInited = true;
- QObject::connect(&_dnd, &QProcess::finished, [=] {
+ QObject::connect(&_dnd, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), [=] {
_waitingDnd = false;
checkFocusState();
});
- QObject::connect(&_focus, &QProcess::finished, [=] {
+ QObject::connect(&_focus, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), [=] {
_waitingFocus = false;
checkFocusState();
});
@@ -536,7 +536,7 @@ void Manager::Private::checkFocusState() {
}
const auto istrue = [](QProcess &process) {
const auto output = process.readAllStandardOutput();
- DEBUG_LOG(("Focus Check: %1").arg(output));
+ DEBUG_LOG(("Focus Check: %1").arg(QString::fromUtf8(output)));
const auto result = (output.trimmed() == u"true"_q);
return result;
};
Submodule Telegram/lib_ui contains modified content
diff --git a/Telegram/lib_ui/ui/rp_widget.cpp b/Telegram/lib_ui/ui/rp_widget.cpp
index 0b57704..0d2ca01 100644
--- a/Telegram/lib_ui/ui/rp_widget.cpp
+++ b/Telegram/lib_ui/ui/rp_widget.cpp
@@ -62,7 +62,7 @@ TWidget::TWidget(QWidget *parent)
auto format = QSurfaceFormat::defaultFormat();
format.setSwapInterval(0);
#ifdef Q_OS_MAC
- format.setColorSpace(QColorSpace::SRgb);
+ format.setColorSpace(QSurfaceFormat::sRGBColorSpace);
#endif // Q_OS_MAC
QSurfaceFormat::setDefaultFormat(format);
return true;

View File

@@ -0,0 +1,554 @@
diff --git a/src/api/environment/environment.h b/src/api/environment/environment.h
index d86b7ae78..cc2761f71 100644
--- a/src/api/environment/environment.h
+++ b/src/api/environment/environment.h
@@ -99,10 +99,10 @@ class RTC_EXPORT Environment final {
private:
friend class EnvironmentFactory;
Environment(scoped_refptr<const rtc::RefCountedBase> storage,
- absl::Nonnull<const FieldTrialsView*> field_trials,
- absl::Nonnull<Clock*> clock,
- absl::Nonnull<TaskQueueFactory*> task_queue_factory,
- absl::Nonnull<RtcEventLog*> event_log)
+ const FieldTrialsView* absl_nonnull field_trials,
+ Clock* absl_nonnull clock,
+ TaskQueueFactory* absl_nonnull task_queue_factory,
+ RtcEventLog* absl_nonnull event_log)
: storage_(std::move(storage)),
field_trials_(field_trials),
clock_(clock),
@@ -117,10 +117,10 @@ class RTC_EXPORT Environment final {
// `storage_` is alive.
scoped_refptr<const rtc::RefCountedBase> storage_;
- absl::Nonnull<const FieldTrialsView*> field_trials_;
- absl::Nonnull<Clock*> clock_;
- absl::Nonnull<TaskQueueFactory*> task_queue_factory_;
- absl::Nonnull<RtcEventLog*> event_log_;
+ const FieldTrialsView* absl_nonnull field_trials_;
+ Clock* absl_nonnull clock_;
+ TaskQueueFactory* absl_nonnull task_queue_factory_;
+ RtcEventLog* absl_nonnull event_log_;
};
//------------------------------------------------------------------------------
diff --git a/src/api/environment/environment_factory.cc b/src/api/environment/environment_factory.cc
index c0b681aa0..ded3effe8 100644
--- a/src/api/environment/environment_factory.cc
+++ b/src/api/environment/environment_factory.cc
@@ -25,12 +25,12 @@ namespace webrtc {
namespace {
template <typename T>
-void Store(absl::Nonnull<std::unique_ptr<T>> value,
+void Store(std::unique_ptr<T> absl_nonnull value,
scoped_refptr<const rtc::RefCountedBase>& leaf) {
class StorageNode : public rtc::RefCountedBase {
public:
StorageNode(scoped_refptr<const rtc::RefCountedBase> parent,
- absl::Nonnull<std::unique_ptr<T>> value)
+ std::unique_ptr<T> absl_nonnull value)
: parent_(std::move(parent)), value_(std::move(value)) {}
StorageNode(const StorageNode&) = delete;
@@ -40,7 +40,7 @@ void Store(absl::Nonnull<std::unique_ptr<T>> value,
private:
scoped_refptr<const rtc::RefCountedBase> parent_;
- absl::Nonnull<std::unique_ptr<T>> value_;
+ std::unique_ptr<T> absl_nonnull value_;
};
// Utilities provided with ownership form a tree:
@@ -63,14 +63,14 @@ EnvironmentFactory::EnvironmentFactory(const Environment& env)
event_log_(env.event_log_) {}
void EnvironmentFactory::Set(
- absl::Nullable<std::unique_ptr<const FieldTrialsView>> utility) {
+ std::unique_ptr<const FieldTrialsView> absl_nullable utility) {
if (utility != nullptr) {
field_trials_ = utility.get();
Store(std::move(utility), leaf_);
}
}
-void EnvironmentFactory::Set(absl::Nullable<std::unique_ptr<Clock>> utility) {
+void EnvironmentFactory::Set(std::unique_ptr<Clock> absl_nullable utility) {
if (utility != nullptr) {
clock_ = utility.get();
Store(std::move(utility), leaf_);
@@ -78,7 +78,7 @@ void EnvironmentFactory::Set(absl::Nullable<std::unique_ptr<Clock>> utility) {
}
void EnvironmentFactory::Set(
- absl::Nullable<std::unique_ptr<TaskQueueFactory>> utility) {
+ std::unique_ptr<TaskQueueFactory> absl_nullable utility) {
if (utility != nullptr) {
task_queue_factory_ = utility.get();
Store(std::move(utility), leaf_);
@@ -86,7 +86,7 @@ void EnvironmentFactory::Set(
}
void EnvironmentFactory::Set(
- absl::Nullable<std::unique_ptr<RtcEventLog>> utility) {
+ std::unique_ptr<RtcEventLog> absl_nullable utility) {
if (utility != nullptr) {
event_log_ = utility.get();
Store(std::move(utility), leaf_);
diff --git a/src/api/environment/environment_factory.h b/src/api/environment/environment_factory.h
index a0fc3effd..b6be04f6a 100644
--- a/src/api/environment/environment_factory.h
+++ b/src/api/environment/environment_factory.h
@@ -54,15 +54,15 @@ class RTC_EXPORT EnvironmentFactory final {
~EnvironmentFactory() = default;
- void Set(absl::Nullable<std::unique_ptr<const FieldTrialsView>> utility);
- void Set(absl::Nullable<std::unique_ptr<Clock>> utility);
- void Set(absl::Nullable<std::unique_ptr<TaskQueueFactory>> utility);
- void Set(absl::Nullable<std::unique_ptr<RtcEventLog>> utility);
+ void Set(std::unique_ptr<const FieldTrialsView> absl_nullable utility);
+ void Set(std::unique_ptr<Clock> absl_nullable utility);
+ void Set(std::unique_ptr<TaskQueueFactory> absl_nullable utility);
+ void Set(std::unique_ptr<RtcEventLog> absl_nullable utility);
- void Set(absl::Nullable<const FieldTrialsView*> utility);
- void Set(absl::Nullable<Clock*> utility);
- void Set(absl::Nullable<TaskQueueFactory*> utility);
- void Set(absl::Nullable<RtcEventLog*> utility);
+ void Set(const FieldTrialsView* absl_nullable utility);
+ void Set(Clock* absl_nullable utility);
+ void Set(TaskQueueFactory* absl_nullable utility);
+ void Set(RtcEventLog* absl_nullable utility);
Environment Create() const;
@@ -71,10 +71,10 @@ class RTC_EXPORT EnvironmentFactory final {
scoped_refptr<const rtc::RefCountedBase> leaf_;
- absl::Nullable<const FieldTrialsView*> field_trials_ = nullptr;
- absl::Nullable<Clock*> clock_ = nullptr;
- absl::Nullable<TaskQueueFactory*> task_queue_factory_ = nullptr;
- absl::Nullable<RtcEventLog*> event_log_ = nullptr;
+ const FieldTrialsView* absl_nullable field_trials_ = nullptr;
+ Clock* absl_nullable clock_ = nullptr;
+ TaskQueueFactory* absl_nullable task_queue_factory_ = nullptr;
+ RtcEventLog* absl_nullable event_log_ = nullptr;
};
// Helper for concise way to create an environment.
@@ -97,25 +97,25 @@ Environment CreateEnvironment(Utilities&&... utilities);
//------------------------------------------------------------------------------
inline void EnvironmentFactory::Set(
- absl::Nullable<const FieldTrialsView*> utility) {
+ const FieldTrialsView* absl_nullable utility) {
if (utility != nullptr) {
field_trials_ = utility;
}
}
-inline void EnvironmentFactory::Set(absl::Nullable<Clock*> utility) {
+inline void EnvironmentFactory::Set(Clock* absl_nullable utility) {
if (utility != nullptr) {
clock_ = utility;
}
}
-inline void EnvironmentFactory::Set(absl::Nullable<TaskQueueFactory*> utility) {
+inline void EnvironmentFactory::Set(TaskQueueFactory* absl_nullable utility) {
if (utility != nullptr) {
task_queue_factory_ = utility;
}
}
-inline void EnvironmentFactory::Set(absl::Nullable<RtcEventLog*> utility) {
+inline void EnvironmentFactory::Set(RtcEventLog* absl_nullable utility) {
if (utility != nullptr) {
event_log_ = utility;
}
diff --git a/src/api/rtc_event_log/rtc_event_log_factory.cc b/src/api/rtc_event_log/rtc_event_log_factory.cc
index bfe272d2a..2196c31cd 100644
--- a/src/api/rtc_event_log/rtc_event_log_factory.cc
+++ b/src/api/rtc_event_log/rtc_event_log_factory.cc
@@ -23,7 +23,7 @@
namespace webrtc {
-absl::Nonnull<std::unique_ptr<RtcEventLog>> RtcEventLogFactory::Create(
+std::unique_ptr<RtcEventLog> absl_nonnull RtcEventLogFactory::Create(
const Environment& env) const {
#ifndef WEBRTC_ENABLE_RTC_EVENT_LOG
return std::make_unique<RtcEventLogNull>();
diff --git a/src/api/rtc_event_log/rtc_event_log_factory.h b/src/api/rtc_event_log/rtc_event_log_factory.h
index 1deb0612b..7f868a552 100644
--- a/src/api/rtc_event_log/rtc_event_log_factory.h
+++ b/src/api/rtc_event_log/rtc_event_log_factory.h
@@ -31,7 +31,7 @@ class RTC_EXPORT RtcEventLogFactory : public RtcEventLogFactoryInterface {
~RtcEventLogFactory() override = default;
- absl::Nonnull<std::unique_ptr<RtcEventLog>> Create(
+ std::unique_ptr<RtcEventLog> absl_nonnull Create(
const Environment& env) const override;
};
diff --git a/src/api/rtc_event_log/rtc_event_log_factory_interface.h b/src/api/rtc_event_log/rtc_event_log_factory_interface.h
index 313558496..d39766955 100644
--- a/src/api/rtc_event_log/rtc_event_log_factory_interface.h
+++ b/src/api/rtc_event_log/rtc_event_log_factory_interface.h
@@ -26,7 +26,7 @@ class RtcEventLogFactoryInterface {
public:
virtual ~RtcEventLogFactoryInterface() = default;
- virtual absl::Nonnull<std::unique_ptr<RtcEventLog>> Create(
+ virtual std::unique_ptr<RtcEventLog> absl_nonnull Create(
const Environment& env) const = 0;
};
diff --git a/src/api/task_queue/pending_task_safety_flag.cc b/src/api/task_queue/pending_task_safety_flag.cc
index 4d8fc2b9f..4b521ea04 100644
--- a/src/api/task_queue/pending_task_safety_flag.cc
+++ b/src/api/task_queue/pending_task_safety_flag.cc
@@ -37,7 +37,7 @@ PendingTaskSafetyFlag::CreateDetached() {
rtc::scoped_refptr<PendingTaskSafetyFlag>
PendingTaskSafetyFlag::CreateAttachedToTaskQueue(
bool alive,
- absl::Nonnull<TaskQueueBase*> attached_queue) {
+ TaskQueueBase* absl_nonnull attached_queue) {
RTC_DCHECK(attached_queue) << "Null TaskQueue provided";
return rtc::scoped_refptr<PendingTaskSafetyFlag>(
new PendingTaskSafetyFlag(alive, attached_queue));
diff --git a/src/api/task_queue/pending_task_safety_flag.h b/src/api/task_queue/pending_task_safety_flag.h
index 12b1e00ee..1a002e0ad 100644
--- a/src/api/task_queue/pending_task_safety_flag.h
+++ b/src/api/task_queue/pending_task_safety_flag.h
@@ -73,7 +73,7 @@ class RTC_EXPORT PendingTaskSafetyFlag final
// a given task queue and the `alive()` flag specified.
static rtc::scoped_refptr<PendingTaskSafetyFlag> CreateAttachedToTaskQueue(
bool alive,
- absl::Nonnull<TaskQueueBase*> attached_queue);
+ TaskQueueBase* absl_nonnull attached_queue);
// Same as `CreateDetached()` except the initial state of the returned flag
// will be `!alive()`.
@@ -103,7 +103,7 @@ class RTC_EXPORT PendingTaskSafetyFlag final
protected:
explicit PendingTaskSafetyFlag(bool alive) : alive_(alive) {}
PendingTaskSafetyFlag(bool alive,
- absl::Nonnull<TaskQueueBase*> attached_queue)
+ TaskQueueBase* absl_nonnull attached_queue)
: alive_(alive), main_sequence_(attached_queue) {}
private:
diff --git a/src/api/test/create_time_controller.cc b/src/api/test/create_time_controller.cc
index cbf1f09aa..049451bf5 100644
--- a/src/api/test/create_time_controller.cc
+++ b/src/api/test/create_time_controller.cc
@@ -44,8 +44,8 @@ void EnableMediaWithDefaultsAndTimeController(
class TimeControllerBasedFactory : public MediaFactory {
public:
TimeControllerBasedFactory(
- absl::Nonnull<Clock*> clock,
- absl::Nonnull<std::unique_ptr<MediaFactory>> media_factory)
+ Clock* absl_nonnull clock,
+ std::unique_ptr<MediaFactory> absl_nonnull media_factory)
: clock_(clock), media_factory_(std::move(media_factory)) {}
std::unique_ptr<Call> CreateCall(const CallConfig& config) override {
@@ -64,8 +64,8 @@ void EnableMediaWithDefaultsAndTimeController(
}
private:
- absl::Nonnull<Clock*> clock_;
- absl::Nonnull<std::unique_ptr<MediaFactory>> media_factory_;
+ Clock* absl_nonnull clock_;
+ std::unique_ptr<MediaFactory> absl_nonnull media_factory_;
};
EnableMediaWithDefaults(deps);
diff --git a/src/logging/rtc_event_log/fake_rtc_event_log_factory.cc b/src/logging/rtc_event_log/fake_rtc_event_log_factory.cc
index bacc3cd1c..c5a43e7dd 100644
--- a/src/logging/rtc_event_log/fake_rtc_event_log_factory.cc
+++ b/src/logging/rtc_event_log/fake_rtc_event_log_factory.cc
@@ -17,7 +17,7 @@
namespace webrtc {
-absl::Nonnull<std::unique_ptr<RtcEventLog>> FakeRtcEventLogFactory::Create(
+std::unique_ptr<RtcEventLog> absl_nonnull FakeRtcEventLogFactory::Create(
const Environment& /*env*/) const {
auto fake_event_log = std::make_unique<FakeRtcEventLog>();
const_cast<FakeRtcEventLog*&>(last_log_created_) = fake_event_log.get();
diff --git a/src/logging/rtc_event_log/fake_rtc_event_log_factory.h b/src/logging/rtc_event_log/fake_rtc_event_log_factory.h
index 0d6d07603..08017432a 100644
--- a/src/logging/rtc_event_log/fake_rtc_event_log_factory.h
+++ b/src/logging/rtc_event_log/fake_rtc_event_log_factory.h
@@ -25,7 +25,7 @@ class FakeRtcEventLogFactory : public RtcEventLogFactoryInterface {
FakeRtcEventLogFactory() = default;
~FakeRtcEventLogFactory() override = default;
- absl::Nonnull<std::unique_ptr<RtcEventLog>> Create(
+ std::unique_ptr<RtcEventLog> absl_nonnull Create(
const Environment& env) const override;
FakeRtcEventLog* last_log_created() { return last_log_created_; }
diff --git a/src/modules/audio_processing/aec_dump/aec_dump_factory.h b/src/modules/audio_processing/aec_dump/aec_dump_factory.h
index 0d258a9eb..89435d62c 100644
--- a/src/modules/audio_processing/aec_dump/aec_dump_factory.h
+++ b/src/modules/audio_processing/aec_dump/aec_dump_factory.h
@@ -29,18 +29,18 @@ class RTC_EXPORT AecDumpFactory {
// The AecDump takes responsibility for `handle` and closes it in the
// destructor. A non-null return value indicates that the file has been
// sucessfully opened.
- static absl::Nullable<std::unique_ptr<AecDump>> Create(
+ static std::unique_ptr<AecDump> absl_nullable Create(
FileWrapper file,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue);
- static absl::Nullable<std::unique_ptr<AecDump>> Create(
+ TaskQueueBase* absl_nonnull worker_queue);
+ static std::unique_ptr<AecDump> absl_nullable Create(
absl::string_view file_name,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue);
- static absl::Nullable<std::unique_ptr<AecDump>> Create(
- absl::Nonnull<FILE*> handle,
+ TaskQueueBase* absl_nonnull worker_queue);
+ static std::unique_ptr<AecDump> absl_nullable Create(
+ FILE* absl_nonnull handle,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue);
+ TaskQueueBase* absl_nonnull worker_queue);
};
} // namespace webrtc
diff --git a/src/modules/audio_processing/aec_dump/aec_dump_impl.cc b/src/modules/audio_processing/aec_dump/aec_dump_impl.cc
index 8484fcc6e..76b59d0e5 100644
--- a/src/modules/audio_processing/aec_dump/aec_dump_impl.cc
+++ b/src/modules/audio_processing/aec_dump/aec_dump_impl.cc
@@ -60,7 +60,7 @@ void CopyFromConfigToEvent(const webrtc::InternalAPMConfig& config,
AecDumpImpl::AecDumpImpl(FileWrapper debug_file,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue)
+ TaskQueueBase* absl_nonnull worker_queue)
: debug_file_(std::move(debug_file)),
num_bytes_left_for_log_(max_log_size_bytes),
worker_queue_(worker_queue) {}
@@ -255,10 +255,10 @@ void AecDumpImpl::PostWriteToFileTask(std::unique_ptr<audioproc::Event> event) {
});
}
-absl::Nullable<std::unique_ptr<AecDump>> AecDumpFactory::Create(
+std::unique_ptr<AecDump> absl_nullable AecDumpFactory::Create(
FileWrapper file,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue) {
+ TaskQueueBase* absl_nonnull worker_queue) {
RTC_DCHECK(worker_queue);
if (!file.is_open())
return nullptr;
@@ -267,18 +267,18 @@ absl::Nullable<std::unique_ptr<AecDump>> AecDumpFactory::Create(
worker_queue);
}
-absl::Nullable<std::unique_ptr<AecDump>> AecDumpFactory::Create(
+std::unique_ptr<AecDump> absl_nullable AecDumpFactory::Create(
absl::string_view file_name,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue) {
+ TaskQueueBase* absl_nonnull worker_queue) {
return Create(FileWrapper::OpenWriteOnly(file_name), max_log_size_bytes,
worker_queue);
}
-absl::Nullable<std::unique_ptr<AecDump>> AecDumpFactory::Create(
- absl::Nonnull<FILE*> handle,
+std::unique_ptr<AecDump> absl_nullable AecDumpFactory::Create(
+ FILE* absl_nonnull handle,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue) {
+ TaskQueueBase* absl_nonnull worker_queue) {
return Create(FileWrapper(handle), max_log_size_bytes, worker_queue);
}
diff --git a/src/modules/audio_processing/aec_dump/aec_dump_impl.h b/src/modules/audio_processing/aec_dump/aec_dump_impl.h
index d5af31b01..e3fb25469 100644
--- a/src/modules/audio_processing/aec_dump/aec_dump_impl.h
+++ b/src/modules/audio_processing/aec_dump/aec_dump_impl.h
@@ -39,7 +39,7 @@ class AecDumpImpl : public AecDump {
// `max_log_size_bytes == -1` means the log size will be unlimited.
AecDumpImpl(FileWrapper debug_file,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue);
+ TaskQueueBase* absl_nonnull worker_queue);
AecDumpImpl(const AecDumpImpl&) = delete;
AecDumpImpl& operator=(const AecDumpImpl&) = delete;
~AecDumpImpl() override;
@@ -74,7 +74,7 @@ class AecDumpImpl : public AecDump {
FileWrapper debug_file_;
int64_t num_bytes_left_for_log_ = 0;
rtc::RaceChecker race_checker_;
- absl::Nonnull<TaskQueueBase*> worker_queue_;
+ TaskQueueBase* absl_nonnull worker_queue_;
CaptureStreamInfo capture_stream_info_;
};
} // namespace webrtc
diff --git a/src/modules/audio_processing/aec_dump/null_aec_dump_factory.cc b/src/modules/audio_processing/aec_dump/null_aec_dump_factory.cc
index 63929afac..2902c1bbc 100644
--- a/src/modules/audio_processing/aec_dump/null_aec_dump_factory.cc
+++ b/src/modules/audio_processing/aec_dump/null_aec_dump_factory.cc
@@ -16,24 +16,24 @@
namespace webrtc {
-absl::Nullable<std::unique_ptr<AecDump>> AecDumpFactory::Create(
+std::unique_ptr<AecDump> absl_nullable AecDumpFactory::Create(
FileWrapper file,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue) {
+ TaskQueueBase* absl_nonnull worker_queue) {
return nullptr;
}
-absl::Nullable<std::unique_ptr<AecDump>> AecDumpFactory::Create(
+std::unique_ptr<AecDump> absl_nullable AecDumpFactory::Create(
absl::string_view file_name,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue) {
+ TaskQueueBase* absl_nonnull worker_queue) {
return nullptr;
}
-absl::Nullable<std::unique_ptr<AecDump>> AecDumpFactory::Create(
- absl::Nonnull<FILE*> handle,
+std::unique_ptr<AecDump> absl_nullable AecDumpFactory::Create(
+ FILE* absl_nonnull handle,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue) {
+ TaskQueueBase* absl_nonnull worker_queue) {
return nullptr;
}
} // namespace webrtc
diff --git a/src/modules/audio_processing/audio_processing_impl.cc b/src/modules/audio_processing/audio_processing_impl.cc
index 0d11e418e..0a579f7dd 100644
--- a/src/modules/audio_processing/audio_processing_impl.cc
+++ b/src/modules/audio_processing/audio_processing_impl.cc
@@ -2087,7 +2087,7 @@ void AudioProcessingImpl::UpdateRecommendedInputVolumeLocked() {
bool AudioProcessingImpl::CreateAndAttachAecDump(
absl::string_view file_name,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue) {
+ TaskQueueBase* absl_nonnull worker_queue) {
std::unique_ptr<AecDump> aec_dump =
AecDumpFactory::Create(file_name, max_log_size_bytes, worker_queue);
if (!aec_dump) {
@@ -2101,7 +2101,7 @@ bool AudioProcessingImpl::CreateAndAttachAecDump(
bool AudioProcessingImpl::CreateAndAttachAecDump(
FILE* handle,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue) {
+ TaskQueueBase* absl_nonnull worker_queue) {
std::unique_ptr<AecDump> aec_dump =
AecDumpFactory::Create(handle, max_log_size_bytes, worker_queue);
if (!aec_dump) {
diff --git a/src/modules/audio_processing/audio_processing_impl.h b/src/modules/audio_processing/audio_processing_impl.h
index 2c0ab198d..4cea151cd 100644
--- a/src/modules/audio_processing/audio_processing_impl.h
+++ b/src/modules/audio_processing/audio_processing_impl.h
@@ -76,11 +76,11 @@ class AudioProcessingImpl : public AudioProcessing {
bool CreateAndAttachAecDump(
absl::string_view file_name,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue) override;
+ TaskQueueBase* absl_nonnull worker_queue) override;
bool CreateAndAttachAecDump(
FILE* handle,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue) override;
+ TaskQueueBase* absl_nonnull worker_queue) override;
// TODO(webrtc:5298) Deprecated variant.
void AttachAecDump(std::unique_ptr<AecDump> aec_dump) override;
void DetachAecDump() override;
diff --git a/src/modules/audio_processing/include/audio_processing.h b/src/modules/audio_processing/include/audio_processing.h
index dd484be4f..f7c115e58 100644
--- a/src/modules/audio_processing/include/audio_processing.h
+++ b/src/modules/audio_processing/include/audio_processing.h
@@ -633,11 +633,11 @@ class RTC_EXPORT AudioProcessing : public RefCountInterface {
virtual bool CreateAndAttachAecDump(
absl::string_view file_name,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue) = 0;
+ TaskQueueBase* absl_nonnull worker_queue) = 0;
virtual bool CreateAndAttachAecDump(
- absl::Nonnull<FILE*> handle,
+ FILE* absl_nonnull handle,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue) = 0;
+ TaskQueueBase* absl_nonnull worker_queue) = 0;
// TODO(webrtc:5298) Deprecated variant.
// Attaches provided webrtc::AecDump for recording debugging
diff --git a/src/modules/audio_processing/include/mock_audio_processing.h b/src/modules/audio_processing/include/mock_audio_processing.h
index dfe7d84e0..fad0a5b83 100644
--- a/src/modules/audio_processing/include/mock_audio_processing.h
+++ b/src/modules/audio_processing/include/mock_audio_processing.h
@@ -157,13 +157,13 @@ class MockAudioProcessing : public AudioProcessing {
CreateAndAttachAecDump,
(absl::string_view file_name,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue),
+ TaskQueueBase* absl_nonnull worker_queue),
(override));
MOCK_METHOD(bool,
CreateAndAttachAecDump,
(FILE * handle,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue),
+ TaskQueueBase* absl_nonnull worker_queue),
(override));
MOCK_METHOD(void, AttachAecDump, (std::unique_ptr<AecDump>), (override));
MOCK_METHOD(void, DetachAecDump, (), (override));
diff --git a/src/pc/test/enable_fake_media.cc b/src/pc/test/enable_fake_media.cc
index 5497c6072..5c10fd8d5 100644
--- a/src/pc/test/enable_fake_media.cc
+++ b/src/pc/test/enable_fake_media.cc
@@ -29,11 +29,11 @@ using ::cricket::MediaEngineInterface;
void EnableFakeMedia(
PeerConnectionFactoryDependencies& deps,
- absl::Nonnull<std::unique_ptr<FakeMediaEngine>> fake_media_engine) {
+ std::unique_ptr<FakeMediaEngine> absl_nonnull fake_media_engine) {
class FakeMediaFactory : public MediaFactory {
public:
explicit FakeMediaFactory(
- absl::Nonnull<std::unique_ptr<FakeMediaEngine>> fake)
+ std::unique_ptr<FakeMediaEngine> absl_nonnull fake)
: fake_(std::move(fake)) {}
std::unique_ptr<Call> CreateCall(const CallConfig& config) override {
@@ -49,7 +49,7 @@ void EnableFakeMedia(
}
private:
- absl::Nullable<std::unique_ptr<FakeMediaEngine>> fake_;
+ std::unique_ptr<FakeMediaEngine> absl_nullable fake_;
};
deps.media_factory =
diff --git a/src/pc/test/enable_fake_media.h b/src/pc/test/enable_fake_media.h
index 82c55ad08..5fc339d29 100644
--- a/src/pc/test/enable_fake_media.h
+++ b/src/pc/test/enable_fake_media.h
@@ -28,7 +28,7 @@ namespace webrtc {
// Enables media support backed by the 'fake_media_engine'.
void EnableFakeMedia(
PeerConnectionFactoryDependencies& deps,
- absl::Nonnull<std::unique_ptr<cricket::FakeMediaEngine>> fake_media_engine);
+ std::unique_ptr<cricket::FakeMediaEngine> absl_nonnull fake_media_engine);
// Enables media support backed by unspecified lightweight fake implementation.
void EnableFakeMedia(PeerConnectionFactoryDependencies& deps);

View File

@@ -0,0 +1,81 @@
{
callPackage,
lib,
stdenv,
pname ? "telegram-desktop",
unwrapped ? callPackage ./unwrapped.nix { inherit stdenv; },
qtbase,
qtimageformats,
qtsvg,
qtwayland,
kimageformats,
libavif,
libheif,
libjxl,
wrapGAppsHook3,
wrapQtAppsHook,
glib-networking,
webkitgtk_4_1,
withWebkit ? true,
}:
stdenv.mkDerivation (finalAttrs: {
inherit pname;
inherit (finalAttrs.unwrapped) version meta passthru;
inherit unwrapped;
nativeBuildInputs = [
wrapQtAppsHook
]
++ lib.optionals withWebkit [
wrapGAppsHook3
];
buildInputs = [
qtbase
qtimageformats
qtsvg
]
++ lib.optionals stdenv.hostPlatform.isLinux [
kimageformats
qtwayland
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
libavif
libheif
libjxl
]
++ lib.optionals withWebkit [
glib-networking
];
qtWrapperArgs = lib.optionals (stdenv.hostPlatform.isLinux && withWebkit) [
"--prefix"
"LD_LIBRARY_PATH"
":"
(lib.makeLibraryPath [ webkitgtk_4_1 ])
];
dontUnpack = true;
dontWrapGApps = true;
dontWrapQtApps = stdenv.hostPlatform.isDarwin;
installPhase = ''
runHook preInstall
cp -r "$unwrapped" "$out"
runHook postInstall
'';
preFixup = lib.optionalString (stdenv.hostPlatform.isLinux && withWebkit) ''
qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
'';
postFixup =
lib.optionalString stdenv.hostPlatform.isDarwin ''
wrapQtApp "$out/Applications/${finalAttrs.meta.mainProgram}.app/Contents/MacOS/${finalAttrs.meta.mainProgram}"
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace $out/share/dbus-1/services/* \
--replace-fail "$unwrapped" "$out"
'';
})

View File

@@ -0,0 +1,110 @@
{
lib,
stdenv,
fetchFromGitHub,
pkg-config,
cmake,
ninja,
python3,
libjpeg,
openssl,
libopus,
ffmpeg_6,
openh264,
crc32c,
libvpx,
libX11,
libXtst,
libXcomposite,
libXdamage,
libXext,
libXrender,
libXrandr,
libXi,
glib,
abseil-cpp,
pipewire,
libgbm,
libdrm,
libGL,
apple-sdk_15,
unstableGitUpdater,
}:
stdenv.mkDerivation {
pname = "tg_owt";
version = "0-unstable-2025-06-02";
src = fetchFromGitHub {
owner = "desktop-app";
repo = "tg_owt";
rev = "62321fd7128ab2650b459d4195781af8185e46b5";
hash = "sha256-l6EdHJLd42TU+4pLakdU3a5PLVxrxjta0CSRy5hVBFU=";
fetchSubmodules = true;
};
patches = [
# fix build with abseil 202508
# upstream PR: https://github.com/desktop-app/tg_owt/pull/164
./abseil-202508.patch
];
postPatch = lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace src/modules/desktop_capture/linux/wayland/egl_dmabuf.cc \
--replace-fail '"libEGL.so.1"' '"${lib.getLib libGL}/lib/libEGL.so.1"' \
--replace-fail '"libGL.so.1"' '"${lib.getLib libGL}/lib/libGL.so.1"' \
--replace-fail '"libgbm.so.1"' '"${lib.getLib libgbm}/lib/libgbm.so.1"' \
--replace-fail '"libdrm.so.2"' '"${lib.getLib libdrm}/lib/libdrm.so.2"'
'';
outputs = [
"out"
"dev"
];
nativeBuildInputs = [
pkg-config
cmake
ninja
python3
];
propagatedBuildInputs = [
libjpeg
openssl
libopus
ffmpeg_6
openh264
crc32c
libvpx
abseil-cpp
]
++ lib.optionals stdenv.hostPlatform.isLinux [
libX11
libXtst
libXcomposite
libXdamage
libXext
libXrender
libXrandr
libXi
glib
pipewire
libgbm
libdrm
libGL
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
apple-sdk_15
];
passthru.updateScript = unstableGitUpdater { };
meta = {
description = "Fork of Google's webrtc library for telegram-desktop";
homepage = "https://github.com/desktop-app/tg_owt";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ oxalica ];
platforms = lib.platforms.linux ++ lib.platforms.darwin;
};
}

View File

@@ -0,0 +1,131 @@
{
lib,
stdenv,
fetchFromGitHub,
callPackage,
pkg-config,
cmake,
ninja,
clang,
python3,
tdlib,
tg_owt ? callPackage ./tg_owt.nix { inherit stdenv; },
qtbase,
qtsvg,
qtwayland,
kcoreaddons,
lz4,
xxHash,
ffmpeg_6,
protobuf,
openalSoft,
minizip,
range-v3,
tl-expected,
hunspell,
gobject-introspection,
rnnoise,
microsoft-gsl,
boost,
ada,
libicns,
apple-sdk_15,
nix-update-script,
}:
# Main reference:
# - This package was originally based on the Arch package but all patches are now upstreamed:
# https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/telegram-desktop
# Other references that could be useful:
# - https://git.alpinelinux.org/aports/tree/testing/telegram-desktop/APKBUILD
# - https://github.com/void-linux/void-packages/blob/master/srcpkgs/telegram-desktop/template
stdenv.mkDerivation (finalAttrs: {
pname = "telegram-desktop-unwrapped";
version = "6.1.3";
src = fetchFromGitHub {
owner = "telegramdesktop";
repo = "tdesktop";
rev = "v${finalAttrs.version}";
fetchSubmodules = true;
hash = "sha256-ElbKzv+QMqH62BGAvNjDDNp7NSJYIEvoDzxKCbEdwqM=";
};
nativeBuildInputs = [
pkg-config
cmake
ninja
python3
]
++ lib.optionals stdenv.hostPlatform.isLinux [
# to build bundled libdispatch
clang
gobject-introspection
];
buildInputs = [
qtbase
qtsvg
lz4
xxHash
ffmpeg_6
openalSoft
minizip
range-v3
tl-expected
rnnoise
tg_owt
microsoft-gsl
boost
ada
(tdlib.override { tde2eOnly = true; })
]
++ lib.optionals stdenv.hostPlatform.isLinux [
protobuf
qtwayland
kcoreaddons
hunspell
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
apple-sdk_15
libicns
];
dontWrapQtApps = true;
cmakeFlags = [
# We're allowed to used the API ID of the Snap package:
(lib.cmakeFeature "TDESKTOP_API_ID" "611335")
(lib.cmakeFeature "TDESKTOP_API_HASH" "d524b414d21f4d37f08684c1df41ac9c")
];
installPhase = lib.optionalString stdenv.hostPlatform.isDarwin ''
runHook preInstall
mkdir -p $out/Applications
cp -r ${finalAttrs.meta.mainProgram}.app $out/Applications
ln -sr $out/{Applications/${finalAttrs.meta.mainProgram}.app/Contents/MacOS,bin}
runHook postInstall
'';
passthru = {
inherit tg_owt;
updateScript = nix-update-script { };
};
meta = {
description = "Telegram Desktop messaging app";
longDescription = ''
Desktop client for the Telegram messenger, based on the Telegram API and
the MTProto secure protocol.
'';
license = lib.licenses.gpl3Only;
platforms = lib.platforms.all;
homepage = "https://desktop.telegram.org/";
changelog = "https://github.com/telegramdesktop/tdesktop/releases/tag/v${finalAttrs.version}";
maintainers = with lib.maintainers; [ nickcao ];
mainProgram = "Telegram";
};
})

View File

@@ -0,0 +1,81 @@
{
mkDerivation,
lib,
stdenv,
fetchFromGitHub,
qtbase,
qtquickcontrols,
qmake,
makeDesktopItem,
}:
# we now have libqmatrixclient so a future version of tensor that supports it
# should use that
mkDerivation rec {
pname = "tensor";
version = "unstable-2017-02-21";
src = fetchFromGitHub {
owner = "davidar";
repo = "tensor";
rev = "f3f3056d770d7fb4a21c610cee7936ee900569f5";
hash = "sha256-aR6TsfUxsxoSDaIWYgRCwd7BCgekSEqY6LpDoQ5DNqY=";
fetchSubmodules = true;
};
buildInputs = [
qtbase
qtquickcontrols
];
nativeBuildInputs = [ qmake ];
desktopItem = makeDesktopItem {
name = "tensor";
exec = "@bin@";
icon = "tensor.png";
comment = meta.description;
desktopName = "Tensor Matrix Client";
genericName = meta.description;
categories = [
"Chat"
"Utility"
];
mimeTypes = [ "application/x-chat" ];
};
installPhase =
if stdenv.hostPlatform.isDarwin then
''
runHook preInstall
mkdir -p $out/Applications
cp -r tensor.app $out/Applications/tensor.app
runHook postInstall
''
else
''
runHook preInstall
install -Dm755 tensor $out/bin/tensor
install -Dm644 client/logo.png \
$out/share/icons/hicolor/512x512/apps/tensor.png
install -Dm644 ${desktopItem}/share/applications/tensor.desktop \
$out/share/applications/tensor.desktop
substituteInPlace $out/share/applications/tensor.desktop \
--subst-var-by bin $out/bin/tensor
runHook postInstall
'';
meta = with lib; {
homepage = "https://github.com/davidar/tensor";
description = "Cross-platform Qt5/QML-based Matrix client";
mainProgram = "tensor";
license = licenses.gpl3;
maintainers = with maintainers; [ peterhoeg ];
inherit (qtbase.meta) platforms;
};
}

View File

@@ -0,0 +1,72 @@
{
lib,
fetchFromGitHub,
cmake,
libxml2,
libsndfile,
file,
readline,
bison,
flex,
ucommon,
ccrtp,
qtbase,
qttools,
qtquickcontrols2,
alsa-lib,
speex,
ilbc,
mkDerivation,
bcg729,
}:
mkDerivation rec {
pname = "twinkle";
version = "unstable-2024-20-11";
src = fetchFromGitHub {
owner = "LubosD";
repo = "twinkle";
rev = "e067dcba28f4e2acd7f71b875fc4168e9706aaaa";
hash = "sha256-3YtZwP/ugWOSfUa4uaEAEEsk9i5j93eLt5lHgAu5qqI=";
};
buildInputs = [
libxml2
file # libmagic
libsndfile
readline
ucommon
ccrtp
qtbase
qttools
qtquickcontrols2
alsa-lib
speex
ilbc
];
nativeBuildInputs = [
cmake
bison
flex
bcg729
];
cmakeFlags = [
"-DWITH_G729=On"
"-DWITH_SPEEX=On"
"-DWITH_ILBC=On"
"-DHAVE_LIBATOMIC=atomic"
# "-DWITH_DIAMONDCARD=On" seems ancient and broken
];
meta = {
changelog = "https://github.com/LubosD/twinkle/blob/${version}/NEWS";
description = "SIP-based VoIP client";
homepage = "http://twinkle.dolezel.info/";
license = lib.licenses.gpl2Plus;
maintainers = [ lib.maintainers.mkg20001 ];
platforms = lib.platforms.linux;
};
}

View File

@@ -0,0 +1,55 @@
{
stdenv,
lib,
fetchFromGitHub,
qtbase,
qttools,
qtx11extras,
qtmultimedia,
qtwebkit,
wrapQtAppsHook,
cmake,
openssl,
xorgproto,
libX11,
libXScrnSaver,
xz,
zlib,
}:
stdenv.mkDerivation {
pname = "vacuum-im";
version = "unstable-2021-12-09";
src = fetchFromGitHub {
owner = "Vacuum-IM";
repo = "vacuum-im";
rev = "0abd5e11dd3e2538b8c47f5a06febedf73ae99ee";
sha256 = "0l9pln07zz874m1r6wnpc9vcdbpgvjdsy49cjjilc6s4p4b2c812";
};
nativeBuildInputs = [
wrapQtAppsHook
cmake
];
buildInputs = [
qtbase
qttools
qtx11extras
qtmultimedia
qtwebkit
openssl
xorgproto
libX11
libXScrnSaver
xz
zlib
];
meta = with lib; {
description = "XMPP client fully composed of plugins";
maintainers = [ maintainers.raskin ];
platforms = platforms.linux;
license = licenses.gpl3;
homepage = "http://www.vacuum-im.org";
};
}