2021-09-26 12:46:18 +00:00
|
|
|
{ ocamlPackages
|
|
|
|
, fetchFromGitHub
|
|
|
|
, lib
|
|
|
|
, zlib
|
|
|
|
, pkg-config
|
|
|
|
, cacert
|
|
|
|
, gmp
|
|
|
|
, libev
|
|
|
|
, autoconf
|
|
|
|
, sqlite
|
|
|
|
, stdenv
|
|
|
|
}:
|
2021-07-24 12:14:16 +00:00
|
|
|
let
|
2021-09-26 12:46:18 +00:00
|
|
|
mkCombyPackage = { pname, extraBuildInputs ? [ ], extraNativeInputs ? [ ], preBuild ? "" }:
|
2021-07-24 12:14:16 +00:00
|
|
|
ocamlPackages.buildDunePackage rec {
|
2021-09-26 12:46:18 +00:00
|
|
|
inherit pname preBuild;
|
2022-09-09 14:08:57 +00:00
|
|
|
version = "1.8.1";
|
2023-01-11 07:51:40 +00:00
|
|
|
duneVersion = "3";
|
|
|
|
minimalOcamlVersion = "4.08.1";
|
2021-07-24 12:14:16 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "comby-tools";
|
|
|
|
repo = "comby";
|
|
|
|
rev = version;
|
2022-09-09 14:08:57 +00:00
|
|
|
sha256 = "sha256-yQrfSzJgJm0OWJxhxst2XjZULIVHeEfPMvMIwH7BYDc=";
|
2021-07-24 12:14:16 +00:00
|
|
|
};
|
|
|
|
|
2022-07-18 16:21:45 +00:00
|
|
|
patches = [ ./comby.patch ];
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
nativeBuildInputs = extraNativeInputs;
|
2021-07-24 12:14:16 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
ocamlPackages.core
|
2022-07-18 16:21:45 +00:00
|
|
|
ocamlPackages.core_kernel
|
2021-07-24 12:14:16 +00:00
|
|
|
ocamlPackages.ocaml_pcre
|
|
|
|
ocamlPackages.mparser
|
|
|
|
ocamlPackages.mparser-pcre
|
|
|
|
ocamlPackages.angstrom
|
2023-02-09 11:40:11 +00:00
|
|
|
ocamlPackages.ppx_deriving
|
|
|
|
ocamlPackages.ppx_deriving_yojson
|
|
|
|
ocamlPackages.ppx_sexp_conv
|
|
|
|
ocamlPackages.ppx_sexp_message
|
2021-07-24 12:14:16 +00:00
|
|
|
] ++ extraBuildInputs;
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ cacert ];
|
2021-07-24 12:14:16 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Tool for searching and changing code structure";
|
|
|
|
license = lib.licenses.asl20;
|
|
|
|
homepage = "https://comby.dev";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
combyKernel = mkCombyPackage { pname = "comby-kernel"; };
|
2021-09-26 12:46:18 +00:00
|
|
|
combySemantic = mkCombyPackage { pname = "comby-semantic"; extraBuildInputs = [ ocamlPackages.cohttp-lwt-unix ]; };
|
|
|
|
in
|
|
|
|
mkCombyPackage {
|
2021-07-24 12:14:16 +00:00
|
|
|
pname = "comby";
|
|
|
|
|
2021-09-26 12:46:18 +00:00
|
|
|
# tests have to be removed before building otherwise installPhase will fail
|
|
|
|
# cli tests expect a path to the built binary
|
|
|
|
preBuild = ''
|
|
|
|
substituteInPlace test/common/dune \
|
|
|
|
--replace "test_cli_list" "" \
|
|
|
|
--replace "test_cli_helper" "" \
|
|
|
|
--replace "test_cli" ""
|
|
|
|
rm test/common/{test_cli_list,test_cli_helper,test_cli}.ml
|
|
|
|
'';
|
|
|
|
|
2021-07-24 12:14:16 +00:00
|
|
|
extraBuildInputs = [
|
|
|
|
zlib
|
|
|
|
gmp
|
|
|
|
libev
|
|
|
|
sqlite
|
|
|
|
ocamlPackages.shell # This input must appear before `parany` or any other input that propagates `ocamlnet`
|
|
|
|
ocamlPackages.lwt
|
|
|
|
ocamlPackages.patience_diff
|
|
|
|
ocamlPackages.toml
|
|
|
|
ocamlPackages.cohttp-lwt-unix
|
|
|
|
ocamlPackages.opium
|
|
|
|
ocamlPackages.textutils
|
|
|
|
ocamlPackages.jst-config
|
|
|
|
ocamlPackages.parany
|
|
|
|
ocamlPackages.conduit-lwt-unix
|
|
|
|
ocamlPackages.lwt_react
|
2022-06-26 10:26:21 +00:00
|
|
|
ocamlPackages.tar-unix
|
2021-07-24 12:14:16 +00:00
|
|
|
ocamlPackages.tls
|
2023-02-09 11:40:11 +00:00
|
|
|
ocamlPackages.ppx_jane
|
|
|
|
ocamlPackages.ppx_expect
|
|
|
|
ocamlPackages.dune-configurator
|
2021-07-24 12:14:16 +00:00
|
|
|
combyKernel
|
2021-09-26 12:46:18 +00:00
|
|
|
combySemantic
|
2021-07-24 12:14:16 +00:00
|
|
|
] ++ (if !stdenv.isAarch32 && !stdenv.isAarch64 then
|
|
|
|
[ ocamlPackages.hack_parallel ]
|
|
|
|
else
|
|
|
|
[ ]);
|
|
|
|
|
|
|
|
extraNativeInputs = [
|
|
|
|
autoconf
|
|
|
|
pkg-config
|
|
|
|
];
|
2021-09-26 12:46:18 +00:00
|
|
|
|
2021-07-24 12:14:16 +00:00
|
|
|
}
|