From 2620e4e69e7b75f2af0a528515c539d7e0963fb1 Mon Sep 17 00:00:00 2001 From: jared <> Date: Fri, 20 Oct 2023 16:28:50 -0600 Subject: [PATCH] Added `lbf-prelude-to-purescript` and `lbf-plutus-to-purescript` scripts to the frontend --- lambda-buffers-frontend/build.nix | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/lambda-buffers-frontend/build.nix b/lambda-buffers-frontend/build.nix index 45c7b1aa..fabe03b0 100644 --- a/lambda-buffers-frontend/build.nix +++ b/lambda-buffers-frontend/build.nix @@ -67,6 +67,8 @@ config.packages.lbf-pure config.packages.lbf-prelude-to-haskell config.packages.lbf-plutus-to-haskell + config.packages.lbf-prelude-to-purescript + config.packages.lbf-plutus-to-purescript ]; }; }; @@ -123,6 +125,40 @@ work-dir = ".work"; }} $@; ''; + + lbf-prelude-to-purescript = pkgs.writeShellScriptBin "lbf-prelude-to-purescript" '' + export LB_COMPILER=${config.packages.lbc}/bin/lbc; + mkdir autogen; + mkdir .work; + ${config.overlayAttrs.lbf-nix.lbfBuild.buildCall { + files = []; + import-paths = [ config.packages.lbf-prelude ]; + gen = "${config.packages.lbg-purescript}/bin/lbg-purescript"; + gen-classes = ["Prelude.Eq" "Prelude.Json"]; + gen-dir = "autogen"; + gen-opts = ["--config=${config.packages.codegen-configs}/purescript-prelude-base.json"]; + work-dir = ".work"; + }} $@; + ''; + + lbf-plutus-to-purescript = pkgs.writeShellScriptBin "lbf-plutus-to-purescript" '' + export LB_COMPILER=${config.packages.lbc}/bin/lbc; + mkdir autogen; + mkdir .work; + ${config.overlayAttrs.lbf-nix.lbfBuild.buildCall { + files = []; + import-paths = [ config.packages.lbf-prelude config.packages.lbf-plutus ]; + gen = "${config.packages.lbg-purescript}/bin/lbg-purescript"; + gen-classes = [ "Prelude.Eq" "Prelude.Json" "Plutus.V1.PlutusData" ]; + gen-dir = "autogen"; + gen-opts = [ + "--config=${config.packages.codegen-configs}/purescript-prelude-base.json" + "--config=${config.packages.codegen-configs}/purescript-plutus-ctl.json" + ]; + work-dir = ".work"; + }} $@; + ''; + }; inherit (hsNixFlake) checks;