nixpkgs/pkgs/development/compilers/ligo/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

153 lines
3.1 KiB
Nix
Raw Normal View History

2022-12-07 15:12:39 +00:00
{ stdenv
, lib
2021-09-21 09:11:20 +00:00
, fetchFromGitLab
, git
2021-09-21 09:11:20 +00:00
, coq
2022-10-11 07:24:21 +00:00
, ocamlPackages
2021-09-21 09:11:20 +00:00
, cacert
, ocaml-crunch
2023-04-27 14:31:24 +00:00
, jq
, mustache-go
, yaml2json
, tezos-rust-libs
2023-05-05 13:02:39 +00:00
, darwin
2021-09-21 09:11:20 +00:00
}:
2022-10-11 07:24:21 +00:00
ocamlPackages.buildDunePackage rec {
2021-09-21 09:11:20 +00:00
pname = "ligo";
2023-08-16 15:06:29 +00:00
version = "0.72.0";
2021-09-21 09:11:20 +00:00
src = fetchFromGitLab {
owner = "ligolang";
repo = "ligo";
2021-10-22 08:54:19 +00:00
rev = version;
2023-08-16 15:06:29 +00:00
sha256 = "sha256-DQ3TxxLxi8/W1+uBX7NEBIsVXBKnJBa6YNRBFleNrEA=";
fetchSubmodules = true;
2021-09-21 09:11:20 +00:00
};
postPatch = ''
substituteInPlace "vendors/tezos-ligo/src/lib_hacl/hacl.ml" \
--replace \
"Hacl.NaCl.Noalloc.Easy.secretbox ~pt:msg ~n:nonce ~key ~ct:cmsg" \
"Hacl.NaCl.Noalloc.Easy.secretbox ~pt:msg ~n:nonce ~key ~ct:cmsg ()" \
--replace \
"Hacl.NaCl.Noalloc.Easy.box_afternm ~pt:msg ~n:nonce ~ck:k ~ct:cmsg" \
"Hacl.NaCl.Noalloc.Easy.box_afternm ~pt:msg ~n:nonce ~ck:k ~ct:cmsg ()"
substituteInPlace "vendors/tezos-ligo/src/lib_crypto/crypto_box.ml" \
--replace \
"secretbox_open ~key ~nonce ~cmsg ~msg" \
"secretbox_open ~key ~nonce ~cmsg ~msg ()" \
--replace \
"Box.box_open ~k ~nonce ~cmsg ~msg" \
"Box.box_open ~k ~nonce ~cmsg ~msg ()"
'';
2021-09-21 09:11:20 +00:00
# The build picks this up for ligo --version
2021-10-22 08:54:19 +00:00
LIGO_VERSION = version;
2023-04-27 14:31:24 +00:00
# This is a hack to work around the hack used in the dune files
OPAM_SWITCH_PREFIX = "${tezos-rust-libs}";
2021-09-21 09:11:20 +00:00
2022-10-11 07:24:21 +00:00
duneVersion = "3";
strictDeps = true;
nativeBuildInputs = [
ocaml-crunch
git
coq
2022-10-11 07:24:21 +00:00
ocamlPackages.crunch
ocamlPackages.menhir
ocamlPackages.ocaml-recovery-parser
2023-04-27 14:31:24 +00:00
# deps for changelog
jq
mustache-go
yaml2json
];
2022-10-11 07:24:21 +00:00
buildInputs = with ocamlPackages; [
2021-09-21 09:11:20 +00:00
coq
menhir
menhirLib
qcheck
ocamlgraph
bisect_ppx
2022-10-11 07:24:21 +00:00
decompress
2021-09-21 09:11:20 +00:00
ppx_deriving
ppx_deriving_yojson
2023-08-16 15:06:29 +00:00
ppx_yojson_conv
2021-09-21 09:11:20 +00:00
ppx_expect
ppx_import
terminal_size
ocaml-recovery-parser
2021-09-21 09:11:20 +00:00
yojson
getopt
core
core_unix
2021-09-21 09:11:20 +00:00
pprint
linenoise
crunch
2022-10-11 07:24:21 +00:00
semver
lambda-term
tar-unix
parse-argv
2023-04-27 14:31:24 +00:00
hacl-star
prometheus
# lsp
linol
linol-lwt
ocaml-lsp
# Test helpers deps
qcheck
qcheck-alcotest
alcotest-lwt
# vendored tezos' deps
2023-04-27 14:31:24 +00:00
aches
aches-lwt
ctypes
2022-10-11 07:24:21 +00:00
ctypes_stubs_js
class_group_vdf
dune-configurator
hacl-star
hacl-star-raw
lwt-canceler
ipaddr
bls12-381
bls12-381-signature
ptime
mtime_1
lwt_log
secp256k1-internal
resto
resto-directory
resto-cohttp-self-serving-client
irmin-pack
ezjsonm
2021-09-21 09:11:20 +00:00
data-encoding
2022-10-11 07:24:21 +00:00
pure-splitmix
zarith_stubs_js
2023-02-20 08:57:14 +00:00
simple-diff
2023-06-08 14:00:16 +00:00
seqes
stdint
2023-05-05 13:02:39 +00:00
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
2021-09-21 09:11:20 +00:00
];
nativeCheckInputs = [
2021-09-21 09:11:20 +00:00
cacert
2022-10-11 07:24:21 +00:00
ocamlPackages.ca-certs
2021-09-21 09:11:20 +00:00
];
doCheck = false; # Tests fail, but could not determine the reason
2021-09-21 09:11:20 +00:00
meta = with lib; {
homepage = "https://ligolang.org/";
downloadPage = "https://ligolang.org/docs/intro/installation";
description = "A friendly Smart Contract Language for Tezos";
license = licenses.mit;
2022-10-11 07:24:21 +00:00
platforms = ocamlPackages.ocaml.meta.platforms;
2022-12-07 15:12:39 +00:00
broken = stdenv.isLinux && stdenv.isAarch64;
2021-09-21 09:11:20 +00:00
maintainers = with maintainers; [ ulrikstrid ];
};
}