1{ stdenv
2, lib
3, fetchFromGitLab
4, git
5, coq
6, ocamlPackages
7, cacert
8, ocaml-crunch
9, jq
10, mustache-go
11, yaml2json
12, tezos-rust-libs
13, darwin
14}:
15
16ocamlPackages.buildDunePackage rec {
17 pname = "ligo";
18 version = "1.7.1";
19 src = fetchFromGitLab {
20 owner = "ligolang";
21 repo = "ligo";
22 rev = version;
23 hash = "sha256-pBoLgS/9MLMrc98niI+o2JoJ3gpvhyRY2o9GmVc5hIA=";
24 fetchSubmodules = true;
25 };
26
27 # The build picks this up for ligo --version
28 LIGO_VERSION = version;
29
30 # This is a hack to work around the hack used in the dune files
31 OPAM_SWITCH_PREFIX = "${tezos-rust-libs}";
32
33 nativeBuildInputs = [
34 ocaml-crunch
35 git
36 coq
37 ocamlPackages.crunch
38 ocamlPackages.menhir
39 ocamlPackages.ocaml-recovery-parser
40 # deps for changelog
41 jq
42 mustache-go
43 yaml2json
44 ];
45
46 buildInputs = with ocamlPackages; [
47 coq
48 menhir
49 menhirLib
50 qcheck
51 ocamlgraph
52 bisect_ppx
53 decompress
54 fileutils
55 ppx_deriving
56 ppx_deriving_yojson
57 ppx_yojson_conv
58 ppx_expect
59 ppx_import
60 terminal_size
61 ocaml-recovery-parser
62 yojson
63 getopt
64 core
65 core_unix
66 pprint
67 linenoise
68 crunch
69 semver
70 lambda-term
71 tar-unix
72 parse-argv
73 hacl-star
74 prometheus
75 lwt_ppx
76 msgpck
77 # lsp
78 linol
79 linol-lwt
80 ocaml-lsp
81 # Test helpers deps
82 qcheck
83 qcheck-alcotest
84 alcotest-lwt
85 # vendored tezos' deps
86 aches
87 aches-lwt
88 ctypes
89 ctypes_stubs_js
90 class_group_vdf
91 dune-configurator
92 hacl-star
93 hacl-star-raw
94 lwt-canceler
95 ipaddr
96 bls12-381
97 bls12-381-signature
98 ptime
99 mtime
100 lwt_log
101 secp256k1-internal
102 resto
103 resto-directory
104 resto-cohttp-self-serving-client
105 irmin-pack
106 ezjsonm
107 data-encoding
108 pure-splitmix
109 zarith_stubs_js
110 simple-diff
111 seqes
112 stdint
113 tezt
114 ] ++ lib.optionals stdenv.isDarwin [
115 darwin.apple_sdk.frameworks.Security
116 ];
117
118 nativeCheckInputs = [
119 cacert
120 ocamlPackages.ca-certs
121 ];
122
123 doCheck = false; # Tests fail, but could not determine the reason
124
125 meta = with lib; {
126 homepage = "https://ligolang.org/";
127 downloadPage = "https://ligolang.org/docs/intro/installation";
128 description = "Friendly Smart Contract Language for Tezos";
129 mainProgram = "ligo";
130 license = licenses.mit;
131 platforms = ocamlPackages.ocaml.meta.platforms;
132 broken = stdenv.isLinux && stdenv.isAarch64;
133 maintainers = with maintainers; [ ulrikstrid ];
134 };
135}