[Nix-dev] Gajim and OMEMO

Jookia 166291 at gmail.com
Mon Feb 27 21:42:00 CET 2017


I have this as a package:

{ stdenv, makeWrapper, fetchurl, pythonPackages, buildPythonPackage, python
, gajim, potr }:
let
  gajim-omemo = stdenv.mkDerivation {
    name = "gajim-omemo";
    src = fetchurl {
      url = "https://api.github.com/repos/kalkin/gajim-omemo/tarball/8356479";
      sha256 = "1czfayh0dhijy4ycph4krwq1zl8g0x0hbj952x75fbxs1jr7qpdk";
      name = "gajim-omemo-8356479.tar.gz";
    };
    phases = [ "unpackPhase" "installPhase" ];
    installPhase = "cp -r . $out";
  };
  gajim-otr = stdenv.mkDerivation {
    name = "gajim-otr";
    src = fetchurl {
      url = "https://api.github.com/repos/python-otr/gajim-otr/tarball/0613803";
      sha256 = "1ng3pwl8z31zpipkwp8m24xm2hwpj70i1hlrcqkklqx9ar7yxj4h";
      name = "gajim-otr-0613803.tar.gz";
    };
    phases = [ "unpackPhase" "installPhase" ];
    installPhase = "cp -r src/gotr $out";
  };
in
stdenv.mkDerivation {
  name = "gajim-crypto";
  buildInputs = with pythonPackages; [ makeWrapper python python-axolotl
    python-axolotl-curve25519 potr protobuf2_6 google_apputils ];
  buildCommand = ''
    mkdir -p $out/share/gajim/plugins
    for i in share/{applications,icons,locale,man} \
             share/gajim/{data,icons,src}; do
      ln -s ${gajim}/$i $out/$i
    done
    for i in ${gajim}/share/gajim/plugins/*; do
      ln -s $i $out/share/gajim/plugins/$(basename $i);
    done
    ln -s ${gajim-omemo} $out/share/gajim/plugins/${gajim-omemo.name}
    ln -s ${gajim-otr} $out/share/gajim/plugins/${gajim-otr.name}
    cp -r --no-preserve=all ${gajim}/bin $out
    for i in $out/bin/*; do
      chmod +x $i
      wrapProgram $i \
        --set GAJIM_BASEDIR "$out/share/gajim" \
        --prefix PYTHONPATH : "$PYTHONPATH" ;
      sed -i "s/APP=.*/APP=$(basename $i)/g" $out/bin/.$(basename $i)-wrapped
    done
  '';
}

(and potr:)

{ stdenv, fetchurl, pythonPackages, buildPythonPackage }:
buildPythonPackage rec {
  version = "1.0.1";
  name = "python-pure-otr-${version}";
  src = fetchurl {
    url = "https://github.com/python-otr/pure-python-otr/archive/${version}.tar.gz";
    sha256 = "0xwzxvmvz7dbd6ahf6nscgby6wc469xgmjq8bqcazgv59h83i5lh";
  };
  buildInputs = [ pythonPackages.pycrypto ];
}


Might be outdated, set it up a while ago.


More information about the nix-dev mailing list