Skip to content

Commit

Permalink
build offline lifter
Browse files Browse the repository at this point in the history
  • Loading branch information
ailrst committed Jan 21, 2025
1 parent 4890de3 commit 005d4da
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 11 deletions.
16 changes: 5 additions & 11 deletions aslp/asli.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,30 @@

buildDunePackage {
pname = "asli";
version = "cpp-backend-test-unstable-2024-12-27";
version = "offline-package-2025-01-21";

minimalOCamlVersion = "4.09";

src = fetchFromGitHub {
owner = "UQ-PAC";
repo = "aslp";
rev = "dde3c1de0044e812c2badfa53f18b5da929546f4";
hash = "sha256-85y72OMSO6Bw0LcPSryRYnLUYKbNwq3DyQiMX6D3oGs=";
rev = "export-offline-lifter";
hash = "sha256-HmdHfbfrqLRmvS8EjSqgiu/vWF8BEm7E6DS7MecX6Qw=";
};

checkInputs = [ alcotest ];
nativeCheckInputs = [ jdk ];
buildInputs = [ linenoise ppx_blob ];
nativeBuildInputs = [ ott menhir ];
propagatedBuildInputs = [ dune-site z3 pcre pprint zarith ocaml_z3 ocaml_pcre yojson cohttp-lwt-unix mlbdd ];
propagatedBuildInputs = [ z3 pcre pprint zarith ocaml_z3 ocaml_pcre yojson cohttp-lwt-unix mlbdd ];

preConfigure = ''
mkdir -p $out/share/asli
cp -rv prelude.asl mra_tools tests $out/share/asli
'';

postInstall = ''
mv -v $out/bin/asli $out/bin/aslp
cp -v $out/bin/asli $out/bin/aslp
'';

env = {
Expand All @@ -71,12 +71,6 @@ buildDunePackage {
command = "aslp --version";
version = "ASL";
};

tests.aslp-server = testers.testVersion {
package = asli;
command = "command -v aslp-server";
version = "aslp-server";
};
};

meta = {
Expand Down
33 changes: 33 additions & 0 deletions aslp/aslp_offline.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{ lib
, fetchFromGitHub
, buildDunePackage
, pcre
, ott
, menhir
, asli
, alcotest
}:

buildDunePackage {
pname = "aslp_offline";
version = asli.version;

minimalOCamlVersion = "4.09";

src = asli.src ;

checkInputs = [ alcotest ];
nativeCheckInputs = [ ];
buildInputs = [ asli ];
nativeBuildInputs = [ asli ];
propagatedBuildInputs = [ ];

doCheck = true;

meta = {
homepage = "https://github.com/UQ-PAC/aslp";
description = "ASL offline lifter generated from ARM's MRA.";
maintainers = with lib.maintainers; [ katrinafyi ];
mainProgram = "offline_sem";
};
}
3 changes: 3 additions & 0 deletions aslp/overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ final: prev:
inherit (final.ocamlPackages_pac) aslp asli;
inherit (final.ocamlPackages_pac_5) aslp_web;
inherit (final.ocamlPackages_pac_5) aslp-server;
inherit (final.ocamlPackages_pac) aslp_offline;

overlay_ocamlPackages = ofinal: oprev: {
asli = ofinal.callPackage ./asli.nix { inherit (final) z3; ocaml_z3 = ofinal.z3; };
Expand All @@ -16,6 +17,8 @@ final: prev:
zarith_stubs_js_0_17 = ofinal.callPackage ./zarith_stubs_js.nix { };
aslp_web = ofinal.callPackage ./aslp_web.nix { zarith_stubs_js = ofinal.zarith_stubs_js_0_17; };

aslp_offline = ofinal.callPackage ./aslp_offline.nix { };

mlbdd = ofinal.callPackage ./mlbdd.nix { };
cohttp = oprev.cohttp.overrideAttrs (p: rec {
version = "6.0.0";
Expand Down

0 comments on commit 005d4da

Please sign in to comment.