summary refs log tree commit diff
path: root/pkgs/tools/misc/enjarify/default.nix
blob: 1828ddce7aacd78911d99e82ff212467b77aef6f (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
{ lib, stdenv, fetchFromGitHub, python3, runtimeShell }:

stdenv.mkDerivation rec {
  pname = "enjarify";
  version = "1.0.3";

  src = fetchFromGitHub {
    owner = "google";
    repo = pname;
    rev = version;
    sha256 = "sha256-VDBC5n2jWLNJsilX+PV1smL5JeBDj23jYFRwdObXwYs=";
  };

  installPhase = ''
    pypath="$out/${python3.sitePackages}"
    mkdir -p $out/bin $pypath
    mv enjarify $pypath

    cat << EOF > $out/bin/enjarify
    #!${runtimeShell}
    export PYTHONPATH=$pypath
    exec ${python3.interpreter} -O -m enjarify.main "\$@"
    EOF
    chmod +x $out/bin/enjarify
  '';

  buildInputs = [ ];

  meta = with lib; {
    description = "Tool for translating Dalvik bytecode to equivalent Java bytecode";
    homepage = "https://github.com/google/enjarify/";
    license = licenses.asl20;
    maintainers = with maintainers; [ ];
  };
}