From e0c25ec2bd95f5d89e2ecce5343c445544cdf098 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Tue, 26 Sep 2023 16:07:27 +0200 Subject: [PATCH 1/3] =?UTF-8?q?ocamlPackages.ocamlformat:=200.26.0=20?= =?UTF-8?q?=E2=86=92=200.26.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/development/ocaml-modules/ocamlformat/generic.nix | 1 + pkgs/development/ocaml-modules/ocamlformat/ocamlformat.nix | 2 +- pkgs/top-level/all-packages.nix | 2 +- pkgs/top-level/ocaml-packages.nix | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/development/ocaml-modules/ocamlformat/generic.nix b/pkgs/development/ocaml-modules/ocamlformat/generic.nix index 215c0268562b..f724531ca12e 100644 --- a/pkgs/development/ocaml-modules/ocamlformat/generic.nix +++ b/pkgs/development/ocaml-modules/ocamlformat/generic.nix @@ -23,6 +23,7 @@ rec { "0.24.1" = "sha256-AjQl6YGPgOpQU3sjcaSnZsFJqZV9BYB+iKAE0tX0Qc4="; "0.25.1" = "sha256-3I8qMwyjkws2yssmI7s2Dti99uSorNKT29niJBpv0z0="; "0.26.0" = "sha256-AxSUq3cM7xCo9qocvrVmDkbDqmwM1FexEP7IWadeh30="; + "0.26.1" = "sha256-2gBuQn8VuexhL7gI1EZZm9m3w+4lq+s9VVdHpw10xtc="; }."${version}"; }; diff --git a/pkgs/development/ocaml-modules/ocamlformat/ocamlformat.nix b/pkgs/development/ocaml-modules/ocamlformat/ocamlformat.nix index a2456dbef3b9..8dfc6838613b 100644 --- a/pkgs/development/ocaml-modules/ocamlformat/ocamlformat.nix +++ b/pkgs/development/ocaml-modules/ocamlformat/ocamlformat.nix @@ -5,7 +5,7 @@ , re , ocamlformat-lib , menhir -, version ? "0.26.0" +, version ? "0.26.1" }: let inherit (callPackage ./generic.nix { inherit version; }) src library_deps; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 91b3c4469f1a..7c6b50d1213c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16857,7 +16857,7 @@ with pkgs; ocamlformat # latest version ocamlformat_0_19_0 ocamlformat_0_20_0 ocamlformat_0_20_1 ocamlformat_0_21_0 ocamlformat_0_22_4 ocamlformat_0_23_0 ocamlformat_0_24_1 ocamlformat_0_25_1 - ocamlformat_0_26_0; + ocamlformat_0_26_0 ocamlformat_0_26_1; orc = callPackage ../development/compilers/orc { }; diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index e6cbbec2da74..282fd52bb587 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -1264,6 +1264,7 @@ let ocamlformat_0_24_1 = ocamlformat.override { version = "0.24.1"; }; ocamlformat_0_25_1 = ocamlformat.override { version = "0.25.1"; }; ocamlformat_0_26_0 = ocamlformat.override { version = "0.26.0"; }; + ocamlformat_0_26_1 = ocamlformat.override { version = "0.26.1"; }; ocamlformat = callPackage ../development/ocaml-modules/ocamlformat/ocamlformat.nix {}; From 1bef913e8ca6e63aa8f92a6b2f78420db4b3203f Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Tue, 26 Sep 2023 16:09:45 +0200 Subject: [PATCH 2/3] =?UTF-8?q?ocamlPackages.ocamlformat-rpc-lib:=200.26.0?= =?UTF-8?q?=20=E2=86=92=200.26.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ocaml-modules/ocamlformat/ocamlformat-rpc-lib.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-rpc-lib.nix b/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-rpc-lib.nix index a4492b2ead38..3893be12f681 100644 --- a/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-rpc-lib.nix +++ b/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-rpc-lib.nix @@ -4,8 +4,8 @@ let source = if lib.versionAtLeast ocaml.version "4.13" then { - version = "0.26.0"; - sha256 = "sha256-AxSUq3cM7xCo9qocvrVmDkbDqmwM1FexEP7IWadeh30="; + version = "0.26.1"; + sha256 = "sha256-2gBuQn8VuexhL7gI1EZZm9m3w+4lq+s9VVdHpw10xtc="; } else { version = "0.20.0"; sha256 = "sha256-JtmNCgwjbCyUE4bWqdH5Nc2YSit+rekwS43DcviIfgk="; From 32a2a0852c37606f963868baa1276ed28f73c047 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Tue, 26 Sep 2023 16:28:44 +0200 Subject: [PATCH 3/3] Link version for ocamlformat{,-lib,-rpc-lib} The default (latest) version is now defined in 'generic.nix' and is the same for the three packages. 'ocamlformat-rpc-lib' is no longer defined separately and also use the latest version as a default. --- .../ocaml-modules/ocamlformat/generic.nix | 6 ++-- .../ocamlformat/ocamlformat-lib.nix | 5 ++-- .../ocamlformat/ocamlformat-rpc-lib.nix | 29 +++++++------------ .../ocaml-modules/ocamlformat/ocamlformat.nix | 7 +++-- 4 files changed, 21 insertions(+), 26 deletions(-) diff --git a/pkgs/development/ocaml-modules/ocamlformat/generic.nix b/pkgs/development/ocaml-modules/ocamlformat/generic.nix index f724531ca12e..ca5c78bca7d9 100644 --- a/pkgs/development/ocaml-modules/ocamlformat/generic.nix +++ b/pkgs/development/ocaml-modules/ocamlformat/generic.nix @@ -1,6 +1,6 @@ -{ lib, fetchurl, version, astring, base, camlp-streams, cmdliner_1_0 +{ lib, fetchurl, version ? "0.26.1", astring, base, camlp-streams, cmdliner_1_0 , cmdliner_1_1, csexp, dune-build-info, either, fix, fpath, menhirLib, menhirSdk -, ocaml-version, ocp-indent, odoc-parser, result, stdio, uuseg, uutf }: +, ocaml-version, ocp-indent, odoc-parser, result, stdio, uuseg, uutf, ... }: # The ocamlformat package have been split into two in version 0.25.1: # one for the library and one for the executable. @@ -27,6 +27,8 @@ rec { }."${version}"; }; + inherit version; + odoc-parser_v = odoc-parser.override { version = if lib.versionAtLeast version "0.24.0" then "2.0.0" diff --git a/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-lib.nix b/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-lib.nix index cefae4af027c..9e271fe186b5 100644 --- a/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-lib.nix +++ b/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-lib.nix @@ -1,6 +1,7 @@ -{ lib, callPackage, buildDunePackage, menhir, version ? "0.25.1" }: +# Version can be selected with the 'version' argument, see generic.nix. +{ lib, callPackage, buildDunePackage, menhir, ... }@args: -let inherit (callPackage ./generic.nix { inherit version; }) src library_deps; +let inherit (callPackage ./generic.nix args) src version library_deps; in assert (lib.versionAtLeast version "0.25.1"); diff --git a/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-rpc-lib.nix b/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-rpc-lib.nix index 3893be12f681..e1f5f29aa2fb 100644 --- a/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-rpc-lib.nix +++ b/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-rpc-lib.nix @@ -1,25 +1,16 @@ -{ lib, fetchurl, buildDunePackage, ocaml, csexp, sexplib0 }: +# Version can be selected with the 'version' argument, see generic.nix. +{ lib, fetchurl, buildDunePackage, ocaml, csexp, sexplib0, callPackage, ... }@args: -# for compat with ocaml-lsp -let source = - if lib.versionAtLeast ocaml.version "4.13" - then { - version = "0.26.1"; - sha256 = "sha256-2gBuQn8VuexhL7gI1EZZm9m3w+4lq+s9VVdHpw10xtc="; - } else { - version = "0.20.0"; - sha256 = "sha256-JtmNCgwjbCyUE4bWqdH5Nc2YSit+rekwS43DcviIfgk="; - }; -in +let + # for compat with ocaml-lsp + version_arg = + if lib.versionAtLeast ocaml.version "4.13" then {} else { version = "0.20.0"; }; -buildDunePackage rec { + inherit (callPackage ./generic.nix (args // version_arg)) src version; + +in buildDunePackage rec { pname = "ocamlformat-rpc-lib"; - inherit (source) version; - - src = fetchurl { - url = "https://github.com/ocaml-ppx/ocamlformat/releases/download/${version}/ocamlformat-${version}.tbz"; - inherit (source) sha256; - }; + inherit src version; minimalOCamlVersion = "4.08"; duneVersion = "3"; diff --git a/pkgs/development/ocaml-modules/ocamlformat/ocamlformat.nix b/pkgs/development/ocaml-modules/ocamlformat/ocamlformat.nix index 8dfc6838613b..4c3b6607737d 100644 --- a/pkgs/development/ocaml-modules/ocamlformat/ocamlformat.nix +++ b/pkgs/development/ocaml-modules/ocamlformat/ocamlformat.nix @@ -1,3 +1,4 @@ +# Version can be selected with the 'version' argument, see generic.nix. { lib , callPackage , buildDunePackage @@ -5,10 +6,10 @@ , re , ocamlformat-lib , menhir -, version ? "0.26.1" -}: +, ... +}@args: -let inherit (callPackage ./generic.nix { inherit version; }) src library_deps; +let inherit (callPackage ./generic.nix args) src version library_deps; in lib.throwIf (lib.versionAtLeast ocaml.version "5.0" && !lib.versionAtLeast version "0.23")