nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 57 lines 1.3 kB view raw
1{ 2 lib, 3 fetchurl, 4 buildDunePackage, 5 ounit, 6 ppx_deriving, 7 ppx_sexp_conv, 8 ppxlib, 9 version ? 10 if lib.versionAtLeast ppxlib.version "0.36" then 11 "1.12.0" 12 else if lib.versionAtLeast ppxlib.version "0.26" then 13 "1.11.0" 14 else if lib.versionAtLeast ppxlib.version "0.24.0" then 15 "1.9.1" 16 else 17 throw "ppx_import is not available with ppxlib-${ppxlib.version}", 18}: 19 20buildDunePackage { 21 pname = "ppx_import"; 22 inherit version; 23 24 src = fetchurl { 25 url = 26 let 27 dir = if lib.versionAtLeast version "1.11" then "v${version}" else "${version}"; 28 in 29 "https://github.com/ocaml-ppx/ppx_import/releases/download/${dir}/ppx_import-${version}.tbz"; 30 31 hash = 32 { 33 "1.9.1" = "sha256-0bSY4u44Ds84XPIbcT5Vt4AG/4PkzFKMl9CDGFZyIdI="; 34 "1.11.0" = "sha256-Jmfv1IkQoaTkyxoxp9FI0ChNESqCaoDsA7D4ZUbOrBo="; 35 "1.12.0" = "sha256-1vpYHFl0rEdG3hE+6BCpWmfLvdLvoEx+Jxq0DFrRdJc="; 36 } 37 ."${version}"; 38 }; 39 40 propagatedBuildInputs = [ 41 ppxlib 42 ]; 43 44 checkInputs = [ 45 ounit 46 ppx_deriving 47 ppx_sexp_conv 48 ]; 49 50 doCheck = true; 51 52 meta = { 53 description = "Syntax extension for importing declarations from interface files"; 54 license = lib.licenses.mit; 55 homepage = "https://github.com/ocaml-ppx/ppx_import"; 56 }; 57}