about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/misc/aws-mturk-clt/default.nix
blob: c5f4b0f5670ae92eb026364898c5a9e5a25926a5 (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
44
45
46
47
48
{ stdenv, fetchurl, jre }:

stdenv.mkDerivation rec {
  name = "aws-mturk-clt-1.3.0";

  src = fetchurl {
    url = "https://mturk.s3.amazonaws.com/CLTSource/${name}.tar.gz";
    sha256 = "00yyc7k3iygg83cknv9i2dsaxwpwzdkc8a2l9j56lg999hw3mqm3";
  };

  installPhase =
    ''
      mkdir -p $out
      cp -prvd bin $out/

      for i in $out/bin/*.sh; do
        sed -i "$i" -e "s|^MTURK_CMD_HOME=.*|MTURK_CMD_HOME=$out\nexport JAVA_HOME=${jre}|"
      done

      mkdir -p $out/lib
      cp -prvd lib/* $out/lib/
    ''; # */

  meta = {
    homepage = "https://requester.mturk.com/developer";
    description = "Command line tools for interacting with the Amazon Mechanical Turk";
    license = stdenv.lib.licenses.amazonsl;

    longDescription =
      ''
        The Amazon Mechanical Turk is a crowdsourcing marketplace that
        allows users (“requesters”) to submit tasks to be performed by
        other humans (“workers”) for a small fee.  This package
        contains command-line tools for submitting tasks, querying
        results, and so on.

        The command-line tools expect a file
        <filename>mturk.properties<filename> in the current directory,
        which should contain the following:

        <screen>
        access_key=[insert your access key here]
        secret_key=[insert your secret key here]
        service_url=http://mechanicalturk.amazonaws.com/?Service=AWSMechanicalTurkRequester
        </screen>
      '';
  };
}