about summary refs log tree commit diff
path: root/pkgs/development/interpreters/mujs/default.nix
blob: 1c0db241c1c84841d866c200094c31eac1a3c8b0 (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
{ lib, stdenv, fetchurl, fetchpatch, readline }:

stdenv.mkDerivation rec {
  pname = "mujs";
  version = "1.3.2";

  src = fetchurl {
    url = "https://mujs.com/downloads/mujs-${version}.tar.xz";
    sha256 = "sha256-SIZZP8aIsM3M0x5ey+Wv560b7iOqaeZnuHGv1d/GQMM=";
  };

  patches = lib.optionals stdenv.isDarwin [
    (fetchpatch {
      # ld: library not found for -l:libmujs.a
      name = "darwin-failures.patch";
      url = "https://git.ghostscript.com/?p=mujs.git;a=patch;h=d592c785c0b2f9fea982ac3fe7b88fdd7c4817fc";
      sha256 = "sha256-/57A7S65LWZFyQIGe+LtqDMu85K1N/hbztXB+/nCDJk=";
      revert = true;
    })
  ];

  buildInputs = [ readline ];

  makeFlags = [ "prefix=$(out)" ];

  meta = with lib; {
    homepage = "https://mujs.com/";
    description = "A lightweight, embeddable Javascript interpreter";
    platforms = platforms.unix;
    maintainers = with maintainers; [ pSub ];
    license = licenses.isc;
  };
}