nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 48 lines 1.3 kB view raw
1# Version can be selected with the 'version' argument, see generic.nix. 2{ 3 lib, 4 callPackage, 5 buildDunePackage, 6 ocaml, 7 re, 8 ocamlformat-lib, 9 menhir, 10 ... 11}@args: 12 13let 14 inherit (callPackage ./generic.nix args) src version library_deps; 15in 16buildDunePackage { 17 pname = "ocamlformat"; 18 inherit src version; 19 20 minimalOCamlVersion = "4.08"; 21 22 nativeBuildInputs = if lib.versionAtLeast version "0.25.1" then [ ] else [ menhir ]; 23 24 buildInputs = [ 25 re 26 ] 27 ++ library_deps 28 ++ lib.optionals (lib.versionAtLeast version "0.25.1") [ 29 (ocamlformat-lib.override { inherit version; }) 30 ]; 31 32 meta = { 33 homepage = "https://github.com/ocaml-ppx/ocamlformat"; 34 description = "Auto-formatter for OCaml code"; 35 maintainers = with lib.maintainers; [ 36 Zimmi48 37 Julow 38 ]; 39 license = lib.licenses.mit; 40 mainProgram = "ocamlformat"; 41 broken = 42 lib.versionAtLeast ocaml.version "5.0" && !lib.versionAtLeast version "0.23" 43 || lib.versionAtLeast ocaml.version "5.1" && !lib.versionAtLeast version "0.25" 44 || lib.versionAtLeast ocaml.version "5.2" && !lib.versionAtLeast version "0.26.2" 45 || lib.versionAtLeast ocaml.version "5.3" && !lib.versionAtLeast version "0.27" 46 || lib.versionAtLeast ocaml.version "5.4" && !lib.versionAtLeast version "0.28"; 47 }; 48}