Something went wrong. Try again.
What happens if I push all of nixpkgs
Something went wrong. Try again.
1.3 kB · 53 lines
Nix
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354# Version can be selected with the 'version' argument, see generic.nix.{ lib, callPackage, buildDunePackage, ocaml, re, ocamlformat-lib, menhir, ...}@args:
let inherit (callPackage ./generic.nix args) src version library_deps;in
lib.throwIf ( lib.versionAtLeast ocaml.version "5.0" && !lib.versionAtLeast version "0.23" || lib.versionAtLeast ocaml.version "5.1" && !lib.versionAtLeast version "0.25" || lib.versionAtLeast ocaml.version "5.2" && !lib.versionAtLeast version "0.26.2" || lib.versionAtLeast ocaml.version "5.3" && !lib.versionAtLeast version "0.27" ) "ocamlformat ${version} is not available for OCaml ${ocaml.version}"
buildDunePackage { pname = "ocamlformat"; inherit src version;
minimalOCamlVersion = "4.08";
nativeBuildInputs = if lib.versionAtLeast version "0.25.1" then [ ] else [ menhir ];
buildInputs = [ re ] ++ library_deps ++ lib.optionals (lib.versionAtLeast version "0.25.1") [ (ocamlformat-lib.override { inherit version; }) ];
meta = { homepage = "https://github.com/ocaml-ppx/ocamlformat"; description = "Auto-formatter for OCaml code"; maintainers = with lib.maintainers; [ Zimmi48 Julow ]; license = lib.licenses.mit; mainProgram = "ocamlformat"; }; }