summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers/rambox/sencha/bare.nix
blob: 30b12963b337dcb5e846f85a9045701d24b52679 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ stdenv, fetchurl, gzip, which, unzip, jdk }:

let
  version = "6.6.0.13";
  srcs = {
    i686-linux = fetchurl {
      url = "https://cdn.sencha.com/cmd/${version}/no-jre/SenchaCmd-${version}-linux-i386.sh.zip";
      sha256 = "15b197108b49mf0afpihkh3p68lxm7580zz2w0xsbahglnvhwyfz";
    };
    x86_64-linux = fetchurl {
      url = "https://cdn.sencha.com/cmd/${version}/no-jre/SenchaCmd-${version}-linux-amd64.sh.zip";
      sha256 = "1cxhckmx1802p9qiw09cgb1v5f30wcvnrwkshmia8p8n0q47lpp4";
    };
  };
in

stdenv.mkDerivation {
  inherit version;

  pname = "sencha-bare";
  src = srcs.${stdenv.hostPlatform.system};

  nativeBuildInputs = [ gzip which unzip ];
  buildInputs = [ jdk ];

  sourceRoot = ".";

  configurePhase = ''
    substituteAll ${./response.varfile} response.varfile
  '';

  installPhase = ''
    ./SenchaCmd*.sh -q -dir $out -varfile response.varfile
    # disallow sencha writing into /nix/store/repo
    echo "repo.local.dir=$TMP/repo" >> $out/sencha.cfg
    rm $out/shell-wrapper.sh $out/Uninstaller
  '';

  meta = with stdenv.lib; {
    license = licenses.unfree;
    platforms = attrNames srcs;
  };
}