Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 mkDerivation, 4 fetchurl, 5 makeFontsConf, 6 appimageTools, 7 qtbase, 8 qtsvg, 9 qtmultimedia, 10 qtwebsockets, 11 qtimageformats, 12 autoPatchelfHook, 13 desktop-file-utils, 14 imagemagick, 15 twemoji-color-font, 16 xorg, 17 libsodium, 18 libopus, 19 libGL, 20 alsa-lib, 21}: 22 23mkDerivation rec { 24 pname = "ripcord"; 25 version = "0.4.29"; 26 27 src = 28 let 29 appimage = fetchurl { 30 url = "https://cancel.fm/dl/Ripcord-${version}-x86_64.AppImage"; 31 sha256 = "sha256-4yDLPEBDsPKWtLwdpmSyl3b5XCwLAr2/EVtNRrFmmJk="; 32 name = "${pname}-${version}.AppImage"; 33 }; 34 in 35 appimageTools.extract { 36 inherit pname version; 37 src = appimage; 38 }; 39 40 nativeBuildInputs = [ 41 autoPatchelfHook 42 desktop-file-utils 43 imagemagick 44 ]; 45 buildInputs = [ 46 libsodium 47 libopus 48 libGL 49 alsa-lib 50 ] 51 ++ [ 52 qtbase 53 qtsvg 54 qtmultimedia 55 qtwebsockets 56 qtimageformats 57 ] 58 ++ (with xorg; [ 59 libX11 60 libXScrnSaver 61 libXcursor 62 xkeyboardconfig 63 ]); 64 65 fontsConf = makeFontsConf { 66 fontDirectories = [ twemoji-color-font ]; 67 }; 68 69 installPhase = '' 70 runHook preInstall 71 72 mkdir -p $out 73 cp -r ${src}/{qt.conf,translations,twemoji.ripdb} $out 74 75 for size in 16 32 48 64 72 96 128 192 256 512 1024; do 76 mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps 77 convert -resize "$size"x"$size" ${src}/Ripcord_Icon.png $out/share/icons/hicolor/"$size"x"$size"/apps/ripcord.png 78 done 79 80 desktop-file-install --dir $out/share/applications \ 81 --set-key Exec --set-value ripcord \ 82 --set-key Icon --set-value ripcord \ 83 --set-key Comment --set-value "${meta.description}" \ 84 ${src}/Ripcord.desktop 85 mv $out/share/applications/Ripcord.desktop $out/share/applications/ripcord.desktop 86 87 install -Dm755 ${src}/Ripcord $out/Ripcord 88 patchelf --replace-needed libsodium.so.18 libsodium.so $out/Ripcord 89 makeQtWrapper $out/Ripcord $out/bin/ripcord \ 90 --chdir "$out" \ 91 --set FONTCONFIG_FILE "${fontsConf}" \ 92 --prefix LD_LIBRARY_PATH ":" "${xorg.libXcursor}/lib" \ 93 --prefix QT_XKB_CONFIG_ROOT ":" "${xorg.xkeyboardconfig}/share/X11/xkb" \ 94 --set RIPCORD_ALLOW_UPDATES 0 95 96 runHook postInstall 97 ''; 98 99 meta = with lib; { 100 description = "Desktop chat client for Slack and Discord"; 101 homepage = "https://cancel.fm/ripcord/"; 102 sourceProvenance = with sourceTypes; [ binaryNativeCode ]; 103 # See: https://cancel.fm/ripcord/shareware-redistribution/ 104 license = licenses.unfreeRedistributable; 105 maintainers = [ ]; 106 platforms = [ "x86_64-linux" ]; 107 }; 108}