at master 59 lines 1.3 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchurl, 5 ocaml, 6 findlib, 7 ocamlbuild, 8 cmdliner, 9 topkg, 10 uchar, 11 version ? 12 if lib.versionAtLeast ocaml.version "4.08" then 13 "1.0.4" 14 else if lib.versionAtLeast ocaml.version "4.03" then 15 "1.0.3" 16 else 17 throw "uutf is not available with OCaml ${ocaml.version}", 18}: 19 20stdenv.mkDerivation { 21 name = "ocaml${ocaml.version}-uutf-${version}"; 22 inherit version; 23 24 src = fetchurl { 25 url = "https://erratique.ch/software/uutf/releases/uutf-${version}.tbz"; 26 hash = 27 { 28 "1.0.3" = "sha256-h3KlYT0ecCmM4U3zMkGjaF8h5O9r20zwP+mF+x7KBWg="; 29 "1.0.4" = "sha256-p6V45q+RSaiJThjjtHWchWWTemnGyaznowu/BIRhnKg="; 30 } 31 ."${version}"; 32 }; 33 34 nativeBuildInputs = [ 35 ocaml 36 ocamlbuild 37 findlib 38 topkg 39 ]; 40 buildInputs = [ 41 topkg 42 cmdliner 43 ]; 44 propagatedBuildInputs = [ uchar ]; 45 46 strictDeps = true; 47 48 inherit (topkg) buildPhase installPhase; 49 50 meta = with lib; { 51 description = "Non-blocking streaming Unicode codec for OCaml"; 52 homepage = "https://erratique.ch/software/uutf"; 53 changelog = "https://raw.githubusercontent.com/dbuenzli/uutf/refs/tags/v${version}/CHANGES.md"; 54 license = licenses.isc; 55 maintainers = [ maintainers.vbgl ]; 56 mainProgram = "utftrip"; 57 inherit (ocaml.meta) platforms; 58 }; 59}