14 mkCombyPackage = { pname, extraBuildInputs ? [ ], extraNativeInputs ? [ ], preBuild ? "" }:
15 ocamlPackages.buildDunePackage rec {
16 inherit pname preBuild;
19 minimalOcamlVersion = "4.08.1";
22 src = fetchFromGitHub {
23 owner = "comby-tools";
26 sha256 = "sha256-yQrfSzJgJm0OWJxhxst2XjZULIVHeEfPMvMIwH7BYDc=";
29 patches = [ ./comby.patch ];
31 nativeBuildInputs = extraNativeInputs;
35 ocamlPackages.core_kernel
36 ocamlPackages.ocaml_pcre
38 ocamlPackages.mparser-pcre
39 ocamlPackages.angstrom
40 ocamlPackages.ppx_deriving
41 ocamlPackages.ppx_deriving_yojson
42 ocamlPackages.ppx_sexp_conv
43 ocamlPackages.ppx_sexp_message
44 ] ++ extraBuildInputs;
46 nativeCheckInputs = [ cacert ];
49 description = "Tool for searching and changing code structure";
50 mainProgram = "comby";
51 license = lib.licenses.asl20;
52 homepage = "https://comby.dev";
56 combyKernel = mkCombyPackage { pname = "comby-kernel"; };
57 combySemantic = mkCombyPackage { pname = "comby-semantic"; extraBuildInputs = [ ocamlPackages.cohttp-lwt-unix ]; };
62 # tests have to be removed before building otherwise installPhase will fail
63 # cli tests expect a path to the built binary
65 substituteInPlace test/common/dune \
66 --replace "test_cli_list" "" \
67 --replace "test_cli_helper" "" \
68 --replace "test_cli" ""
69 rm test/common/{test_cli_list,test_cli_helper,test_cli}.ml
77 ocamlPackages.shell # This input must appear before `parany` or any other input that propagates `ocamlnet`
79 ocamlPackages.patience_diff
81 ocamlPackages.cohttp-lwt-unix
83 ocamlPackages.textutils
84 ocamlPackages.jst-config
86 ocamlPackages.conduit-lwt-unix
87 ocamlPackages.lwt_react
88 ocamlPackages.tar-unix
90 ocamlPackages.ppx_jane
91 ocamlPackages.ppx_expect
92 ocamlPackages.dune-configurator
95 ] ++ (if !stdenv.isAarch32 && !stdenv.isAarch64 then
96 [ ocamlPackages.hack_parallel ]
100 extraNativeInputs = [