From 51457da6e17e7f40e1b685c83bc0f4e5a9653263 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Sun, 12 Jan 2025 16:03:13 +0100 Subject: [PATCH] ocamlPackages.ulex: mark as unavailable for ocaml 5.0+ --- .../ocaml-modules/ulex/default.nix | 64 ++++++++++--------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/pkgs/development/ocaml-modules/ulex/default.nix b/pkgs/development/ocaml-modules/ulex/default.nix index bbc26d8650f8..ac98285c101f 100644 --- a/pkgs/development/ocaml-modules/ulex/default.nix +++ b/pkgs/development/ocaml-modules/ulex/default.nix @@ -23,39 +23,43 @@ let }; in -stdenv.mkDerivation rec { - name = "ocaml${ocaml.version}-${pname}-${version}"; - inherit (param) version; +lib.throwIf (lib.versionAtLeast ocaml.version "5.0") + "ulex is not available for OCaml ${ocaml.version}" - src = fetchFromGitHub { - owner = "whitequark"; - repo = pname; - rev = "v${version}"; - inherit (param) sha256; - }; + stdenv.mkDerivation + rec { + name = "ocaml${ocaml.version}-${pname}-${version}"; + inherit (param) version; - createFindlibDestdir = true; + src = fetchFromGitHub { + owner = "whitequark"; + repo = pname; + rev = "v${version}"; + inherit (param) sha256; + }; - nativeBuildInputs = [ - ocaml - findlib - ocamlbuild - camlp4 - ]; - propagatedBuildInputs = [ camlp4 ]; + createFindlibDestdir = true; - strictDeps = true; + nativeBuildInputs = [ + ocaml + findlib + ocamlbuild + camlp4 + ]; + propagatedBuildInputs = [ camlp4 ]; - buildFlags = [ - "all" - "all.opt" - ]; + strictDeps = true; - meta = { - inherit (src.meta) homepage; - description = "Lexer generator for Unicode and OCaml"; - license = lib.licenses.mit; - inherit (ocaml.meta) platforms; - maintainers = [ lib.maintainers.roconnor ]; - }; -} + buildFlags = [ + "all" + "all.opt" + ]; + + meta = { + inherit (src.meta) homepage; + description = "Lexer generator for Unicode and OCaml"; + license = lib.licenses.mit; + inherit (ocaml.meta) platforms; + maintainers = [ lib.maintainers.roconnor ]; + }; + }