ocamlformat: init at 0.8
This commit is contained in:
parent
a463643de8
commit
cea4806bc5
50
pkgs/development/tools/ocaml/ocamlformat/default.nix
Normal file
50
pkgs/development/tools/ocaml/ocamlformat/default.nix
Normal file
@ -0,0 +1,50 @@
|
||||
{ stdenv, fetchFromGitHub, ocamlPackages, dune }:
|
||||
|
||||
with ocamlPackages;
|
||||
|
||||
if !stdenv.lib.versionAtLeast ocaml.version "4.05"
|
||||
then throw "ocamlformat is not available for OCaml ${ocaml.version}"
|
||||
else
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "0.8";
|
||||
pname = "ocamlformat";
|
||||
name = "${pname}-${version}";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ocaml-ppx";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "1i7rsbs00p43362yv7z7dw0qsnv7vjf630qk676qvfg7kg422w6j";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
ocaml
|
||||
dune
|
||||
findlib
|
||||
base
|
||||
cmdliner
|
||||
fpath
|
||||
ocaml-migrate-parsetree
|
||||
stdio
|
||||
];
|
||||
|
||||
configurePhase = ''
|
||||
patchShebangs tools/gen_version.sh
|
||||
tools/gen_version.sh src/Version.ml version
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
dune build -p ocamlformat
|
||||
'';
|
||||
|
||||
inherit (dune) installPhase;
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/ocaml-ppx/ocamlformat";
|
||||
description = "Auto-formatter for OCaml code";
|
||||
maintainers = [ stdenv.lib.maintainers.Zimmi48 ];
|
||||
license = stdenv.lib.licenses.mit;
|
||||
inherit (ocamlPackages.ocaml.meta) platforms;
|
||||
};
|
||||
}
|
@ -7266,6 +7266,8 @@ with pkgs;
|
||||
|
||||
ocamlPackages = recurseIntoAttrs ocaml-ng.ocamlPackages;
|
||||
|
||||
ocamlformat = callPackage ../development/tools/ocaml/ocamlformat { };
|
||||
|
||||
orc = callPackage ../development/compilers/orc { };
|
||||
|
||||
metaocaml_3_09 = callPackage ../development/compilers/ocaml/metaocaml-3.09.nix { };
|
||||
|
Loading…
Reference in New Issue
Block a user