Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at fix-function-merge 105 lines 2.7 kB view raw
1{ ocamlPackages 2, fetchFromGitHub 3, lib 4, zlib 5, pkg-config 6, cacert 7, gmp 8, libev 9, autoconf 10, sqlite 11, stdenv 12}: 13let 14 mkCombyPackage = { pname, extraBuildInputs ? [ ], extraNativeInputs ? [ ], preBuild ? "" }: 15 ocamlPackages.buildDunePackage rec { 16 inherit pname preBuild; 17 version = "1.8.1"; 18 duneVersion = "3"; 19 minimalOCamlVersion = "4.08.1"; 20 doCheck = true; 21 22 src = fetchFromGitHub { 23 owner = "comby-tools"; 24 repo = "comby"; 25 rev = version; 26 sha256 = "sha256-yQrfSzJgJm0OWJxhxst2XjZULIVHeEfPMvMIwH7BYDc="; 27 }; 28 29 patches = [ ./comby.patch ]; 30 31 nativeBuildInputs = extraNativeInputs; 32 33 buildInputs = [ 34 ocamlPackages.core 35 ocamlPackages.core_kernel 36 ocamlPackages.ocaml_pcre 37 ocamlPackages.mparser 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; 45 46 nativeCheckInputs = [ cacert ]; 47 48 meta = { 49 description = "Tool for searching and changing code structure"; 50 mainProgram = "comby"; 51 license = lib.licenses.asl20; 52 homepage = "https://comby.dev"; 53 }; 54 }; 55 56 combyKernel = mkCombyPackage { pname = "comby-kernel"; }; 57 combySemantic = mkCombyPackage { pname = "comby-semantic"; extraBuildInputs = [ ocamlPackages.cohttp-lwt-unix ]; }; 58in 59mkCombyPackage { 60 pname = "comby"; 61 62 # tests have to be removed before building otherwise installPhase will fail 63 # cli tests expect a path to the built binary 64 preBuild = '' 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 70 ''; 71 72 extraBuildInputs = [ 73 zlib 74 gmp 75 libev 76 sqlite 77 ocamlPackages.shell # This input must appear before `parany` or any other input that propagates `ocamlnet` 78 ocamlPackages.lwt 79 ocamlPackages.patience_diff 80 ocamlPackages.toml 81 ocamlPackages.cohttp-lwt-unix 82 ocamlPackages.opium 83 ocamlPackages.textutils 84 ocamlPackages.jst-config 85 ocamlPackages.parany 86 ocamlPackages.conduit-lwt-unix 87 ocamlPackages.lwt_react 88 ocamlPackages.tar-unix 89 ocamlPackages.tls 90 ocamlPackages.ppx_jane 91 ocamlPackages.ppx_expect 92 ocamlPackages.dune-configurator 93 combyKernel 94 combySemantic 95 ] ++ (if !stdenv.isAarch32 && !stdenv.isAarch64 then 96 [ ocamlPackages.hack_parallel ] 97 else 98 [ ]); 99 100 extraNativeInputs = [ 101 autoconf 102 pkg-config 103 ]; 104 105}