summary refs log tree commit diff
path: root/pkgs/development/compilers/avian/default.nix
blob: 34d1e64c484f25a1e616b43ec4276df9c33a758d (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, fetchFromGitHub, zlib, jdk, CoreServices, Foundation }:

stdenv.mkDerivation rec {
  pname = "avian";
  version = "1.2.0";

  src = fetchFromGitHub {
    owner = "readytalk";
    repo = "avian";
    rev = "v${version}";
    sha256 = "1j2y45cpqk3x6a743mgpg7z3ivwm7qc9jy6xirvay7ah1qyxmm48";
  };

  buildInputs = [ zlib jdk ]
    ++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices Foundation ];

  NIX_CFLAGS_COMPILE = "-Wno-error";

  postPatch = ''
    substituteInPlace makefile \
        --replace 'g++' 'c++' \
        --replace 'gcc' 'cc'
  '';

  installPhase = ''
    mkdir -p $out/bin
    cp build/*/avian $out/bin/
    cp build/*/avian-dynamic $out/bin/
  '';

  meta = {
    description = "Lightweight Java virtual machine";
    longDescription = ''
      Avian is a lightweight virtual machine and class library designed
      to provide a useful subset of Java’s features, suitable for
      building self-contained applications.
    '';
    homepage = https://readytalk.github.io/avian/;
    license = stdenv.lib.licenses.isc;
    platforms = stdenv.lib.platforms.all;
    maintainers = [ stdenv.lib.maintainers.earldouglas ];
  };
}