From 0ffff40447f2a91ec6bb146d37a0b68c77713de8 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Tue, 14 Oct 2025 07:58:03 +0200 Subject: [PATCH] =?UTF-8?q?ocamlPackages.ppx=5Fimport:=201.11.0=20?= =?UTF-8?q?=E2=86=92=201.12.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ocaml-modules/ppx_import/default.nix | 80 ++++++++++--------- 1 file changed, 41 insertions(+), 39 deletions(-) diff --git a/pkgs/development/ocaml-modules/ppx_import/default.nix b/pkgs/development/ocaml-modules/ppx_import/default.nix index 349bb527b3da..fdd59a094f5e 100644 --- a/pkgs/development/ocaml-modules/ppx_import/default.nix +++ b/pkgs/development/ocaml-modules/ppx_import/default.nix @@ -2,54 +2,56 @@ lib, fetchurl, buildDunePackage, - ocaml, ounit, ppx_deriving, ppx_sexp_conv, ppxlib, - version ? if lib.versionAtLeast ocaml.version "4.11" then "1.11.0" else "1.9.1", + version ? + if lib.versionAtLeast ppxlib.version "0.36" then + "1.12.0" + else if lib.versionAtLeast ppxlib.version "0.26" then + "1.11.0" + else if lib.versionAtLeast ppxlib.version "0.24.0" then + "1.9.1" + else + throw "ppx_import is not available with ppxlib-${ppxlib.version}", }: -lib.throwIfNot (lib.versionAtLeast ppxlib.version "0.24.0") - "ppx_import is not available with ppxlib-${ppxlib.version}" +buildDunePackage { + pname = "ppx_import"; + inherit version; - buildDunePackage - rec { - pname = "ppx_import"; - inherit version; + src = fetchurl { + url = + let + dir = if lib.versionAtLeast version "1.11" then "v${version}" else "${version}"; + in + "https://github.com/ocaml-ppx/ppx_import/releases/download/${dir}/ppx_import-${version}.tbz"; - minimalOCamlVersion = "4.05"; + hash = + { + "1.9.1" = "sha256-0bSY4u44Ds84XPIbcT5Vt4AG/4PkzFKMl9CDGFZyIdI="; + "1.11.0" = "sha256-Jmfv1IkQoaTkyxoxp9FI0ChNESqCaoDsA7D4ZUbOrBo="; + "1.12.0" = "sha256-1vpYHFl0rEdG3hE+6BCpWmfLvdLvoEx+Jxq0DFrRdJc="; + } + ."${version}"; + }; - src = fetchurl { - url = - let - dir = if lib.versionAtLeast version "1.11" then "v${version}" else "${version}"; - in - "https://github.com/ocaml-ppx/ppx_import/releases/download/${dir}/ppx_import-${version}.tbz"; + propagatedBuildInputs = [ + ppxlib + ]; - hash = - { - "1.9.1" = "sha256-0bSY4u44Ds84XPIbcT5Vt4AG/4PkzFKMl9CDGFZyIdI="; - "1.11.0" = "sha256-Jmfv1IkQoaTkyxoxp9FI0ChNESqCaoDsA7D4ZUbOrBo="; - } - ."${version}"; - }; + checkInputs = [ + ounit + ppx_deriving + ppx_sexp_conv + ]; - propagatedBuildInputs = [ - ppxlib - ]; + doCheck = true; - checkInputs = [ - ounit - ppx_deriving - ppx_sexp_conv - ]; - - doCheck = true; - - meta = { - description = "Syntax extension for importing declarations from interface files"; - license = lib.licenses.mit; - homepage = "https://github.com/ocaml-ppx/ppx_import"; - }; - } + meta = { + description = "Syntax extension for importing declarations from interface files"; + license = lib.licenses.mit; + homepage = "https://github.com/ocaml-ppx/ppx_import"; + }; +}