diff --git a/pkgs/applications/networking/instant-messengers/ripcord/default.nix b/pkgs/applications/networking/instant-messengers/ripcord/default.nix new file mode 100755 index 000000000000..6efb900b3b57 --- /dev/null +++ b/pkgs/applications/networking/instant-messengers/ripcord/default.nix @@ -0,0 +1,69 @@ +{ lib, mkDerivation, fetchurl, makeFontsConf, appimageTools, + qtbase, qtsvg, qtmultimedia, qtwebsockets, qtimageformats, + autoPatchelfHook, desktop-file-utils, imagemagick, makeWrapper, + twemoji-color-font, xorg, libsodium, libopus, libGL, zlib, alsaLib }: + +mkDerivation rec { + pname = "ripcord"; + version = "0.4.23"; + + src = let + appimage = fetchurl { + url = "https://cancel.fm/dl/Ripcord-${version}-x86_64.AppImage"; + sha256 = "0395w0pwr1cz8ichcbyrsscmm2p7srgjk4vkqvqgwyx41prm0x2h"; + name = "${pname}-${version}.AppImage"; + }; + in appimageTools.extract { + name = "${pname}-${version}"; + src = appimage; + }; + + nativeBuildInputs = [ autoPatchelfHook desktop-file-utils imagemagick ]; + buildInputs = [ libsodium libopus libGL alsaLib ] ++ + [ qtbase qtsvg qtmultimedia qtwebsockets qtimageformats ] ++ + (with xorg; [ libX11 libXScrnSaver libXcursor xkeyboardconfig ]); + + fontsConf = makeFontsConf { + fontDirectories = [ twemoji-color-font ]; + }; + + installPhase = '' + runHook preInstall + + mkdir -p $out + cp -r ${src}/{qt.conf,translations,twemoji.ripdb} $out + + for size in 16 32 48 64 72 96 128 192 256 512 1024; do + mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps + convert -resize "$size"x"$size" ${src}/Ripcord_Icon.png $out/share/icons/hicolor/"$size"x"$size"/apps/ripcord.png + done + + desktop-file-install --dir $out/share/applications \ + --set-key Exec --set-value ripcord \ + --set-key Icon --set-value ripcord \ + --set-key Comment --set-value "${meta.description}" \ + ${src}/Ripcord.desktop + mv $out/share/applications/Ripcord.desktop $out/share/applications/ripcord.desktop + + install -Dm755 ${src}/Ripcord $out/Ripcord + patchelf --replace-needed libsodium.so.18 libsodium.so $out/Ripcord + makeQtWrapper $out/Ripcord $out/bin/ripcord \ + --run "cd $out" \ + --set FONTCONFIG_FILE "${fontsConf}" \ + --prefix LD_LIBRARY_PATH ":" "${xorg.libXcursor}/lib" \ + --prefix QT_XKB_CONFIG_ROOT ":" "${xorg.xkeyboardconfig}/share/X11/xkb" + + runHook postInstall + ''; + + meta = with lib; { + description = "Desktop chat client for Slack and Discord"; + homepage = "https://cancel.fm/ripcord/"; + + # See: https://cancel.fm/ripcord/shareware-redistribution/ + license = licenses.unfreeRedistributable; + + maintainers = with maintainers; [ infinisil ]; + platforms = [ "x86_64-linux" ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5574d0cc76aa..188bf34ca17a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -21373,6 +21373,8 @@ in ries = callPackage ../applications/science/math/ries { }; + ripcord = qt5.callPackage ../applications/networking/instant-messengers/ripcord { }; + ripser = callPackage ../applications/science/math/ripser { }; rkt = callPackage ../applications/virtualization/rkt { };