ocamlformat: Support the version override

Rewrite the OCamlformat declaration to support overriding the 'version'
argument.
This commit is contained in:
Jules Aguillon 2022-07-19 11:08:25 +02:00 committed by Vincent Laporte
parent 1afb55692d
commit 98db578afa
2 changed files with 9 additions and 31 deletions

View file

@ -1,39 +1,17 @@
{ lib, fetchurl, fetchzip, callPackage }: { lib, fetchurl, fetchzip, callPackage }:
let mkOCamlformat = callPackage ./generic.nix; in
# Older versions should be removed when their usage decrease # Older versions should be removed when their usage decrease
# This script scraps Github looking for OCamlformat's options and versions usage: # This script scraps Github looking for OCamlformat's options and versions usage:
# https://gist.github.com/Julow/110dc94308d6078225e0665e3eccd433 # https://gist.github.com/Julow/110dc94308d6078225e0665e3eccd433
rec { rec {
ocamlformat_0_19_0 = mkOCamlformat { ocamlformat_0_19_0 = ocamlformat.override { version = "0.19.0"; };
version = "0.19.0"; ocamlformat_0_20_0 = ocamlformat.override { version = "0.20.0"; };
}; ocamlformat_0_20_1 = ocamlformat.override { version = "0.20.1"; };
ocamlformat_0_21_0 = ocamlformat.override { version = "0.21.0"; };
ocamlformat_0_22_4 = ocamlformat.override { version = "0.22.4"; };
ocamlformat_0_23_0 = ocamlformat.override { version = "0.23.0"; };
ocamlformat_0_24_0 = ocamlformat.override { version = "0.24.0"; };
ocamlformat_0_20_0 = mkOCamlformat { ocamlformat = callPackage ./generic.nix {};
version = "0.20.0";
};
ocamlformat_0_20_1 = mkOCamlformat {
version = "0.20.1";
};
ocamlformat_0_21_0 = mkOCamlformat {
version = "0.21.0";
};
ocamlformat_0_22_4 = mkOCamlformat {
version = "0.22.4";
};
ocamlformat_0_23_0 = mkOCamlformat {
version = "0.23.0";
};
ocamlformat_0_24_0 = mkOCamlformat {
version = "0.24.0";
};
ocamlformat = ocamlformat_0_24_0;
} }

View file

@ -1,5 +1,5 @@
{ lib, fetchurl, fetchzip, ocaml-ng { lib, fetchurl, fetchzip, ocaml-ng
, version , version ? "0.24.0"
, tarballName ? "ocamlformat-${version}.tbz", , tarballName ? "ocamlformat-${version}.tbz",
}: }: