Skip to content

Instantly share code, notes, and snippets.

@easrng
Last active December 9, 2023 06:10
Show Gist options
  • Save easrng/85adf6bccb6211b1bcccd1688df3c6a6 to your computer and use it in GitHub Desktop.
Save easrng/85adf6bccb6211b1bcccd1688df3c6a6 to your computer and use it in GitHub Desktop.
Cwtch (Metadata Resistant Chat) packaged for nix
{
stdenv, lib, fetchurl, autoPatchelfHook, makeWrapper,
zlib, gdk-pixbuf, cairo, libepoxy, at-spi2-atk, glib, gtk3, pango, harfbuzz, fontconfig
}:
stdenv.mkDerivation rec {
pname = "cwtch-bin";
version = "1.13.2";
src = fetchurl {
url = "https://cwtch.im/releases/cwtch-v${version}/cwtch-v${version}.tar.gz";
hash = "sha512-+at/91e/RkpTvCIyxEZ9BPXnXSvje+oAYKIWJ9iQ+hIeKdbhCxN2yLNjLTRlvyINuLrmikOtVXMCQ6m7u8eIxQ==";
};
nativeBuildInputs = [
autoPatchelfHook
];
buildInputs = [ makeWrapper zlib gdk-pixbuf cairo libepoxy at-spi2-atk glib gtk3 pango harfbuzz fontconfig stdenv.cc.cc.lib ];
sourceRoot = ".";
installPhase = ''
runHook preInstall
rm -rf cwtch/lib/Tor/libstdc++
mkdir -p $out/bin
cp -r cwtch $out/cwtch
mkdir -p $out/share/icons
ln -s $out/cwtch/cwtch.png $out/share/icons
mkdir -p $out/share/applications
sed "s|PREFIX|$out|g" $out/cwtch/cwtch.template.desktop > $out/share/applications/cwtch.desktop
chmod a+x $out/share/applications/cwtch.desktop
rm -rf $out/cwtch/*.template.* $out/cwtch/*.yml $out/cwtch/install* #*/
makeWrapper $out/cwtch/cwtch $out/bin/cwtch --run "cd $out/cwtch"
runHook postInstall
'';
meta = with lib; {
homepage = "https://cwtch.im";
description = "Metadata Resistant Chat";
platforms = platforms.linux;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment