Unverified Commit 43cf1629 authored by Vincent Laporte's avatar Vincent Laporte Committed by GitHub
Browse files

ocamlPackages.camlp4: fix build (#372762)

parents 599c108a e5b29630
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
  fetchFromGitLab,
  makeWrapper,
  ocamlPackages,
  fetchpatch,
}:

stdenv.mkDerivation (finalAttrs: {
@@ -18,6 +19,13 @@ stdenv.mkDerivation (finalAttrs: {
    hash = "sha256-b4O48MQT3Neh8a1Z5wRgS701w6XrwpsbSMprlqTT+CE=";
  };

  patches = [
    (fetchpatch {
      url = "https://gitlab.inria.fr/synchrone/heptagon/-/commit/f10405e385ca25dc737727e0c210a44986929bf0.patch";
      hash = "sha256-Sn55jEoRDYnEUg4SjuBDCNN4TNl2Dwn1fTjb9O8O1bo=";
    })
  ];

  strictDeps = true;

  nativeBuildInputs = with ocamlPackages; [
+26 −22
Original line number Diff line number Diff line
@@ -7,7 +7,11 @@
  camlp4,
}:

stdenv.mkDerivation rec {
lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
  "config-file is not available for OCaml ${ocaml.version}"

  stdenv.mkDerivation
  rec {
    pname = "ocaml-config-file";
    version = "1.2";

+40 −36
Original line number Diff line number Diff line
@@ -23,7 +23,11 @@ let
      };
in

stdenv.mkDerivation rec {
lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
  "ulex is not available for OCaml ${ocaml.version}"

  stdenv.mkDerivation
  rec {
    name = "ocaml${ocaml.version}-${pname}-${version}";
    inherit (param) version;

+31 −4
Original line number Diff line number Diff line
@@ -4,10 +4,12 @@
  fetchzip,
  which,
  ocaml,
  camlp-streams,
  ocamlbuild,
  findlib,
}:

if lib.versionAtLeast ocaml.version "4.15" then
if lib.versionAtLeast ocaml.version "5.4" then
  throw "camlp4 is not available for OCaml ${ocaml.version}"
else

@@ -66,6 +68,22 @@ else
          version = "4.14+1";
          sha256 = "sha256-cPN3GioZT/Zt6uzbjGUPEGVJcPQdsAnCkU/AQoPfvuo=";
        };
        "5.0" = {
          version = "5.0";
          sha256 = "sha256-oZptFNPUEAq5YlcqAoDWfLghGMF9AN7E7hUN55SAX+4=";
        };
        "5.1" = {
          version = "5.1";
          sha256 = "sha256-Ubedjg3BeHA0bJbEalQN9eEk5+LRAI/er+8mWfVYchg=";
        };
        "5.2" = {
          version = "5.2";
          sha256 = "sha256-lzbc9xsgeYlbVf71O+PWYS14QivAH1aPdnvWhe0HHME=";
        };
        "5.3" = {
          version = "5.3";
          sha256 = "sha256-V/kKhTP9U4jWDFuQKuB7BS3XICg1lq/2Avj7UJR55+k=";
        };
      }
      .${ocaml.meta.branch};
  in
@@ -81,10 +99,19 @@ else

    strictDeps = true;

    nativeBuildInputs = [
    nativeBuildInputs =
      [
        which
        ocaml
        ocamlbuild
      ]
      ++ lib.optionals (lib.versionAtLeast ocaml.version "5.0") [
        findlib
      ];

    buildInputs = lib.optionals (lib.versionAtLeast ocaml.version "5.0") [
      camlp-streams
      ocamlbuild
    ];

    # build fails otherwise
+0 −4
Original line number Diff line number Diff line
@@ -6331,10 +6331,6 @@ with pkgs;
    inherit (emacs.pkgs.melpaStablePackages) irony;
  };
  heptagon = callPackage ../development/compilers/heptagon {
    ocamlPackages = ocaml-ng.ocamlPackages_4_14;
  };
  openjfx17 = openjfx;
  openjfx21 = callPackage ../by-name/op/openjfx/package.nix { featureVersion = "21"; };
  openjfx23 = callPackage ../by-name/op/openjfx/package.nix { featureVersion = "23"; };