about summary refs log tree commit diff
path: root/pkgs/development/interpreters/janet/default.nix
blob: 098a7fe7d3a10405db2a4976be41963e71f955bb (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
{ lib, stdenv, fetchFromGitHub, meson, ninja }:

stdenv.mkDerivation rec {
  pname = "janet";
  version = "1.21.2";

  src = fetchFromGitHub {
    owner = "janet-lang";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-6E726+DLs1hCUbr2/rqIdSn8u94LLFdKBBHkbB4rgm0=";
  };

  # This release fails the test suite on darwin, remove when debugged.
  # See https://github.com/NixOS/nixpkgs/pull/150618 for discussion.
  patches = lib.optionals stdenv.isDarwin ./darwin-remove-net-test.patch;

  postPatch = ''
    substituteInPlace janet.1 \
      --replace /usr/local/ $out/
  '';

  nativeBuildInputs = [ meson ninja ];

  mesonFlags = [ "-Dgit_hash=release" ];

  doCheck = true;

  meta = with lib; {
    description = "Janet programming language";
    homepage = "https://janet-lang.org/";
    license = licenses.mit;
    maintainers = with maintainers; [ andrewchambers peterhoeg ];
    platforms = platforms.all;
    # Marked as broken when patch is applied, see comment above patch.
    broken = stdenv.isDarwin;
  };
}