nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 97 lines 2.1 kB view raw
1{ 2 buildDunePackage, 3 cmdliner, 4 cppo, 5 dune-build-info, 6 fetchurl, 7 jq, 8 lib, 9 makeWrapper, 10 menhirLib, 11 merlin, 12 nodejs, 13 ocaml, 14 ounit2, 15 ppxlib, 16 reason, 17 stdenv, 18 tree, 19}: 20 21let 22 pname = "melange"; 23 versionHash = 24 if lib.versionAtLeast ocaml.version "5.4" then 25 { 26 version = "6.0.1-54"; 27 hash = "sha256-bV5TD8qlLt7wQdm9W0TyhDDBFFo/PdJXGgiscnsBFmc="; 28 } 29 else if lib.versionAtLeast ocaml.version "5.3" then 30 { 31 version = "6.0.1-53"; 32 hash = "sha256-e1/RIsFsKeAbc2wgQf1Hhta+nyAXIuEP7uatXrU9cLs="; 33 } 34 else if lib.versionAtLeast ocaml.version "5.2" then 35 { 36 version = "5.1.0-52"; 37 hash = "sha256-EGIInGCo3JADYyE4mLw5Fzkm4OB+V9yi2ayV0lVq3v0="; 38 } 39 else if lib.versionAtLeast ocaml.version "5.1" then 40 { 41 version = "5.1.0-51"; 42 hash = "sha256-DIF8vZLEKsFf6m5tl1/T6zqjHyKxDMois2h//tDhsJI="; 43 } 44 else if lib.versionAtLeast ocaml.version "5.0" then 45 throw "melange is not available for OCaml ${ocaml.version}" 46 else 47 { 48 version = "5.1.0-414"; 49 hash = "sha256-Sv1XyOqCNhICTsXzetXh/zqX/tdTupYZ0Q1nZRLfpe0="; 50 }; 51 version = versionHash.version; 52 hash = versionHash.hash; 53in 54buildDunePackage { 55 inherit pname; 56 inherit version; 57 minimalOCamlVersion = "4.14"; 58 src = fetchurl { 59 url = "https://github.com/melange-re/${pname}/releases/download/${version}/${pname}-${version}.tbz"; 60 inherit hash; 61 }; 62 nativeBuildInputs = [ 63 cppo 64 makeWrapper 65 ]; 66 buildInputs = [ 67 cmdliner 68 dune-build-info 69 ]; 70 propagatedBuildInputs = [ 71 menhirLib 72 ppxlib 73 ]; 74 doCheck = false; 75 nativeCheckInputs = [ 76 jq 77 merlin 78 nodejs 79 reason 80 tree 81 ]; 82 checkInputs = [ 83 ounit2 84 ]; 85 postInstall = '' 86 wrapProgram "$out/bin/melc" --set MELANGELIB "$OCAMLFIND_DESTDIR/melange/melange:$OCAMLFIND_DESTDIR/melange/js/melange" 87 ''; 88 meta = { 89 description = "Toolchain to produce JS from Reason/OCaml"; 90 homepage = "https://melange.re/"; 91 mainProgram = "melc"; 92 license = lib.licenses.lgpl3; 93 maintainers = [ 94 lib.maintainers.vog 95 ]; 96 }; 97}