summary refs log tree commit diff
path: root/pkgs/development/compilers/scryer-prolog/default.nix
blob: 0d4d843664cac557385e3fd7db31a3edae29264d (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
44
45
46
47
48
49
50
51
{ stdenv
, lib
, fetchFromGitHub
, fetchpatch
, rustPlatform
, rustfmt
, gmp
, libmpc
, mpfr
, openssl
, pkg-config
}:

rustPlatform.buildRustPackage rec {
  pname = "scryer-prolog";
  version = "0.9.0";

  src = fetchFromGitHub {
    owner = "mthom";
    repo = "scryer-prolog";
    rev = "v${version}";
    sha256 = "3NHpEg6QaUaqbBCq8uM5hFcqS24q4XrOnKjMmn8Z1Dg=";
  };

  cargoPatches = [
    # Use system openssl, gmp, mpc and mpfr.
    ./cargo.patch

    ./fix-tests.patch

    # Avoid testing failing with "couldn't save history"
    (fetchpatch {
      name = "fix-tests-1";
      url = "https://patch-diff.githubusercontent.com/raw/mthom/scryer-prolog/pull/1342.patch";
      sha256 = "2N0AOkFuf+H/aUn2QTXgmqjmvShTxHxB6kNuNdNoVRI=";
    })
  ];

  cargoSha256 = "nqAHVXAmTW9mdE2L2yhpOTz16JbYgQUmCgiFq9pBzUU=";

  nativeBuildInputs = [ pkg-config rustfmt];
  buildInputs = [ openssl gmp libmpc mpfr ];

  meta = with lib; {
    broken = stdenv.isDarwin;
    description = "A modern Prolog implementation written mostly in Rust.";
    homepage = "https://github.com/mthom/scryer-prolog";
    license = with licenses; [ bsd3 ];
    maintainers = with maintainers; [ malbarbo ];
  };
}