Skip to content

Commit

Permalink
Merge branch 'main' into add_case_match
Browse files Browse the repository at this point in the history
  • Loading branch information
KFoxder authored Mar 15, 2024
2 parents f986682 + 4c7b75b commit f796b09
Show file tree
Hide file tree
Showing 5 changed files with 325 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
_build
*.install
_build
# nix ignores
.direnv
result
.envrc
17 changes: 5 additions & 12 deletions config/ppx.t/run.t
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$ target_os=macos dune describe pp main.ml
$ target_os=macos target_env="" dune describe pp main.ml
[@@@ocaml.ppx.context
{
tool_name = "ppx_driver";
Expand Down Expand Up @@ -40,8 +40,9 @@
(target_os = "freebsd"), (target_os = "netbsd"),
(target_os = "linux"))]
let () = Printf.printf "sys=%s env=%s" Sys.name Env.name

$ dune clean
$ target_os=windows target_arch=x86 dune describe pp main.ml
$ target_os=windows target_arch=x86 target_env="" dune describe pp main.ml
[@@@ocaml.ppx.context
{
tool_name = "ppx_driver";
Expand Down Expand Up @@ -81,7 +82,7 @@
let () = Printf.printf "sys=%s env=%s" Sys.name Env.name

$ dune clean
$ target_os=windows target_arch=arm dune describe pp main.ml
$ target_os=windows target_arch=arm target_env="" dune describe pp main.ml
[@@@ocaml.ppx.context
{
tool_name = "ppx_driver";
Expand Down Expand Up @@ -121,15 +122,7 @@
let () = Printf.printf "sys=%s env=%s" Sys.name Env.name

$ dune clean
$ made_up=false dune exec ./main.exe
sys=unix env=unknown

$ dune clean
$ dune exec ./main.exe
sys=unix env=unknown

$ dune clean
$ target_os=windows target_arch=x86 dune exec ./main.exe
$ target_os=windows target_arch=x86 target_env="" made_up=false dune exec ./main.exe
sys=win32 env=unknown

$ dune clean
Expand Down
1 change: 0 additions & 1 deletion dune-project
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
(lang dune 3.11)
(using mdx 0.4)

(name config)

Expand Down
276 changes: 276 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
description = "Conditional compilation via attributes for OCaml";

inputs.minttea.url = "github:leostera/minttea";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";

outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
perSystem = { config, self', inputs', pkgs, system, ... }:
let
inherit (pkgs) ocamlPackages mkShell;
inherit (ocamlPackages) buildDunePackage;
name = "config";
version = "0.0.1";
in
{
devShells = {
default = mkShell {
buildInputs = [ ocamlPackages.utop ];
inputsFrom = [ self'.packages.default ];
};
};

packages = {
default = buildDunePackage {
inherit version;
pname = name;
propagatedBuildInputs = with ocamlPackages; [
inputs'.minttea.packages.spices
sedlex
ppxlib
];
src = ./.;
};
};
};
};
}

0 comments on commit f796b09

Please sign in to comment.