uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead

https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948
this can do it nicely.

Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,27 @@
{ lib, stdenv, fetchFromGitHub, cmake, boost166 }:
stdenv.mkDerivation rec {
pname = "SkypeExport";
version = "1.4.0";
src = fetchFromGitHub {
owner = "Temptin";
repo = "SkypeExport";
rev = "v${version}";
sha256 = "1ilkh0s3dz5cp83wwgmscnfmnyck5qcwqg1yxp9zv6s356dxnbak";
};
nativeBuildInputs = [ cmake ];
buildInputs = [ boost166 ];
preConfigure = "cd src/SkypeExport/_gccbuild/linux";
installPhase = "install -Dt $out/bin SkypeExport";
meta = with lib; {
description = "Export Skype history to HTML";
homepage = "https://github.com/Temptin/SkypeExport";
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = with maintainers; [ yana ];
};
}

View file

@ -0,0 +1,80 @@
{ stdenv, lib, fetchurl, dpkg, autoPatchelfHook, makeWrapper, wrapGAppsHook
, alsa-lib, dbus, fontconfig, freetype, glib, gst_all_1, libGL
, libinput, libpulseaudio, libsecret, libtiff, libxkbcommon
, mesa, openssl, systemd, xorg }:
stdenv.mkDerivation rec {
pname = "alfaview";
version = "8.45.0";
src = fetchurl {
url = "https://production-alfaview-assets.alfaview.com/stable/linux/${pname}_${version}.deb";
sha256 = "sha256-qSLKPtBjhbPGX9axbQnyCb+Tcq47xDMvVGj18hEPw28=";
};
nativeBuildInputs = [
dpkg
makeWrapper
autoPatchelfHook
wrapGAppsHook
];
buildInputs = [
alsa-lib
dbus
fontconfig
freetype
glib
gst_all_1.gst-plugins-bad
gst_all_1.gst-plugins-good
gst_all_1.gst-plugins-base
libGL
libinput
libpulseaudio
libsecret
libtiff
libxkbcommon
mesa
openssl
stdenv.cc.cc
systemd
xorg.libX11
xorg.xcbutilwm
xorg.xcbutilimage
xorg.xcbutilkeysyms
xorg.xcbutilrenderutil
];
libPath = lib.makeLibraryPath buildInputs;
dontBuild = true;
dontConfigure = true;
unpackPhase = ''
dpkg-deb -x ${src} ./
'';
installPhase = ''
runHook preInstall
mv usr $out
mv opt $out
substituteInPlace $out/share/applications/alfaview.desktop \
--replace "/opt/alfaview" "$out/bin" \
--replace "/usr/share/pixmaps/alfaview_production.png" alfaview_production
makeWrapper $out/opt/alfaview/alfaview $out/bin/alfaview \
--prefix LD_LIBRARY_PATH : ${libPath}
runHook postInstall
'';
meta = with lib; {
description = "Video-conferencing application, specialized in virtual online meetings, seminars, training sessions and conferences";
homepage = "https://alfaview.com";
license = licenses.unfree;
maintainers = with maintainers; [ wolfangaukang hexchen ];
platforms = [ "x86_64-linux" ];
};
}

View file

@ -0,0 +1,120 @@
{ lib
, stdenv
, fetchFromGitHub
, zlib
, openssl
, libre
, librem
, pkg-config
, gst_all_1
, cairo
, mpg123
, alsa-lib
, SDL2
, libv4l
, celt
, libsndfile
, srtp
, ffmpeg
, gsm
, speex
, portaudio
, spandsp3
, libuuid
, libvpx
}:
stdenv.mkDerivation rec {
version = "1.1.0";
pname = "baresip";
src = fetchFromGitHub {
owner = "baresip";
repo = "baresip";
rev = "v${version}";
sha256 = "sha256-9mc1Beo7/iNhDXSDC/jiTL+lJRt8ah/1xF1heoHTE+g=";
};
postPatch = ''
patchShebangs modules/ctrl_dbus/gen.sh
'';
nativeBuildInputs = [ pkg-config ];
buildInputs = [
zlib
openssl
libre
librem
cairo
mpg123
alsa-lib
SDL2
libv4l
celt
libsndfile
srtp
ffmpeg
gsm
speex
portaudio
spandsp3
libuuid
libvpx
] ++ (with gst_all_1; [ gstreamer gst-libav gst-plugins-base gst-plugins-bad gst-plugins-good ]);
makeFlags = [
"LIBRE_MK=${libre}/share/re/re.mk"
"LIBRE_INC=${libre}/include/re"
"LIBRE_SO=${libre}/lib"
"LIBREM_PATH=${librem}"
"PREFIX=$(out)"
"USE_VIDEO=1"
"CCACHE_DISABLE=1"
"USE_ALSA=1"
"USE_AMR=1"
"USE_CAIRO=1"
"USE_CELT=1"
"USE_CONS=1"
"USE_EVDEV=1"
"USE_FFMPEG=1"
"USE_GSM=1"
"USE_GST1=1"
"USE_L16=1"
"USE_MPG123=1"
"USE_OSS=1"
"USE_PLC=1"
"USE_VPX=1"
"USE_PORTAUDIO=1"
"USE_SDL=1"
"USE_SNDFILE=1"
"USE_SPEEX=1"
"USE_SPEEX_AEC=1"
"USE_SPEEX_PP=1"
"USE_SPEEX_RESAMP=1"
"USE_SRTP=1"
"USE_STDIO=1"
"USE_SYSLOG=1"
"USE_UUID=1"
"USE_V4L2=1"
"USE_X11=1"
"USE_BV32="
"USE_COREAUDIO="
"USE_G711=1"
"USE_G722=1"
"USE_G722_1="
"USE_ILBC="
"USE_OPUS="
"USE_SILK="
]
++ lib.optional (stdenv.cc.cc != null) "SYSROOT_ALT=${stdenv.cc.cc}"
++ lib.optional (stdenv.cc.libc != null) "SYSROOT=${stdenv.cc.libc}"
;
NIX_CFLAGS_COMPILE = '' -I${librem}/include/rem -I${gsm}/include/gsm
-DHAVE_INTTYPES_H -D__GLIBC__
-D__need_timeval -D__need_timespec -D__need_time_t '';
meta = {
description = "A modular SIP User-Agent with audio and video support";
homepage = "https://github.com/baresip/baresip";
maintainers = with lib.maintainers; [ elohmeier raskin ];
license = lib.licenses.bsd3;
};
}

View file

@ -0,0 +1,32 @@
{ lib, fetchFromGitHub, stdenv, bitlbee, autoreconfHook, pkg-config, glib }:
with lib;
stdenv.mkDerivation rec {
pname = "bitlbee-discord";
version = "0.4.3";
src = fetchFromGitHub {
rev = version;
owner = "sm00th";
repo = "bitlbee-discord";
sha256 = "00qgdvrp7hv02n0ns685igp810zxmv3adsama8601122al6x041n";
};
nativeBuildInputs = [ autoreconfHook pkg-config ];
buildInputs = [ bitlbee ];
preConfigure = ''
export BITLBEE_PLUGINDIR=$out/lib/bitlbee
export BITLBEE_DATADIR=$out/share/bitlbee
./autogen.sh
'';
meta = {
description = "Bitlbee plugin for Discord";
homepage = "https://github.com/sm00th/bitlbee-discord";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ lassulus ];
platforms = lib.platforms.linux;
};
}

View file

@ -0,0 +1,30 @@
{ lib, fetchFromGitHub, stdenv, bitlbee, autoconf, automake, libtool, pkg-config, json-glib }:
stdenv.mkDerivation rec {
pname = "bitlbee-facebook";
version = "1.2.2";
src = fetchFromGitHub {
rev = "v${version}";
owner = "bitlbee";
repo = "bitlbee-facebook";
sha256 = "1qiiiq17ybylbhwgbwsvmshb517589r8yy5rsh1rfaylmlcxyy7z";
};
nativeBuildInputs = [ autoconf automake libtool pkg-config ];
buildInputs = [ bitlbee json-glib ];
preConfigure = ''
export BITLBEE_PLUGINDIR=$out/lib/bitlbee
./autogen.sh
'';
meta = with lib; {
description = "The Facebook protocol plugin for bitlbee";
homepage = "https://github.com/bitlbee/bitlbee-facebook";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ toonn ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,29 @@
{ lib, fetchgit, stdenv, bitlbee, autoreconfHook, pkg-config, glib }:
with lib;
stdenv.mkDerivation rec {
pname = "bitlbee-mastodon";
version = "1.4.5";
src = fetchgit {
url = "https://alexschroeder.ch/cgit/bitlbee-mastodon";
rev = "v${version}";
sha256 = "sha256-8vmq/YstuBYUxe00P4NrxD/eMYI++R9uvn1sCcMTr7I=";
};
nativeBuildInputs = [ autoreconfHook pkg-config ];
buildInputs = [ bitlbee ];
preConfigure = ''
export BITLBEE_PLUGINDIR=$out/lib/bitlbee
export BITLBEE_DATADIR=$out/share/bitlbee
'';
meta = {
description = "Bitlbee plugin for Mastodon";
homepage = "https://alexschroeder.ch/cgit/bitlbee-mastodon/about";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ jpotier ];
platforms = lib.platforms.linux;
};
}

View file

@ -0,0 +1,30 @@
{ lib, fetchFromGitHub, stdenv, bitlbee, autoconf, automake, libtool, pkg-config, glib, libgcrypt }:
with lib;
stdenv.mkDerivation rec {
version = "1.4.2";
pname = "bitlbee-steam";
src = fetchFromGitHub {
rev = "v${version}";
owner = "bitlbee";
repo = "bitlbee-steam";
sha256 = "121r92mgwv445wwxzh35n19fs5k81ihr0j19k256ia5502b1xxaq";
};
nativeBuildInputs = [ pkg-config autoconf automake ];
buildInputs = [ bitlbee libtool libgcrypt ];
preConfigure = ''
export BITLBEE_PLUGINDIR=$out/lib/bitlbee
./autogen.sh
'';
meta = {
description = "Steam protocol plugin for BitlBee";
homepage = "https://github.com/jgeboski/bitlbee-steam";
license = licenses.gpl2Plus;
platforms = lib.platforms.linux;
};
}

View file

@ -0,0 +1,69 @@
{ lib, fetchurl, fetchpatch, stdenv, gnutls, glib, pkg-config, check, libotr, python3
, enableLibPurple ? false, pidgin ? null
, enablePam ? false, pam ? null
}:
with lib;
stdenv.mkDerivation rec {
pname = "bitlbee";
version = "3.6";
src = fetchurl {
url = "mirror://bitlbee/src/bitlbee-${version}.tar.gz";
sha256 = "0zhhcbcr59sx9h4maf8zamzv2waya7sbsl7w74gbyilvy93dw5cz";
};
nativeBuildInputs = [ pkg-config ] ++ optional doCheck check;
buildInputs = [ gnutls libotr python3 ]
++ optional enableLibPurple pidgin
++ optional enablePam pam;
propagatedBuildInputs = [ glib ];
configureFlags = [
"--otr=1"
"--ssl=gnutls"
"--pidfile=/var/lib/bitlbee/bitlbee.pid"
] ++ optional enableLibPurple "--purple=1"
++ 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 = {
description = "IRC instant messaging gateway";
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,15 @@
{ lib, runCommandLocal, bitlbee }:
with lib;
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,135 @@
{ stdenv
, lib
, fetchurl
, rpmextract
, libnotify
, libuuid
, cairo
, cups
, pango
, fontconfig
, udev
, dbus
, gtk3
, atk
, at-spi2-atk
, expat
, gdk-pixbuf
, freetype
, nspr
, glib
, nss
, libX11
, libXrandr
, libXrender
, libXtst
, libXdamage
, libxcb
, libXcursor
, libXi
, libXext
, libXfixes
, libXft
, libXcomposite
, libXScrnSaver
, alsa-lib
, pulseaudio
, makeWrapper
, xdg-utils
}:
let
getFirst = n: v: builtins.concatStringsSep "." (lib.take n (lib.splitString "." v));
in
stdenv.mkDerivation rec {
pname = "bluejeans";
version = "2.27.0.130";
src = fetchurl {
url = "https://swdl.bluejeans.com/desktop-app/linux/${getFirst 3 version}/BlueJeans_${version}.rpm";
sha256 = "sha256-J0BGL03k1NAJLLEUOfvKjZEsBlupeHJR2Bp3c0ANBwg=";
};
nativeBuildInputs = [ rpmextract makeWrapper ];
libPath =
lib.makeLibraryPath
[
libnotify
libuuid
cairo
cups
pango
fontconfig
gtk3
atk
at-spi2-atk
expat
gdk-pixbuf
dbus
(lib.getLib udev)
freetype
nspr
glib
stdenv.cc.cc.lib
nss
libX11
libXrandr
libXrender
libXtst
libXdamage
libxcb
libXcursor
libXi
libXext
libXfixes
libXft
libXcomposite
libXScrnSaver
alsa-lib
pulseaudio
];
localtime64_stub = ./localtime64_stub.c;
buildCommand = ''
mkdir -p $out/bin/
cd $out
rpmextract $src
mv usr/share share
rmdir usr
patchelf \
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
--replace-needed libudev.so.0 libudev.so.1 \
opt/BlueJeans/bluejeans-v2
patchelf \
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
opt/BlueJeans/resources/BluejeansHelper
cc $localtime64_stub -shared -o "${placeholder "out"}"/opt/BlueJeans/liblocaltime64_stub.so
makeWrapper $out/opt/BlueJeans/bluejeans-v2 $out/bin/bluejeans \
--set LD_LIBRARY_PATH "${libPath}":"${placeholder "out"}"/opt/BlueJeans \
--set LD_PRELOAD "$out"/opt/BlueJeans/liblocaltime64_stub.so \
--prefix PATH : ${lib.makeBinPath [ xdg-utils ]}
substituteInPlace "$out"/share/applications/bluejeans-v2.desktop \
--replace "/opt/BlueJeans/bluejeans-v2" "$out/bin/bluejeans"
patchShebangs "$out"
'';
passthru.updateScript = ./update.sh;
meta = with lib; {
description = "Video, audio, and web conferencing that works together with the collaboration tools you use every day";
homepage = "https://www.bluejeans.com";
license = licenses.unfree;
maintainers = with maintainers; [ ];
platforms = [ "x86_64-linux" ];
};
}

View file

@ -0,0 +1,12 @@
#include <stdio.h>
#include <stdlib.h>
void *localtime64() {
fprintf(stderr, "nixpkgs: call into localtime64_r\n");
abort();
}
void *localtime64_r() {
fprintf(stderr, "nixpkgs: call into localtime64_r\n");
abort();
}

View file

@ -0,0 +1,12 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl pup common-updater-scripts
set -eu -o pipefail
version="$(curl -Ls https://www.bluejeans.com/downloads | \
pup 'a[href$=".rpm"] attr{href}' | \
# output contains app and events
grep "desktop-app" | \
awk -F'[ ._ ]' '{printf $6"."$7"."$8"."$9"\n"}')"
update-source-version bluejeans-gui "$version"

View file

@ -0,0 +1,47 @@
{ lib
, fetchurl
, appimageTools
, xorg
, pname
, version
, sha256
, metaCommon ? { }
}:
let
name = "${pname}-${version}";
src = fetchurl {
url = "https://github.com/sindresorhus/caprine/releases/download/v${version}/Caprine-${version}.AppImage";
name = "Caprine-${version}.AppImage";
inherit sha256;
};
extracted = appimageTools.extractType2 { inherit name src; };
in
(appimageTools.wrapType2 {
inherit name src;
profile = ''
export LC_ALL=C.UTF-8
'';
extraPkgs = pkgs: appimageTools.defaultFhsEnvArgs.multiPkgs pkgs;
extraInstallCommands = ''
mv $out/bin/{${name},caprine}
mkdir -p $out/share
"${xorg.lndir}/bin/lndir" -silent "${extracted}/usr/share" "$out/share"
ln -s ${extracted}/caprine.png $out/share/icons/caprine.png
mkdir $out/share/applications
cp ${extracted}/caprine.desktop $out/share/applications/
substituteInPlace $out/share/applications/caprine.desktop \
--replace AppRun caprine
'';
meta = metaCommon // {
platforms = [ "x86_64-linux" ];
mainProgram = "caprine";
};
}) // {
inherit pname version;
}

View file

@ -0,0 +1,35 @@
{ stdenvNoCC
, lib
, fetchurl
, undmg
, pname
, version
, sha256
, metaCommon ? { }
}:
stdenvNoCC.mkDerivation {
inherit pname version;
src = fetchurl {
url = "https://github.com/sindresorhus/caprine/releases/download/v${version}/Caprine-${version}.dmg";
name = "Caprine-${version}.dmg";
inherit sha256;
};
sourceRoot = "Caprine.app";
nativeBuildInputs = [ undmg ];
installPhase = ''
mkdir -p "$out/Applications/Caprine.app"
cp -R . "$out/Applications/Caprine.app"
mkdir "$out/bin"
ln -s "$out/Applications/Caprine.app/Contents/MacOS/Caprine" "$out/bin/caprine"
'';
meta = metaCommon // {
platforms = with lib.platforms; darwin;
mainProgram = "caprine";
};
}

View file

@ -0,0 +1,25 @@
{ lib, callPackage, stdenvNoCC }:
let
pname = "caprine";
version = "2.55.4";
metaCommon = with lib; {
description = "An elegant Facebook Messenger desktop app";
homepage = "https://sindresorhus.com/caprine";
license = licenses.mit;
maintainers = with maintainers; [ ShamrockLee ];
};
x86_64-appimage = callPackage ./build-from-appimage.nix {
inherit pname version metaCommon;
sha256 = "221PyDoCkWqDdewCkFycpjMTcVOcl58blCjrC7O7xyk=";
};
x86_64-dmg = callPackage ./build-from-dmg.nix {
inherit pname version metaCommon;
sha256 = "6SOqlH7Z9DuQVR4i1OltnSb4dJscFUxaXxgNkE5FVUE=";
};
in
(if stdenvNoCC.isDarwin then x86_64-dmg else x86_64-appimage).overrideAttrs (oldAttrs: {
passthru = (oldAttrs.passthru or { }) // { inherit x86_64-appimage x86_64-dmg; };
meta = oldAttrs.meta // {
platforms = x86_64-appimage.meta.platforms ++ x86_64-dmg.meta.platforms;
};
})

View file

@ -0,0 +1,32 @@
{ lib, stdenv, fetchurl, gnused, openssl, curl, ncurses, libjpeg
, withGpg ? true, gpgme ? null}:
stdenv.mkDerivation rec {
version = "5.0.1";
pname = "centerim5";
src = fetchurl {
url = "http://centerim.org/download/cim5/${pname}-${version}.tar.gz";
sha256 = "0viz86jflp684vfginhl6aaw4gh2qvalc25anlwljjl3kkmibklk";
};
CXXFLAGS = "-std=gnu++98";
buildInputs = [ openssl curl ncurses libjpeg ]
++ lib.optional withGpg gpgme;
preConfigure = ''
${gnused}/bin/sed -i '1,1i#include <stdio.h>' libicq2000/libicq2000/sigslot.h
'';
configureFlags = [
"--with-openssl=${openssl.dev}"
];
meta = {
homepage = "http://www.centerim.org/";
description = "Fork of CenterICQ, a curses instant messaging program";
license = lib.licenses.gpl2Plus;
platforms = with lib.platforms; linux;
};
}

View file

@ -0,0 +1,36 @@
{ mkDerivation, stdenv, lib, pkg-config, fetchFromGitHub, qtbase, qtsvg, qtmultimedia, qmake, boost, openssl, wrapQtAppsHook }:
mkDerivation rec {
pname = "chatterino2";
version = "2.3.5";
src = fetchFromGitHub {
owner = "Chatterino";
repo = pname;
rev = "v${version}";
sha256 = "sha256-ozfLLoNUN+1SPXbMNbF1V5sdZgPZEA/J3xXzJP9D3uI=";
fetchSubmodules = true;
};
nativeBuildInputs = [ qmake pkg-config wrapQtAppsHook ];
buildInputs = [ qtbase qtsvg qtmultimedia boost openssl ];
postInstall = lib.optionalString stdenv.isDarwin ''
mkdir -p "$out/Applications"
mv bin/chatterino.app "$out/Applications/"
'' + ''
mkdir -p $out/share/icons/hicolor/256x256/apps
cp $src/resources/icon.png $out/share/icons/hicolor/256x256/apps/chatterino.png
'';
meta = with lib; {
description = "A chat client for Twitch chat";
longDescription = ''
Chatterino is a chat client for Twitch chat. It aims to be an
improved/extended version of the Twitch web chat. Chatterino 2 is
the second installment of the Twitch chat client series
"Chatterino".
'';
homepage = "https://github.com/Chatterino/chatterino2";
changelog = "https://github.com/Chatterino/chatterino2/blob/master/CHANGELOG.md";
license = licenses.mit;
platforms = platforms.unix;
maintainers = with maintainers; [ rexim ];
};
}

View file

@ -0,0 +1,90 @@
{ lib
, stdenv
, fetchFromGitLab
, appstream-glib
, desktop-file-utils
, itstool
, meson
, ninja
, pkg-config
, python3
, wrapGAppsHook
, evolution-data-server
, feedbackd
, glibmm
, gnome-desktop
, gspell
, gtk3
, json-glib
, libgcrypt
, libhandy
, libphonenumber
, modemmanager
, olm
, pidgin
, protobuf
, sqlite
, plugins ? [ ]
}:
stdenv.mkDerivation rec {
pname = "chatty";
version = "0.6.4";
src = fetchFromGitLab {
domain = "source.puri.sm";
owner = "Librem5";
repo = "chatty";
rev = "v${version}";
fetchSubmodules = true;
hash = "sha256-uDuSx+tWv6DV93/99QUcUKZaWA9kNW8phHZhetYlG/M=";
};
postPatch = ''
patchShebangs build-aux/meson
'';
nativeBuildInputs = [
appstream-glib
desktop-file-utils
itstool
meson
ninja
pkg-config
python3
wrapGAppsHook
];
buildInputs = [
evolution-data-server
feedbackd
glibmm
gnome-desktop
gspell
gtk3
json-glib
libgcrypt
libhandy
libphonenumber
modemmanager
olm
pidgin
protobuf
sqlite
];
preFixup = ''
gappsWrapperArgs+=(
--prefix PURPLE_PLUGIN_PATH : ${lib.escapeShellArg (pidgin.makePluginPath plugins)}
${lib.concatMapStringsSep " " (p: p.wrapArgs or "") plugins}
)
'';
meta = with lib; {
description = "XMPP and SMS messaging via libpurple and ModemManager";
homepage = "https://source.puri.sm/Librem5/chatty";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ dotlambda tomfitzhenry ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,31 @@
{ lib, stdenv, fetchurl, writeText, jq, conf ? {} }:
let
configOverrides = writeText "cinny-config-overrides.json" (builtins.toJSON conf);
in stdenv.mkDerivation rec {
pname = "cinny";
version = "2.0.4";
src = fetchurl {
url = "https://github.com/ajbura/cinny/releases/download/v${version}/cinny-v${version}.tar.gz";
sha256 = "0p5s25nkjs9514a16c7kl0m78vn5f14mv6nbi79yz0sxb7hc12qg";
};
installPhase = ''
runHook preInstall
mkdir -p $out/
cp -R . $out/
${jq}/bin/jq -s '.[0] * .[1]' "config.json" "${configOverrides}" > "$out/config.json"
runHook postInstall
'';
meta = with lib; {
description = "Yet another Matrix client for the web";
homepage = "https://cinny.in/";
maintainers = with maintainers; [ abbe ];
license = licenses.mit;
platforms = platforms.all;
};
}

View file

@ -0,0 +1,25 @@
{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "cordless";
version = "2020-11-22";
src = fetchFromGitHub {
owner = "Bios-Marcel";
repo = pname;
rev = version;
sha256 = "0avf09b73fs3wpb4fzmm6ka595aanfvp95m6xj1ccxvq8ciwpqcw";
};
subPackages = [ "." ];
vendorSha256 = "01anbhwgwam70dymcmvkia1xpw48658rq7wv4m7fiavxvnli6z2y";
meta = with lib; {
homepage = "https://github.com/Bios-Marcel/cordless";
description = "Discord terminal client";
license = licenses.bsd3;
maintainers = with maintainers; [ colemickens ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,28 @@
{ lib, buildGoPackage, fetchFromGitHub, pkg-config,
cairo, gdk-pixbuf, glib, gnome, wrapGAppsHook, gtk3 }:
buildGoPackage rec {
pname = "coyim";
version = "0.3.11";
goPackagePath = "github.com/coyim/coyim";
src = fetchFromGitHub {
owner = "coyim";
repo = "coyim";
rev = "v${version}";
sha256 = "1g8nf56j17rdhhj7pv3ha1rb2mfc0mdvyzl35pgcki08w7iw08j3";
};
nativeBuildInputs = [ pkg-config wrapGAppsHook ];
buildInputs = [ glib cairo gdk-pixbuf gtk3 gnome.adwaita-icon-theme ];
meta = with lib; {
description = "a safe and secure chat client";
homepage = "https://coy.im/";
license = licenses.gpl3;
platforms = platforms.linux;
broken = true; #fails to build with go >= 1.16
};
}

View file

@ -0,0 +1,38 @@
{ lib
, python3
, fetchFromGitHub
}:
python3.pkgs.buildPythonApplication rec {
pname = "deltachat-cursed";
version = "0.7.1";
src = fetchFromGitHub {
owner = "adbenitez";
repo = "deltachat-cursed";
rev = "v${version}";
hash = "sha256-EA3yTP4j/jj26E8zdRwTIW+9FkI0ehK4Y8AqiCnF2xA=";
};
nativeBuildInputs = [
python3.pkgs.setuptools-scm
];
SETUPTOOLS_SCM_PRETEND_VERSION = version;
propagatedBuildInputs = with python3.pkgs; [
deltachat
emoji
notify-py
urwid-readline
];
doCheck = false; # no tests implemented
meta = with lib; {
description = "Lightweight Delta Chat client";
homepage = "https://github.com/adbenitez/deltachat-cursed";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ dotlambda ];
};
}

View file

@ -0,0 +1,128 @@
{ lib
, copyDesktopItems
, electron_18
, esbuild
, fetchFromGitHub
, libdeltachat
, makeDesktopItem
, makeWrapper
, nodePackages
, noto-fonts-emoji
, pkg-config
, roboto
, rustPlatform
, sqlcipher
, stdenv
, CoreServices
}:
let
libdeltachat' = libdeltachat.overrideAttrs (old: rec {
version = "1.86.0";
src = fetchFromGitHub {
owner = "deltachat";
repo = "deltachat-core-rust";
rev = version;
hash = "sha256-VLS93Ffeit2rVmXxYkXcnf8eDA3DC2/wKYZTh56QCk0=";
};
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${old.pname}-${version}";
hash = "sha256-4rpoDQ3o0WdWg/TmazTI+J0hL/MxwHcNMXWMq7GE7Tk=";
};
});
electronExec = if stdenv.isDarwin then
"${electron_18}/Applications/Electron.app/Contents/MacOS/Electron"
else
"${electron_18}/bin/electron";
esbuild' = esbuild.overrideAttrs (old: rec {
version = "0.12.29";
src = fetchFromGitHub {
owner = "evanw";
repo = "esbuild";
rev = "v${version}";
hash = "sha256-oU++9E3StUoyrMVRMZz8/1ntgPI62M1NoNz9sH/N5Bg=";
};
});
in nodePackages.deltachat-desktop.override rec {
pname = "deltachat-desktop";
version = "1.30.1";
src = fetchFromGitHub {
owner = "deltachat";
repo = "deltachat-desktop";
rev = "v${version}";
hash = "sha256-gZjZbXiqhFVfThZOsvL/nKkf6MX+E3KB5ldEAIuzBYA=";
};
nativeBuildInputs = [
makeWrapper
pkg-config
] ++ lib.optionals stdenv.isLinux [
copyDesktopItems
];
buildInputs = [
libdeltachat'
] ++ lib.optionals stdenv.isDarwin [
CoreServices
];
ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
ESBUILD_BINARY_PATH = "${esbuild'}/bin/esbuild";
USE_SYSTEM_LIBDELTACHAT = "true";
VERSION_INFO_GIT_REF = src.rev;
preRebuild = ''
substituteInPlace package.json \
--replace "node ./bin/check-nodejs-version.js" true
'';
postInstall = ''
rm -r node_modules/deltachat-node/node/prebuilds
npm run build4production
npm prune --production
install -D $out/lib/node_modules/deltachat-desktop/build/icon.png \
$out/share/icons/hicolor/scalable/apps/deltachat.png
awk '!/^#/ && NF' build/packageignore_list \
| xargs -I {} sh -c "rm -rf {}" || true
ln -sf ${noto-fonts-emoji}/share/fonts/noto/NotoColorEmoji.ttf \
$out/lib/node_modules/deltachat-desktop/html-dist/fonts/noto/emoji
for font in $out/lib/node_modules/deltachat-desktop/html-dist/fonts/Roboto-*.ttf; do
ln -sf ${roboto}/share/fonts/truetype/$(basename $font) \
$out/lib/node_modules/deltachat-desktop/html-dist/fonts
done
makeWrapper ${electronExec} $out/bin/deltachat \
--set LD_PRELOAD ${sqlcipher}/lib/libsqlcipher${stdenv.hostPlatform.extensions.sharedLibrary} \
--add-flags $out/lib/node_modules/deltachat-desktop
'';
desktopItems = lib.singleton (makeDesktopItem {
name = "deltachat";
exec = "deltachat %u";
icon = "deltachat";
desktopName = "Delta Chat";
genericName = "Delta Chat";
comment = meta.description;
categories = [ "Network" "InstantMessaging" "Chat" ];
startupWMClass = "DeltaChat";
mimeTypes = [ "x-scheme-handler/openpgp4fpr" "x-scheme-handler/mailto" ];
});
passthru.updateScript = ./update.sh;
meta = with lib; {
description = "Email-based instant messaging for Desktop";
homepage = "https://github.com/deltachat/deltachat-desktop";
changelog = "https://github.com/deltachat/deltachat-desktop/blob/${src.rev}/CHANGELOG.md";
license = licenses.gpl3Plus;
mainProgram = "deltachat";
maintainers = with maintainers; [ dotlambda ];
};
}

View file

@ -0,0 +1,39 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fe7abe08..acdbe0d6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,7 +13,6 @@ find_program(CARGO cargo)
add_custom_command(
OUTPUT
- "target/release/libdeltachat.a"
"target/release/libdeltachat.${DYNAMIC_EXT}"
"target/release/pkgconfig/deltachat.pc"
COMMAND
@@ -38,13 +37,11 @@ add_custom_target(
lib_deltachat
ALL
DEPENDS
- "target/release/libdeltachat.a"
"target/release/libdeltachat.${DYNAMIC_EXT}"
"target/release/pkgconfig/deltachat.pc"
)
include(GNUInstallDirs)
install(FILES "deltachat-ffi/deltachat.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
-install(FILES "target/release/libdeltachat.a" DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES "target/release/libdeltachat.${DYNAMIC_EXT}" DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES "target/release/pkgconfig/deltachat.pc" DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
diff --git a/deltachat-ffi/Cargo.toml b/deltachat-ffi/Cargo.toml
index a34a27ba..cf354abb 100644
--- a/deltachat-ffi/Cargo.toml
+++ b/deltachat-ffi/Cargo.toml
@@ -12,7 +12,7 @@ categories = ["cryptography", "std", "email"]
[lib]
name = "deltachat"
-crate-type = ["cdylib", "staticlib"]
+crate-type = ["cdylib"]
[dependencies]
deltachat = { path = "../", default-features = false }

View file

@ -0,0 +1,56 @@
{
"name": "deltachat-desktop",
"version": "1.30.1",
"dependencies": {
"@blueprintjs/core": "^4.1.2",
"@deltachat/message_parser_wasm": "^0.4.0",
"@deltachat/react-qr-reader": "^4.0.0",
"@mapbox/geojson-extent": "^1.0.0",
"application-config": "^1.0.1",
"classnames": "^2.3.1",
"debounce": "^1.2.0",
"deltachat-node": "1.86.0",
"emoji-js-clean": "^4.0.0",
"emoji-mart": "^3.0.1",
"emoji-regex": "^9.2.2",
"error-stack-parser": "^2.0.7",
"filesize": "^8.0.6",
"immutable": "^4.0.0",
"mapbox-gl": "^1.12.0",
"mime-types": "^2.1.31",
"moment": "^2.29.2",
"path-browserify": "^1.0.1",
"rc": "^1.2.8",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-string-replace": "^1.0.0",
"react-virtualized-auto-sizer": "^1.0.5",
"react-window": "^1.8.6",
"react-window-infinite-loader": "^1.0.7",
"react-zoom-pan-pinch": "^2.1.3",
"source-map-support": "^0.5.19",
"stackframe": "^1.2.1",
"url-parse": "^1.5.9",
"use-debounce": "^3.3.0",
"@babel/core": "^7.7.7",
"@babel/preset-env": "^7.7.7",
"@babel/preset-react": "^7.7.4",
"@types/debounce": "^1.2.0",
"@types/emoji-mart": "^3.0.9",
"@types/mapbox-gl": "^0.54.5",
"@types/mime-types": "^2.1.0",
"@types/node": "^14.14.20",
"@types/rc": "^1.1.0",
"@types/react": "^17.0.2",
"@types/react-dom": "^17.0.2",
"@types/react-window": "^1.8.4",
"@types/react-window-infinite-loader": "^1.0.4",
"@types/url-parse": "^1.4.3",
"electron": "^18.0.3",
"esbuild": "^0.12.29",
"glob-watcher": "^5.0.5",
"sass": "^1.26.5",
"typescript": "^4.4.4",
"xml-js": "^1.6.8"
}
}

View file

@ -0,0 +1,45 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p coreutils curl gnused jq moreutils nix-prefetch
set -euo pipefail
cd "$(dirname "$0")"
owner=deltachat
repo=deltachat-desktop
nixpkgs=../../../../..
rev=$(
curl -s "https://api.github.com/repos/$owner/$repo/releases" |
jq 'map(select(.prerelease | not)) | .[0].tag_name' --raw-output
)
ver=$(echo "$rev" | sed 's/^v//')
old_ver=$(tac default.nix | sed -n 's/.*\bversion = "\(.*\)".*/\1/p' | head -1)
if [ "$ver" = "$old_ver" ]; then
echo "Up to date: $ver"
exit
fi
echo "$old_ver -> $ver"
hash=$(nix-prefetch -f "$nixpkgs" deltachat-desktop --rev "$rev")
tac default.nix \
| sed -e "0,/version = \".*\"/s//version = \"$ver\"/" \
-e "0,/hash = \".*\"/s//hash = \"${hash//\//\\/}\"/" \
| tac \
| sponge default.nix
src=$(nix-build "$nixpkgs" -A deltachat-desktop.src --no-out-link)
jq '{ name, version, dependencies: (.dependencies + (.devDependencies | del(.["@types/chai","@types/mocha","@types/node-fetch","@typescript-eslint/eslint-plugin","@typescript-eslint/parser","chai","electron-builder","electron-devtools-installer","electron-notarize","eslint","eslint-config-prettier","eslint-plugin-react-hooks","hallmark","mocha","node-fetch","prettier","testcafe","testcafe-browser-provider-electron","testcafe-react-selectors","ts-node","walk"]))) }' \
"$src/package.json" > package.json.new
if cmp --quiet package.json{.new,}; then
echo "package.json not changed, skip updating nodePackages"
rm package.json.new
else
echo "package.json changed, updating nodePackages"
mv package.json{.new,}
pushd ../../../../development/node-packages
./generate.sh
popd
fi

View file

@ -0,0 +1,97 @@
{ lib, stdenv, fetchFromGitHub
, vala, cmake, ninja, wrapGAppsHook, pkg-config, gettext
, gobject-introspection, gnome, glib, gdk-pixbuf, gtk3, glib-networking
, xorg, libXdmcp, libxkbcommon
, libnotify, libsoup, libgee
, librsvg, libsignal-protocol-c
, libgcrypt
, libepoxy
, at-spi2-core
, sqlite
, dbus
, gpgme
, pcre
, qrencode
, icu
, gspell
, srtp, libnice, gnutls, gstreamer, gst-plugins-base, gst-plugins-good
}:
stdenv.mkDerivation rec {
pname = "dino";
version = "0.3.0";
src = fetchFromGitHub {
owner = "dino";
repo = "dino";
rev = "v${version}";
sha256 = "sha256-L5a5QlF9qlr4X/hGTabbbvOE5J1x/UVneWl/BRAa29Q=";
};
nativeBuildInputs = [
vala
cmake
ninja
pkg-config
wrapGAppsHook
gettext
];
buildInputs = [
qrencode
gobject-introspection
glib-networking
glib
libgee
gnome.adwaita-icon-theme
sqlite
gdk-pixbuf
gtk3
libnotify
gpgme
libgcrypt
libsoup
pcre
libepoxy
at-spi2-core
dbus
icu
libsignal-protocol-c
librsvg
gspell
srtp
libnice
gnutls
gstreamer
gst-plugins-base
gst-plugins-good
] ++ lib.optionals (!stdenv.isDarwin) [
xorg.libxcb
xorg.libpthreadstubs
libXdmcp
libxkbcommon
];
# 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.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";
homepage = "https://github.com/dino/dino";
license = licenses.gpl3Plus;
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ qyliss tomfitzhenry ];
};
}

View file

@ -0,0 +1,14 @@
{ pname, version, src, meta, stdenv, binaryName, desktopName, undmg }:
stdenv.mkDerivation {
inherit pname version src meta;
nativeBuildInputs = [ undmg ];
sourceRoot = ".";
installPhase = ''
mkdir -p $out/Applications
cp -r "${desktopName}.app" $out/Applications
'';
}

View file

@ -0,0 +1,84 @@
{ branch ? "stable", pkgs, lib, stdenv }:
let
inherit (pkgs) callPackage fetchurl;
versions = if stdenv.isLinux then {
stable = "0.0.17";
ptb = "0.0.29";
canary = "0.0.135";
} else {
stable = "0.0.264";
ptb = "0.0.59";
canary = "0.0.283";
};
version = versions.${branch};
srcs = let
darwin-ptb = fetchurl {
url = "https://dl-ptb.discordapp.net/apps/osx/${version}/DiscordPTB.dmg";
sha256 = "sha256-LS7KExVXkOv8O/GrisPMbBxg/pwoDXIOo1dK9wk1yB8=";
};
in {
x86_64-linux = {
stable = fetchurl {
url =
"https://dl.discordapp.net/apps/linux/${version}/discord-${version}.tar.gz";
sha256 = "058k0cmbm4y572jqw83bayb2zzl2fw2aaz0zj1gvg6sxblp76qil";
};
ptb = fetchurl {
url =
"https://dl-ptb.discordapp.net/apps/linux/${version}/discord-ptb-${version}.tar.gz";
sha256 = "d78NnQZ3MkLje8mHrI6noH2iD2oEvSJ3cDnsmzQsUYc=";
};
canary = fetchurl {
url =
"https://dl-canary.discordapp.net/apps/linux/${version}/discord-canary-${version}.tar.gz";
sha256 = "sha256-dmG+3BWS1BMHHQAv4fsXuObVeAJBeD+TqnyQz69AMac=";
};
};
x86_64-darwin = {
stable = fetchurl {
url = "https://dl.discordapp.net/apps/osx/${version}/Discord.dmg";
sha256 = "1jvlxmbfqhslsr16prsgbki77kq7i3ipbkbn67pnwlnis40y9s7p";
};
ptb = darwin-ptb;
canary = fetchurl {
url =
"https://dl-canary.discordapp.net/apps/osx/${version}/DiscordCanary.dmg";
sha256 = "0mqpk1szp46mih95x42ld32rrspc6jx1j7qdaxf01whzb3d4pi9l";
};
};
# Only PTB bundles a MachO Universal binary with ARM support.
aarch64-darwin = { ptb = darwin-ptb; };
};
src = srcs.${stdenv.hostPlatform.system}.${branch};
meta = with lib; {
description = "All-in-one cross-platform voice and text chat for gamers";
homepage = "https://discordapp.com/";
downloadPage = "https://discordapp.com/download";
license = licenses.unfree;
maintainers = with maintainers; [ ldesgoui MP2E devins2518 ];
platforms = [ "x86_64-linux" "x86_64-darwin" ]
++ lib.optionals (branch == "ptb") [ "aarch64-darwin" ];
};
package = if stdenv.isLinux then ./linux.nix else ./darwin.nix;
packages = (builtins.mapAttrs
(_: value: callPackage package (value // { inherit src version; meta = meta // { mainProgram = value.binaryName; }; }))
{
stable = rec {
pname = "discord";
binaryName = "Discord";
desktopName = "Discord";
};
ptb = rec {
pname = "discord-ptb";
binaryName = "DiscordPTB";
desktopName = "Discord PTB";
};
canary = rec {
pname = "discord-canary";
binaryName = "DiscordCanary";
desktopName = "Discord Canary";
};
}
);
in packages.${branch}

View file

@ -0,0 +1,119 @@
{ pname, version, src, meta, binaryName, desktopName, autoPatchelfHook
, makeDesktopItem, lib, stdenv, wrapGAppsHook, makeShellWrapper, alsa-lib, at-spi2-atk
, at-spi2-core, atk, cairo, cups, dbus, expat, fontconfig, freetype, gdk-pixbuf
, glib, gtk3, libcxx, libdrm, libnotify, libpulseaudio, libuuid, libX11
, libXScrnSaver, libXcomposite, libXcursor, libXdamage, libXext, libXfixes
, libXi, libXrandr, libXrender, libXtst, libxcb, libxshmfence, mesa, nspr, nss
, pango, systemd, libappindicator-gtk3, libdbusmenu, writeScript
, common-updater-scripts }:
stdenv.mkDerivation rec {
inherit pname version src meta;
nativeBuildInputs = [
alsa-lib
autoPatchelfHook
cups
libdrm
libuuid
libXdamage
libX11
libXScrnSaver
libXtst
libxcb
libxshmfence
mesa
nss
wrapGAppsHook
makeShellWrapper
];
dontWrapGApps = true;
libPath = lib.makeLibraryPath [
libcxx
systemd
libpulseaudio
libdrm
mesa
stdenv.cc.cc
alsa-lib
atk
at-spi2-atk
at-spi2-core
cairo
cups
dbus
expat
fontconfig
freetype
gdk-pixbuf
glib
gtk3
libnotify
libX11
libXcomposite
libuuid
libXcursor
libXdamage
libXext
libXfixes
libXi
libXrandr
libXrender
libXtst
nspr
nss
libxcb
pango
libXScrnSaver
libappindicator-gtk3
libdbusmenu
];
installPhase = ''
mkdir -p $out/{bin,opt/${binaryName},share/pixmaps}
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:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}" \
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
--prefix LD_LIBRARY_PATH : ${libPath}:$out/opt/${binaryName}
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 "${desktopItem}/share/applications" $out/share/
'';
desktopItem = makeDesktopItem {
name = pname;
exec = binaryName;
icon = pname;
inherit desktopName;
genericName = meta.description;
categories = [ "Network" "InstantMessaging" ];
mimeTypes = [ "x-scheme-handler/discord" ];
};
passthru.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 "https://discordapp.com/api/download/${
builtins.replaceStrings [ "discord-" "discord" ] [ "" "stable" ] pname
}?platform=linux&format=tar.gz" | grep -oP 'location: \K\S+')
version=''${url##https://dl*.discordapp.net/apps/linux/}
version=''${version%%/*.tar.gz}
update-source-version ${pname} "$version" --file=./pkgs/applications/networking/instant-messengers/discord/default.nix
'';
}

View file

@ -0,0 +1,140 @@
{
"name": "element-desktop",
"productName": "Element",
"main": "lib/electron-main.js",
"version": "1.10.13",
"description": "A feature-rich client for Matrix.org",
"author": "Element",
"repository": {
"type": "git",
"url": "https://github.com/vector-im/element-desktop"
},
"license": "Apache-2.0",
"files": [],
"scripts": {
"i18n": "matrix-gen-i18n",
"prunei18n": "matrix-prune-i18n",
"diff-i18n": "cp src/i18n/strings/en_EN.json src/i18n/strings/en_EN_orig.json && matrix-gen-i18n && matrix-compare-i18n-files src/i18n/strings/en_EN_orig.json src/i18n/strings/en_EN.json",
"mkdirs": "mkdirp packages deploys",
"fetch": "yarn run mkdirs && node scripts/fetch-package.js",
"asar-webapp": "asar p webapp webapp.asar",
"start": "yarn run build:ts && yarn run build:res && electron .",
"lint": "yarn lint:types && yarn lint:js",
"lint:js": "eslint --max-warnings 0 src scripts hak",
"lint:js-fix": "eslint --fix src scripts hak",
"lint:types": "tsc --noEmit && tsc -p scripts/hak/tsconfig.json --noEmit && tsc -p hak/tsconfig.json --noEmit",
"build:native": "yarn run hak",
"build:native:universal": "yarn run hak --target x86_64-apple-darwin fetchandbuild && yarn run hak --target aarch64-apple-darwin fetchandbuild && yarn run hak --target x86_64-apple-darwin --target aarch64-apple-darwin copyandlink",
"build:32": "yarn run build:ts && yarn run build:res && electron-builder --ia32",
"build:64": "yarn run build:ts && yarn run build:res && electron-builder --x64",
"build:universal": "yarn run build:ts && yarn run build:res && electron-builder --universal",
"build": "yarn run build:ts && yarn run build:res && electron-builder",
"build:ts": "tsc",
"build:res": "node scripts/copy-res.js",
"docker:setup": "docker build -t element-desktop-dockerbuild dockerbuild",
"docker:build:native": "scripts/in-docker.sh yarn run hak",
"docker:build": "scripts/in-docker.sh yarn run build",
"docker:install": "scripts/in-docker.sh yarn install",
"debrepo": "scripts/mkrepo.sh",
"clean": "rimraf webapp.asar dist packages deploys lib",
"hak": "ts-node scripts/hak/index.ts"
},
"dependencies": {
"auto-launch": "^5.0.5",
"counterpart": "^0.18.6",
"electron-store": "^6.0.1",
"electron-window-state": "^5.0.3",
"minimist": "^1.2.6",
"png-to-ico": "^2.1.1",
"request": "^2.88.2"
},
"devDependencies": {
"@types/auto-launch": "^5.0.1",
"@types/counterpart": "^0.18.1",
"@types/minimist": "^1.2.1",
"@types/mkdirp": "^1.0.2",
"@types/pacote": "^11.1.1",
"@types/rimraf": "^3.0.2",
"@typescript-eslint/eslint-plugin": "^5.6.0",
"@typescript-eslint/parser": "^5.6.0",
"allchange": "^1.0.6",
"app-builder-lib": "^22.14.10",
"asar": "^2.0.1",
"chokidar": "^3.5.2",
"electron": "^17",
"electron-builder": "22.11.4",
"electron-builder-squirrel-windows": "22.11.4",
"electron-devtools-installer": "^3.1.1",
"electron-notarize": "^1.0.0",
"eslint": "7.18.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-matrix-org": "^0.4.0",
"find-npm-prefix": "^1.0.2",
"fs-extra": "^8.1.0",
"glob": "^7.1.6",
"matrix-web-i18n": "^1.2.0",
"mkdirp": "^1.0.3",
"needle": "^2.5.0",
"node-pre-gyp": "^0.15.0",
"pacote": "^11.3.5",
"rimraf": "^3.0.2",
"tar": "^6.1.2",
"ts-node": "^10.4.0",
"typescript": "4.5.5"
},
"hakDependencies": {
"matrix-seshat": "^2.3.3",
"keytar": "^7.9.0"
},
"build": {
"appId": "im.riot.app",
"asarUnpack": "**/*.node",
"files": [
"package.json",
{
"from": ".hak/hakModules",
"to": "node_modules"
},
"lib/**"
],
"extraResources": [
{
"from": "res/img",
"to": "img"
},
"webapp.asar"
],
"linux": {
"target": "deb",
"category": "Network;InstantMessaging;Chat",
"maintainer": "support@element.io",
"desktop": {
"StartupWMClass": "element"
}
},
"mac": {
"category": "public.app-category.social-networking",
"darkModeSupport": true
},
"win": {
"target": {
"target": "squirrel"
},
"sign": "scripts/electron_winSign"
},
"directories": {
"output": "dist"
},
"afterPack": "scripts/electron_afterPack",
"afterSign": "scripts/electron_afterSign",
"protocols": [
{
"name": "element",
"schemes": [
"element"
]
}
]
}
}

View file

@ -0,0 +1,137 @@
{ lib
, stdenv
, fetchFromGitHub
, makeWrapper
, makeDesktopItem
, mkYarnPackage
, fetchYarnDeps
, electron
, element-web
, sqlcipher
, callPackage
, Security
, AppKit
, CoreServices
, desktopToDarwinBundle
, useKeytar ? true
}:
let
pinData = lib.importJSON ./pin.json;
executableName = "element-desktop";
electron_exec = if stdenv.isDarwin then "${electron}/Applications/Electron.app/Contents/MacOS/Electron" else "${electron}/bin/electron";
keytar = callPackage ./keytar { inherit Security AppKit; };
seshat = callPackage ./seshat { inherit CoreServices; };
in
mkYarnPackage rec {
pname = "element-desktop";
inherit (pinData) version;
name = "${pname}-${version}";
src = fetchFromGitHub {
owner = "vector-im";
repo = "element-desktop";
rev = "v${version}";
sha256 = pinData.desktopSrcHash;
};
packageJSON = ./element-desktop-package.json;
offlineCache = fetchYarnDeps {
yarnLock = src + "/yarn.lock";
sha256 = pinData.desktopYarnHash;
};
nativeBuildInputs = [ makeWrapper ] ++ lib.optionals stdenv.isDarwin [ desktopToDarwinBundle ];
inherit seshat;
buildPhase = ''
runHook preBuild
export HOME=$(mktemp -d)
pushd deps/element-desktop/
npx tsc
yarn run i18n
node ./scripts/copy-res.js
popd
rm -rf node_modules/matrix-seshat node_modules/keytar
${lib.optionalString useKeytar "ln -s ${keytar} node_modules/keytar"}
ln -s $seshat node_modules/matrix-seshat
runHook postBuild
'';
installPhase = ''
runHook preInstall
# resources
mkdir -p "$out/share/element"
ln -s '${element-web}' "$out/share/element/webapp"
cp -r './deps/element-desktop' "$out/share/element/electron"
cp -r './deps/element-desktop/res/img' "$out/share/element"
rm "$out/share/element/electron/node_modules"
cp -r './node_modules' "$out/share/element/electron"
cp $out/share/element/electron/lib/i18n/strings/en_EN.json $out/share/element/electron/lib/i18n/strings/en-us.json
ln -s $out/share/element/electron/lib/i18n/strings/en{-us,}.json
# icons
for icon in $out/share/element/electron/build/icons/*.png; do
mkdir -p "$out/share/icons/hicolor/$(basename $icon .png)/apps"
ln -s "$icon" "$out/share/icons/hicolor/$(basename $icon .png)/apps/element.png"
done
# desktop item
mkdir -p "$out/share"
ln -s "${desktopItem}/share/applications" "$out/share/applications"
# executable wrapper
# LD_PRELOAD workaround for sqlcipher not found: https://github.com/matrix-org/seshat/issues/102
makeWrapper '${electron_exec}' "$out/bin/${executableName}" \
--set LD_PRELOAD ${sqlcipher}/lib/libsqlcipher.so \
--add-flags "$out/share/element/electron" \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}"
runHook postInstall
'';
# Do not attempt generating a tarball for element-web again.
# note: `doDist = false;` does not work.
distPhase = ''
true
'';
# The desktop item properties should be kept in sync with data from upstream:
# https://github.com/vector-im/element-desktop/blob/develop/package.json
desktopItem = makeDesktopItem {
name = "element-desktop";
exec = "${executableName} %u";
icon = "element";
desktopName = "Element";
genericName = "Matrix Client";
comment = meta.description;
categories = [ "Network" "InstantMessaging" "Chat" ];
startupWMClass = "element";
mimeTypes = [ "x-scheme-handler/element" ];
};
passthru = {
updateScript = ./update.sh;
# TL;DR: keytar is optional while seshat isn't.
#
# This prevents building keytar when `useKeytar` is set to `false`, because
# if libsecret is unavailable (e.g. set to `null` or fails to build), then
# this package wouldn't even considered for building because
# "one of the dependencies failed to build",
# although the dependency wouldn't even be used.
#
# It needs to be `passthru` anyways because other packages do depend on it.
inherit keytar;
};
meta = with lib; {
description = "A feature-rich client for Matrix.org";
homepage = "https://element.io/";
changelog = "https://github.com/vector-im/element-desktop/blob/v${version}/CHANGELOG.md";
license = licenses.asl20;
maintainers = teams.matrix.members;
inherit (electron.meta) platforms;
};
}

View file

@ -0,0 +1,39 @@
{ lib, stdenv, fetchurl, writeText, jq, conf ? {} }:
let
pinData = lib.importJSON ./pin.json;
noPhoningHome = {
disable_guests = true; # disable automatic guest account registration at matrix.org
piwik = false; # disable analytics
};
configOverrides = writeText "element-config-overrides.json" (builtins.toJSON (noPhoningHome // conf));
in stdenv.mkDerivation rec {
pname = "element-web";
inherit (pinData) version;
src = fetchurl {
url = "https://github.com/vector-im/element-web/releases/download/v${version}/element-v${version}.tar.gz";
sha256 = pinData.webHash;
};
installPhase = ''
runHook preInstall
mkdir -p $out/
cp -R . $out/
${jq}/bin/jq -s '.[0] * .[1]' "config.sample.json" "${configOverrides}" > "$out/config.json"
runHook postInstall
'';
meta = {
description = "A glossy Matrix collaboration client for the web";
homepage = "https://element.io/";
changelog = "https://github.com/vector-im/element-web/blob/v${version}/CHANGELOG.md";
maintainers = lib.teams.matrix.members;
license = lib.licenses.asl20;
platforms = lib.platforms.all;
hydraPlatforms = [];
};
}

View file

@ -0,0 +1,59 @@
{ lib, stdenv, fetchFromGitHub, nodejs-14_x, python3, callPackage, removeReferencesTo
, fixup_yarn_lock, yarn, pkg-config, libsecret, xcbuild, Security, AppKit, fetchYarnDeps }:
let
pinData = lib.importJSON ./pin.json;
in stdenv.mkDerivation rec {
pname = "keytar";
inherit (pinData) version;
src = fetchFromGitHub {
owner = "atom";
repo = "node-keytar";
rev = "v${version}";
sha256 = pinData.srcHash;
};
nativeBuildInputs = [ nodejs-14_x python3 yarn pkg-config ]
++ lib.optional stdenv.isDarwin xcbuild;
buildInputs = lib.optionals (!stdenv.isDarwin) [ libsecret ]
++ lib.optionals stdenv.isDarwin [ Security AppKit ];
npm_config_nodedir = nodejs-14_x;
yarnOfflineCache = fetchYarnDeps {
yarnLock = ./yarn.lock;
sha256 = pinData.yarnHash;
};
buildPhase = ''
runHook preBuild
cp ${./yarn.lock} ./yarn.lock
chmod u+w . ./yarn.lock
export HOME=$PWD/tmp
mkdir -p $HOME
yarn config --offline set yarn-offline-mirror ${yarnOfflineCache}
${fixup_yarn_lock}/bin/fixup_yarn_lock yarn.lock
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
patchShebangs node_modules/
node_modules/.bin/node-gyp rebuild
runHook postBuild
'';
doCheck = false;
installPhase = ''
runHook preInstall
shopt -s extglob
rm -rf node_modules
rm -rf $HOME
mkdir -p $out
cp -r ./!(build) $out
install -D -t $out/build/Release build/Release/keytar.node
${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc.cc} $out/build/Release/keytar.node
runHook postInstall
'';
disallowedReferences = [ stdenv.cc.cc ];
}

View file

@ -0,0 +1,5 @@
{
"version": "7.7.0",
"srcHash": "sd6h+vDJGvmXFhOm4MDAljb4dAOMBB8W1IL7JSfJWyo=",
"yarnHash": "1m75hvl06mcj260hicbmv75p94h73gw5d24zpm5wxwc0q8v8wzfl"
}

View file

@ -0,0 +1,38 @@
#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=../../../../../../ -i bash -p wget prefetch-yarn-deps yarn
if [ "$#" -gt 1 ] || [[ "$1" == -* ]]; then
echo "Regenerates packaging data for the seshat package."
echo "Usage: $0 [git release tag]"
exit 1
fi
version="$1"
set -euo pipefail
if [ -z "$version" ]; then
version="$(wget -O- "https://api.github.com/repos/atom/node-keytar/releases?per_page=1" | jq -r '.[0].tag_name')"
fi
# strip leading "v"
version="${version#v}"
SRC="https://raw.githubusercontent.com/atom/node-keytar/v$version"
wget "$SRC/package-lock.json"
wget "$SRC/package.json"
rm -f yarn.lock
yarn import
rm -rf node_modules package.json package-lock.json
yarn_hash=$(prefetch-yarn-deps yarn.lock)
src_hash=$(nix-prefetch-github atom node-keytar --rev v${version} | jq -r .sha256)
cat > pin.json << EOF
{
"version": "$version",
"srcHash": "$src_hash",
"yarnHash": "$yarn_hash"
}
EOF

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,6 @@
{
"version": "1.10.13",
"desktopSrcHash": "tTvpjSIipvmJIfZF1RiRtlDjsKJYHoPQ6XSqI8TGH14=",
"desktopYarnHash": "105bphn4ga4f0n60cvrlppf8wim2c1qy09g8arraadcxymds98n6",
"webHash": "1zxjlzlxh2gbswa1063zbw6ahwlcnvyqkvbwj92vk873c3g8ba72"
}

View file

@ -0,0 +1,58 @@
{ lib, stdenv, rustPlatform, fetchFromGitHub, callPackage, sqlcipher, nodejs-14_x, python3, yarn, fixup_yarn_lock, CoreServices, fetchYarnDeps, removeReferencesTo }:
let
pinData = lib.importJSON ./pin.json;
in rustPlatform.buildRustPackage rec {
pname = "seshat-node";
inherit (pinData) version;
src = fetchFromGitHub {
owner = "matrix-org";
repo = "seshat";
rev = version;
sha256 = pinData.srcHash;
};
sourceRoot = "source/seshat-node/native";
nativeBuildInputs = [ nodejs-14_x python3 yarn ];
buildInputs = [ sqlcipher ] ++ lib.optional stdenv.isDarwin CoreServices;
npm_config_nodedir = nodejs-14_x;
yarnOfflineCache = fetchYarnDeps {
yarnLock = src + "/seshat-node/yarn.lock";
sha256 = pinData.yarnHash;
};
buildPhase = ''
runHook preBuild
cd ..
chmod u+w . ./yarn.lock
export HOME=$PWD/tmp
mkdir -p $HOME
yarn config --offline set yarn-offline-mirror ${yarnOfflineCache}
${fixup_yarn_lock}/bin/fixup_yarn_lock yarn.lock
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
patchShebangs node_modules/
node_modules/.bin/neon build --release
runHook postBuild
'';
doCheck = false;
installPhase = ''
runHook preInstall
shopt -s extglob
rm -rf native/!(index.node)
rm -rf node_modules $HOME
cp -r . $out
${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc.cc} $out/native/index.node
runHook postInstall
'';
disallowedReferences = [ stdenv.cc.cc ];
cargoSha256 = pinData.cargoHash;
}

View file

@ -0,0 +1,6 @@
{
"version": "2.3.0",
"srcHash": "JyqtM1CCRgxAAdhgQYaIUYPnxEcDrlW1SjDCmsrPL34=",
"yarnHash": "0bym6i1f0i3bs4fncbiwzwmbxp7j14rz1v4kyvsl02qs97qw1jac",
"cargoHash": "sha256-EjtH96SC2kgan631+wlu9LStGKm6ljCR4x3/WpCTS0E="
}

View file

@ -0,0 +1,49 @@
#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=../../../../../../ -i bash -p wget prefetch-yarn-deps yarn nix-prefetch
if [ "$#" -gt 1 ] || [[ "$1" == -* ]]; then
echo "Regenerates packaging data for the seshat package."
echo "Usage: $0 [git release tag]"
exit 1
fi
version="$1"
set -euo pipefail
if [ -z "$version" ]; then
version="$(wget -O- "https://api.github.com/repos/matrix-org/seshat/tags" | jq -r '.[] | .name' | sort --version-sort | tail -1)"
fi
SRC="https://raw.githubusercontent.com/matrix-org/seshat/$version"
tmpdir=$(mktemp -d)
trap 'rm -rf "$tmpdir"' EXIT
pushd $tmpdir
wget "$SRC/seshat-node/yarn.lock"
yarn_hash=$(prefetch-yarn-deps yarn.lock)
popd
src_hash=$(nix-prefetch-github matrix-org seshat --rev ${version} | jq -r .sha256)
cat > pin.json << EOF
{
"version": "$version",
"srcHash": "$src_hash",
"yarnHash": "$yarn_hash",
"cargoHash": "0000000000000000000000000000000000000000000000000000"
}
EOF
cargo_hash=$(nix-prefetch "{ sha256 }: (import ../../../../../.. {}).element-desktop.seshat.cargoDeps")
cat > pin.json << EOF
{
"version": "$version",
"srcHash": "$src_hash",
"yarnHash": "$yarn_hash",
"cargoHash": "$cargo_hash"
}
EOF

View file

@ -0,0 +1,43 @@
#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=../../../../../ -i bash -p nix wget prefetch-yarn-deps nix-prefetch-github
if [ "$#" -gt 1 ] || [[ "$1" == -* ]]; then
echo "Regenerates packaging data for the element packages."
echo "Usage: $0 [git release tag]"
exit 1
fi
version="$1"
set -euo pipefail
if [ -z "$version" ]; then
version="$(wget -O- "https://api.github.com/repos/vector-im/element-desktop/releases?per_page=1" | jq -r '.[0].tag_name')"
fi
# strip leading "v"
version="${version#v}"
desktop_src="https://raw.githubusercontent.com/vector-im/element-desktop/v$version"
desktop_src_hash=$(nix-prefetch-github vector-im element-desktop --rev v${version} | jq -r .sha256)
web_hash=$(nix-prefetch-url "https://github.com/vector-im/element-web/releases/download/v$version/element-v$version.tar.gz")
wget "$desktop_src/package.json" -O element-desktop-package.json
tmpdir=$(mktemp -d)
trap 'rm -rf "$tmpdir"' EXIT
pushd $tmpdir
wget "$desktop_src/yarn.lock"
desktop_yarn_hash=$(prefetch-yarn-deps yarn.lock)
popd
cat > pin.json << EOF
{
"version": "$version",
"desktopSrcHash": "$desktop_src_hash",
"desktopYarnHash": "$desktop_yarn_hash",
"webHash": "$web_hash"
}
EOF

View file

@ -0,0 +1,34 @@
{ lib, mkFranzDerivation, fetchurl, xorg, xdg-utils, buildEnv, writeShellScriptBin }:
let
mkFranzDerivation' = mkFranzDerivation.override {
xdg-utils = buildEnv {
name = "xdg-utils-for-ferdi";
paths = [
xdg-utils
(lib.hiPrio (writeShellScriptBin "xdg-open" ''
unset GDK_BACKEND
exec ${xdg-utils}/bin/xdg-open "$@"
''))
];
};
};
in
mkFranzDerivation' rec {
pname = "ferdi";
name = "Ferdi";
version = "5.8.1";
src = fetchurl {
url = "https://master.dl.sourceforge.net/project/ferdi.mirror/v${version}/ferdi_${version}_amd64.deb";
sha256 = "sha256-Bl7bM5iDQlfPSZxksqlg7GbuwWlm53QkOf/TQEg3/n0=";
};
extraBuildInputs = [ xorg.libxshmfence ];
meta = with lib; {
description = "Combine your favorite messaging services into one application";
homepage = "https://getferdi.com/";
license = licenses.asl20;
maintainers = with maintainers; [ davidtwco ma27 ];
platforms = [ "x86_64-linux" ];
hydraPlatforms = [ ];
};
}

View file

@ -0,0 +1,81 @@
{ lib
, fetchFromGitLab
, flutter
, olm
, imagemagick
, makeDesktopItem
}:
flutter.mkFlutterApp rec {
pname = "fluffychat";
version = "1.2.0";
vendorHash = "sha256-j5opwEFifa+DMG7Uziv4SWEPVokD6OSq8mSIr0AdDL0=";
src = fetchFromGitLab {
owner = "famedly";
repo = "fluffychat";
rev = "v${version}";
hash = "sha256-PJH3jMQc6u9R6Snn+9rNN8t+8kt6l3Xt7zKPbpqj13E=";
};
desktopItem = makeDesktopItem {
name = "Fluffychat";
exec = "@out@/bin/fluffychat";
icon = "fluffychat";
desktopName = "Fluffychat";
genericName = "Chat with your friends (matrix client)";
categories = [ "Chat" "Network" "InstantMessaging" ];
};
buildInputs = [
olm
];
nativeBuildInputs = [
imagemagick
];
flutterExtraFetchCommands = ''
M=$(echo $TMP/.pub-cache/hosted/pub.dartlang.org/matrix-*)
sed -i $M/scripts/prepare.sh \
-e "s|/usr/lib/x86_64-linux-gnu/libolm.so.3|/bin/sh|g" \
-e "s|if which flutter >/dev/null; then|exit; if which flutter >/dev/null; then|g"
pushd $M
bash scripts/prepare.sh
popd
'';
# replace olm dummy path
postConfigure = ''
M=$(echo $depsFolder/.pub-cache/hosted/pub.dartlang.org/matrix-*)
ln -sf ${olm}/lib/libolm.so.3 $M/ffi/olm/libolm.so
'';
postInstall = ''
FAV=$out/app/data/flutter_assets/assets/favicon.png
ICO=$out/share/icons
install -D $FAV $ICO/fluffychat.png
mkdir $out/share/applications
cp $desktopItem/share/applications/*.desktop $out/share/applications
for s in 24 32 42 64 128 256 512; do
D=$ICO/hicolor/''${s}x''${s}/apps
mkdir -p $D
convert $FAV -resize ''${s}x''${s} $D/fluffychat.png
done
substituteInPlace $out/share/applications/*.desktop \
--subst-var out
'';
meta = with lib; {
description = "Chat with your friends (matrix client)";
homepage = "https://fluffychat.im/";
license = licenses.agpl3Plus;
maintainers = with maintainers; [ mkg20001 ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,104 @@
{ stdenv
, lib
, fetchFromGitLab
, fetchpatch
, nix-update-script
, meson
, ninja
, gettext
, python3
, rustPlatform
, pkg-config
, gtksourceview4
, glib
, libhandy_0
, gtk3
, dbus
, openssl
, sqlite
, gst_all_1
, cairo
, gdk-pixbuf
, gspell
, wrapGAppsHook
}:
stdenv.mkDerivation rec {
pname = "fractal";
version = "4.4.0";
src = fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "GNOME";
repo = "fractal";
rev = version;
sha256 = "DSNVd9YvI7Dd3s3+M0+wE594tmL1yPNMnD1W9wLhSuw=";
};
patches = [
# Fix build with meson 0.61
# fractal-gtk/res/meson.build:5:0: ERROR: Function does not take positional arguments.
(fetchpatch {
url = "https://gitlab.gnome.org/GNOME/fractal/-/commit/6fa1a23596d65d94aa889efe725174e6cd2903f0.patch";
sha256 = "3OzU9XL2V1VNOkvL1j677K3HNoBqPMQudQDmiDxYfAc=";
})
];
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}";
hash = "sha256-xim5sOzeXJjRXbTOg2Gk/LHU0LioiyMK5nSr1LwMPjc=";
};
nativeBuildInputs = [
gettext
meson
ninja
pkg-config
python3
rustPlatform.rust.cargo
rustPlatform.cargoSetupHook
rustPlatform.rust.rustc
wrapGAppsHook
glib
];
buildInputs = [
cairo
dbus
gdk-pixbuf
glib
gspell
gst_all_1.gst-editing-services
gst_all_1.gst-plugins-bad
gst_all_1.gst-plugins-base
(gst_all_1.gst-plugins-good.override {
gtkSupport = true;
})
gst_all_1.gstreamer
gst_all_1.gst-devtools
gtk3
gtksourceview4
libhandy_0
openssl
sqlite
];
postPatch = ''
chmod +x scripts/test.sh
patchShebangs scripts/meson_post_install.py scripts/test.sh
'';
passthru = {
updateScript = nix-update-script {
attrPath = pname;
};
};
meta = with lib; {
description = "Matrix group messaging app";
homepage = "https://gitlab.gnome.org/GNOME/fractal";
license = licenses.gpl3;
maintainers = teams.gnome.members ++ (with maintainers; [ dtzWill ]);
};
}

View file

@ -0,0 +1,19 @@
{ lib, mkFranzDerivation, fetchurl }:
mkFranzDerivation rec {
pname = "franz";
name = "Franz";
version = "5.9.2";
src = fetchurl {
url = "https://github.com/meetfranz/franz/releases/download/v${version}/franz_${version}_amd64.deb";
sha256 = "sha256-W/60g5CbSUZcNASjdbiS7DNv9375GiesEG60QLLAh1g=";
};
meta = with lib; {
description = "A free messaging app that combines chat & messaging services into one application";
homepage = "https://meetfranz.com";
license = licenses.free;
maintainers = [ maintainers.davidtwco ];
platforms = [ "x86_64-linux" ];
hydraPlatforms = [ ];
};
}

View file

@ -0,0 +1,93 @@
{ stdenv
, lib
, makeWrapper
, wrapGAppsHook
, autoPatchelfHook
, dpkg
, xorg
, atk
, glib
, pango
, gdk-pixbuf
, cairo
, freetype
, fontconfig
, gtk3
, dbus
, nss
, nspr
, alsa-lib
, cups
, expat
, udev
, libnotify
, xdg-utils
, mesa
, libappindicator-gtk3
}:
# Helper function for building a derivation for Franz and forks.
{ pname, name, version, src, meta, extraBuildInputs ? [] }:
stdenv.mkDerivation rec {
inherit pname version src meta;
# Don't remove runtime deps.
dontPatchELF = true;
nativeBuildInputs = [ autoPatchelfHook makeWrapper wrapGAppsHook dpkg ];
buildInputs = extraBuildInputs ++ (with xorg; [
libXi
libXcursor
libXdamage
libXrandr
libXcomposite
libXext
libXfixes
libXrender
libX11
libXtst
libXScrnSaver
]) ++ [
mesa #libgbm
gtk3
atk
glib
pango
gdk-pixbuf
cairo
freetype
fontconfig
dbus
nss
nspr
alsa-lib
cups
expat
stdenv.cc.cc
];
runtimeDependencies = [ stdenv.cc.cc.lib (lib.getLib udev) libnotify libappindicator-gtk3 ];
unpackPhase = "dpkg-deb -x $src .";
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 = ''
wrapProgram $out/opt/${name}/${pname} \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath runtimeDependencies}" \
--prefix PATH : ${xdg-utils}/bin \
"''${gappsWrapperArgs[@]}"
'';
}

View file

@ -0,0 +1,43 @@
{ lib, stdenv, fetchFromGitHub, fetchpatch
, guile, pkg-config, glib, loudmouth, gmp, libidn, readline, libtool
, libunwind, ncurses, curl, jansson, texinfo
, automake, autoconf }:
stdenv.mkDerivation rec {
pname = "freetalk";
version = "4.1";
src = fetchFromGitHub {
owner = "GNUFreetalk";
repo = "freetalk";
rev = "v${version}";
sha256 = "09jwk2i8qd8c7wrn9xbqcwm32720dwxis22kf3jpbg8mn6w6i757";
};
patches = [
# Pull pending patch for -fno-common tuulchain support:
# https://github.com/GNUFreetalk/freetalk/pull/39
(fetchpatch {
name = "fno-common.patch";
url = "https://github.com/GNUFreetalk/freetalk/commit/f04d6bc8422be44cdf51b29c9a4310f20a18775a.patch";
sha256 = "1zjm56cdibnqabgcwl2bx79dj6dmqjf40zghqwwb0lfi60v1njqf";
})
];
preConfigure = ''
./autogen.sh
'';
nativeBuildInputs = [ pkg-config texinfo autoconf automake ];
buildInputs = [
guile glib loudmouth gmp libidn readline libtool
libunwind ncurses curl jansson
];
meta = with lib; {
description = "Console XMPP client";
license = licenses.gpl3Plus ;
maintainers = with maintainers; [ raskin ];
platforms = platforms.linux;
downloadPage = "https://www.gnu.org/software/freetalk/";
};
}

View file

@ -0,0 +1,79 @@
{ lib, fetchurl, fetchFromGitLab, gettext, wrapGAppsHook
# Native dependencies
, python3, gtk3, gobject-introspection, gnome
, gtksourceview4
, glib-networking
# 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
, enableOmemoPluginDependencies ? true
, enableAppIndicator ? true, libappindicator-gtk3
, extraPythonPackages ? ps: []
}:
python3.pkgs.buildPythonApplication rec {
pname = "gajim";
version = "1.4.3";
src = fetchurl {
url = "https://gajim.org/downloads/${lib.versions.majorMinor version}/gajim-${version}.tar.gz";
sha256 = "sha256:0n6v96pwgds8655877fjgsphq4rd4gb9mz7cbqp4nkd4m7kvr3xv";
};
buildInputs = [
gobject-introspection gtk3 gnome.adwaita-icon-theme
gtksourceview4
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;
nativeBuildInputs = [
gettext wrapGAppsHook
];
dontWrapGApps = true;
preFixup = ''
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
'';
propagatedBuildInputs = with python3.pkgs; [
nbxmpp pygobject3 dbus-python pillow css-parser precis-i18n keyring setuptools packaging gssapi
] ++ lib.optionals enableE2E [ pycrypto python-gnupg ]
++ lib.optional enableRST docutils
++ lib.optionals enableOmemoPluginDependencies [ python-axolotl qrcode ]
++ extraPythonPackages python3.pkgs;
checkInputs = [ xvfb-run dbus.daemon ];
checkPhase = ''
xvfb-run dbus-run-session \
--config-file=${dbus.daemon}/share/dbus-1/session.conf \
${python3.interpreter} -m unittest discover -s test/gtk -v
${python3.interpreter} -m unittest discover -s test/no_gui -v
'';
# necessary for wrapGAppsHook
strictDeps = false;
meta = {
homepage = "http://gajim.org/";
description = "Jabber client written in PyGTK";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ raskin abbradar ];
downloadPage = "http://gajim.org/download/";
platforms = lib.platforms.linux;
};
}

View file

@ -0,0 +1,101 @@
{ lib, stdenv, alsa-lib, atk, at-spi2-core, cairo, cups, dbus, dpkg, expat, fetchurl
, fontconfig, freetype, gdk-pixbuf, glib, gtk3, libdrm, libX11
, libXScrnSaver, libXcomposite, libXcursor, libXdamage, libXext, libXfixes
, libXi, libXrandr, libXrender, libXtst, libappindicator-gtk3, libcxx
, libnotify, libpulseaudio, libxcb, makeDesktopItem, makeWrapper, mesa, nspr, nss
, pango, systemd }:
let gitterDirectorySuffix = "opt/gitter";
libPath = lib.makeLibraryPath [
alsa-lib
atk
at-spi2-core
cairo
cups
dbus
expat
fontconfig
freetype
gdk-pixbuf
glib
gtk3
libX11
libXScrnSaver
libXcomposite
libXcursor
libXdamage
libXext
libXfixes
libXi
libXrandr
libXrender
libXtst
libappindicator-gtk3
libcxx
libdrm
libnotify
libpulseaudio
libxcb
mesa
nspr
nss
pango
stdenv.cc.cc
systemd
];
doELFPatch = target: ''
patchelf --set-interpreter ${stdenv.cc.bintools.dynamicLinker} \
--set-rpath "$out/${gitterDirectorySuffix}/lib:${libPath}" \
$out/${gitterDirectorySuffix}/${target}
'';
in stdenv.mkDerivation rec {
pname = "gitter";
version = "5.0.1";
src = fetchurl {
url = "https://update.gitter.im/linux64/${pname}_${version}_amd64.deb";
sha256 = "1ps9akylqrril4902r8mi0mprm0hb5wra51ry6c1rb5xz5nrzgh1";
};
nativeBuildInputs = [ makeWrapper dpkg ];
unpackPhase = "dpkg -x $src .";
installPhase = ''
mkdir -p $out/{bin,opt/gitter,share/pixmaps}
mv ./opt/Gitter/linux64/* $out/opt/gitter
${doELFPatch "Gitter"}
${doELFPatch "nacl_helper"}
${doELFPatch "minidump_stackwalk"}
${doELFPatch "nwjc"}
${doELFPatch "chromedriver"}
${doELFPatch "payload"}
patchelf --set-rpath "$out/${gitterDirectorySuffix}/lib:${libPath}" \
$out/${gitterDirectorySuffix}/lib/libnw.so
wrapProgram $out/${gitterDirectorySuffix}/Gitter --prefix LD_LIBRARY_PATH : ${libPath}
ln -s $out/${gitterDirectorySuffix}/Gitter $out/bin/
ln -s $out/${gitterDirectorySuffix}/logo.png $out/share/pixmaps/gitter.png
ln -s "${desktopItem}/share/applications" $out/share/
'';
desktopItem = makeDesktopItem {
name = pname;
exec = "Gitter";
icon = pname;
desktopName = "Gitter";
genericName = meta.description;
categories = [ "Network" "InstantMessaging" ];
};
meta = with lib; {
description = "Where developers come to talk";
downloadPage = "https://gitter.im/apps";
license = licenses.mit;
maintainers = [ maintainers.imalison ];
platforms = [ "x86_64-linux" ];
};
}

View file

@ -0,0 +1,29 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests, olm }:
buildGoModule {
pname = "go-neb";
version = "unstable-2021-07-21";
src = fetchFromGitHub {
owner = "matrix-org";
repo = "go-neb";
rev = "8916c80f8ce1732f64b50f9251242ca189082e76";
sha256 = "sha256-kuH4vbvS4G1bczxUdY4bd4oL4pIZzuueUxdEp4xuzJM=";
};
subPackages = [ "." ];
buildInputs = [ olm ];
vendorSha256 = "sha256-5Vg7aUkqiFIQuxmsDOJjvXoeA5NjMoBoD0XBhC+o4GA=";
doCheck = false;
passthru.tests.go-neb = nixosTests.go-neb;
meta = with lib; {
description = "Extensible matrix bot written in Go";
homepage = "https://github.com/matrix-org/go-neb";
license = licenses.asl20;
maintainers = with maintainers; [ hexa maralorn ];
};
}

View file

@ -0,0 +1,62 @@
{ lib
, stdenv
, substituteAll
, buildGoModule
, fetchFromGitHub
, makeDesktopItem
, makeWrapper
, libnotify
, olm
, pulseaudio
, sound-theme-freedesktop
}:
buildGoModule rec {
pname = "gomuks";
version = "0.2.4";
src = fetchFromGitHub {
owner = "tulir";
repo = pname;
rev = "v${version}";
sha256 = "bTOfnEmJHTuniewH//SugNNDuKIFMQb1Safs0UVKH1c=";
};
vendorSha256 = "PuNROoxL7UmcuYDgfnsMUsGk9i1jnQyWtaUmT7vXdKE=";
doCheck = false;
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ olm ];
# Upstream issue: https://github.com/tulir/gomuks/issues/260
patches = lib.optional stdenv.isLinux (substituteAll {
src = ./hardcoded_path.patch;
soundTheme = sound-theme-freedesktop;
});
postInstall = ''
cp -r ${
makeDesktopItem {
name = "net.maunium.gomuks.desktop";
exec = "@out@/bin/gomuks";
terminal = true;
desktopName = "Gomuks";
genericName = "Matrix client";
categories = [ "Network" "Chat" ];
comment = meta.description;
}
}/* $out/
substituteAllInPlace $out/share/applications/*
wrapProgram $out/bin/gomuks \
--prefix PATH : "${lib.makeBinPath (lib.optionals stdenv.isLinux [ libnotify pulseaudio ])}"
'';
meta = with lib; {
homepage = "https://maunium.net/go/gomuks/";
description = "A terminal based Matrix client written in Go";
license = licenses.agpl3Plus;
maintainers = with maintainers; [ chvp emily ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,15 @@
diff --git a/lib/notification/notify_xdg.go b/lib/notification/notify_xdg.go
index 7f102b8..996c15f 100644
--- a/lib/notification/notify_xdg.go
+++ b/lib/notification/notify_xdg.go
@@ -26,8 +26,8 @@ import (
var notifySendPath string
var audioCommand string
var tryAudioCommands = []string{"ogg123", "paplay"}
-var soundNormal = "/usr/share/sounds/freedesktop/stereo/message-new-instant.oga"
-var soundCritical = "/usr/share/sounds/freedesktop/stereo/complete.oga"
+var soundNormal = "@soundTheme@/share/sounds/freedesktop/stereo/message-new-instant.oga"
+var soundCritical = "@soundTheme@/share/sounds/freedesktop/stereo/complete.oga"
func getSoundPath(env, defaultPath string) string {
if path, ok := os.LookupEnv(env); ok {

View file

@ -0,0 +1,42 @@
{ lib
, buildGoModule
, fetchFromGitHub
, gtk4
, glib
, gobject-introspection
, pkg-config
, go
}:
buildGoModule rec {
pname = "gotktrix";
version = "0.1.3";
src = fetchFromGitHub {
owner = "diamondburned";
repo = pname;
rev = "v${version}";
sha256 = "sha256-/UDXqN7FnFvbiXp3pID1WbNfCuKDsMrFQvL1101xxOo=";
};
vendorSha256 = "sha256-xA2DW4v6aT4fEW2WSa96oRr5Yrb2HoR054V1+BiWSvk=";
buildInputs = [
gtk4
glib
gobject-introspection
];
nativeBuildInputs = [ pkg-config ];
# Checking requires a working display
doCheck = false;
meta = with lib; {
description = "Matrix client written in Go using GTK4";
homepage = "https://github.com/diamondburned/gotktrix";
license = licenses.agpl3Plus;
maintainers = with maintainers; [ chuangzhu ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,31 @@
{ stdenv
, lib
, protobuf
, rustPlatform
, fetchFromGitHub
}:
rustPlatform.buildRustPackage rec {
pname = "gurk-rs";
version = "0.2.4";
src = fetchFromGitHub {
owner = "boxdot";
repo = pname;
rev = "v${version}";
sha256 = "sha256-WZUoUvu7GaiBOaRAOGRCXrLe6u3DRbI6CDTAf5jryGc=";
};
cargoHash = "sha256-81ZW61JX40W0D/cmYogR3RJH2dvEKW1K7sIsl2io/7E=";
buildInputs = [ protobuf ];
PROTOC = "${protobuf}/bin/protoc";
meta = with lib; {
broken = stdenv.isDarwin;
description = "Signal Messenger client for terminal";
homepage = "https://github.com/boxdot/gurk-rs";
license = licenses.agpl3Only;
maintainers = with maintainers; [ devhell ];
};
}

View file

@ -0,0 +1,88 @@
{ lib, stdenv, fetchurl, xorg, freetype, fontconfig, openssl, glib, nss, nspr, expat
, alsa-lib, dbus, zlib, libxml2, libxslt, makeWrapper, xkeyboard_config, systemd
, libGL, xcbutilkeysyms, xdg-utils, libtool }:
let
version = "4.30.5.1682";
rpath = lib.makeLibraryPath [
xdg-utils
xorg.libXext
xorg.libSM
xorg.libICE
xorg.libX11
xorg.libXrandr
xorg.libXdamage
xorg.libXrender
xorg.libXfixes
xorg.libXcomposite
xorg.libXcursor
xorg.libxcb
xorg.libXi
xorg.libXScrnSaver
xorg.libXtst
freetype
fontconfig
openssl
glib
nss
nspr
dbus
alsa-lib
zlib
libtool
libxml2
libxslt
expat
xcbutilkeysyms
systemd
libGL
] + ":${stdenv.cc.cc.lib}/lib64";
in stdenv.mkDerivation {
pname = "hipchat";
inherit version;
src = fetchurl {
url = "https://atlassian.artifactoryonline.com/artifactory/hipchat-apt-client/pool/HipChat4-${version}-Linux.deb";
sha256 = "03pz8wskafn848yvciq29kwdvqcgjrk6sjnm8nk9acl89xf0sn96";
};
nativeBuildInputs = [ makeWrapper ];
buildCommand = ''
ar x $src
tar xfvz data.tar.gz
mkdir -p $out/libexec/hipchat
d=$out/libexec/hipchat/lib
mv opt/HipChat4/* $out/libexec/hipchat/
mv usr/share $out
for file in $(find $d -type f); do
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $file || true
patchelf --set-rpath ${rpath}:$out/libexec/hipchat/lib:\$ORIGIN $file || true
done
patchShebangs $d/linuxbrowserlaunch.sh
substituteInPlace $out/share/applications/hipchat4.desktop \
--replace /opt/HipChat4/bin/HipChat4 $out/bin/hipchat
makeWrapper $d/HipChat.bin $out/bin/hipchat \
--run 'export HIPCHAT_LD_LIBRARY_PATH=$LD_LIBRARY_PATH' \
--run 'export HIPCHAT_QT_PLUGIN_PATH=$QT_PLUGIN_PATH' \
--set QT_XKB_CONFIG_ROOT ${xkeyboard_config}/share/X11/xkb \
--set QTWEBENGINEPROCESS_PATH $d/QtWebEngineProcess
makeWrapper $d/QtWebEngineProcess.bin $d/QtWebEngineProcess \
--set QT_PLUGIN_PATH "$d/plugins"
'';
meta = with lib; {
description = "Desktop client for HipChat services";
homepage = "http://www.hipchat.com";
license = licenses.unfree;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ puffnfresh ];
};
}

View file

@ -0,0 +1,53 @@
{ lib, fetchFromGitHub, ocamlPackages }:
with ocamlPackages;
buildDunePackage rec {
pname = "jackline";
version = "unstable-2021-12-28";
minimumOCamlVersion = "4.08";
useDune2 = true;
src = fetchFromGitHub {
owner = "hannesm";
repo = "jackline";
rev = "ca1012098d123c555e9fa5244466d2e009521700";
sha256 = "1j1azskcdrp4g44rv3a4zylkzbzpcs23zzzrx94llbgssw6cd9ih";
};
nativeBuildInpts = [
ppx_sexp_conv
ppx_deriving
];
buildInputs = [
erm_xmpp
tls
mirage-crypto-pk
x509
domain-name
ocaml_lwt
otr
astring
ptime
notty
sexplib
hex
uutf
uchar
uuseg
uucp
dns-client
cstruct
base64
];
meta = with lib; {
homepage = "https://github.com/hannesm/jackline";
description = "minimalistic secure XMPP client in OCaml";
license = licenses.bsd2;
maintainers = with maintainers; [ sternenseemann ];
};
}

View file

@ -0,0 +1,64 @@
{ version
, src
, jami-meta
, stdenv
, lib
, pkg-config
, cmake
, wrapQtAppsHook
, wrapGAppsHook
, gtk3-x11
, networkmanager # for libnm
, libayatana-appindicator
, libnotify
, clutter-gtk
, libcanberra-gtk3
, webkitgtk
, qrencode
, jami-libclient
, qttools
}:
stdenv.mkDerivation {
pname = "jami-client-gnome";
inherit version src;
sourceRoot = "source/client-gnome";
preConfigure = ''
echo ${version} > version.txt
'';
nativeBuildInputs = [
pkg-config
cmake
wrapGAppsHook
wrapQtAppsHook
];
# To spare double wrapping
dontWrapGApps = true;
preFixup = ''
qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
# Users that set CLUTTER_BACKEND=wayland in their default environment will
# encounter a segfault due to:
# https://git.jami.net/savoirfairelinux/jami-client-gnome/-/issues/1100 .
qtWrapperArgs+=("--unset" "CLUTTER_BACKEND")
'';
buildInputs = [
qttools
jami-libclient
gtk3-x11
networkmanager
libayatana-appindicator
libnotify
clutter-gtk
libcanberra-gtk3
webkitgtk
qrencode
];
meta = jami-meta // {
description = "The client based on GTK" + jami-meta.description;
};
}

View file

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

View file

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

View file

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

View file

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

View file

@ -0,0 +1,6 @@
remove-mjpeg-log.patch
change-RTCP-ratio.patch
rtp_ext_abs_send_time.patch
libopusdec-enable-FEC.patch
libopusenc-enable-FEC.patch
screen-sharing-x11-fix.patch

View file

@ -0,0 +1 @@
0009-add-config-site.patch

View file

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

View file

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

View file

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

View file

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

View file

@ -0,0 +1,6 @@
{
owner = "savoirfairelinux";
repo = "pjproject";
rev = "e1f389d0b905011e0cb62cbdf7a8b37fc1bcde1a";
sha256 = "0inpmyb6mhrzr0g309d6clkc99lddqdvyf9xajz0igvgp9pvgpza";
}

View file

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

View file

@ -0,0 +1,60 @@
{ lib, stdenv
, fetchurl
, appimageTools
, makeWrapper
, electron
, xorg
, pipewire
}:
stdenv.mkDerivation rec {
pname = "jitsi-meet-electron";
version = "2022.3.1";
src = fetchurl {
url = "https://github.com/jitsi/jitsi-meet-electron/releases/download/v${version}/jitsi-meet-x86_64.AppImage";
sha256 = "sha256-/5WpjmTLwQN73m7nHg4DKPbXIbD9WyJ+YBbFMD4ZDfg=";
name = "${pname}-${version}.AppImage";
};
appimageContents = appimageTools.extractType2 {
name = "${pname}-${version}";
inherit src;
};
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share/${pname} $out/share/applications
cp -a ${appimageContents}/{locales,resources} $out/share/${pname}
cp -a ${appimageContents}/jitsi-meet.desktop $out/share/applications/${pname}.desktop
cp -a ${appimageContents}/usr/share/icons $out/share
substituteInPlace $out/share/applications/${pname}.desktop \
--replace 'Exec=AppRun' 'Exec=${pname}'
runHook postInstall
'';
postFixup = ''
makeWrapper ${electron}/bin/electron $out/bin/${pname} \
--add-flags $out/share/${pname}/resources/app.asar \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc xorg.libXtst pipewire ]}" \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}"
'';
meta = with lib; {
description = "Jitsi Meet desktop application powered by Electron";
homepage = "https://github.com/jitsi/jitsi-meet-electron";
license = licenses.asl20;
maintainers = teams.jitsi.members;
platforms = [ "x86_64-linux" ];
};
}

View file

@ -0,0 +1,73 @@
{ stdenv, lib, fetchurl, makeDesktopItem, unzip, ant, jdk8
# Optional, Jitsi still runs without, but you may pass null:
, alsa-lib, dbus, gtk2, libpulseaudio, openssl, xorg
}:
let jdk = jdk8; in
stdenv.mkDerivation rec {
pname = "jitsi";
version = "2.10.5550";
src = fetchurl {
url = "https://download.jitsi.org/jitsi/src/jitsi-src-${version}.zip";
sha256 = "11vjchc3dnzj55x7c62wsm6masvwmij1ifkds917r1qvil1nzz6d";
};
patches = [ ./jitsi.patch ];
jitsiItem = makeDesktopItem {
name = "Jitsi";
exec = "jitsi";
comment = "VoIP and Instant Messaging client";
desktopName = "Jitsi";
genericName = "Instant Messaging";
categories = [ "Chat" ];
};
libPath = lib.makeLibraryPath ([
stdenv.cc.cc # For libstdc++.
alsa-lib
dbus
gtk2
libpulseaudio
openssl
xorg.libX11
xorg.libXext
xorg.libXScrnSaver
xorg.libXv
]);
nativeBuildInputs = [ unzip ];
buildInputs = [ ant jdk ];
buildPhase = "ant make";
installPhase = ''
mkdir -p $out
cp -a lib $out/
rm -rf $out/lib/native/solaris
cp -a sc-bundles $out/
mkdir $out/bin
cp resources/install/generic/run.sh $out/bin/jitsi
chmod +x $out/bin/jitsi
substituteInPlace $out/bin/jitsi \
--subst-var-by JAVA ${jdk}/bin/java \
--subst-var-by EXTRALIBS ${gtk2.out}/lib
sed -e 's,^java\ ,${jdk}/bin/java ,' -i $out/bin/jitsi
patchShebangs $out
libPath="$libPath:${jdk.home}/lib/${jdk.architecture}"
find $out/ -type f -name '*.so' | while read file; do
patchelf --set-rpath "$libPath" "$file" && \
patchelf --shrink-rpath "$file"
done
'';
meta = with lib; {
homepage = "https://jitsi.org/";
description = "Open Source Video Calls and Chat";
sourceProvenance = with sourceTypes; [ binaryBytecode ];
license = licenses.lgpl21Plus;
platforms = platforms.linux;
maintainers = teams.jitsi.members;
};
}

View file

@ -0,0 +1,27 @@
--- /home/dario/Downloads/jitsi/resources/install/generic/run.sh 2013-11-01 15:37:21.000000000 +0000
+++ jitsi/resources/install/generic/run.sh 2014-03-04 11:52:30.796397567 +0000
@@ -1,4 +1,9 @@
-mkdir -p $HOME/.sip-communicator/log
+#! /bin/bash
+# A modified version of the generic run.sh
+
+#mkdir -p $HOME/.sip-communicator/log
+
+cd "$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")"
# Get architecture
ARCH=`uname -m | sed -e s/x86_64/64/ -e s/i.86/32/`
@@ -6,10 +11,12 @@
# Additionnal JVM arguments
CLIENTARGS=""
+NATIVELIBS="lib/native/linux-64"
if [ $ARCH = 32 ]
then
CLIENTARGS="-client -Xmx256m"
+ NATIVELIBS="lib/native/linux"
fi
export PATH=$PATH:native
-java $CLIENTARGS -classpath "lib/felix.jar:sc-bundles/sc-launcher.jar:sc-bundles/util.jar:lib/" -Djava.library.path=native -Dfelix.config.properties=file:./lib/felix.client.run.properties -Djava.util.logging.config.file=lib/logging.properties net.java.sip.communicator.launcher.SIPCommunicator
+LD_LIBRARY_PATH=@EXTRALIBS@ exec @JAVA@ $CLIENTARGS -classpath "lib/felix.jar:sc-bundles/sc-launcher.jar:sc-bundles/util.jar:lib/" -Djava.library.path=$NATIVELIBS -Dfelix.config.properties=file:lib/felix.client.run.properties -Djava.util.logging.config.file=lib/logging.properties net.java.sip.communicator.launcher.SIPCommunicator

View file

@ -0,0 +1,73 @@
{ mkDerivation
, lib
, fetchFromGitLab
, cmake
, extra-cmake-modules
, pkg-config
, qtquickcontrols2
, qtmultimedia
, qtlocation
, qqc2-desktop-style
, kirigami2
, knotifications
, zxing-cpp
, qxmpp
, sonnet
, gst_all_1
}:
mkDerivation rec {
pname = "kaidan";
version = "0.8.0";
src = fetchFromGitLab {
domain = "invent.kde.org";
owner = "network";
repo = pname;
rev = "v${version}";
sha256 = "070njci5zyzahmz3nqyp660chxnqx1mxp31w17syfllvrw403qmg";
};
nativeBuildInputs = [ cmake extra-cmake-modules pkg-config ];
buildInputs = with gst_all_1; [
qtquickcontrols2
qtmultimedia
qtlocation
qqc2-desktop-style
kirigami2
knotifications
zxing-cpp
qxmpp
sonnet
gstreamer
gst-plugins-bad
gst-plugins-base
gst-plugins-good
];
postInstall = ''
qtWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0")
'';
meta = with lib; {
description = "User-friendly and modern chat app, using XMPP";
longDescription = ''
Kaidan is a user-friendly and modern chat app for every device. It uses
the open communication protocol XMPP (Jabber). Unlike other chat apps,
you are not dependent on one specific service provider.
Kaidan does not have all basic features yet and has still some
stability issues. Current features include audio messages, video
messages, and file sharing.
'';
homepage = "https://www.kaidan.im";
license = with licenses; [
gpl3Plus
mit
asl20
cc-by-sa-40
];
maintainers = with maintainers; [ astro ];
platforms = with platforms; linux;
};
}

View file

@ -0,0 +1,53 @@
{ lib
, mkDerivation
, fetchFromSourcehut
, cmake
, extra-cmake-modules
, pkg-config
, kirigami2
, libdeltachat
, qtbase
, qtimageformats
, qtmultimedia
, qtwebengine
}:
mkDerivation rec {
pname = "kdeltachat";
version = "unstable-2022-03-20";
src = fetchFromSourcehut {
owner = "~link2xt";
repo = "kdeltachat";
rev = "8cce6d20b49e917929521a13caed30e81037c868";
hash = "sha256-1L45KodOmvy6pBbBzJwGWMAY7y3+lfxjeXtsH1SdipU=";
};
nativeBuildInputs = [
cmake
extra-cmake-modules
pkg-config
];
buildInputs = [
kirigami2
libdeltachat
qtimageformats
qtmultimedia
qtwebengine
];
# needed for qmlplugindump to work
QT_PLUGIN_PATH = "${qtbase.bin}/${qtbase.qtPluginPrefix}";
QML2_IMPORT_PATH = lib.concatMapStringsSep ":"
(lib: "${lib}/${qtbase.qtQmlPrefix}")
[ kirigami2 qtmultimedia ];
meta = with lib; {
description = "Delta Chat client using Kirigami framework";
homepage = "https://git.sr.ht/~link2xt/kdeltachat";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ dotlambda ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,145 @@
{ bctoolbox
, belcard
, belle-sip
, belr
, cmake
, fetchFromGitLab
, lib
, liblinphone
, mediastreamer
, mediastreamer-openh264
, minizip2
, mkDerivation
, qtgraphicaleffects
, qtquickcontrols2
, qttranslations
}:
# How to update Linphone? (The Qt desktop app)
#
# Belledonne Communications (BC), the company making Linphone, has split the
# project into several sub-projects that they maintain, plus some third-party
# dependencies that they also extend with commits of their own, specific to
# Linphone and not (yet?) upstreamed.
#
# All of this is organised in a Software Development Kit (SDK) meta-repository
# with git submodules to pin all those repositories into a coherent whole.
#
# The Linphone Qt desktop app uses this SDK as submodule as well.
#
# So, in order to update the desktop app to a new release, one has to follow
# the submodule chain and update the corresponding derivations here, in nixpkgs,
# with the corresponding version number (or commit hash)
mkDerivation rec {
pname = "linphone-desktop";
version = "4.4.1";
src = fetchFromGitLab {
domain = "gitlab.linphone.org";
owner = "public";
group = "BC";
repo = pname;
rev = version;
sha256 = "sha256-BBOTyKMZikkxMJSmzAuChVHpVeCvbAimn1K3REGbqEg=";
};
patches = [
./do-not-build-linphone-sdk.patch
./remove-bc_compute_full_version-usage.patch
./no-store-path-in-autostart.patch
];
# See: https://gitlab.linphone.org/BC/public/linphone-desktop/issues/21
postPatch = ''
echo "project(linphoneqt VERSION ${version})" >linphone-app/linphoneqt_version.cmake
substituteInPlace linphone-app/src/app/AppController.cpp \
--replace "LINPHONE_QT_GIT_VERSION" "\"${version}\""
'';
# TODO: After linphone-desktop and liblinphone split into separate packages,
# there might be some build inputs here that aren't needed for
# linphone-desktop.
buildInputs = [
# Made by BC
bctoolbox
belcard
belle-sip
belr
liblinphone
mediastreamer
mediastreamer-openh264
minizip2
qtgraphicaleffects
qtquickcontrols2
qttranslations
];
nativeBuildInputs = [
cmake
];
cmakeFlags = [
"-DMINIZIP_INCLUDE_DIRS=${minizip2}/include"
"-DMINIZIP_LIBRARIES=minizip"
];
# The default install phase fails because the paths are somehow messed up in
# the makefiles. The errors were like:
#
# CMake Error at cmake_builder/linphone_package/cmake_install.cmake:49 (file):
# file INSTALL cannot find
# "/build/linphone-desktop-.../build/linphone-sdk/desktop//nix/store/.../bin":
# No such file or directory.
#
# If someone is able to figure out how to fix that, great. For now, just
# trying to pick all the relevant files to the output.
#
# Also, the exec path in linphone.desktop file remains invalid, pointing to
# the build directory, after the whole nix build process. So, let's use sed to
# manually fix that path.
#
# 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.
#
# Also, 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. These missing grammar files
# were discovered when linphone crashed at startup and it was run with
# --verbose flag. Instead of actually copying these files, create symlinks.
#
# 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 copied manually below.
installPhase = ''
mkdir -p $out/bin $out/lib
cp linphone-app/linphone $out/bin/
cp linphone-app/libapp-plugin.so $out/lib/
mkdir -p $out/lib/mediastreamer/plugins
ln -s ${mediastreamer-openh264}/lib/mediastreamer/plugins/* $out/lib/mediastreamer/plugins/
ln -s ${mediastreamer}/lib/mediastreamer/plugins/* $out/lib/mediastreamer/plugins/
wrapProgram $out/bin/linphone \
--set MEDIASTREAMER_PLUGINS_DIR \
$out/lib/mediastreamer/plugins
mkdir -p $out/share/applications
cp linphone-app/linphone.desktop $out/share/applications/
mkdir -p $out/share/icons/hicolor/scalable/apps
cp ../linphone-app/assets/images/linphone_logo.svg $out/share/icons/hicolor/scalable/apps/linphone.svg
mkdir -p $out/share/belr/grammars
ln -s ${liblinphone}/share/belr/grammars/* $out/share/belr/grammars/
ln -s ${belle-sip}/share/belr/grammars/* $out/share/belr/grammars/
mkdir -p $out/share/linphone
ln -s ${liblinphone}/share/linphone/* $out/share/linphone/
ln -s ${liblinphone}/share/sounds $out/share/sounds
'';
meta = with lib; {
homepage = "https://www.linphone.org/";
description = "Open source SIP phone for voice/video calls and instant messaging";
license = licenses.gpl3Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ jluttine ];
};
}

View file

@ -0,0 +1,143 @@
From e6a9992461f368d08d1ad63ffe454714ec0c59ce Mon Sep 17 00:00:00 2001
From: Lorenz Brun <lorenz@brun.one>
Date: Fri, 28 Jan 2022 02:36:01 +0100
Subject: [PATCH] Remove Linphone SDK build
---
CMakeLists.txt | 86 ++-----------------
.../cmake_builder/additional_steps.cmake | 9 --
2 files changed, 5 insertions(+), 90 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2002b925..6d92a8e5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -152,7 +152,6 @@ list(APPEND APP_OPTIONS "-DENABLE_RELATIVE_PREFIX=${ENABLE_RELATIVE_PREFIX}")
list(APPEND APP_OPTIONS "-DLINPHONE_OUTPUT_DIR=${LINPHONE_OUTPUT_DIR}")
list(APPEND APP_OPTIONS "-DENABLE_QT_GL=${ENABLE_VIDEO}")#Activate on video
-include(ExternalProject)
set(PROJECT_BUILD_COMMAND "")
if(CMAKE_BUILD_PARALLEL_LEVEL)
list(APPEND APP_OPTIONS "-DCMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL}")
@@ -190,30 +189,8 @@ if(ENABLE_BUILD_APP_PLUGINS)
endif()
endif()
-
-if(NOT LINPHONE_QT_ONLY)
-ExternalProject_Add(sdk PREFIX "${CMAKE_BINARY_DIR}/sdk"
- SOURCE_DIR "${CMAKE_SOURCE_DIR}/linphone-sdk"
- INSTALL_DIR "${LINPHONE_OUTPUT_DIR}"
- STAMP_DIR "${SDK_BUILD_DIR}/stamp"
- BINARY_DIR "${SDK_BUILD_DIR}"
- STEP_TARGETS build
- BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG> ${PROJECT_BUILD_COMMAND}
- INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step is already done at build time."
- LIST_SEPARATOR | # Use the alternate list separator
- CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DCMAKE_PREFIX_PATH=${PREFIX_PATH}
- BUILD_ALWAYS NO #${DO_BUILD}
-)
-ExternalProject_Add_Step(sdk force_build
- COMMENT "Forcing build for 'desktop'"
- DEPENDEES configure
- DEPENDERS build
- ALWAYS 1
-)
-endif()
include(FindPkgConfig)
-set(APP_DEPENDS sdk)
find_package(Qt5 5.10 COMPONENTS Core REQUIRED)
if ( NOT Qt5_FOUND )
@@ -227,62 +204,9 @@ find_package(belcard CONFIG QUIET)
find_package(Mediastreamer2 CONFIG QUIET)
find_package(ortp CONFIG QUIET)
-if(NOT (LinphoneCxx_FOUND) OR NOT (Linphone_FOUND) OR NOT (bctoolbox_FOUND) OR NOT (belcard_FOUND) OR NOT (Mediastreamer2_FOUND) OR NOT (ortp_FOUND) OR FORCE_APP_EXTERNAL_PROJECTS)
- message("Projects are set as External projects. You can start building them by using for example : cmake --build . --target install")
- ExternalProject_Add(linphone-qt PREFIX "${CMAKE_BINARY_DIR}/linphone-app"
- SOURCE_DIR "${CMAKE_SOURCE_DIR}/linphone-app"
- INSTALL_DIR "${APPLICATION_OUTPUT_DIR}"
- BINARY_DIR "${CMAKE_BINARY_DIR}/linphone-app"
- DEPENDS ${APP_DEPENDS}
- BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG> ${PROJECT_BUILD_COMMAND}
- INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step is already done at build time."
- LIST_SEPARATOR | # Use the alternate list separator
- CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DCMAKE_PREFIX_PATH=${PREFIX_PATH}
- # ${APP_OPTIONS}
- BUILD_ALWAYS ON
- )
- if( ENABLE_BUILD_APP_PLUGINS)
- ExternalProject_Add(app-plugins PREFIX "${CMAKE_BINARY_DIR}/plugins-app"
- SOURCE_DIR "${CMAKE_SOURCE_DIR}/plugins"
- INSTALL_DIR "${APPLICATION_OUTPUT_DIR}"
- BINARY_DIR "${CMAKE_BINARY_DIR}/plugins-app"
- DEPENDS linphone-qt
- BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG> ${PROJECT_BUILD_COMMAND}
- INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step is already done at build time."
- LIST_SEPARATOR | # Use the alternate list separator
- CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DCMAKE_PREFIX_PATH=${PREFIX_PATH}
- )
- endif()
- install(CODE "message(STATUS Running install)")
- set(AUTO_REGENERATION auto_regeneration)
- if( ENABLE_BUILD_APP_PLUGINS)
- add_custom_target(${AUTO_REGENERATION} ALL
- COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR}
- DEPENDS app-plugins)
- else()
- add_custom_target(${AUTO_REGENERATION} ALL
- COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR}
- DEPENDS linphone-qt)
- endif()
-else()
- message("Adding Linphone Desktop in an IDE-friendly state")
- set(CMAKE_INSTALL_PREFIX "${APPLICATION_OUTPUT_DIR}")
- add_subdirectory(${CMAKE_SOURCE_DIR}/linphone-app)
- if(NOT LINPHONE_QT_ONLY)
- add_dependencies(app-library ${APP_DEPENDS})
- endif()
- if( ENABLE_BUILD_APP_PLUGINS)
- add_subdirectory(${CMAKE_SOURCE_DIR}/plugins "plugins-app")
- endif()
+message("Adding Linphone Desktop in an IDE-friendly state")
+set(CMAKE_INSTALL_PREFIX "${APPLICATION_OUTPUT_DIR}")
+add_subdirectory(${CMAKE_SOURCE_DIR}/linphone-app)
+if( ENABLE_BUILD_APP_PLUGINS)
+ add_subdirectory(${CMAKE_SOURCE_DIR}/plugins "plugins-app")
endif()
-ExternalProject_Add(linphone-qt-only PREFIX "${CMAKE_BINARY_DIR}/linphone-app"
- SOURCE_DIR "${CMAKE_SOURCE_DIR}/linphone-app"
- INSTALL_DIR "${APPLICATION_OUTPUT_DIR}"
- BINARY_DIR "${CMAKE_BINARY_DIR}/linphone-app"
- BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG> ${PROJECT_BUILD_COMMAND}
-# INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step is already done at build time."
- LIST_SEPARATOR | # Use the alternate list separator
- CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DCMAKE_PREFIX_PATH=${PREFIX_PATH}
- EXCLUDE_FROM_ALL ON
- #BUILD_ALWAYS ON
-)
diff --git a/linphone-app/cmake_builder/additional_steps.cmake b/linphone-app/cmake_builder/additional_steps.cmake
index 7f7fd573..a69a04e8 100644
--- a/linphone-app/cmake_builder/additional_steps.cmake
+++ b/linphone-app/cmake_builder/additional_steps.cmake
@@ -54,14 +54,5 @@ if (ENABLE_PACKAGING)
linphone_builder_apply_flags()
linphone_builder_set_ep_directories(linphone_package)
linphone_builder_expand_external_project_vars()
- ExternalProject_Add(TARGET_linphone_package
- DEPENDS TARGET_linphone_builder
- TMP_DIR ${ep_tmp}
- BINARY_DIR ${ep_build}
- SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/linphone_package"
- DOWNLOAD_COMMAND ""
- CMAKE_GENERATOR ${CMAKE_GENERATOR}
- CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} -DCMAKE_INSTALL_PREFIX=${LINPHONE_BUILDER_WORK_DIR}/PACKAGE -DTOOLS_DIR=${CMAKE_BINARY_DIR}/programs -DLINPHONE_OUTPUT_DIR=${CMAKE_INSTALL_PREFIX} -DLINPHONE_DESKTOP_DIR=${CMAKE_CURRENT_LIST_DIR}/.. -DLINPHONE_SOURCE_DIR=${EP_linphone_SOURCE_DIR} ${ENABLE_VARIABLES} -DLINPHONE_BUILDER_SIGNING_IDENTITY=${LINPHONE_BUILDER_SIGNING_IDENTITY}
- )
endif ()
endif ()
--
2.25.1

View file

@ -0,0 +1,27 @@
From 6a26922e5e4363de36057d635a1bf889160b2533 Mon Sep 17 00:00:00 2001
From: Lorenz Brun <lorenz@brun.one>
Date: Fri, 28 Jan 2022 18:44:43 +0100
Subject: [PATCH] Do not use store path for autostart on Nix
---
linphone-app/src/app/App.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/linphone-app/src/app/App.cpp b/linphone-app/src/app/App.cpp
index 868f8f44..2c61c648 100644
--- a/linphone-app/src/app/App.cpp
+++ b/linphone-app/src/app/App.cpp
@@ -858,6 +858,10 @@ void App::setAutoStart (bool enabled) {
exec = QProcessEnvironment::systemEnvironment().value(QStringLiteral("APPIMAGE"));
qDebug() << "exec path autostart set appimage=" << exec;
}
+ else if (binPath.startsWith("/nix/store")) { // Nix/NixOS
+ exec = QStringLiteral("linphone");
+ qDebug() << "exec path autostart set nix=" << exec;
+ }
else { //classic package
exec = binPath;
qDebug() << "exec path autostart set classic package=" << exec;
--
2.25.1

View file

@ -0,0 +1,74 @@
From 4849d5633b98e6d3514355436eab5ba537cbfd99 Mon Sep 17 00:00:00 2001
From: David P <megver83@parabola.nu>
Date: Fri, 23 Oct 2020 16:44:17 -0300
Subject: [PATCH] remove bc_compute_full_version usage
---
linphone-app/CMakeLists.txt | 11 +----------
linphone-app/build/CMakeLists.txt | 5 -----
.../cmake_builder/linphone_package/CMakeLists.txt | 10 +---------
3 files changed, 2 insertions(+), 24 deletions(-)
diff --git a/linphone-app/CMakeLists.txt b/linphone-app/CMakeLists.txt
index de7f917f..ee14ff78 100644
--- a/linphone-app/CMakeLists.txt
+++ b/linphone-app/CMakeLists.txt
@@ -21,17 +21,8 @@
################################################################################
cmake_minimum_required(VERSION 3.1)
+include(linphoneqt_version.cmake)
find_package(bctoolbox CONFIG)
-set(FULL_VERSION )
-bc_compute_full_version(FULL_VERSION)
-set(version_major )
-set(version_minor )
-set(version_patch )
-set(identifiers )
-set(metadata )
-bc_parse_full_version("${FULL_VERSION}" version_major version_minor version_patch identifiers metadata)
-
-project(linphoneqt VERSION "${version_major}.${version_minor}.${version_patch}")
if(ENABLE_BUILD_VERBOSE)
diff --git a/linphone-app/build/CMakeLists.txt b/linphone-app/build/CMakeLists.txt
index 8ef03faa..97d94bd6 100644
--- a/linphone-app/build/CMakeLists.txt
+++ b/linphone-app/build/CMakeLists.txt
@@ -46,11 +46,6 @@ set(CPACK_SOURCE_IGNORE_FILES
"libmng.spec"
)
-bc_compute_full_version(PROJECT_VERSION_BUILD)
-if(PROJECT_VERSION_BUILD)
- set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${PROJECT_VERSION_BUILD}")
-endif()
-
message("-- Package file name is ${CPACK_PACKAGE_FILE_NAME}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
diff --git a/linphone-app/cmake_builder/linphone_package/CMakeLists.txt b/linphone-app/cmake_builder/linphone_package/CMakeLists.txt
index ac85c68a..e6af5a66 100644
--- a/linphone-app/cmake_builder/linphone_package/CMakeLists.txt
+++ b/linphone-app/cmake_builder/linphone_package/CMakeLists.txt
@@ -38,15 +38,7 @@ set(LINPHONE_QML_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../ui")
# ==============================================================================
# Build package version.
# ==============================================================================
-bc_compute_full_version(APP_PROJECT_VERSION)
-if (GIT_EXECUTABLE AND NOT(APP_PROJECT_VERSION))
- execute_process(
- COMMAND ${GIT_EXECUTABLE} describe --always
- OUTPUT_VARIABLE APP_PROJECT_VERSION
- OUTPUT_STRIP_TRAILING_WHITESPACE
- WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../.."
- )
-elseif (NOT(APP_PROJECT_VERSION))
+if (NOT(APP_PROJECT_VERSION))
set(APP_PROJECT_VERSION "0.0.0")
endif ()
string(REGEX REPLACE "([0-9.]+)-?.*" "\\1" LINPHONE_VERSION "${APP_PROJECT_VERSION}")
--
2.25.1

View file

@ -0,0 +1,43 @@
{ stdenv, lib, fetchFromGitHub, cacert, python3 }:
stdenv.mkDerivation {
pname = "matrix-commander";
version = "unstable-2021-08-05";
src = fetchFromGitHub {
owner = "8go";
repo = "matrix-commander";
rev = "7ab3fd9a0ef4eb19d882cb3701d2025b4d41b63a";
sha256 = "sha256-WWf7GbJxGlqIdsS1d0T1DO0WN2RBepHGgJrl/nt7UIg=";
};
buildInputs = [
cacert
(python3.withPackages(ps: with ps; [
matrix-nio
magic
markdown
pillow
urllib3
aiofiles
notify2
]))];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp $src/matrix-commander.py $out/bin/matrix-commander
chmod +x $out/bin/matrix-commander
runHook postInstall
'';
meta = with lib; {
description = "Simple but convenient CLI-based Matrix client app for sending and receiving";
homepage = "https://github.com/8go/matrix-commander";
license = licenses.gpl3Plus;
platforms = platforms.linux;
maintainers = [ maintainers.seb314 ];
};
}

View file

@ -0,0 +1,25 @@
{ lib, python3Packages, fetchFromGitHub }:
python3Packages.buildPythonApplication rec {
pname = "matrix-dl";
version = "unstable-2020-07-14";
src = fetchFromGitHub {
owner = "rubo77";
repo = pname;
rev = "b1a86d1421f39ee327284e1023f09dc165e3c8a5";
sha256 = "1l8nh8z7kz24v0wcy3ll3w6in2yxwa1yz8lyc3x0blz37d8ss4ql";
};
propagatedBuildInputs = with python3Packages; [
matrix-client
];
meta = with lib; {
description = "Download backlogs from Matrix as raw text";
homepage = src.meta.homepage;
license = licenses.gpl1Plus;
maintainers = with maintainers; [ aw ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,20 @@
# This file has been generated by node2nix 1.7.0. Do not edit!
{pkgs ? import <nixpkgs> {
inherit system;
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-14_x"}:
let
nodeEnv = import ./node-env.nix {
inherit (pkgs) lib stdenv python2 util-linux runCommand writeTextFile;
inherit nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
locpkgs = import ./node-packages.nix {
inherit (pkgs) fetchurl fetchgit;
inherit nodeEnv;
globalBuildInputs = [
locpkgs.node-pre-gyp
];
};
in locpkgs

View file

@ -0,0 +1,27 @@
{ lib, stdenv, pkgs }:
(import ./composition.nix {
inherit pkgs;
inherit (stdenv.hostPlatform) system;
})."package".override {
postInstall = ''
mkdir "$out/bin"
echo '#!/bin/sh' >> "$out/bin/matrix-recorder"
echo "'${pkgs.nodejs-14_x}/bin/node'" \
"'$out/lib/node_modules/matrix-recorder/matrix-recorder.js'" \
'"$@"' >> "$out/bin/matrix-recorder"
echo '#!/bin/sh' >> "$out/bin/matrix-recorder-to-html"
echo 'cd "$1"' >> "$out/bin/matrix-recorder-to-html"
echo "test -d templates/ || ln -sfT '$out/lib/node_modules/matrix-recorder/templates' templates" >> "$out/bin/matrix-recorder-to-html"
echo "'${pkgs.nodejs-14_x}/bin/node'" \
"'$out/lib/node_modules/matrix-recorder/recorder-to-html.js'" \
'.' >> "$out/bin/matrix-recorder-to-html"
chmod a+x "$out/bin/matrix-recorder"
chmod a+x "$out/bin/matrix-recorder-to-html"
'';
meta = {
description = "Matrix message recorder";
homepage = "https://gitlab.com/argit/matrix-recorder/";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.raskin ];
};
}

View file

@ -0,0 +1,540 @@
# This file originates from node2nix
{lib, stdenv, nodejs, python2, util-linux, libtool, runCommand, writeTextFile}:
let
python = if nodejs ? python then nodejs.python else python2;
# Create a tar wrapper that filters all the 'Ignoring unknown extended header keyword' noise
tarWrapper = runCommand "tarWrapper" {} ''
mkdir -p $out/bin
cat > $out/bin/tar <<EOF
#! ${stdenv.shell} -e
$(type -p tar) "\$@" --warning=no-unknown-keyword --delay-directory-restore
EOF
chmod +x $out/bin/tar
'';
# Function that generates a TGZ file from a NPM project
buildNodeSourceDist =
{ name, version, src, ... }:
stdenv.mkDerivation {
name = "node-tarball-${name}-${version}";
inherit src;
buildInputs = [ nodejs ];
buildPhase = ''
export HOME=$TMPDIR
tgzFile=$(npm pack | tail -n 1) # Hooks to the pack command will add output (https://docs.npmjs.com/misc/scripts)
'';
installPhase = ''
mkdir -p $out/tarballs
mv $tgzFile $out/tarballs
mkdir -p $out/nix-support
echo "file source-dist $out/tarballs/$tgzFile" >> $out/nix-support/hydra-build-products
'';
};
includeDependencies = {dependencies}:
lib.optionalString (dependencies != [])
(lib.concatMapStrings (dependency:
''
# Bundle the dependencies of the package
mkdir -p node_modules
cd node_modules
# Only include dependencies if they don't exist. They may also be bundled in the package.
if [ ! -e "${dependency.name}" ]
then
${composePackage dependency}
fi
cd ..
''
) dependencies);
# Recursively composes the dependencies of a package
composePackage = { name, packageName, src, dependencies ? [], ... }@args:
''
DIR=$(pwd)
cd $TMPDIR
unpackFile ${src}
# Make the base dir in which the target dependency resides first
mkdir -p "$(dirname "$DIR/${packageName}")"
if [ -f "${src}" ]
then
# Figure out what directory has been unpacked
packageDir="$(find . -maxdepth 1 -type d | tail -1)"
# Restore write permissions to make building work
find "$packageDir" -type d -exec chmod u+x {} \;
chmod -R u+w "$packageDir"
# Move the extracted tarball into the output folder
mv "$packageDir" "$DIR/${packageName}"
elif [ -d "${src}" ]
then
# Get a stripped name (without hash) of the source directory.
# On old nixpkgs it's already set internally.
if [ -z "$strippedName" ]
then
strippedName="$(stripHash ${src})"
fi
# Restore write permissions to make building work
chmod -R u+w "$strippedName"
# Move the extracted directory into the output folder
mv "$strippedName" "$DIR/${packageName}"
fi
# Unset the stripped name to not confuse the next unpack step
unset strippedName
# Include the dependencies of the package
cd "$DIR/${packageName}"
${includeDependencies { inherit dependencies; }}
cd ..
${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."}
'';
pinpointDependencies = {dependencies, production}:
let
pinpointDependenciesFromPackageJSON = writeTextFile {
name = "pinpointDependencies.js";
text = ''
var fs = require('fs');
var path = require('path');
function resolveDependencyVersion(location, name) {
if(location == process.env['NIX_STORE']) {
return null;
} else {
var dependencyPackageJSON = path.join(location, "node_modules", name, "package.json");
if(fs.existsSync(dependencyPackageJSON)) {
var dependencyPackageObj = JSON.parse(fs.readFileSync(dependencyPackageJSON));
if(dependencyPackageObj.name == name) {
return dependencyPackageObj.version;
}
} else {
return resolveDependencyVersion(path.resolve(location, ".."), name);
}
}
}
function replaceDependencies(dependencies) {
if(typeof dependencies == "object" && dependencies !== null) {
for(var dependency in dependencies) {
var resolvedVersion = resolveDependencyVersion(process.cwd(), dependency);
if(resolvedVersion === null) {
process.stderr.write("WARNING: cannot pinpoint dependency: "+dependency+", context: "+process.cwd()+"\n");
} else {
dependencies[dependency] = resolvedVersion;
}
}
}
}
/* Read the package.json configuration */
var packageObj = JSON.parse(fs.readFileSync('./package.json'));
/* Pinpoint all dependencies */
replaceDependencies(packageObj.dependencies);
if(process.argv[2] == "development") {
replaceDependencies(packageObj.devDependencies);
}
replaceDependencies(packageObj.optionalDependencies);
/* Write the fixed package.json file */
fs.writeFileSync("package.json", JSON.stringify(packageObj, null, 2));
'';
};
in
''
node ${pinpointDependenciesFromPackageJSON} ${if production then "production" else "development"}
${lib.optionalString (dependencies != [])
''
if [ -d node_modules ]
then
cd node_modules
${lib.concatMapStrings (dependency: pinpointDependenciesOfPackage dependency) dependencies}
cd ..
fi
''}
'';
# Recursively traverses all dependencies of a package and pinpoints all
# dependencies in the package.json file to the versions that are actually
# being used.
pinpointDependenciesOfPackage = { packageName, dependencies ? [], production ? true, ... }@args:
''
if [ -d "${packageName}" ]
then
cd "${packageName}"
${pinpointDependencies { inherit dependencies production; }}
cd ..
${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."}
fi
'';
# Extract the Node.js source code which is used to compile packages with
# native bindings
nodeSources = runCommand "node-sources" {} ''
tar --no-same-owner --no-same-permissions -xf ${nodejs.src}
mv node-* $out
'';
# Script that adds _integrity fields to all package.json files to prevent NPM from consulting the cache (that is empty)
addIntegrityFieldsScript = writeTextFile {
name = "addintegrityfields.js";
text = ''
var fs = require('fs');
var path = require('path');
function augmentDependencies(baseDir, dependencies) {
for(var dependencyName in dependencies) {
var dependency = dependencies[dependencyName];
// Open package.json and augment metadata fields
var packageJSONDir = path.join(baseDir, "node_modules", dependencyName);
var packageJSONPath = path.join(packageJSONDir, "package.json");
if(fs.existsSync(packageJSONPath)) { // Only augment packages that exist. Sometimes we may have production installs in which development dependencies can be ignored
console.log("Adding metadata fields to: "+packageJSONPath);
var packageObj = JSON.parse(fs.readFileSync(packageJSONPath));
if(dependency.integrity) {
packageObj["_integrity"] = dependency.integrity;
} else {
packageObj["_integrity"] = "sha1-000000000000000000000000000="; // When no _integrity string has been provided (e.g. by Git dependencies), add a dummy one. It does not seem to harm and it bypasses downloads.
}
if(dependency.resolved) {
packageObj["_resolved"] = dependency.resolved; // Adopt the resolved property if one has been provided
} else {
packageObj["_resolved"] = dependency.version; // Set the resolved version to the version identifier. This prevents NPM from cloning Git repositories.
}
if(dependency.from !== undefined) { // Adopt from property if one has been provided
packageObj["_from"] = dependency.from;
}
fs.writeFileSync(packageJSONPath, JSON.stringify(packageObj, null, 2));
}
// Augment transitive dependencies
if(dependency.dependencies !== undefined) {
augmentDependencies(packageJSONDir, dependency.dependencies);
}
}
}
if(fs.existsSync("./package-lock.json")) {
var packageLock = JSON.parse(fs.readFileSync("./package-lock.json"));
if(packageLock.lockfileVersion !== 1) {
process.stderr.write("Sorry, I only understand lock file version 1!\n");
process.exit(1);
}
if(packageLock.dependencies !== undefined) {
augmentDependencies(".", packageLock.dependencies);
}
}
'';
};
# Reconstructs a package-lock file from the node_modules/ folder structure and package.json files with dummy sha1 hashes
reconstructPackageLock = writeTextFile {
name = "addintegrityfields.js";
text = ''
var fs = require('fs');
var path = require('path');
var packageObj = JSON.parse(fs.readFileSync("package.json"));
var lockObj = {
name: packageObj.name,
version: packageObj.version,
lockfileVersion: 1,
requires: true,
dependencies: {}
};
function augmentPackageJSON(filePath, dependencies) {
var packageJSON = path.join(filePath, "package.json");
if(fs.existsSync(packageJSON)) {
var packageObj = JSON.parse(fs.readFileSync(packageJSON));
dependencies[packageObj.name] = {
version: packageObj.version,
integrity: "sha1-000000000000000000000000000=",
dependencies: {}
};
processDependencies(path.join(filePath, "node_modules"), dependencies[packageObj.name].dependencies);
}
}
function processDependencies(dir, dependencies) {
if(fs.existsSync(dir)) {
var files = fs.readdirSync(dir);
files.forEach(function(entry) {
var filePath = path.join(dir, entry);
var stats = fs.statSync(filePath);
if(stats.isDirectory()) {
if(entry.substr(0, 1) == "@") {
// When we encounter a namespace folder, augment all packages belonging to the scope
var pkgFiles = fs.readdirSync(filePath);
pkgFiles.forEach(function(entry) {
if(stats.isDirectory()) {
var pkgFilePath = path.join(filePath, entry);
augmentPackageJSON(pkgFilePath, dependencies);
}
});
} else {
augmentPackageJSON(filePath, dependencies);
}
}
});
}
}
processDependencies("node_modules", lockObj.dependencies);
fs.writeFileSync("package-lock.json", JSON.stringify(lockObj, null, 2));
'';
};
prepareAndInvokeNPM = {packageName, bypassCache, reconstructLock, npmFlags, production}:
let
forceOfflineFlag = if bypassCache then "--offline" else "--registry http://www.example.com";
in
''
# Pinpoint the versions of all dependencies to the ones that are actually being used
echo "pinpointing versions of dependencies..."
source $pinpointDependenciesScriptPath
# Patch the shebangs of the bundled modules to prevent them from
# calling executables outside the Nix store as much as possible
patchShebangs .
# Deploy the Node.js package by running npm install. Since the
# dependencies have been provided already by ourselves, it should not
# attempt to install them again, which is good, because we want to make
# it Nix's responsibility. If it needs to install any dependencies
# anyway (e.g. because the dependency parameters are
# incomplete/incorrect), it fails.
#
# The other responsibilities of NPM are kept -- version checks, build
# steps, postprocessing etc.
export HOME=$TMPDIR
cd "${packageName}"
runHook preRebuild
${lib.optionalString bypassCache ''
${lib.optionalString reconstructLock ''
if [ -f package-lock.json ]
then
echo "WARNING: Reconstruct lock option enabled, but a lock file already exists!"
echo "This will most likely result in version mismatches! We will remove the lock file and regenerate it!"
rm package-lock.json
else
echo "No package-lock.json file found, reconstructing..."
fi
node ${reconstructPackageLock}
''}
node ${addIntegrityFieldsScript}
''}
npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${lib.optionalString production "--production"} rebuild
if [ "$dontNpmInstall" != "1" ]
then
# NPM tries to download packages even when they already exist if npm-shrinkwrap is used.
rm -f npm-shrinkwrap.json
npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${lib.optionalString production "--production"} install
fi
'';
# Builds and composes an NPM package including all its dependencies
buildNodePackage =
{ name
, packageName
, version
, dependencies ? []
, buildInputs ? []
, production ? true
, npmFlags ? ""
, dontNpmInstall ? false
, bypassCache ? false
, reconstructLock ? false
, preRebuild ? ""
, dontStrip ? true
, unpackPhase ? "true"
, buildPhase ? "true"
, ... }@args:
let
extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" "dontStrip" "dontNpmInstall" "preRebuild" "unpackPhase" "buildPhase" ];
in
stdenv.mkDerivation ({
name = "node_${name}-${version}";
buildInputs = [ tarWrapper python nodejs ]
++ lib.optional (stdenv.isLinux) util-linux
++ lib.optional (stdenv.isDarwin) libtool
++ buildInputs;
inherit dontStrip; # Stripping may fail a build for some package deployments
inherit dontNpmInstall preRebuild unpackPhase buildPhase;
compositionScript = composePackage args;
pinpointDependenciesScript = pinpointDependenciesOfPackage args;
passAsFile = [ "compositionScript" "pinpointDependenciesScript" ];
installPhase = ''
# Create and enter a root node_modules/ folder
mkdir -p $out/lib/node_modules
cd $out/lib/node_modules
# Compose the package and all its dependencies
source $compositionScriptPath
${prepareAndInvokeNPM { inherit packageName bypassCache reconstructLock npmFlags production; }}
# Create symlink to the deployed executable folder, if applicable
if [ -d "$out/lib/node_modules/.bin" ]
then
ln -s $out/lib/node_modules/.bin $out/bin
fi
# Create symlinks to the deployed manual page folders, if applicable
if [ -d "$out/lib/node_modules/${packageName}/man" ]
then
mkdir -p $out/share
for dir in "$out/lib/node_modules/${packageName}/man/"*
do
mkdir -p $out/share/man/$(basename "$dir")
for page in "$dir"/*
do
ln -s $page $out/share/man/$(basename "$dir")
done
done
fi
# Run post install hook, if provided
runHook postInstall
'';
} // extraArgs);
# Builds a development shell
buildNodeShell =
{ name
, packageName
, version
, src
, dependencies ? []
, buildInputs ? []
, production ? true
, npmFlags ? ""
, dontNpmInstall ? false
, bypassCache ? false
, reconstructLock ? false
, dontStrip ? true
, unpackPhase ? "true"
, buildPhase ? "true"
, ... }@args:
let
extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" ];
nodeDependencies = stdenv.mkDerivation ({
name = "node-dependencies-${name}-${version}";
buildInputs = [ tarWrapper python nodejs ]
++ lib.optional (stdenv.isLinux) util-linux
++ lib.optional (stdenv.isDarwin) libtool
++ buildInputs;
inherit dontStrip; # Stripping may fail a build for some package deployments
inherit dontNpmInstall unpackPhase buildPhase;
includeScript = includeDependencies { inherit dependencies; };
pinpointDependenciesScript = pinpointDependenciesOfPackage args;
passAsFile = [ "includeScript" "pinpointDependenciesScript" ];
installPhase = ''
mkdir -p $out/${packageName}
cd $out/${packageName}
source $includeScriptPath
# Create fake package.json to make the npm commands work properly
cp ${src}/package.json .
chmod 644 package.json
${lib.optionalString bypassCache ''
if [ -f ${src}/package-lock.json ]
then
cp ${src}/package-lock.json .
fi
''}
# Go to the parent folder to make sure that all packages are pinpointed
cd ..
${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."}
${prepareAndInvokeNPM { inherit packageName bypassCache reconstructLock npmFlags production; }}
# Expose the executables that were installed
cd ..
${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."}
mv ${packageName} lib
ln -s $out/lib/node_modules/.bin $out/bin
'';
} // extraArgs);
in
stdenv.mkDerivation {
name = "node-shell-${name}-${version}";
buildInputs = [ python nodejs ] ++ lib.optional (stdenv.isLinux) util-linux ++ buildInputs;
buildCommand = ''
mkdir -p $out/bin
cat > $out/bin/shell <<EOF
#! ${stdenv.shell} -e
$shellHook
exec ${stdenv.shell}
EOF
chmod +x $out/bin/shell
'';
# Provide the dependencies in a development shell through the NODE_PATH environment variable
inherit nodeDependencies;
shellHook = lib.optionalString (dependencies != []) ''
export NODE_PATH=$nodeDependencies/lib/node_modules
export PATH="$nodeDependencies/bin:$PATH"
'';
};
in
{
buildNodeSourceDist = lib.makeOverridable buildNodeSourceDist;
buildNodePackage = lib.makeOverridable buildNodePackage;
buildNodeShell = lib.makeOverridable buildNodeShell;
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,27 @@
{
"name": "matrix-recorder",
"version": "0.0.6",
"description": "A recorder that can record Matrix rooms you are a member of (including E2E-encrypted rooms).",
"author": "Hello Matrix <hello@hello-matrix.net>",
"main": "matrix-recorder.js",
"scripts": {
"start": "node matrix-recorder.js"
},
"repository": {
"type": "git",
"url": "https://gitlab.com/argit/matrix-recorder.git"
},
"dependencies": {
"marked": "^0.6.2",
"matrix-js-sdk": "^0.7.13",
"mime-types": "^2.1.14",
"mustache": "^2.3.0",
"node-fetch": "^1.6.3",
"node-localstorage": "^1.3.0",
"sqlite3": "^4.0.7",
"olm": "https://packages.matrix.org/npm/olm/olm-2.3.0.tgz"
},
"license": "MIT",
"optionalDependencies": {
}
}

View file

@ -0,0 +1,53 @@
{ lib, fetchFromGitHub
, buildPythonApplication, buildPythonPackage
, pygobject3, pytest-runner, requests, responses, pytest, python-olm
, canonicaljson, olm
}:
let
mainsrc = fetchFromGitHub {
owner = "saadnpq";
repo = "matrixcli";
rev = "61ebde173ca2f77185c261c2b7f6db297ca89863";
sha256 = "sha256-eH/8b8IyfXqUo7odSECYF+84pXTsP+5S7pFR3oWXknU=";
fetchSubmodules = true;
};
sdk = buildPythonPackage rec {
name = "${pname}-${version}";
pname = "matrix-python-sdk-matrixcli";
version = "0.0.2019-08-15";
src = "${mainsrc}/matrix-python-sdk/";
propagatedBuildInputs = [
requests responses olm python-olm canonicaljson
pytest-runner pytest
];
doCheck = false;
doInstallCheck = false;
meta = {
license = lib.licenses.asl20;
description = "Fork of Matrix Python SDK";
platforms = lib.platforms.linux;
};
};
in
buildPythonApplication rec {
pname = "matrixcli";
version = "0.0.2019-08-15";
src = mainsrc;
propagatedBuildInputs = [pygobject3 sdk];
meta = {
description = "CLI client for Matrix";
license = lib.licenses.gpl3;
maintainers = [lib.maintainers.raskin];
platforms = lib.platforms.linux;
homepage = "https://github.com/saadnpq/matrixcli";
};
}

View file

@ -0,0 +1,91 @@
{ lib
, stdenv
, fetchurl
, atomEnv
, systemd
, pulseaudio
, libxshmfence
, libnotify
, libappindicator-gtk3
, wrapGAppsHook
, autoPatchelfHook
}:
let
pname = "mattermost-desktop";
version = "5.0.3";
srcs = {
"x86_64-linux" = {
url = "https://releases.mattermost.com/desktop/${version}/${pname}-${version}-linux-x64.tar.gz";
hash = "sha256-KLSWJpNSMGmfugbkFIJLDnxcZtrtBZOGjLlR+kAoMTA=";
};
"i686-linux" = {
url = "https://releases.mattermost.com/desktop/${version}/${pname}-${version}-linux-ia32.tar.gz";
hash = "sha256-4ofjOsfGbgO1PSqQpigNp90JsvlGP1kGexVAR/h3/88=";
};
};
inherit (stdenv.hostPlatform) system;
in
stdenv.mkDerivation {
inherit pname version;
src = fetchurl (srcs."${system}" or (throw "Unsupported system ${system}"));
dontBuild = true;
dontConfigure = true;
dontStrip = true;
nativeBuildInputs = [ wrapGAppsHook autoPatchelfHook ];
buildInputs = atomEnv.packages ++ [
libxshmfence
];
runtimeDependencies = [
(lib.getLib systemd)
pulseaudio
libnotify
libappindicator-gtk3
];
installPhase = ''
runHook preInstall
# Mattermost tarball comes with executable bit set for everything.
# Well apply it only to files that need it.
find . -type f -print0 | xargs -0 chmod -x
find . -type f \( -name '*.so.*' -o -name '*.s[oh]' \) -print0 | xargs -0 chmod +x
chmod +x mattermost-desktop chrome-sandbox
mkdir -p $out/share/mattermost-desktop
cp -R . $out/share/mattermost-desktop
mkdir -p "$out/bin"
ln -s $out/share/mattermost-desktop/mattermost-desktop $out/bin/mattermost-desktop
patchShebangs $out/share/mattermost-desktop/create_desktop_file.sh
$out/share/mattermost-desktop/create_desktop_file.sh
rm $out/share/mattermost-desktop/create_desktop_file.sh
mkdir -p $out/share/applications
chmod -x Mattermost.desktop
mv Mattermost.desktop $out/share/applications/Mattermost.desktop
substituteInPlace $out/share/applications/Mattermost.desktop \
--replace /share/mattermost-desktop/mattermost-desktop /bin/mattermost-desktop
runHook postInstall
'';
meta = with lib; {
description = "Mattermost Desktop client";
homepage = "https://about.mattermost.com/";
license = licenses.asl20;
platforms = [ "x86_64-linux" "i686-linux" ];
maintainers = [ maintainers.joko ];
};
}

View file

@ -0,0 +1,43 @@
{ lib, stdenv, fetchurl, fetchpatch, openssl, ncurses, pkg-config, glib, loudmouth, libotr
, gpgme
}:
stdenv.mkDerivation rec {
pname = "mcabber";
version = "1.1.2";
src = fetchurl {
url = "https://mcabber.com/files/mcabber-${version}.tar.bz2";
sha256 = "0q1i5acyghsmzas88qswvki8kkk2nfpr8zapgnxbcd3lwcxl38f4";
};
patches = [
# Pull upstream patch for ncurses-6.3.
(fetchpatch {
name = "ncurses-6.3.patch";
url = "https://github.com/McKael/mcabber/commit/5a0893d69023b77b7671731defbdca5d47731130.patch";
sha256 = "01bc23z0mva9l9jv587sq2r9w3diachgkmb9ad99hlzgj02fmq4v";
stripLen = 1;
})
];
nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl ncurses glib loudmouth libotr gpgme ];
configureFlags = [
"--with-openssl=${openssl.dev}"
"--enable-modules"
"--enable-otr"
];
doCheck = true;
meta = with lib; {
homepage = "http://mcabber.com/";
description = "Small Jabber console client";
license = licenses.gpl2;
maintainers = with maintainers; [ pSub ];
platforms = with platforms; linux;
downloadPage = "http://mcabber.com/files/";
};
}

View file

@ -0,0 +1,160 @@
{ lib
, stdenv
, fetchurl
, bundlerEnv
, alsa-utils
, atk
, copyDesktopItems
, gobject-introspection
, gtk2
, ruby
, libicns
, libnotify
, makeDesktopItem
, which
, wrapGAppsHook
, writeText
}:
let
# NOTE: $out may have different values depending on context
mikutterPaths = rec {
optPrefixDir = "$out/opt/mikutter";
appPrefixDir = "$out/Applications/mikutter.app/Contents";
appBinDir = "${appPrefixDir}/MacOS";
appResourceDir = "${appPrefixDir}/Resources";
iconPath = "${optPrefixDir}/core/skin/data/icon.png";
};
gems = bundlerEnv {
name = "mikutter-gems"; # leave the version out to enable package reuse
gemdir = ./deps;
groups = [ "default" "plugin" ];
inherit ruby;
# Avoid the following error:
# > `<module:Moneta>': uninitialized constant Moneta::Builder (NameError)
#
# Related:
# https://github.com/NixOS/nixpkgs/pull/76510
# https://github.com/NixOS/nixpkgs/pull/76765
# https://github.com/NixOS/nixpkgs/issues/83442
# https://github.com/NixOS/nixpkgs/issues/106545
copyGemFiles = true;
};
mkDesktopItem = { description }:
makeDesktopItem {
name = "mikutter";
desktopName = "mikutter";
exec = "mikutter";
icon = "mikutter";
categories = [ "Network" ];
comment = description;
keywords = [ "Mastodon" ];
};
mkInfoPlist = { version }:
writeText "Info.plist" (lib.generators.toPlist { } {
CFBundleName = "mikutter";
CFBundleDisplayName = "mikutter";
CFBundleExecutable = "mikutter";
CFBundleIconFile = "mikutter";
CFBundleIdentifier = "net.hachune.mikutter";
CFBundleInfoDictionaryVersion = "6.0";
CFBundlePackageType = "APPL";
CFBundleVersion = version;
CFBundleShortVersionString = version;
});
inherit (gems) wrappedRuby;
in
with mikutterPaths; stdenv.mkDerivation rec {
pname = "mikutter";
version = "4.1.4";
src = fetchurl {
url = "https://mikutter.hachune.net/bin/mikutter-${version}.tar.gz";
sha256 = "05253nz4i1lmnq6czj48qdab2ny4vx2mznj6nsn2l1m2z6zqkwk3";
};
nativeBuildInputs = [ copyDesktopItems wrapGAppsHook ]
++ lib.optionals stdenv.isDarwin [ libicns ];
buildInputs = [
atk
gtk2
gobject-introspection
libnotify
which # some plugins use it at runtime
wrappedRuby
] ++ lib.optionals stdenv.isLinux [ alsa-utils ];
scriptPath = lib.makeBinPath (
[ wrappedRuby libnotify which ]
++ lib.optionals stdenv.isLinux [ alsa-utils ]
);
postUnpack = ''
rm -rf vendor
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin ${optPrefixDir}
install -Dm644 README $out/share/doc/mikutter/README
install -Dm644 LICENSE $out/share/doc/mikutter/LICENSE
rm -r README LICENSE deployment
cp -r . ${optPrefixDir}
gappsWrapperArgsHook # FIXME: currently runs at preFixup
wrapGApp ${optPrefixDir}/mikutter.rb \
--prefix PATH : "${scriptPath}" \
--set DISABLE_BUNDLER_SETUP 1
mv ${optPrefixDir}/mikutter.rb $out/bin/mikutter
install -Dm644 ${iconPath} $out/share/icons/hicolor/256x256/apps/mikutter.png
runHook postInstall
'';
postInstall =
let
infoPlist = mkInfoPlist { inherit version; };
in
lib.optionalString stdenv.isDarwin ''
mkdir -p ${appBinDir} ${appResourceDir}
install -Dm644 ${infoPlist} ${appPrefixDir}/Info.plist
ln -s $out/bin/mikutter ${appBinDir}/mikutter
png2icns ${appResourceDir}/mikutter.icns ${iconPath}
'';
installCheckPhase = ''
runHook preInstallCheck
testDir="$(mktemp -d)"
install -Dm644 ${./test_plugin.rb} "$testDir/plugin/test_plugin/test_plugin.rb"
$out/bin/mikutter --confroot="$testDir" --plugin=test_plugin --debug
runHook postInstallCheck
'';
desktopItems = [
(mkDesktopItem { inherit (meta) description; })
];
doInstallCheck = true;
dontWrapGApps = true; # the target is placed outside of bin/
passthru.updateScript = [ ./update.sh version (toString ./.) ];
meta = with lib; {
description = "An extensible Mastodon client";
homepage = "https://mikutter.hachune.net";
platforms = ruby.meta.platforms;
license = licenses.mit;
};
}

View file

@ -0,0 +1,39 @@
alias __source_distinct__ source
def source(url)
@loaded ||= {}
unless @loaded[url]
@loaded[url] = true
__source_distinct__(url) end end
source 'https://rubygems.org'
ruby '>= 2.5.0'
group :default do
gem 'addressable','>= 2.7.0', '< 2.8'
gem 'delayer','>= 1.1.2', '< 2.0'
gem 'delayer-deferred','>= 2.2.0', '< 3.0'
gem 'diva','>= 1.0.2', '< 2.0'
gem 'memoist','>= 0.16.2', '< 0.17'
gem 'oauth','>= 0.5.4'
gem 'pluggaloid','>= 1.5.0', '< 2.0'
gem 'typed-array','>= 0.1.2', '< 0.2'
end
group :test do
gem 'test-unit','>= 3.3.4', '< 4.0'
gem 'rake','>= 13.0.1'
gem 'mocha','>= 1.11.1'
gem 'webmock','>= 3.7.6'
gem 'ruby-prof','>= 1.1.0'
end
group :plugin do
Dir.glob(File.expand_path(File.join(__dir__, 'plugin/*/Gemfile'))){ |path|
eval File.open(path).read
}
Dir.glob(File.join(File.expand_path(ENV['MIKUTTER_CONFROOT'] || '~/.mikutter'), 'plugin/*/Gemfile')){ |path|
eval File.open(path).read
}
end

View file

@ -0,0 +1,101 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
atk (3.4.1)
glib2 (= 3.4.1)
cairo (1.17.5)
native-package-installer (>= 1.0.3)
pkg-config (>= 1.2.2)
red-colors
cairo-gobject (3.4.1)
cairo (>= 1.16.2)
glib2 (= 3.4.1)
crack (0.4.5)
rexml
delayer (1.2.0)
delayer-deferred (2.2.0)
delayer (>= 1.1.2, < 2.0)
diva (1.0.2)
addressable (>= 2.5.2, < 2.8)
gdk_pixbuf2 (3.4.1)
gio2 (= 3.4.1)
gettext (3.3.7)
locale (>= 2.0.5)
text (>= 1.3.0)
gio2 (3.4.1)
gobject-introspection (= 3.4.1)
glib2 (3.4.1)
native-package-installer (>= 1.0.3)
pkg-config (>= 1.3.5)
gobject-introspection (3.4.1)
glib2 (= 3.4.1)
gtk2 (3.4.1)
atk (= 3.4.1)
gdk_pixbuf2 (= 3.4.1)
pango (= 3.4.1)
hashdiff (1.0.1)
httpclient (2.8.3)
instance_storage (1.0.0)
locale (2.1.3)
memoist (0.16.2)
mini_portile2 (2.5.0)
mocha (1.12.0)
moneta (1.4.1)
native-package-installer (1.1.1)
nokogiri (1.11.3)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
oauth (0.5.6)
pango (3.4.1)
cairo-gobject (= 3.4.1)
gobject-introspection (= 3.4.1)
pkg-config (1.4.6)
pluggaloid (1.5.0)
delayer (>= 1.1.0, < 2.0)
instance_storage (>= 1.0.0, < 2.0.0)
power_assert (2.0.0)
public_suffix (4.0.6)
racc (1.5.2)
rake (13.0.3)
red-colors (0.1.1)
rexml (3.2.5)
ruby-prof (1.4.3)
test-unit (3.4.0)
power_assert
text (1.3.1)
typed-array (0.1.2)
webmock (3.12.2)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
PLATFORMS
ruby
DEPENDENCIES
addressable (>= 2.7.0, < 2.8)
delayer (>= 1.1.2, < 2.0)
delayer-deferred (>= 2.2.0, < 3.0)
diva (>= 1.0.2, < 2.0)
gettext (>= 3.3.5, < 3.4)
gtk2 (= 3.4.1)
httpclient
memoist (>= 0.16.2, < 0.17)
mocha (>= 1.11.1)
moneta
nokogiri
oauth (>= 0.5.4)
pluggaloid (>= 1.5.0, < 2.0)
rake (>= 13.0.1)
ruby-prof (>= 1.1.0)
test-unit (>= 3.3.4, < 4.0)
typed-array (>= 0.1.2, < 0.2)
webmock (>= 3.7.6)
RUBY VERSION
ruby 2.6.6p146
BUNDLED WITH
2.1.4

View file

@ -0,0 +1,410 @@
{
addressable = {
dependencies = ["public_suffix"];
groups = ["default" "test"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1fvchp2rhp2rmigx7qglf69xvjqvzq7x0g49naliw29r2bz656sy";
type = "gem";
};
version = "2.7.0";
};
atk = {
dependencies = ["glib2"];
groups = ["default" "plugin"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0a8q9a1f6x4gy55p8cf52a22bnpjgn18ad9n959x0f4gybbhs948";
type = "gem";
};
version = "3.4.1";
};
cairo = {
dependencies = ["native-package-installer" "pkg-config" "red-colors"];
groups = ["default" "plugin"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0vbj9szp2xbnxqan8hppip8vm9fxpcmpx745y5fvg2scdh9f0p7s";
type = "gem";
};
version = "1.17.5";
};
cairo-gobject = {
dependencies = ["cairo" "glib2"];
groups = ["default" "plugin"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0gkxdfslcvrwrs48giilji3bgxd5bwijwq33p9h00r10jzfg2028";
type = "gem";
};
version = "3.4.1";
};
crack = {
dependencies = ["rexml"];
groups = ["default" "test"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1cr1kfpw3vkhysvkk3wg7c54m75kd68mbm9rs5azdjdq57xid13r";
type = "gem";
};
version = "0.4.5";
};
delayer = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0iqf4i18i8rk3x7qgvkhbiqskf0xzdf733fjimrq6xkag2mq60bl";
type = "gem";
};
version = "1.2.0";
};
delayer-deferred = {
dependencies = ["delayer"];
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0i2das3ncssacpqdgaf4as77vrxm7jfiizaja884fqv4rzv6s2sv";
type = "gem";
};
version = "2.2.0";
};
diva = {
dependencies = ["addressable"];
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "05wl4wg57vvng4nrp4lzjq148v908xzq092kq93phwvyxs7jnw2g";
type = "gem";
};
version = "1.0.2";
};
gdk_pixbuf2 = {
dependencies = ["gio2"];
groups = ["default" "plugin"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0194gzn0kialfh0j7crllvp808r64sg6dh297x69b0av21ar5pam";
type = "gem";
};
version = "3.4.1";
};
gettext = {
dependencies = ["locale" "text"];
groups = ["default" "plugin"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1fqlwq7i8ck1fjyhn19q3skvgrbz44q7gq51mlr0qym5rkj5f6rn";
type = "gem";
};
version = "3.3.7";
};
gio2 = {
dependencies = ["gobject-introspection"];
groups = ["default" "plugin"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1l3jpgbdvb55xhcmpkcqgwx5068dfyi8kijfvzhbqh96ng0p1m7g";
type = "gem";
};
version = "3.4.1";
};
glib2 = {
dependencies = ["native-package-installer" "pkg-config"];
groups = ["default" "plugin"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "18clyn0fp0h5alnkf9i2bqd6wvl78h468pdbzs1csqnba8vw4q1c";
type = "gem";
};
version = "3.4.1";
};
gobject-introspection = {
dependencies = ["glib2"];
groups = ["default" "plugin"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1a3x8qiisbax3x0izj8l5w66r53ba5ma53ax2jhdbhbvaxx3d02n";
type = "gem";
};
version = "3.4.1";
};
gtk2 = {
dependencies = ["atk" "gdk_pixbuf2" "pango"];
groups = ["plugin"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "17az8g0n1yzz90kdbjg2hpabi04qccda7v6lin76bs637ivfg2md";
type = "gem";
};
version = "3.4.1";
};
hashdiff = {
groups = ["default" "test"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1nynpl0xbj0nphqx1qlmyggq58ms1phf5i03hk64wcc0a17x1m1c";
type = "gem";
};
version = "1.0.1";
};
httpclient = {
groups = ["plugin"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "19mxmvghp7ki3klsxwrlwr431li7hm1lczhhj8z4qihl2acy8l99";
type = "gem";
};
version = "2.8.3";
};
instance_storage = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "08nf5fhq9dckq9lmaklxydq0hrlfi7phk66gr3bggxg45zd687pl";
type = "gem";
};
version = "1.0.0";
};
locale = {
groups = ["default" "plugin"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0997465kxvpxm92fiwc2b16l49mngk7b68g5k35ify0m3q0yxpdn";
type = "gem";
};
version = "2.1.3";
};
memoist = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0i9wpzix3sjhf6d9zw60dm4371iq8kyz7ckh2qapan2vyaim6b55";
type = "gem";
};
version = "0.16.2";
};
mini_portile2 = {
groups = ["default" "plugin"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1hdbpmamx8js53yk3h8cqy12kgv6ca06k0c9n3pxh6b6cjfs19x7";
type = "gem";
};
version = "2.5.0";
};
mocha = {
groups = ["test"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "05yw6rwgjppq116jgqfg4pv4bql3ci4r2fmmg0m2c3sqib1bq41a";
type = "gem";
};
version = "1.12.0";
};
moneta = {
groups = ["plugin"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0z25b4yysvnf2hi9jxnsiv3fvnicnzr2m70ci231av5093jfknc6";
type = "gem";
};
version = "1.4.1";
};
native-package-installer = {
groups = ["default" "plugin"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1ww1mq41q7rda975byjmq5dk8k13v8dawvm33370pbkrymd8syp8";
type = "gem";
};
version = "1.1.1";
};
nokogiri = {
dependencies = ["mini_portile2" "racc"];
groups = ["plugin"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "19d78mdg2lbz9jb4ph6nk783c9jbsdm8rnllwhga6pd53xffp6x0";
type = "gem";
};
version = "1.11.3";
};
oauth = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1zwd6v39yqfdrpg1p3d9jvzs9ljg55ana2p06m0l7qn5w0lgx1a0";
type = "gem";
};
version = "0.5.6";
};
pango = {
dependencies = ["cairo-gobject" "gobject-introspection"];
groups = ["default" "plugin"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1d0cn50qgpifrcv8qx72wi6l9xalw3ryngbfmm9xpg9vx5rl1qbp";
type = "gem";
};
version = "3.4.1";
};
pkg-config = {
groups = ["default" "plugin"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1mjjy1grxr64znkffxsvprcckbrrnm40b6gbllnbm7jxslbr3gjl";
type = "gem";
};
version = "1.4.6";
};
pluggaloid = {
dependencies = ["delayer" "instance_storage"];
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0m3f940lf1bg01jin22by7hg9hs43y995isgcyqb6vbvlv51zj11";
type = "gem";
};
version = "1.5.0";
};
power_assert = {
groups = ["default" "test"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "172qfmzwxdf82bmwgcb13hnz9i3p6i2s2nijxnx6r63kn3drjppr";
type = "gem";
};
version = "2.0.0";
};
public_suffix = {
groups = ["default" "test"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1xqcgkl7bwws1qrlnmxgh8g4g9m10vg60bhlw40fplninb3ng6d9";
type = "gem";
};
version = "4.0.6";
};
racc = {
groups = ["default" "plugin"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "178k7r0xn689spviqzhvazzvxfq6fyjldxb3ywjbgipbfi4s8j1g";
type = "gem";
};
version = "1.5.2";
};
rake = {
groups = ["test"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1iik52mf9ky4cgs38fp2m8r6skdkq1yz23vh18lk95fhbcxb6a67";
type = "gem";
};
version = "13.0.3";
};
red-colors = {
groups = ["default" "plugin"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0ar2k7zvhr1215jx5di29hkg5h1798f1gypmq6v0sy9v35w6ijca";
type = "gem";
};
version = "0.1.1";
};
rexml = {
groups = ["default" "test"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "08ximcyfjy94pm1rhcx04ny1vx2sk0x4y185gzn86yfsbzwkng53";
type = "gem";
};
version = "3.2.5";
};
ruby-prof = {
groups = ["test"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1r3xalp91l07m0cwllcxjzg6nkviiqnxkcbgg5qnzsdji6rgy65m";
type = "gem";
};
version = "1.4.3";
};
test-unit = {
dependencies = ["power_assert"];
groups = ["test"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1h0c323zfn4hdida4g58h8wnlh4kax438gyxlw20dd78kcp01i8m";
type = "gem";
};
version = "3.4.0";
};
text = {
groups = ["default" "plugin"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1x6kkmsr49y3rnrin91rv8mpc3dhrf3ql08kbccw8yffq61brfrg";
type = "gem";
};
version = "1.3.1";
};
typed-array = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0qlv2rnkin9rwkgjx3k5qvc17m0m7jf5cdirw3wxbjnw5kga27w9";
type = "gem";
};
version = "0.1.2";
};
webmock = {
dependencies = ["addressable" "crack" "hashdiff"];
groups = ["test"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "038igpmkpmn0nw0k7s4db8x88af1nwcy7wzh9m9c9q4p74h7rii0";
type = "gem";
};
version = "3.12.2";
};
}

View file

@ -0,0 +1,4 @@
source 'https://rubygems.org'
gem 'gtk2', '3.4.1'

View file

@ -0,0 +1,4 @@
source 'https://rubygems.org'
gem 'nokogiri'
gem 'httpclient'

View file

@ -0,0 +1,5 @@
source 'https://rubygems.org'
group :default do
gem 'gettext', '>= 3.3.5', '< 3.4'
end

View file

@ -0,0 +1,10 @@
# Tests mikutter's event system.
Plugin.create(:test_plugin) do
require 'logger'
Delayer.new do
log = Logger.new(STDOUT)
log.info("loaded test_plugin")
exit
end
end

View file

@ -0,0 +1,51 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bundler bundix curl jq common-updater-scripts
# shellcheck shell=bash
set -euo pipefail
main() {
local currentVer="$1"
local scriptDir="$2"
local latestVer
local srcDir
if [[ -z "$UPDATE_NIX_ATTR_PATH" ]]; then
echo "[ERROR] Please run the following instead:" >&2
echo >&2
echo " % nix-shell maintainers/scripts/update.nix --argstr path mikutter" >&2
exit 1
fi
latestVer="$(queryLatestVersion)"
if [[ "$currentVer" == "$latestVer" ]]; then
echo "[INFO] mikutter is already up to date" >&2
exit
fi
update-source-version "$UPDATE_NIX_ATTR_PATH" "$latestVer"
cd "$scriptDir"
rm -rf deps
mkdir deps
cd deps
srcDir="$(nix-build ../../../../../.. --no-out-link -A mikutter.src)"
tar xvf "$srcDir" --strip-components=1
find . -not -name Gemfile -exec rm {} \;
find . -type d -exec rmdir -p --ignore-fail-on-non-empty {} \; || true
bundle lock
bundix
}
queryLatestVersion() {
curl -sS 'https://mikutter.hachune.net/download.json?count=1' \
| jq -r '.[].version_string' \
| head -n1
}
main "$@"
# vim:set ft=bash:

View file

@ -0,0 +1,92 @@
{ lib
, stdenv
, mkDerivation
, fetchFromGitHub
, libXScrnSaver
, olm
, pkg-config
, pyotherside
, python3Packages
, qmake
, qtbase
, qtgraphicaleffects
, qtkeychain
, qtmultimedia
, qtquickcontrols2
, wrapQtAppsHook
}:
mkDerivation rec {
pname = "mirage";
version = "0.7.2";
src = fetchFromGitHub {
owner = "mirukana";
repo = pname;
rev = "v${version}";
sha256 = "sha256-dJS4lAXHHNUEAG75gQaS9+aQTTTj8KHqHjISioynFdY=";
fetchSubmodules = true;
};
nativeBuildInputs = [
pkg-config
python3Packages.wrapPython
qmake
wrapQtAppsHook
];
buildInputs = [
libXScrnSaver
olm
pyotherside
qtbase
qtgraphicaleffects
qtkeychain
qtmultimedia
qtquickcontrols2
] ++ pythonPath;
pythonPath = with python3Packages; [
pillow
aiofiles
appdirs
cairosvg
filetype
html-sanitizer
lxml
mistune
pymediainfo
plyer
sortedcontainers
watchgod
redbaron
hsluv
simpleaudio
setuptools
watchgod
dbus-python
matrix-nio
];
qmakeFlags = [
"PREFIX=${placeholder "out"}"
"CONFIG+=qtquickcompiler"
];
dontWrapQtApps = true;
postInstall = ''
buildPythonPath "$out $pythonPath"
wrapProgram $out/bin/mirage \
--prefix PYTHONPATH : "$PYTHONPATH" \
"''${qtWrapperArgs[@]}"
'';
meta = with lib; {
homepage = "https://github.com/mirukana/mirage";
description = "A fancy, customizable, keyboard-operable Qt/QML+Python Matrix chat client for encrypted and decentralized communication";
license = licenses.lgpl3Plus;
maintainers = with maintainers; [ colemickens AndersonTorres ];
inherit (qtbase.meta) platforms;
broken = stdenv.isDarwin || python3Packages.isPy37 || python3Packages.isPy38;
};
}

Some files were not shown because too many files have changed in this diff Show more