nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenvNoCC,
4 fetchurl,
5 jre,
6 makeWrapper,
7 unzip,
8}:
9
10stdenvNoCC.mkDerivation (finalAttrs: {
11 pname = "dex2jar";
12 version = "2.4";
13
14 src = fetchurl {
15 url = "https://github.com/pxb1988/dex2jar/releases/download/v${finalAttrs.version}/dex-tools-v${finalAttrs.version}.zip";
16 hash = "sha256-7nxF6zwdJHSmFF2NRH5lGnNqItlmS209O+WlqBfdojo=";
17 };
18
19 nativeBuildInputs = [
20 makeWrapper
21 unzip
22 ];
23
24 postPatch = ''
25 rm *.bat
26 chmod +x *.sh
27 '';
28
29 installPhase = ''
30 f=$out/share/dex2jar/
31
32 mkdir -p $f $out/bin
33
34 mv * $f
35 for i in $f/*.sh; do
36 n=$(basename ''${i%.sh})
37 makeWrapper $i $out/bin/$n --prefix PATH : ${lib.makeBinPath [ jre ]}
38 done
39 '';
40
41 meta = with lib; {
42 homepage = "https://github.com/pxb1988/dex2jar";
43 description = "Tools to work with android .dex and java .class files";
44 maintainers = with maintainers; [ makefu ];
45 sourceProvenance = with sourceTypes; [ binaryBytecode ];
46 license = licenses.asl20;
47 platforms = platforms.unix;
48 };
49})