Unverified Commit 4edb4dca authored by Ulrik Strid's avatar Ulrik Strid Committed by GitHub
Browse files

Merge pull request #228539 from ligolang/ligo--0_64_2

ligo: 0.60.0 -> 0.64.2
parents 93640c56 f5a8cfa4
Loading
Loading
Loading
Loading
+29 −7
Original line number Diff line number Diff line
@@ -6,21 +6,29 @@
, ocamlPackages
, cacert
, ocaml-crunch
, jq
, mustache-go
, yaml2json
, tezos-rust-libs
}:

ocamlPackages.buildDunePackage rec {
  pname = "ligo";
  version = "0.60.0";
  version = "0.64.2";
  src = fetchFromGitLab {
    owner = "ligolang";
    repo = "ligo";
    rev = version;
    sha256 = "sha256-gyMSpy+F3pF2Kv1ygUs20mrspJ6GtJ6ySyZD7zfZj2w=";
    sha256 = "sha256-/XUJFDH1pv65VeZt57P+AiCegTwCn7OWdaa0D8sw7CI=";
    fetchSubmodules = true;
  };

  # The build picks this up for ligo --version
  LIGO_VERSION = version;
  CHANGELOG_PATH = "./changelog.txt";

  # This is a hack to work around the hack used in the dune files
  OPAM_SWITCH_PREFIX = "${tezos-rust-libs}";

  duneVersion = "3";

@@ -33,6 +41,10 @@ ocamlPackages.buildDunePackage rec {
    ocamlPackages.crunch
    ocamlPackages.menhir
    ocamlPackages.ocaml-recovery-parser
    # deps for changelog
    jq
    mustache-go
    yaml2json
  ];

  buildInputs = with ocamlPackages; [
@@ -60,13 +72,19 @@ ocamlPackages.buildDunePackage rec {
    lambda-term
    tar-unix
    parse-argv

    hacl-star
    prometheus
    # lsp
    linol
    linol-lwt
    ocaml-lsp
    # Test helpers deps
    qcheck
    qcheck-alcotest
    alcotest-lwt

    # vendored tezos' deps
    aches
    aches-lwt
    tezos-plonk
    tezos-bls12-381-polynomial
    ctypes
@@ -78,13 +96,10 @@ ocamlPackages.buildDunePackage rec {
    lwt-canceler
    ipaddr
    bls12-381
    bls12-381-legacy
    bls12-381-signature
    ptime
    mtime
    lwt_log
    ringo
    ringo-lwt
    secp256k1-internal
    resto
    resto-directory
@@ -97,6 +112,13 @@ ocamlPackages.buildDunePackage rec {
    simple-diff
  ];

  preBuild = ''
    # The scripts use `nix-shell` in the shebang which seems to fail
    sed -i -e '1,5d' ./scripts/changelog-generation.sh
    sed -i -e '1,5d' ./scripts/changelog-json.sh
    ./scripts/changelog-generation.sh
  '';

  nativeCheckInputs = [
    cacert
    ocamlPackages.ca-certs
+36 −23
Original line number Diff line number Diff line
{ lib, fetchFromGitLab, rustPlatform }:
{ lib, fetchFromGitLab, stdenv, llvmPackages_12, cargo }:

rustPlatform.buildRustPackage rec {
stdenv.mkDerivation rec {
  version = "1.5";
  pname = "tezos-rust-libs";
  version = "1.0";

  src = fetchFromGitLab {
    owner = "tezos";
    repo = "tezos-rust-libs";
    rev = "v${version}";
    sha256 = "1ffkzbvb0ls4wk9205g3xh2c26cmwnl68x43gh6dm9z4xsic94v5";
    sha256 = "sha256-SuCqDZDXmWdGI/GN+3nYcUk66jnW5FQQaeTB76/rvaw=";
  };

  cargoSha256 = "0dgyqfr3dvvdwdi1wvpd7v9j21740jy4zwrwiwknw7csb4bq9wfx";
  nativeBuildInputs = [ llvmPackages_12.llvm cargo ];
  propagatedBuildDeps = [ llvmPackages_12.libllvm ];

  preBuild = ''
    mkdir .cargo
    mv cargo-config .cargo/config
  '';
  buildPhase = ''
    runHook preBuild

    cargo build \
      --target-dir target-librustzcash \
      --package librustzcash \
      --release

    cargo build \
      --target-dir target-wasmer \
      --package wasmer-c-api \
      --no-default-features \
      --features singlepass,cranelift,wat,middlewares,universal \
      --release

  postInstall = ''
    cp -r rustc-bls12-381/include $out/include
    cp -r librustzcash/include $out
    cp -r $out/lib $out/tmp
    mkdir $out/lib/tezos-rust-libs
    mv $out/tmp/ $out/lib/tezos-rust-libs/
    runHook postBuild
  '';

  doCheck = true;
  installPhase = ''
    runHook preInstall

  meta = {
    homepage = "https://gitlab.com/tezos/tezos-rust-libs";
    description = "Tezos: all rust dependencies and their dependencies";
    license = lib.licenses.mit;
    maintainers = [ lib.maintainers.ulrikstrid ];
  };
    mkdir -p $out/lib/tezos-rust-libs/rust
    cp "librustzcash/include/librustzcash.h" \
        "target-librustzcash/release/librustzcash.a" \
        "wasmer-2.3.0/lib/c-api/wasm.h" \
        "wasmer-2.3.0/lib/c-api/wasmer.h" \
        "target-wasmer/release/libwasmer.a" \
        "$out/lib/tezos-rust-libs"
    cp -r "librustzcash/include/rust" "$out/lib/tezos-rust-libs"

    runHook postInstall
  '';

  cargoVendorDir = "./vendor";
}
+16 −0
Original line number Diff line number Diff line
{ lib, buildDunePackage, ringo }:

buildDunePackage {
  pname = "aches";
  inherit (ringo) src version;

  propagatedBuildInputs = [
    ringo
  ];

  meta = {
    description = "Caches (bounded-size stores) for in-memory values and for resources";
    license = lib.licenses.mit;
    maintainers = [ lib.maintainers.ulrikstrid ];
  };
}
+17 −0
Original line number Diff line number Diff line
{ lib, buildDunePackage, ringo, aches, lwt }:

buildDunePackage {
  pname = "aches-lwt";
  inherit (ringo) src version;

  propagatedBuildInputs = [
    aches
    lwt
  ];

  meta = {
    description = "Caches (bounded-size stores) for Lwt promises";
    license = lib.licenses.mit;
    maintainers = [ lib.maintainers.ulrikstrid ];
  };
}
+26 −0
Original line number Diff line number Diff line
{ lib
, fetchurl
, buildDunePackage
, topkg
, findlib
, ocamlbuild
, ocaml
}:

buildDunePackage rec {
  pname = "asetmap";
  version = "0.8.1";
  src = fetchurl {
    url = "https://github.com/dbuenzli/asetmap/archive/refs/tags/v${version}.tar.gz";
    sha256 = "051ky0k62xp4inwi6isif56hx5ggazv4jrl7s5lpvn9cj8329frj";
  };

  strictDeps = true;

  nativeBuildInputs = [ topkg findlib ocamlbuild ocaml ];
  buildInputs = [ topkg ];

  inherit (topkg) buildPhase installPhase;

  meta = { inherit (ocaml.meta) platforms; };
}
Loading